Lines Matching refs:speed
58 unsigned int speed; member
63 static int omap24_i2c_findpsc(u32 *pscl, u32 *psch, uint speed) in omap24_i2c_findpsc() argument
80 speed /= 1000; /* convert speed to kHz */ in omap24_i2c_findpsc()
82 if (speed > 100) in omap24_i2c_findpsc()
91 if (speed > 100) { in omap24_i2c_findpsc()
95 scl = internal_clk / speed; in omap24_i2c_findpsc()
100 *pscl = internal_clk / (speed * 2) - I2C_FASTSPEED_SCLL_TRIM; in omap24_i2c_findpsc()
101 *psch = internal_clk / (speed * 2) - I2C_FASTSPEED_SCLH_TRIM; in omap24_i2c_findpsc()
105 __func__, speed, prescaler, *pscl, *psch); in omap24_i2c_findpsc()
199 static int __omap24_i2c_setspeed(struct i2c *i2c_base, uint speed, argument
206 if (speed >= OMAP_I2C_HIGH_SPEED) {
216 fsscll = I2C_INTERNAL_SAMPLING_CLK / (2 * speed);
229 hsscll = hssclh = I2C_INTERNAL_SAMPLING_CLK / (2 * speed);
244 psc = omap24_i2c_findpsc(&scll, &sclh, speed);
251 *waitdelay = (10000000 / speed) * 2; /* wait for 20 clkperiods */
307 static void __omap24_i2c_init(struct i2c *i2c_base, int speed, int slaveadd, argument
331 if (0 != __omap24_i2c_setspeed(i2c_base, speed, waitdelay)) {
749 static uint omap24_i2c_setspeed(struct i2c_adapter *adap, uint speed) argument
754 ret = __omap24_i2c_setspeed(i2c_base, speed, &adap->waitdelay);
760 adap->speed = speed;
765 static void omap24_i2c_init(struct i2c_adapter *adap, int speed, int slaveadd) argument
769 return __omap24_i2c_init(i2c_base, speed, slaveadd, &adap->waitdelay);
867 static int omap_i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
871 priv->speed = speed;
873 return __omap24_i2c_setspeed(priv->regs, speed, &priv->waitdelay);
888 __omap24_i2c_init(priv->regs, priv->speed, 0, &priv->waitdelay);
899 priv->speed = CONFIG_SYS_OMAP24_I2C_SPEED;