summaryrefslogtreecommitdiff
path: root/drivers/mfd/ab8500-sysctrl.c
AgeCommit message (Collapse)AuthorFilesLines
2013-05-22mfd: ab8500-sysctrl: Let sysctrl driver work without pdataFabio Baltieri1-3/+2
A check for a valid plat->sysctrl was introduced in: 2377e52 mfd: ab8500-sysctrl: Error check clean up but the driver works just fine even without that initialization data, and enforcing it breaks existing platforms for no reason. This patch removes the check and let the driver go ahead with probe. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-05-17mfd: ab8500-sysctrl: Always enable pm_power_off handlerFabio Baltieri1-1/+5
AB8500 sysctrl driver implements a pm_power_off handler, but that is currently not registered until a specific platform data field is enabled. This patch drops the platform data field and always registers ab8500_power_off if no other pm_power_off handler was defined before, and also introduces the necessary cleanup code in the driver's remove function. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-05-17mfd: ab8500-sysctrl: Set sysctrl_dev during probeFabio Baltieri1-0/+2
The driver requires sysctrl_dev to be set at probe, as it's used by other driver functions. This was dropped by mistake in: 2377e52 mfd: ab8500-sysctrl: Error check clean up making all driver functions fail. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-05-17mfd: ab8500-sysctrl: Fix sparse warningFabio Baltieri1-1/+1
Fix sparse warning: drivers/mfd/ab8500-sysctrl.c:26:6: warning: symbol 'ab8500_power_off' was not declared. Should it be static? Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-09mfd: ab8500: sysctrl: Initialize driver at arch_initcallUlf Hansson1-1/+1
The abx500-clk driver is initiated at arch_initcall level. Moreover it is relying on the ab8500-sysctrl API to be available. Therefore move ab8500-sysctrl to arch_initcall level as well. The device is already added before the abx500 clk device, thus it will be probed before as well, which is exactly what we want. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-sysctrl: AB8505 doesn't have SYSCLKREQ5..8Rabin Vincent1-15/+22
So we're removing support for it. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Tested-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-sysctrl: Add new reset functionLee Jones1-0/+63
Add a new reset function which uses the AB WD with 0 timeout. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-sysctrl: Error check clean upMarcus Danielsson1-16/+22
Add error checks to see if sysctrl was probed as it should. If the sysctrl_dev is not set the return value is -EINVAL. Signed-off-by: Marcus Danielsson <marcus.danielsson@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com> Tested-by: Per FORLIN <per.forlin@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-sysctrl: Update correct turn on statusRajkumar Kasirajan1-1/+1
In L9540, turn_on_status register is not updated correctly if the device is rebooted with AC/USB charger connected. Due to this, the device boots android instead of entering into charge only mode. Read the AC/USB status register to detect the charger presence and update the turn on status manually. Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com> Signed-off-by: Per Forlin <per.forlin@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Rupesh KUMAR <rupesh.kumar@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com> Tested-by: Rupesh KUMAR <rupesh.kumar@stericsson.com> Tested-by: Philippe LANGLAIS <philippe.langlais@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-02-04mfd: ab8500-sysctrl: export read/write symbolsJonas Aaberg1-0/+2
Export ab8500_sysctrl_read() and ab8500_sysctrl_write() symobols. They will be used by LTP test cases. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
2013-02-04mfd: ab8500-sysctrl: Provide configuration for SysClkReqRfClkBuf registersKennet Wallden1-0/+24
Add the possibility to pass configuration settings for SysCl1kReqRfClkBuf to SysClk8ReqRfClkBuf via platform data. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Kennet Wallden <kennet.wallden@stericsson.com> Reviewed-by: Karl-Johan PERNTZ <karl-johan.perntz@stericsson.com> Reviewed-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
2013-02-04mfd: ab8500-sysctrl.c: Provide charging as reset reasonJonas Aaberg1-1/+1
It's possible to supply a string to provide a reason for triggering a restart. In this case our reason is to enter charging-only mode, as a charger was found to be present. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
2013-02-04mfd: ab8500-sysctrl: Only reboot into charging mode if battery type is knownJonas Aaberg1-5/+22
When a charger is connected, we usually want AB8500 based systems to reboot into charging-only mode. However, if the battery type cannot be identified this would be futile, so we'll just shut the system down instead. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
2013-02-04mfd: ab8500-sysctrl: If a charger is present, reboot insteadJonas Aaberg1-0/+27
If a charger is attached on power off, reboot the system into charging mode instead of powering it off. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
2013-02-04mfd: ab8500-sysctrl: Provide a platform specific pm_power_off() call-backLee Jones1-0/+22
The kernel allows us to specify a function call-back which will be invoked when a system power-off request has been received. Here we provide one which is to be used when shutting down AB8500 based platforms. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-11-29mfd: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: David Brown <davidb@codeaurora.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-29mfd: remove use of __devinitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: David Brown <davidb@codeaurora.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-29mfd: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: David Brown <davidb@codeaurora.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09mfd: Register ab8500 devices using the newly DT:ed MFD APILee Jones1-6/+0
Now the MFD API is Device Tree aware we can use it for platform registration again, even when booting with DT enabled. To aid in Device Node pointer allocation we provide each cell with the associative compatible string. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20mfd: Enable Device Tree support in the ab8500-sysctrl driverLee Jones1-0/+6
This patch ensures probing of the ab8500-sysctrl driver during a DT enabled boot, so long as the associated nodes are present in the Device Tree binary. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-01-09mfd: Unify abx500 headers in mfd/abx500Linus Walleij1-2/+2
This moves all the header files related to the abx500 family into a common include directory below mfd. From now on we place any subchip header in that directory. Headers previously in e.g. <linux/mfd/ab8500/gpio.h> get prefixed and are now e.g. <linux/mfd/abx500/ab8500-gpio.h>. The top-level abstract interface remains in <linux/mfd/abx500.h>. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-11-01mfd: Add module.h to the implicit drivers/mfd usersPaul Gortmaker1-0/+1
With the pending module.h cleanup, these files will fail to compile, unless they explicitly call out the include of this file. [omap-usb-host addition courtesy of Anand Gadiyar <gadiyar@ti.com>] Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-03-23mfd: AB8500 system control driverMattias Nilsson1-0/+80
This adds a pretty straight-forward system control driver for the AB8500. This driver will be used from the core platform, e.g the clock tree implementation in the machine code, and is by nature singleton. There are a few simple functions to read, write, set and clear registers so that the machine code can control its own foundation. Cc: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>