[PATCH 2/2] Nokia RX-51: Convert to CONFIG_DM_I2C

Tom Rini
2020-10-26T22:00:51Z

On Mon, Oct 26, 2020 at 10:36:16PM +0100, Pali Roh?r wrote:

> Signed-off-by: Pali Roh?r <pali@kernel.org>

Please include something for the commit message.

> ---
> board/nokia/rx51/rx51.c | 26 ++++++++++++++++++++++++--
> configs/nokia_rx51_defconfig | 2 ++
> include/configs/nokia_rx51.h | 2 ++
> 3 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
> index f624dbfbeb..9cc5eb97b3 100644
> --- a/board/nokia/rx51/rx51.c
> +++ b/board/nokia/rx51/rx51.c
> @@ -22,6 +22,7 @@
> */
>
> #include <common.h>
> +#include <dm.h>
> #include <env.h>
> #include <init.h>
> #include <watchdog.h>
> @@ -33,6 +34,7 @@
> #include <asm/setup.h>
> #include <asm/bitops.h>
> #include <asm/mach-types.h>
> +#include <asm/omap_i2c.h>
> #include <asm/arch/mux.h>
> #include <asm/arch/sys_proto.h>
> #include <asm/arch/mmc_host_def.h>
> @@ -390,10 +392,16 @@ int misc_init_r(void)
> u8 state;
>
> /* reset lp5523 led */
> +#ifndef CONFIG_DM_I2C
> i2c_set_bus_num(1);
> state = 0xff;
> i2c_write(0x32, 0x3d, 1, &state, 1);
> i2c_set_bus_num(0);
> +#else
> + struct udevice *dev;
> + if (i2c_get_chip_for_busnum(1, 0x32, 1, &dev) == 0)
> + dm_i2c_reg_write(dev, 0x3d, 0xff);
> +#endif

At this point, and especially for boards and not drivers, just do the
conversion unilaterally. Thanks!

--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201026/4828e584/attachment.sig>