[U-Boot,RESEND,v3,14/19] am57xx: remove non-DM I2C code

Message ID 1544190655-4405-15-git-send-email-jjhiblot@ti.com
State Awaiting Upstream
Delegated to: Heiko Schocher
Headers show
Series
  • DM_I2C_COMPAT removal for all ti platforms
Related show

Commit Message

Jean-Jacques Hiblot Dec. 7, 2018, 1:50 p.m.
am57xx configs uses DM_I2C both in SPL and u-boot.
Remove code for non-DM I2C support.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---

Changes in v3: None
Changes in v2: None

 board/ti/am57xx/board.c | 36 +++---------------------------------
 1 file changed, 3 insertions(+), 33 deletions(-)

Comments

Tom Rini Dec. 7, 2018, 2:20 p.m. | #1
On Fri, Dec 07, 2018 at 02:50:50PM +0100, Jean-Jacques Hiblot wrote:

> am57xx configs uses DM_I2C both in SPL and u-boot.
> Remove code for non-DM I2C support.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
Heiko Schocher Dec. 10, 2018, 6:15 a.m. | #2
Hello Jean-Jacques,

Am 07.12.2018 um 14:50 schrieb Jean-Jacques Hiblot:
> am57xx configs uses DM_I2C both in SPL and u-boot.
> Remove code for non-DM I2C support.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> ---
> 
> Changes in v3: None
> Changes in v2: None
> 
>   board/ti/am57xx/board.c | 36 +++---------------------------------
>   1 file changed, 3 insertions(+), 33 deletions(-)

Thanks for resending!

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko Schocher

Patch

diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 355ea55..9738beb 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -623,7 +623,7 @@  void am57x_idk_lcd_detect(void)
 {
 	int r = -ENODEV;
 	char *idk_lcd = "no";
-	u8 buf = 0;
+	struct udevice *dev;
 
 	/* Only valid for IDKs */
 	if (board_is_x15() || board_is_am572x_evm())
@@ -633,34 +633,6 @@  void am57x_idk_lcd_detect(void)
 	if (board_is_am571x_idk() && !am571x_idk_needs_lcd())
 		goto out;
 
-#ifndef CONFIG_DM_I2C
-	r = i2c_set_bus_num(OSD_TS_FT_BUS_ADDRESS);
-	if (r) {
-		printf("%s: Failed to set bus address to %d: %d\n",
-		       __func__, OSD_TS_FT_BUS_ADDRESS, r);
-		goto out;
-	}
-	r = i2c_probe(OSD_TS_FT_CHIP_ADDRESS);
-	if (r) {
-		/* AM572x IDK has no explicit settings for optional LCD kit */
-		if (board_is_am571x_idk()) {
-			printf("%s: Touch screen detect failed: %d!\n",
-			       __func__, r);
-		}
-		goto out;
-	}
-
-	/* Read FT ID */
-	r = i2c_read(OSD_TS_FT_CHIP_ADDRESS, OSD_TS_FT_REG_ID, 1, &buf, 1);
-	if (r) {
-		printf("%s: Touch screen ID read %d:0x%02x[0x%02x] failed:%d\n",
-		       __func__, OSD_TS_FT_BUS_ADDRESS, OSD_TS_FT_CHIP_ADDRESS,
-		       OSD_TS_FT_REG_ID, r);
-		goto out;
-	}
-#else
-	struct udevice *dev;
-
 	r = i2c_get_chip_for_busnum(OSD_TS_FT_BUS_ADDRESS,
 				    OSD_TS_FT_CHIP_ADDRESS, 1, &dev);
 	if (r) {
@@ -682,10 +654,8 @@  void am57x_idk_lcd_detect(void)
 		       OSD_TS_FT_REG_ID, r);
 		goto out;
 	}
-	buf = (u8)r;
-#endif
 
-	switch (buf) {
+	switch (r) {
 	case OSD_TS_FT_ID_5606:
 		idk_lcd = "osd101t2045";
 		break;
@@ -694,7 +664,7 @@  void am57x_idk_lcd_detect(void)
 		break;
 	default:
 		printf("%s: Unidentifed Touch screen ID 0x%02x\n",
-		       __func__, buf);
+		       __func__, r);
 		/* we will let default be "no lcd" */
 	}
 out: