summaryrefslogtreecommitdiff
path: root/drivers/mfd/ab8500-gpadc.c
AgeCommit message (Collapse)Author
2016-11-29mfd: ab8500-gpadc: Make it explicitly non-modularPaul Gortmaker
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config AB8500_GPADC drivers/mfd/Kconfig: bool "ST-Ericsson AB8500 GPADC driver" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_init was not in use by this code, the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14mfd: ab8500-gpadc: Squash a whole bunch of Checkpatch warnings and one errorLee Jones
WARNING: line over 80 characters +#define ADC_CH_IBAT_MIN (-6000) /* mA range measured by ADC for ib t*/ WARNING: line over 80 characters +#define ADC_CH_IBAT_MIN_V (-60) /* mV range measured by ADC for ibat*/ WARNING: suspect code indent for conditional statements (16, 20) + if (!strcmp(name, dev_name(gpadc->dev))) + return gpadc; WARNING: suspect code indent for conditional statements (0, 16) +if (ad_value < 0) { + dev_err(gpadc->dev, "GPADC raw value failed ch: %d\n", WARNING: quoted string split across lines + dev_err(gpadc->dev, "GPADC to voltage conversion failed ch:" + " %d AD: 0x%x\n", channel, ad_value); WARNING: Missing a blank line after declarations + int raw_data; + raw_data = ab8500_gpadc_double_read_raw(gpadc, channel, WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt + msleep(10); ERROR: else should follow close brace '}' + } + else WARNING: line over 80 characters + delay_max = 10000; /* large range to optimise sleep mode */ WARNING: line over 80 characters + gpadc->cal_data[ADC_INPUT_IBAT].gain = V_gain * V2A_gain; WARNING: line over 80 characters + gpadc = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_gpadc), GFP_KERNEL); WARNING: Possible unnecessary 'out of memory' message + if (!gpadc) { + dev_err(&pdev->dev, "Error: No memory\n"); WARNING: space prohibited before semicolon + return ; WARNING: void function return statements are not generally useful + return ; +} WARNING: quoted string split across lines +MODULE_AUTHOR("Arun R Murthy, Daniel Willerud, Johan Palsson," + "M'boumba Cedric Madianga"); total: 1 errors, 14 warnings, 1089 lines checked Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-22mfd: ab8500-gpadc: Pass the IRQF_ONESHOT flagFabio Estevam
Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail. So pass the IRQF_ONESHOT flag in this case. The semantic patch that makes this change is available in scripts/coccinelle/misc/irqf_oneshot.cocci. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-12-14Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
2014-12-05MFD / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PMRafael J. Wysocki
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM. Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under drivers/mfd/. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Lee Jones <lee.jones@linaro.org>
2014-10-20mfd: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-08-14mfd: ab8500-gpadc: Add CONFIG_PM_SLEEP to suspend/resumeJingoo Han
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the build warnings when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SET_SYSTEM_SLEEP_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/mfd/ab8500-gpadc.c:891:12: warning: 'ab8500_gpadc_suspend' defined but not used [-Wunused-function] drivers/mfd/ab8500-gpadc.c:903:12: warning: 'ab8500_gpadc_resume' defined but not used [-Wunused-function] Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-08-14mfd: ab8500-gpadc: Add CONFIG_PM_RUNTIME to runtime_suspend/runtime_resumeJingoo Han
Add CONFIG_PM_RUNTIME to runtime_suspend/runtime_resume functions to fix the build warnings when CONFIG_PM_RUNTIME is not selected. This is because runtime PM callbacks defined by SET_RUNTIME_PM_OPS are only used when the CONFIG_PM_RUNTIME is enabled. drivers/mfd/ab8500-gpadc.c:870:12: warning: 'ab8500_gpadc_runtime_suspend' defined but not used [-Wunused-function] drivers/mfd/ab8500-gpadc.c:878:12: warning: 'ab8500_gpadc_runtime_resume' defined but not used [-Wunused-function] Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-07-10Merge tag 'mfd-3.11-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next Pull MFD update from Samuel Ortiz: "For the 3.11 merge we only have one new MFD driver for the Kontron PLD. But we also have: - Support for the TPS659038 PMIC from the palmas driver. - Intel's Coleto Creek and Avoton SoCs support from the lpc_ich driver. - RTL8411B support from the rtsx driver. - More DT support for the Arizona, max8998, twl4030-power and the ti_am335x_tsadc drivers. - The SSBI driver move under MFD. - A conversion to the devm_* API for most of the MFD drivers. - The twl4030-power got split from twl-core into its own module. - A major ti_am335x_adc cleanup, leading to a proper DT support. - Our regular arizona and wm* updates and cleanups from the Wolfson folks. - A better error handling and initialization, and a regulator subdevice addition for the 88pm80x driver. - A bulk platform_set_drvdata() call removal that's no longer need since commit 0998d0631001 ("device-core: Ensure drvdata = NULL when no driver is bound") * tag 'mfd-3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next: (102 commits) mfd: sec: Provide max_register to regmap mfd: wm8994: Remove duplicate check for active JACKDET MAINTAINERS: Add include directory to MFD file patterns mfd: sec: Remove fields not used since regmap conversion watchdog: Kontron PLD watchdog timer driver mfd: max8998: Add support for Device Tree regulator: max8998: Use arrays for specifying voltages in platform data mfd: max8998: Add irq domain support regulator: palmas: Add TPS659038 support mfd: Kontron PLD mfd driver mfd: palmas: Add TPS659038 PMIC support mfd: palmas: Add SMPS10_BOOST feature mfd: palmas: Check if irq is valid mfd: lpc_ich: iTCO_wdt patch for Intel Coleto Creek DeviceIDs mfd: twl-core: Change TWL6025 references to TWL6032 mfd: davinci_voicecodec: Fix build breakage mfd: vexpress: Make the driver optional for arm and arm64 mfd: htc-egpio: Use devm_ioremap_nocache() instead of ioremap_nocache() mfd: davinci_voicecodec: Convert to use devm_* APIs mfd: twl4030-power: Fix relocking on error ...
2013-06-13mfd: ab8500-gpadc: Convert to managed resources for allocating memoryLee Jones
Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-06-03PM / Runtime: Rework the "runtime idle" helper routineRafael J. Wysocki
The "runtime idle" helper routine, rpm_idle(), currently ignores return values from .runtime_idle() callbacks executed by it. However, it turns out that many subsystems use pm_generic_runtime_idle() which checks the return value of the driver's callback and executes pm_runtime_suspend() for the device unless that value is not 0. If that logic is moved to rpm_idle() instead, pm_generic_runtime_idle() can be dropped and its users will not need any .runtime_idle() callbacks any more. Moreover, the PCI, SCSI, and SATA subsystems' .runtime_idle() routines, pci_pm_runtime_idle(), scsi_runtime_idle(), and ata_port_runtime_idle(), respectively, as well as a few drivers' ones may be simplified if rpm_idle() calls rpm_suspend() after 0 has been returned by the .runtime_idle() callback executed by it. To reduce overall code bloat, make the changes described above. Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Tested-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Kevin Hilman <khilman@linaro.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Alan Stern <stern@rowland.harvard.edu>
2013-05-17mfd: ab8500-gpadc: Suppress 'ignoring regulator_enable() return value' warningLee Jones
drivers/mfd/ab8500-gpadc.c: In function ‘ab8500_gpadc_resume’: drivers/mfd/ab8500-gpadc.c:911:18: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result] Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-26mfd: ab8500: Export ab8500_gpadc_sw_hw_convert properlyArnd Bergmann
Apparently the ab8500_gpadc_sw_hw_convert function got renamed from ab8500_gpadc_convert to ab8500_gpadc_sw_hw_convert in commit 734823462 "mfd: ab8500-gpadc: Add gpadc hw conversion", but the export for this function did not get changed at the same time, causing this allyesconfig error: ERROR: "ab8500_gpadc_sw_hw_convert" [drivers/hwmon/ab8500.ko] undefined! This patch fixes the export. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: M'boumba Cedric Madianga <cedric.madianga@stericsson.com> Cc: Lee Jones <lee.jones@linaro.org> Cc: Mattias WALLIN <mattias.wallin@stericsson.com> Cc: Michel JAOUEN <michel.jaouen@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08Merge branch 'for-mfd-and-power' of ↵Samuel Ortiz
git://git.linaro.org/people/ljones/linux-3.0-ux500 Conflicts: drivers/mfd/ab8500-gpadc.c Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-12mfd: ab8500-gpadc: Complain if we fail to enable vtvout LDOAxel Lin
Since commit c8801a8e "regulator: core: Mark all get and enable calls as __must_check", we must check return value of regulator_enable() to silence below build warning. CC drivers/mfd/ab8500-gpadc.o drivers/mfd/ab8500-gpadc.c: In function 'ab8500_gpadc_runtime_resume': drivers/mfd/ab8500-gpadc.c:598:18: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Wunused-result] drivers/mfd/ab8500-gpadc.c: In function 'ab8500_gpadc_probe': drivers/mfd/ab8500-gpadc.c:655:18: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Wunused-result] Also convert to devm_regulator_get(), this fixes a missing regulator_put() call in ab8500_gpadc_remove(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-gpadc: Optimise GPADC driverLee Jones
Optimise GPADC driver: * for code readability and maintenance by grouping similar cheking * for performance by grouping several writing to control register Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debug: Add support for the AB8540Lee Jones
Allow GPADC debug information to be shown when executing on an AB8540 based platform. Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@stericsson.com> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-gpadc: Add support for the AB8540Lee Jones
This patch enables the GPADC to work on AB8540 based platforms. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-core: Add ADC support for ab8540Lee Jones
Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-gpadc: Add gpadc hw conversionLee Jones
Add the support of gpacd hw conversion and make the number of sample configurable. Signed-off-by: M'boumba Cedric Madianga <cedric.madianga@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com> Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-gpadc: Reread on failureJonas Aaberg
Reread the gpadc once upon failure. Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-gpadc: Implemented suspend/resumeDaniel WILLERUD
suspend/resume methods implemented to prevent suspend while the gpadc driver is busy. Signed-off-by: Daniel WILLERUD <daniel.willerud@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Ulf HANSSON <ulf.hansson@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-02-04mfd: ab8500-gpadc: Remove unused 'struct ab8500_gpadc'Lee Jones
The ab8500_gpadc structure carries lots of important information which most functions make good use of. The initial expectation was that ab8500_gpadc_runtime_idle() would be no exception; however, this hasn't been the case to date. Let's remove it for now and add it back in only when we have a use for it. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-02-04mfd: ab8500-gpadc: Reduce conversion timeoutLee Jones
Reduce the conversion timeout from 2s to 0.5s 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-gpadc: Add runtime pm supportLee Jones
Add runtime pm support to speed up multiple ADC reads in a row. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-by: Ulf HANSSON <ulf.hansson@stericsson.com>
2013-02-04mfd ab8500-gpadc: Introduce new AB version detectionMichel JAOUEN
Add support for AB8505 and AB9540 Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Maxime Coquelin <maxime.coquelin@stericsson.com> Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2013-02-04mfd: ab8500-gpadc: Change to usleep_range() for greater resolutionLee Jones
The resolution of msleep is related to HZ, so with HZ set to 100 any msleep of less than 10ms will become ~10ms. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-11-28mfd: remove use of __devexitBill Pemberton
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-28mfd: remove use of __devinitBill Pemberton
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-28mfd: remove use of __devexit_pBill Pemberton
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-10-01Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull the trivial tree from Jiri Kosina: "Tiny usual fixes all over the place" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits) doc: fix old config name of kprobetrace fs/fs-writeback.c: cleanup riteback_sb_inodes kerneldoc btrfs: fix the commment for the action flags in delayed-ref.h btrfs: fix trivial typo for the comment of BTRFS_FREE_INO_OBJECTID vfs: fix kerneldoc for generic_fh_to_parent() treewide: fix comment/printk/variable typos ipr: fix small coding style issues doc: fix broken utf8 encoding nfs: comment fix platform/x86: fix asus_laptop.wled_type module parameter mfd: printk/comment fixes doc: getdelays.c: remember to close() socket on error in create_nl_socket() doc: aliasing-test: close fd on write error mmc: fix comment typos dma: fix comments spi: fix comment/printk typos in spi Coccinelle: fix typo in memdup_user.cocci tmiofb: missing NULL pointer checks tools: perf: Fix typo in tools/perf tools/testing: fix comment / output typos ...
2012-09-01mfd: printk/comment fixesMasanari Iida
Correct spelling typo in drivers/mfd Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-07-09mfd: Register ab8500 devices using the newly DT:ed MFD APILee Jones
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-07-09mfd: Enable IRQF_ONESHOT when requesting a threaded IRQ for ab8500gpadcLee Jones
The kernel now forces IRQs to be ONESHOT if no IRQ handler is passed. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20mfd: Enable ab8500-gpadc driver for Device TreeLee Jones
This patch will allow the ab8500-gpadc driver to be probed during Device Tree enabled boot. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20mfd: Prevent unassigned pointer from being used in ab8500-gpadc driverLee Jones
Before this patch if probe failed to find the platform IRQ it would attempt to print a message out using dev_err, which in turn was being passed an unassigned pointer. This patch ensures the information passed to dev_err is correct. 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 Walleij
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-10-24mfd: Refactor ab8500 GPADC API, add raw accessKarl Komierowski
Refactor the GPADC interface to avoid bugs in calling code: - ab8500_gpadc_[convert|read_raw|ad_to_voltage] clarifies each functions use case, *convert wraps *read_raw, and we can access raw ADC values properly. - Renamed gpadc function arguments from "input" to "channel" to clarify use, so we don't get confused again. Signed-off-by: Kalle Komierowski <kalle.komierowski@stericsson.com> Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com> Reviewed-by: John Beckett <john.beckett@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Correct the name and bitmask for ab8500-gpadc BTempPullUpJohan Palsson
The bitmask for enabling the BatTemp pull-up was wrong and is corrected. The name is also changed to be inline with the AB8500 register description Signed-off-by: Johan Palsson <johan.palsson@stericsson.com> Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Add manual ab8500-gpadc batt temp activation for AB8500 3.0Karl Komierowski
In AB8500 3.0 the pull-up supplying the NTC must be manually activated. Add enumerators to chip version detection logic. Signed-off-by: Kalle Komierowski <karl.komierowski@stericsson.com> Reviewed-by: Johan Palsson <johan.palsson@stericsson.com> Reviewed-by: Daniel Willerud <daniel.willerud@stericsson.com> Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-23mfd: Rename ab8500 gpadc headerLinus Walleij
Rename AB8500 GPADC header so as not to be redunantly named. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: Fix ab8500-gpadc to measure charger currentKarl Komierowski
The GPADC in the AB8500 was incorrectly configured when a charger current channel was selected. Signed-off-by: Karl Komierowski <karl.komierowski@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: Calibrate ab8500 gpadc using OTP valuesJohan Palsson
The GPADC found in the AB8500 needs to be calibrated to work properly. This is done by writing a number of special OTP (one-time-programmable) registers at production. This patch makes sure that these values are used to calibrate the returned value from the GPADC so that it is correct. Signed-off-by: Johan Palsson <johan.palsson@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: Free dangling irq in ab8500 gpadc probe error pathDaniel Willerud
Signed-off-by: Daniel Willerud <daniel.willerud@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: Reentrance and revamp ab8500 gpadc fetching interfaceDaniel Willerud
This revamps the interface so that AB8500 GPADCs are fetched by name. Probed GPADCs are added to a list and this list is searched for a matching GPADC. This makes it possible to have multiple AB8500 GPADC instances instead of it being a singleton, and rids the need to keep a GPADC pointer around in the core AB8500 MFD struct. Currently the match is made to the device name which is by default numbered from the device instance such as "ab8500-gpadc.0" but by using the .init_name field of the device a more intiutive naming for the GPADC blocks can be achieved if desired. Signed-off-by: Daniel Willerud <daniel.willerud@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: Move ab8500 gpadc header to subdirDaniel Willerud
This moves the ab8500-gpadc.h header down into the ab8500/ subdir in include/linux/mfd and fixes some whitespace in the header in the process. Signed-off-by: Daniel Willerud <daniel.willerud@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: Add new ab8500 GPADC driverArun Murthy
AB8500 GPADC driver used to convert Acc and battery/ac/usb voltage Signed-off-by: Arun Murthy <arun.murthy@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>