From: Tom Rini Date: Mon, 26 Oct 2020 18:00:51 -0400 Subject: [PATCH 2/2] Nokia RX-51: Convert to CONFIG_DM_I2C In-Reply-To: <20201026213616.20816-2-pali@kernel.org> References: <20201026213616.20816-1-pali@kernel.org> <20201026213616.20816-2-pali@kernel.org> Message-ID: <20201026220051.GX14816@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Oct 26, 2020 at 10:36:16PM +0100, Pali Roh?r wrote: > Signed-off-by: Pali Roh?r 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 > +#include > #include > #include > #include > @@ -33,6 +34,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -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: