struct sh_mobile_dt_config {
int clks_per_count;
- void (*setup)(struct sh_mobile_i2c_data *pd);
+ int (*setup)(struct sh_mobile_i2c_data *pd);
};
#define IIC_FLAG_HAS_ICIC67 (1 << 0)
* r8a7740 chip has lasting errata on I2C I/O pad reset.
* this is work-around for it.
*/
-static void sh_mobile_i2c_r8a7740_workaround(struct sh_mobile_i2c_data *pd)
+static int sh_mobile_i2c_r8a7740_workaround(struct sh_mobile_i2c_data *pd)
{
iic_set_clr(pd, ICCR, ICCR_ICE, 0);
iic_rd(pd, ICCR); /* dummy read */
udelay(10);
iic_wr(pd, ICCR, ICCR_TRS);
udelay(10);
+
+ return 0;
}
static const struct sh_mobile_dt_config default_dt_config = {
if (config) {
pd->clks_per_count = config->clks_per_count;
- if (config->setup)
- config->setup(pd);
+ if (config->setup) {
+ ret = config->setup(pd);
+ if (ret)
+ return ret;
+ }
}
ret = sh_mobile_i2c_init(pd);