aboutsummaryrefslogtreecommitdiff
path: root/board/ti/ks2_evm
diff options
context:
space:
mode:
authorJean-Jacques Hiblot2018-12-07 14:50:49 +0100
committerHeiko Schocher2018-12-10 07:15:21 +0100
commit1514244cc137fe29c9321ea2990de2ec827a9549 (patch)
tree7bd338feaa0ea0e779e9bf9e7b668cc6d1b35dc9 /board/ti/ks2_evm
parentad95da1f3c2d67e36f2b334083bc487b05085c7e (diff)
ti: remove usage of DM_I2C_COMPAT and don't disable DM_I2C in SPL
DM_I2C_COMPAT is a compatibility layer that allows using the non-DM I2C API when DM_I2C is used. The goal is to eventually remove DM_I2C_COMPAT when all I2C "clients" have been migrated to use the DM API. This a step in that direction for the TI based platforms. Build tested with buildman: buildman -dle am33xx ti omap3 omap4 omap5 davinci keystone boot tested with: am335x_evm, am335x_boneblack, am335x_boneblack_vboot (DM version), am57xx_evm, dra7xx_evm, k2g_evm, am437x_evm Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'board/ti/ks2_evm')
-rw-r--r--board/ti/ks2_evm/board_k2g.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c
index 87dc4d009e2..39a782e4796 100644
--- a/board/ti/ks2_evm/board_k2g.c
+++ b/board/ti/ks2_evm/board_k2g.c
@@ -251,6 +251,7 @@ int board_fit_config_name_match(const char *name)
#if defined(CONFIG_DTB_RESELECT)
static int k2g_alt_board_detect(void)
{
+#ifndef CONFIG_DM_I2C
int rc;
rc = i2c_set_bus_num(1);
@@ -260,7 +261,17 @@ static int k2g_alt_board_detect(void)
rc = i2c_probe(K2G_GP_AUDIO_CODEC_ADDRESS);
if (rc)
return rc;
+#else
+ struct udevice *bus, *dev;
+ int rc;
+ rc = uclass_get_device_by_seq(UCLASS_I2C, 1, &bus);
+ if (rc)
+ return rc;
+ rc = dm_i2c_probe(bus, K2G_GP_AUDIO_CODEC_ADDRESS, 0, &dev);
+ if (rc)
+ return rc;
+#endif
ti_i2c_eeprom_am_set("66AK2GGP", "1.0X");
return 0;