Message ID | 20200123114556.v3.17.Ie7424420136cfef8fd8002027a3988764fede49c@changeid |
---|---|
State | Accepted |
Commit | 4bef53684f1b7814a9aa2eee6ff725ff93deec42 |
Headers | show |
Series | i2c: designware_ic2: Improvements to timing and general cleanup | expand |
Hi Simon, On 24/01/20 12:18 AM, Simon Glass wrote: > Update this driver to use the new standard enums for speed. > > Note: This driver needs to move to driver model. omap24xx_i2c is already converted to DM. The following commits has those changes. Not sure what you meant here. commit daa69ffe3d4d603ccb7dfca92c33f19d9e1c2313 Author: Mugunthan V N <mugunthanvnm at ti.com> Date: Mon Jul 18 15:11:01 2016 +0530 drivers: i2c: omap24xx_i2c: adopt omap_i2c driver to driver model Convert omap i2c driver to adopt i2c driver model Signed-off-by: Mugunthan V N <mugunthanvnm at ti.com> Reviewed-by: Simon Glass <sjg at chromium.org> commit be243e4113b6c3c302ee03050726358714f40ffe Author: Mugunthan V N <mugunthanvnm at ti.com> Date: Mon Jul 18 15:11:00 2016 +0530 drivers: i2c: omap24xx_i2c: prepare driver for DM conversion Prepare the driver for DM conversion. Signed-off-by: Mugunthan V N <mugunthanvnm at ti.com> Reviewed-by: Simon Glass <sjg at chromium.org> Thanks and regards, Lokesh > > Signed-off-by: Simon Glass <sjg at chromium.org> > Reviewed-by: Heiko Schocher <hs at denx.de> > --- > > Changes in v3: None > Changes in v2: None > > drivers/i2c/omap24xx_i2c.c | 2 +- > drivers/i2c/omap24xx_i2c.h | 4 ---- > 2 files changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c > index 4b93e02bbe..7e6e3c4f81 100644 > --- a/drivers/i2c/omap24xx_i2c.c > +++ b/drivers/i2c/omap24xx_i2c.c > @@ -306,7 +306,7 @@ static int __omap24_i2c_setspeed(void __iomem *i2c_base, int ip_rev, uint speed, > int hsscll = 0, hssclh = 0; > u32 scll = 0, sclh = 0; > > - if (speed >= OMAP_I2C_HIGH_SPEED) { > + if (speed >= I2C_SPEED_HIGH_RATE) { > /* High speed */ > psc = I2C_IP_CLK / I2C_INTERNAL_SAMPLING_CLK; > psc -= 1; > diff --git a/drivers/i2c/omap24xx_i2c.h b/drivers/i2c/omap24xx_i2c.h > index 3458cf3a7d..6904f2d9ad 100644 > --- a/drivers/i2c/omap24xx_i2c.h > +++ b/drivers/i2c/omap24xx_i2c.h > @@ -81,10 +81,6 @@ > #define I2C_SCLH_HSSCLH 8 > #define I2C_SCLH_HSSCLH_M 0xFF > > -#define OMAP_I2C_STANDARD 100000 > -#define OMAP_I2C_FAST_MODE 400000 > -#define OMAP_I2C_HIGH_SPEED 3400000 > - > #define SYSTEM_CLOCK_12 12000000 > #define SYSTEM_CLOCK_13 13000000 > #define SYSTEM_CLOCK_192 19200000 >
diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c index 4b93e02bbe..7e6e3c4f81 100644 --- a/drivers/i2c/omap24xx_i2c.c +++ b/drivers/i2c/omap24xx_i2c.c @@ -306,7 +306,7 @@ static int __omap24_i2c_setspeed(void __iomem *i2c_base, int ip_rev, uint speed, int hsscll = 0, hssclh = 0; u32 scll = 0, sclh = 0; - if (speed >= OMAP_I2C_HIGH_SPEED) { + if (speed >= I2C_SPEED_HIGH_RATE) { /* High speed */ psc = I2C_IP_CLK / I2C_INTERNAL_SAMPLING_CLK; psc -= 1; diff --git a/drivers/i2c/omap24xx_i2c.h b/drivers/i2c/omap24xx_i2c.h index 3458cf3a7d..6904f2d9ad 100644 --- a/drivers/i2c/omap24xx_i2c.h +++ b/drivers/i2c/omap24xx_i2c.h @@ -81,10 +81,6 @@ #define I2C_SCLH_HSSCLH 8 #define I2C_SCLH_HSSCLH_M 0xFF -#define OMAP_I2C_STANDARD 100000 -#define OMAP_I2C_FAST_MODE 400000 -#define OMAP_I2C_HIGH_SPEED 3400000 - #define SYSTEM_CLOCK_12 12000000 #define SYSTEM_CLOCK_13 13000000 #define SYSTEM_CLOCK_192 19200000