aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/wm831x-spi.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-09-15 12:54:53 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-09-20 08:02:09 -0400
commit523d9cfbb2094e095ff08a01c4eac10cc7d287c3 (patch)
treed1cd9bc2434332e2e79170d6c21d443f2ce5c3ff /drivers/mfd/wm831x-spi.c
parent92afb286d744511f51a05f8acb6c111d05737617 (diff)
mfd: Support software initiated shutdown of WM831x PMICs
In systems where there is no hardware signal from the processor to the PMIC to initiate the final power off sequence we must initiate the shutdown with a register write to the PMIC. Support such systems in the driver. Since this may prevent a full shutdown of the system platform data is used to enable the feature. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/wm831x-spi.c')
-rw-r--r--drivers/mfd/wm831x-spi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c
index 5ea60cd860fc..8d6a9a969dbc 100644
--- a/drivers/mfd/wm831x-spi.c
+++ b/drivers/mfd/wm831x-spi.c
@@ -68,6 +68,13 @@ static int wm831x_spi_suspend(struct device *dev)
68 return wm831x_device_suspend(wm831x); 68 return wm831x_device_suspend(wm831x);
69} 69}
70 70
71static void wm831x_spi_shutdown(struct spi_device *spi)
72{
73 struct wm831x *wm831x = dev_get_drvdata(&spi->dev);
74
75 wm831x_device_shutdown(wm831x);
76}
77
71static const struct dev_pm_ops wm831x_spi_pm = { 78static const struct dev_pm_ops wm831x_spi_pm = {
72 .freeze = wm831x_spi_suspend, 79 .freeze = wm831x_spi_suspend,
73 .suspend = wm831x_spi_suspend, 80 .suspend = wm831x_spi_suspend,
@@ -95,6 +102,7 @@ static struct spi_driver wm831x_spi_driver = {
95 .id_table = wm831x_spi_ids, 102 .id_table = wm831x_spi_ids,
96 .probe = wm831x_spi_probe, 103 .probe = wm831x_spi_probe,
97 .remove = __devexit_p(wm831x_spi_remove), 104 .remove = __devexit_p(wm831x_spi_remove),
105 .shutdown = wm831x_spi_shutdown,
98}; 106};
99 107
100static int __init wm831x_spi_init(void) 108static int __init wm831x_spi_init(void)