提交 d02e83cb 编写于 作者: J Johan Hovold 提交者: Samuel Ortiz

mfd: Add tps65910 32-kHz-crystal-input init

Replace tps65910_misc_init with a dedicated init function for the
32-kHz-crystal input, and make the code more readable.
Signed-off-by: NJohan Hovold <jhovold@gmail.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 8b849553
...@@ -68,21 +68,20 @@ static const struct regmap_config tps65910_regmap_config = { ...@@ -68,21 +68,20 @@ static const struct regmap_config tps65910_regmap_config = {
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_RBTREE,
}; };
static int __devinit tps65910_misc_init(struct tps65910 *tps65910, static int __devinit tps65910_ck32k_init(struct tps65910 *tps65910,
struct tps65910_board *pmic_pdata) struct tps65910_board *pmic_pdata)
{ {
struct device *dev = tps65910->dev;
int ret; int ret;
if (pmic_pdata->en_ck32k_xtal) { if (!pmic_pdata->en_ck32k_xtal)
ret = tps65910_reg_clear_bits(tps65910, return 0;
TPS65910_DEVCTRL,
ret = tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL,
DEVCTRL_CK32K_CTRL_MASK); DEVCTRL_CK32K_CTRL_MASK);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "clear ck32k_ctrl failed: %d\n", ret); dev_err(tps65910->dev, "clear ck32k_ctrl failed: %d\n", ret);
return ret; return ret;
} }
}
return 0; return 0;
} }
...@@ -265,7 +264,7 @@ static __devinit int tps65910_i2c_probe(struct i2c_client *i2c, ...@@ -265,7 +264,7 @@ static __devinit int tps65910_i2c_probe(struct i2c_client *i2c,
init_data->irq_base = pmic_plat_data->irq_base; init_data->irq_base = pmic_plat_data->irq_base;
tps65910_irq_init(tps65910, init_data->irq, init_data); tps65910_irq_init(tps65910, init_data->irq, init_data);
tps65910_misc_init(tps65910, pmic_plat_data); tps65910_ck32k_init(tps65910, pmic_plat_data);
tps65910_sleepinit(tps65910, pmic_plat_data); tps65910_sleepinit(tps65910, pmic_plat_data);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册