diff options
Diffstat (limited to 'board/menlo/m53menlo/m53menlo.c')
-rw-r--r-- | board/menlo/m53menlo/m53menlo.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/board/menlo/m53menlo/m53menlo.c b/board/menlo/m53menlo/m53menlo.c index 9545e63..61ab384 100644 --- a/board/menlo/m53menlo/m53menlo.c +++ b/board/menlo/m53menlo/m53menlo.c @@ -226,16 +226,21 @@ static const char *lvds_compat_string; static int detect_lvds(struct display_info_t const *dev) { + struct udevice *idev, *ibus; u8 touchid[23]; u8 *touchptr = &touchid[0]; int ret; - ret = i2c_set_bus_num(0); + ret = uclass_get_device_by_seq(UCLASS_I2C, 0, &ibus); + if (ret) + return 0; + + ret = dm_i2c_probe(ibus, 0x38, 0, &idev); if (ret) return 0; /* Touchscreen is at address 0x38, ID register is 0xbb. */ - ret = i2c_read(0x38, 0xbb, 1, touchid, sizeof(touchid)); + ret = dm_i2c_read(idev, 0xbb, touchid, sizeof(touchid)); if (ret) return 0; @@ -385,23 +390,6 @@ splasherr: return 0; } -#define I2C_PAD_CTRL (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \ - PAD_CTL_PUS_100K_UP | PAD_CTL_ODE) - -static void setup_iomux_i2c(void) -{ - static const iomux_v3_cfg_t i2c_pads[] = { - /* I2C1 */ - NEW_PAD_CTRL(MX53_PAD_EIM_D28__I2C1_SDA, I2C_PAD_CTRL), - NEW_PAD_CTRL(MX53_PAD_EIM_D21__I2C1_SCL, I2C_PAD_CTRL), - /* I2C2 */ - NEW_PAD_CTRL(MX53_PAD_EIM_D16__I2C2_SDA, I2C_PAD_CTRL), - NEW_PAD_CTRL(MX53_PAD_EIM_EB2__I2C2_SCL, I2C_PAD_CTRL), - }; - - imx_iomux_v3_setup_multiple_pads(i2c_pads, ARRAY_SIZE(i2c_pads)); -} - static void setup_iomux_video(void) { static const iomux_v3_cfg_t lcd_pads[] = { @@ -505,7 +493,6 @@ int board_early_init_f(void) { setup_iomux_uart(); setup_iomux_fec(); - setup_iomux_i2c(); setup_iomux_nand(); setup_iomux_video(); |