aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-07-11 09:44:33 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-07-16 09:43:15 -0400
commitd02e83cbcc4fe2b821a7ecd6464a14d6ad045187 (patch)
tree4f63b437c94143f7730c0e2f6a6ab0511f619c30 /drivers/mfd
parent8b8495532c6ba85221b0f9757e1581b52ed66c9a (diff)
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: Johan Hovold <jhovold@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/tps65910.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 3f27ea1f1ba6..1c563792c777 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -68,20 +68,19 @@ static const struct regmap_config tps65910_regmap_config = {
68 .cache_type = REGCACHE_RBTREE, 68 .cache_type = REGCACHE_RBTREE,
69}; 69};
70 70
71static int __devinit tps65910_misc_init(struct tps65910 *tps65910, 71static int __devinit tps65910_ck32k_init(struct tps65910 *tps65910,
72 struct tps65910_board *pmic_pdata) 72 struct tps65910_board *pmic_pdata)
73{ 73{
74 struct device *dev = tps65910->dev;
75 int ret; 74 int ret;
76 75
77 if (pmic_pdata->en_ck32k_xtal) { 76 if (!pmic_pdata->en_ck32k_xtal)
78 ret = tps65910_reg_clear_bits(tps65910, 77 return 0;
79 TPS65910_DEVCTRL, 78
79 ret = tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL,
80 DEVCTRL_CK32K_CTRL_MASK); 80 DEVCTRL_CK32K_CTRL_MASK);
81 if (ret < 0) { 81 if (ret < 0) {
82 dev_err(dev, "clear ck32k_ctrl failed: %d\n", ret); 82 dev_err(tps65910->dev, "clear ck32k_ctrl failed: %d\n", ret);
83 return ret; 83 return ret;
84 }
85 } 84 }
86 85
87 return 0; 86 return 0;
@@ -265,7 +264,7 @@ static __devinit int tps65910_i2c_probe(struct i2c_client *i2c,
265 init_data->irq_base = pmic_plat_data->irq_base; 264 init_data->irq_base = pmic_plat_data->irq_base;
266 265
267 tps65910_irq_init(tps65910, init_data->irq, init_data); 266 tps65910_irq_init(tps65910, init_data->irq, init_data);
268 tps65910_misc_init(tps65910, pmic_plat_data); 267 tps65910_ck32k_init(tps65910, pmic_plat_data);
269 tps65910_sleepinit(tps65910, pmic_plat_data); 268 tps65910_sleepinit(tps65910, pmic_plat_data);
270 269
271 return ret; 270 return ret;