struct rcar_i2c_priv {
void __iomem *base;
struct clk clk;
+ u32 fall_ns;
+ u32 rise_ns;
u32 intdelay;
u32 icccr;
enum rcar_i2c_type type;
* = F[sum * ick / 1000000000]
* = F[(ick / 1000000) * sum / 1000]
*/
- sum = 35 + 200 + priv->intdelay;
+ sum = priv->fall_ns + priv->rise_ns + priv->intdelay;
round = (ick + 500000) / 1000000 * sum;
round = (round + 500) / 1000;
int ret;
priv->base = dev_read_addr_ptr(dev);
+ priv->rise_ns = dev_read_u32_default(dev,
+ "i2c-scl-rising-time-ns", 200);
+ priv->fall_ns = dev_read_u32_default(dev,
+ "i2c-scl-falling-time-ns", 35);
priv->intdelay = dev_read_u32_default(dev,
"i2c-scl-internal-delay-ns", 5);
priv->type = dev_get_driver_data(dev);