diff options
author | Johan Hovold <jhovold@gmail.com> | 2012-06-28 06:20:21 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-07-08 18:16:14 -0400 |
commit | 712db99df155eeef7bbab8677d8a02d0eff50d11 (patch) | |
tree | a3fad6d54e08614df20385818702568afa9eed0f /drivers/mfd | |
parent | 54210c97c8bfff67a4c5ec09ff797543bf291d6b (diff) |
mfd: Add support for enabling tps65910 external 32-kHz oscillator
Add flag to platform data to enable external 32-kHz crystal oscillator
(or square wave) input.
The tps6591x can use either an internal 32-kHz RC oscillator or an
external crystal (or square wave) to generate the 32-kHz clock.
The default setting depends on the selected boot mode. In boot mode 00
the internal RC oscillator is used at power-on, but the external crystal
oscillator (or square wave) can be enabled by clearing the ck32k_ctrl
flag in the device control register.
Note that there is no way to switch from the external crystal oscillator
to the internal RC oscillator.
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.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c index be9e07b77325..b0526b7d6550 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c | |||
@@ -68,6 +68,25 @@ static const struct regmap_config tps65910_regmap_config = { | |||
68 | .cache_type = REGCACHE_RBTREE, | 68 | .cache_type = REGCACHE_RBTREE, |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static int __devinit tps65910_misc_init(struct tps65910 *tps65910, | ||
72 | struct tps65910_board *pmic_pdata) | ||
73 | { | ||
74 | struct device *dev = tps65910->dev; | ||
75 | int ret; | ||
76 | |||
77 | if (pmic_pdata->en_ck32k_xtal) { | ||
78 | ret = tps65910_reg_clear_bits(tps65910, | ||
79 | TPS65910_DEVCTRL, | ||
80 | DEVCTRL_CK32K_CTRL_MASK); | ||
81 | if (ret < 0) { | ||
82 | dev_err(dev, "clear ck32k_ctrl failed: %d\n", ret); | ||
83 | return ret; | ||
84 | } | ||
85 | } | ||
86 | |||
87 | return 0; | ||
88 | } | ||
89 | |||
71 | static int __devinit tps65910_sleepinit(struct tps65910 *tps65910, | 90 | static int __devinit tps65910_sleepinit(struct tps65910 *tps65910, |
72 | struct tps65910_board *pmic_pdata) | 91 | struct tps65910_board *pmic_pdata) |
73 | { | 92 | { |
@@ -243,7 +262,7 @@ static __devinit int tps65910_i2c_probe(struct i2c_client *i2c, | |||
243 | init_data->irq_base = pmic_plat_data->irq_base; | 262 | init_data->irq_base = pmic_plat_data->irq_base; |
244 | 263 | ||
245 | tps65910_irq_init(tps65910, init_data->irq, init_data); | 264 | tps65910_irq_init(tps65910, init_data->irq, init_data); |
246 | 265 | tps65910_misc_init(tps65910, pmic_plat_data); | |
247 | tps65910_sleepinit(tps65910, pmic_plat_data); | 266 | tps65910_sleepinit(tps65910, pmic_plat_data); |
248 | 267 | ||
249 | return ret; | 268 | return ret; |