[PATCH v3 1/3] drivers: rtc: add pcf2131 rtc driver

Fabio Estevam festevam at gmail.com
Tue Mar 26 23:10:25 CET 2024


On Tue, Mar 26, 2024 at 12:30 AM Joy Zou <joy.zou at nxp.com> wrote:

> +bool is_pcf2131_type(struct udevice *dev)

static bool

>  static int pcf2127_rtc_read(struct udevice *dev, uint offset, u8 *buffer, uint len)
>  {
>         struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
> @@ -43,10 +75,64 @@ static int pcf2127_rtc_read(struct udevice *dev, uint offset, u8 *buffer, uint l
>         return dm_i2c_xfer(dev, &msg, 1);
>  }
>
> +static int pcf2131_rtc_lock(struct udevice *dev)
> +{
> +       int ret = 0;

No need to initialize ret with 0.

> +static int pcf2131_rtc_unlock(struct udevice *dev)
> +{
> +       int ret = 0;

Ditto.

>  static int pcf2127_rtc_write(struct udevice *dev, uint offset,
>                              const u8 *buffer, uint len)
>  {
> -       return dm_i2c_write(dev, offset, buffer, len);
> +       int ret = 0;

Ditto.


More information about the U-Boot mailing list