aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl4030-power.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-23 17:31:27 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-23 17:31:27 -0700
commit84e9c87e6ffc519fdf91949482a65672a7314c9a (patch)
tree29775d71f1f58c41365ce597192524cf5544b340 /drivers/mfd/twl4030-power.c
parentMerge tag 'regulator-v4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator (diff)
parentmfd: lpc_ich: Assign subdevice ids automatically (diff)
downloadlinux-dev-84e9c87e6ffc519fdf91949482a65672a7314c9a.tar.xz
linux-dev-84e9c87e6ffc519fdf91949482a65672a7314c9a.zip
Merge tag 'mfd-for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones: "Changes to existing drivers: - Constify structures; throughout the subsystem - Move support to DT in; cros_ec - DT changes and documentation; cros-ec, max77693, max77686, arizona, da9063 - ACPI changes and documentation; mfd-core - Use different platform specific API in; cros_ec_*, arizona-core - Remove unused parent field from; cros_ec_i2c - Add wake-up/reset delay in; cross_ec_spi, arizona-core - Staticise structures/functions in; cros_ec - Remove redundant code; arizona-core, max77686 - Bugfix; twl4030-power - Allow compile test; aat2870, tps65910 - MAINTAINERS adaptions; samsung, syscon - Resource Management (devm_*); arizona-core - Refactor Reset code; arizona-core - Insist on at least one full boot; arizona-core - Trivial formatting; arizona-core - Add low-power-sleep; arizona-core - IRQ ONESHOT changes; twl4030-irq, mc13xxx-core, wm831x-auxadc, htc-i2cpld, wm8350-core, ab8500-debugfs, ab8500-gpadc, si476x-i2c (Re-)moved drivers: - Move protocol helpers out to drivers/platform; cros_ec New drivers/supported devices: - Add support for AXP22x into axp20x - Add support for OnKey into da9063-core - Add support for Pinctrl into mt6397-core - New STMicroelectronics LPC Watchdog driver - New STMicroelectronics LPC Real-Time Clock driver" * tag 'mfd-for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (59 commits) mfd: lpc_ich: Assign subdevice ids automatically mfd: si476x-i2c: Pass the IRQF_ONESHOT flag mfd: ab8500-gpadc: Pass the IRQF_ONESHOT flag mfd: ab8500-debugfs: Pass the IRQF_ONESHOT flag mfd: wm8350-core: Pass the IRQF_ONESHOT flag mfd: htc-i2cpld: Pass the IRQF_ONESHOT flag mfd: wm831x-auxadc: Pass the IRQF_ONESHOT flag mfd: mc13xxx-core: Pass the IRQF_ONESHOT flag mfd: twl4030-irq: Pass the IRQF_ONESHOT flag mfd: mt6397-core: Add GPIO sub-module support mfd: arizona: Add convience defines for micd_rate/micd_bias_starttime mfd: dt: Add bindings for DA9063 OnKey mfd: da9063: Add support for OnKey driver mfd: arizona: Fix incorrect Makefile conditionals mfd: arizona: Add stub for wm5102_patch() mfd: Check ACPI device companion before checking resources Documentation: Add WM8998/WM1814 device tree bindings mfd: arizona: Split INx_MODE into two fields mfd: wm5110: Add delay before releasing reset line mfd: arizona: Add better support for system suspend ...
Diffstat (limited to 'drivers/mfd/twl4030-power.c')
-rw-r--r--drivers/mfd/twl4030-power.c45
1 files changed, 38 insertions, 7 deletions
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index f440aed61305..04b539850e72 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -264,7 +264,9 @@ out:
return err;
}
-static int twl4030_config_wakeup12_sequence(u8 address)
+static int
+twl4030_config_wakeup12_sequence(const struct twl4030_power_data *pdata,
+ u8 address)
{
int err = 0;
u8 data;
@@ -293,13 +295,14 @@ static int twl4030_config_wakeup12_sequence(u8 address)
if (err)
goto out;
- if (machine_is_omap_3430sdp() || machine_is_omap_ldp()) {
+ if (pdata->ac_charger_quirk || machine_is_omap_3430sdp() ||
+ machine_is_omap_ldp()) {
/* Disabling AC charger effect on sleep-active transitions */
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data,
R_CFG_P1_TRANSITION);
if (err)
goto out;
- data &= ~(1<<1);
+ data &= ~STARTON_CHG;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data,
R_CFG_P1_TRANSITION);
if (err)
@@ -459,8 +462,9 @@ static int twl4030_configure_resource(struct twl4030_resconfig *rconfig)
return 0;
}
-static int load_twl4030_script(struct twl4030_script *tscript,
- u8 address)
+static int load_twl4030_script(const struct twl4030_power_data *pdata,
+ struct twl4030_script *tscript,
+ u8 address)
{
int err;
static int order;
@@ -487,7 +491,7 @@ static int load_twl4030_script(struct twl4030_script *tscript,
if (err)
goto out;
- err = twl4030_config_wakeup12_sequence(address);
+ err = twl4030_config_wakeup12_sequence(pdata, address);
if (err)
goto out;
order = 1;
@@ -567,7 +571,7 @@ twl4030_power_configure_scripts(const struct twl4030_power_data *pdata)
u8 address = twl4030_start_script_address;
for (i = 0; i < pdata->num; i++) {
- err = load_twl4030_script(pdata->scripts[i], address);
+ err = load_twl4030_script(pdata, pdata->scripts[i], address);
if (err)
return err;
address += pdata->scripts[i]->size;
@@ -829,6 +833,21 @@ static struct twl4030_power_data osc_off_idle = {
.board_config = osc_off_rconfig,
};
+static struct twl4030_power_data omap3_idle_ac_quirk = {
+ .scripts = omap3_idle_scripts,
+ .num = ARRAY_SIZE(omap3_idle_scripts),
+ .resource_config = omap3_idle_rconfig,
+ .ac_charger_quirk = true,
+};
+
+static struct twl4030_power_data omap3_idle_ac_quirk_osc_off = {
+ .scripts = omap3_idle_scripts,
+ .num = ARRAY_SIZE(omap3_idle_scripts),
+ .resource_config = omap3_idle_rconfig,
+ .board_config = osc_off_rconfig,
+ .ac_charger_quirk = true,
+};
+
static const struct of_device_id twl4030_power_of_match[] = {
{
.compatible = "ti,twl4030-power",
@@ -845,6 +864,18 @@ static const struct of_device_id twl4030_power_of_match[] = {
.compatible = "ti,twl4030-power-idle-osc-off",
.data = &osc_off_idle,
},
+ {
+ .compatible = "ti,twl4030-power-omap3-sdp",
+ .data = &omap3_idle_ac_quirk,
+ },
+ {
+ .compatible = "ti,twl4030-power-omap3-ldp",
+ .data = &omap3_idle_ac_quirk_osc_off,
+ },
+ {
+ .compatible = "ti,twl4030-power-omap3-evm",
+ .data = &omap3_idle_ac_quirk,
+ },
{ },
};
MODULE_DEVICE_TABLE(of, twl4030_power_of_match);