Noticed during a coding review, if we reorganised the checking a
little, we can rid the code of a pointless 'else'. Whilst looking
for this particular code hunk I noticed another pointless 'else',
which I've subsequently fixed in this patch.
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Unsigned variable can't be negative so it is unnecessary to test it
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Fix checkpatch warning:
WARNING: debugfs_remove_recursive(NULL) is safe this check is probably not required
Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Remove variable that are never used
This was found using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
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 <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
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 <[email protected]>
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 <[email protected]>
The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.
Signed-off-by: Jingoo Han <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
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 <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Reviewed-by: Philippe LANGLAIS <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
Required to read out correct debug information from the AB chip.
Signed-off-by: Lee Jones <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Reviewed-by: Marcus COOPER <[email protected]>
Reviewed-by: Jonas ABERG <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
Allow GPADC debug information to be shown when executing on an AB8540
based platform.
Signed-off-by: Alexandre Bourdiol <[email protected]>
Reviewed-by: Marcus COOPER <[email protected]>
Reviewed-by: Philippe LANGLAIS <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Reviewed-by: Per FORLIN <[email protected]>
Tested-by: Mattias WALLIN <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Reviewed-by: Mattias WALLIN <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Signed-off-by: Philippe Langlais <[email protected]>
This patch adds an entry in debugfs to check number of interrupts
from the AB.
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Bengt Jonsson <[email protected]>
Reviewed-by: Rabin VINCENT <[email protected]>
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 <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Implement an API so that a user may dump all AB8500 registers
via debugfs file access.
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Mian Yousaf Kaukab <[email protected]>
Reviewed-by: Linus WALLEIJ <[email protected]>
Reviewed-by: Jonas ABERG <[email protected]>
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 <[email protected]>
Signed-off-by: <[email protected]>
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 <[email protected]>
Signed-off-by: John Beckett <[email protected]>
Reviewed-by: Mattias WALLIN <[email protected]>
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 <[email protected]>
Signed-off-by: carriere etienne <[email protected]>
Reviewed-by: Mattias WALLIN <[email protected]>
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 <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
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 <[email protected]>
Signed-off-by: Mattias Wallin <[email protected]>
Reviewed-by: Mattias NILSSON <[email protected]>
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 <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Allow the ab8500-debugfs driver to be probed during DT start-up.
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
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 <[email protected]>]
Signed-off-by: Paul Gortmaker <[email protected]>
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 <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>