aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ab8500-debugfs.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-01-06mfd: ab8500-debugfs: Move dereference after check for NULLDan Carpenter1-2/+3
We dereference "desc" before check if it is NULL. I've shifted it around so we check first before dereferencing. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-09-02mfd: ab8500-debugfs: Apply a check for -ENOMEM after allocating memory for event nameLee Jones1-0/+3
The AB8500 debugfs driver allocates memory to contain the name of a new sysfs entry, but fails to apply the proper post-allocation checks. If the device were to run out of memory, the allocation would return NULL. Without the correct checks the driver will continue to populate address NULL with the specified device name which would obviously cause a pointer dereference Oops. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-09-02mfd: ab8500-debugfs: Apply a check for -ENOMEM after allocating memory for sysfsLee Jones1-0/+3
The AB8500 debugfs driver allocates memory for a new sysfs entry, but fails to apply the proper post-allocation checks. If the device were to run out of memory, the allocation would return NULL. Without the correct checks the driver will continue to populate NULL->[show|store|...], which would obviously cause a pointer dereference Oops. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-09-02mfd: ab8500-debugfs: Staticize local variablesSachin Kamat1-4/+4
Local variables referenced only in this file are made static. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-06-13mfd: ab8500-debug: Convert to managed resources for allocating memoryLee Jones1-22/+12
Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-06-13mfd: Replace strict_strtoul() with kstrtoul() in ab* and att*Jingoo Han1-1/+1
The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-05-17mfd: ab8500: Pass AB8500 IRQ to debugfs code by resourceLinus Walleij1-4/+12
The AB8500 debug code which was merged in parallell with the multiplatform work incidentally introduced a new instance using the <mach/irqs.h> header which is now deleted, causing this build regression: drivers/mfd/ab8500-debugfs.c:95:23: fatal error: mach/irqs.h: No such file or directory compilation terminated. make[4]: *** [drivers/mfd/ab8500-debugfs.o] Error 1 The code most certainly never worked with device tree either since that does not rely on this kind of hard-coded interrupt numbers. Fix the problem at the root by passing it as a named resource from the ab8500-core driver. Use an untyped resource to stop the MFD core from remapping this IRQ relative to the AB8500 irqdomain. Signed-off-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>
2013-03-07mfd: ab8500-debugfs: Trivially beautify the debugfs driverLee Jones1-97/+89
Just lots of white space corrections, changing some of the 4 space tabs to 8 and pulling back some of the double tabbing back into singles, such as the remaining of the driver. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debug: Convert to kstrtoul_from_usersrinidhi kasagar1-70/+30
Use kstrtoul_from_user for getting an unsigned long from userspace which is less error prone. Signed-off-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debug: Add explicit dependenciesLinus Walleij1-0/+3
As I am working on SPARSE_IRQ a number of implicit resource grabs in the kernel become evident. For example, some includes like <linux/irqs.h> would implicitly include <mach/irqs.h> and then from there <mach/db8500-regs.h>. In many cases it is masking the fact that drivers do not properly use resources to pass their dependencies, base addresses etc. So write explicit #include statements with TODO items to have this fixed the proper way to all drivers doing this. Signed-off-by: Linus Walleij <linus.walleij@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 register map for ab8540.Lee Jones1-3/+419
Required to read out correct debug information from the AB chip. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debugfs: Change AB8500 debug permissionsLee Jones1-28/+28
Enable group write permissions for ab8500 debug MFD driver. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debug: Add ADC input channel usb_id in debugfsLee Jones1-0/+35
Signed-off-by: Yang QU <yang.qu@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Alexandre BOURDIOL <alexandre.bourdiol@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debugfs: Dump sim registersLee Jones1-0/+78
This patch allows to dump the SIM registers from debugfs. It will temporary change the config to allow APE side to read the SIM registers. Note that this read can cause problem on modem side since the modem can't read these registers while the operation is ongoing. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debug: Add support for the AB8540Lee Jones1-1/+285
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-debug: Add support for ab8505 and ab9540Lee Jones1-11/+372
Make it possible to dump all registers in ab8505 and ab9540. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debugfs: Add tests for ab8540 based platform initialisationsLee Jones1-0/+2
Signed-off-by: Alexandre Torgue <alexandre.torgue@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com> Tested-by: Maxime COQUELIN <maxime.coquelin@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debug: Add wake-up infoJonas Aaberg1-5/+30
Add information regarding what ab interrupt that caused a wake-up from suspend in <debugfs>/ab8500/interrupts. Also print the name of the interrupts, not just the numbers. Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Per FORLIN <per.forlin@stericsson.com> Tested-by: Mattias WALLIN <mattias.wallin@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-debug: Better error handling on crashJonas Aaberg1-4/+11
Stop trying to read i2c registers if one fail. 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-debug: Function to save all ABB registers to memLee Jones1-0/+50
Dump function that stores all readable ABB registers to a memory areas where they can be accessed from dump file. 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-debug: Print banks in hexMattias Wallin1-9/+9
This patch changes bank prints to use hex value. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Daniel WILLERUD <daniel.willerud@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2013-03-07mfd: ab8500-gpadc: Add gpadc hw conversionLee Jones1-26/+266
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-02-14mfd: ab8500: Fix compile errorLinus Walleij1-0/+1
When compiling the AB8500 core driver in the latest MFD tree the following happens: CC drivers/mfd/ab8500-debugfs.o /home/elinwal/linux-next/drivers/mfd/ab8500-debugfs.c:157:3: error: 'AB8500_SYS_CTRL1_BLOCK' undeclared here (not in a function) /home/elinwal/linux-next/drivers/mfd/ab8500-debugfs.c:157:2: error: array index in initializer not of integer type /home/elinwal/linux-next/drivers/mfd/ab8500-debugfs.c:157:2: error: (near initialization for 'debug_ranges') (...) This is due to a missing include statement, so fix it up. Cc: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-02-04mfd: ab8500-gpadc: Use new ab8500_gpadc_get() with name parameterPhilippe Langlais1-13/+13
The new format of ab8500_gpadc_get() accepts a device name as a parameter to specify which device to retrieve. This patch enforces the use of that new format. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
2013-02-04mfd: ab8500-debugfs: sizeof() mismatch bugfixAshok G1-1/+1
Simple pointer error fix to obtain the expected sizeof() result. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Ashok G <ashok.g@stericsson.com> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
2013-02-04mfd: ab8500-debugfs: Add interrupt debugBengt Jonsson1-0/+49
This patch adds an entry in debugfs to check number of interrupts from the AB. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
2013-02-04mfd: ab8500-debugfs: Allow number of IRQs to be provided more dynamicallyLinus Walleij1-10/+41
With the introduction of new AB* platforms, it's important to allow as much code reuse as possible. By allowing a system's number of IRQs to be dynamically passed, we can reuse almost all of the -debugfs driver. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
2013-02-04mfd: ab8500-core: Allow the possibility to dump all AB8500 registersMian Yousaf Kaukab1-0/+13
Implement an API so that a user may dump all AB8500 registers via debugfs file access. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-02-04mfd: ab8500-debugfs: add debugfs node to read all registersMian Yousaf Kaukab1-14/+81
Update the ab8500_registers_print() to reuse it from multiple places. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-02-04mfd: ab8500-debugfs: Set the USB charging current to 300mA for ABV3Philippe Langlais1-2/+24
In case of AB-V3, the eye diagram related issues are resolved. So, set the device charging current to 300mA when connected to standard host. Also, add the USB PHY tuning values to improve the USB eye diagram Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: <thirupathi.chippakurthy@stericsson.com>
2013-02-04mfd: ab8500-debugfs: Export all AB8500 ADCs as debugfs nodesJohn Beckett1-21/+465
Allow a user to take a glimpse into the inner workings of the AB8500 Analogue-to-Digital Converters, via debugfs. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: John Beckett <john.beckett@stericsson.com> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
2013-02-04mfd: ab8500-debugfs: Formated access AB8500 registers from debugfs entrycarriere etienne1-52/+338
Add debugfs entry ab8500/hwreg to read/write bit-field in AB8500 registers. Check the debugfs entries usage from heading comments in ab8500-debugfs.c Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: carriere etienne <etienne.carriere@stericsson.com> Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
2013-02-04mfd: ab8500-debugfs: Use NULL to initialise remaining NULL pointerLee Jones1-1/+1
Partly for coding style reasons, but mostly because sparse warns on it. This patch is a completion of a previous patch by Mark Brown. Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-02-04mfd: ab8500-debugfs: Keep count of IRQs in debugfsMattias Wallin1-24/+53
This patch adds a counter to the sysfs file dynamically created by debugfs. It also fixes an array index error. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Reviewed-by: Mattias NILSSON <mattias.i.nilsson@stericsson.com>
2013-02-04mfd: ab8500-debugfs: Provide a means for a user subscribe to IRQsLee Jones1-0/+198
Allow users to subscribe to and view IRQ events live from debugfs. Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-11-28mfd: 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-28mfd: 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-28mfd: 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-07-09mfd: Generically describe interactions with the DB8500 PRCMULee Jones1-3/+3
There is only one method used to communicate with the DB8500 PRCMU, via I2C. Now this can be assumed, there is no requirement to specify the protocol in the function name. This patch removes protocol specifics and uses a more generic naming convention. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20mfd: Enable ab8500-debug when Device Tree is enabledLee Jones1-0/+6
Allow the ab8500-debugfs driver to be probed during DT start-up. 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-1/+1
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-31mfd: 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-07-31mfd: Use kstrtoul_from_user in ab8500Peter Huewe1-30/+11
This patch replaces the code for getting an unsigned long from a userspace buffer by a simple call to kstroul_from_user. This makes it easier to read and less error prone. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: ab8500: world-writable debugfs register-* filesVasiliy Kulikov1-3/+3
Don't allow everybody to interact with hardware registers. Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-01-14mfd: Use NULL to initialise NULL pointers in ab8500-debugfsMark Brown1-7/+7
Partly for coding style reasons, but mostly because sparse warns on it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-01-14mfd: Fix ab8500-debug indentation errorsMattias Wallin1-508/+508
Replace spaces with proper tabs. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-29mfd: AB8500 debugfsMattias Wallin1-0/+652
This patch adds the possibility to read and write registers via the debug_fs. It also adds ranges of registers sorted by bank which makes it possible to read all defined registers in a bank. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>