X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Fi2c%2Fmvtwsi.c;h=cea3da0b27610cd49cc593dff4b0ab44d42b90ab;hb=7ce79599a1b8f2078b15fa170f11f2666200b24e;hp=ab7481a0d4a9ec80e6d3e792715679b893270424;hpb=c98b171e1098f94b2ff7720c45a25a602882f876;p=platform%2Fkernel%2Fu-boot.git diff --git a/drivers/i2c/mvtwsi.c b/drivers/i2c/mvtwsi.c index ab7481a..cea3da0 100644 --- a/drivers/i2c/mvtwsi.c +++ b/drivers/i2c/mvtwsi.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #ifdef CONFIG_DM_I2C @@ -29,7 +29,7 @@ DECLARE_GLOBAL_DATA_PTR; #include #elif (defined(CONFIG_KIRKWOOD) || defined(CONFIG_ARCH_MVEBU)) #include -#elif defined(CONFIG_SUNXI) +#elif defined(CONFIG_ARCH_SUNXI) #include #else #error Driver mvtwsi not supported by SoC or board @@ -40,7 +40,7 @@ DECLARE_GLOBAL_DATA_PTR; * TWSI register structure */ -#ifdef CONFIG_SUNXI +#ifdef CONFIG_ARCH_SUNXI struct mvtwsi_registers { u32 slave_address; @@ -399,7 +399,7 @@ static int twsi_stop(struct mvtwsi_registers *twsi, uint tick) */ static uint twsi_calc_freq(const int n, const int m) { -#ifdef CONFIG_SUNXI +#ifdef CONFIG_ARCH_SUNXI return CONFIG_SYS_TCLK / (10 * (m + 1) * (1 << n)); #else return CONFIG_SYS_TCLK / (10 * (m + 1) * (2 << n)); @@ -595,7 +595,7 @@ static int __twsi_i2c_read(struct mvtwsi_registers *twsi, uchar chip, status = i2c_begin(twsi, expected_start, (chip << 1), tick); /* Send address bytes */ while ((status == 0) && alen--) - status = twsi_send(twsi, *(addr++), + status = twsi_send(twsi, addr[alen], MVTWSI_STATUS_DATA_W_ACK, tick); /* Send repeated STARTs after the initial START */ expected_start = MVTWSI_STATUS_REPEATED_START; @@ -642,7 +642,7 @@ static int __twsi_i2c_write(struct mvtwsi_registers *twsi, uchar chip, status = i2c_begin(twsi, MVTWSI_STATUS_START, (chip << 1), tick); /* Send address bytes */ while ((status == 0) && (alen-- > 0)) - status = twsi_send(twsi, *(addr++), MVTWSI_STATUS_DATA_W_ACK, + status = twsi_send(twsi, addr[alen], MVTWSI_STATUS_DATA_W_ACK, tick); /* Send data bytes */ while ((status == 0) && (length-- > 0)) @@ -830,6 +830,7 @@ static const struct dm_i2c_ops mvtwsi_i2c_ops = { static const struct udevice_id mvtwsi_i2c_ids[] = { { .compatible = "marvell,mv64xxx-i2c", }, + { .compatible = "marvell,mv78230-i2c", }, { /* sentinel */ } };