From 1028403f2f53093f7c17dd57055d1e8da815348f Mon Sep 17 00:00:00 2001 From: Trevor Woerner Date: Thu, 10 Jun 2021 22:37:05 -0400 Subject: lpc32xx: i2c: remove unused define The LPC32XX_I2C_STAT_DRMI is not used anywhere so remove it. Signed-off-by: Trevor Woerner --- drivers/i2c/lpc32xx_i2c.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/i2c/lpc32xx_i2c.c') diff --git a/drivers/i2c/lpc32xx_i2c.c b/drivers/i2c/lpc32xx_i2c.c index f89f7955e4c..0ae116617c6 100644 --- a/drivers/i2c/lpc32xx_i2c.c +++ b/drivers/i2c/lpc32xx_i2c.c @@ -38,7 +38,6 @@ /* Status register values */ #define LPC32XX_I2C_STAT_TFF 0x00000400 #define LPC32XX_I2C_STAT_RFE 0x00000200 -#define LPC32XX_I2C_STAT_DRMI 0x00000008 #define LPC32XX_I2C_STAT_NAI 0x00000004 #define LPC32XX_I2C_STAT_TDI 0x00000001 -- cgit v1.2.3 From 3f70acdb7dc8c274a09e4421f78e25eac33fef76 Mon Sep 17 00:00:00 2001 From: Trevor Woerner Date: Thu, 10 Jun 2021 22:37:06 -0400 Subject: lpc32xx: i2c: fix base address The lpc32xx driver was not obtaining the per-device base address correctly from the device tree. Fix the FIXME in order to get the correct base address. Signed-off-by: Trevor Woerner --- drivers/i2c/lpc32xx_i2c.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'drivers/i2c/lpc32xx_i2c.c') diff --git a/drivers/i2c/lpc32xx_i2c.c b/drivers/i2c/lpc32xx_i2c.c index 0ae116617c6..6abff263bdc 100644 --- a/drivers/i2c/lpc32xx_i2c.c +++ b/drivers/i2c/lpc32xx_i2c.c @@ -282,11 +282,7 @@ static int lpc32xx_i2c_probe(struct udevice *bus) { struct lpc32xx_i2c_dev *dev = dev_get_plat(bus); - /* - * FIXME: This is not permitted - * dev_seq(bus) = dev->index; - */ - + dev->base = dev_read_addr_ptr(bus); __i2c_init(dev->base, dev->speed, 0, dev->index); return 0; } -- cgit v1.2.3 From 103f233ebf1662c1302f28bd39b6bdac3035f79b Mon Sep 17 00:00:00 2001 From: Trevor Woerner Date: Thu, 10 Jun 2021 22:37:07 -0400 Subject: lpc32xx: i2c: finish DM/OF code Add the of_match/compatible string to the lpc32xx i2c driver so it works correctly with device-tree. Signed-off-by: Trevor Woerner --- drivers/i2c/lpc32xx_i2c.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/i2c/lpc32xx_i2c.c') diff --git a/drivers/i2c/lpc32xx_i2c.c b/drivers/i2c/lpc32xx_i2c.c index 6abff263bdc..774129ad8ea 100644 --- a/drivers/i2c/lpc32xx_i2c.c +++ b/drivers/i2c/lpc32xx_i2c.c @@ -348,9 +348,15 @@ static const struct dm_i2c_ops lpc32xx_i2c_ops = { .set_bus_speed = lpc32xx_i2c_set_bus_speed, }; +static const struct udevice_id lpc32xx_i2c_ids[] = { + { .compatible = "nxp,pnx-i2c" }, + { } +}; + U_BOOT_DRIVER(i2c_lpc32xx) = { - .id = UCLASS_I2C, .name = "i2c_lpc32xx", + .id = UCLASS_I2C, + .of_match = lpc32xx_i2c_ids, .probe = lpc32xx_i2c_probe, .ops = &lpc32xx_i2c_ops, }; -- cgit v1.2.3