The Kconfig currently controlling compilation of this code is:
drivers/mfd/Kconfig:config AB8500_DEBUG
drivers/mfd/Kconfig: bool "Enable debug info via debugfs"
...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.
We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.
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
is already contained at the top of the file in the comments.
Signed-off-by: Paul Gortmaker <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Due to the lack of parity in the way array fields have been named/
numbered, a mistake was made where more debug fields were declared
than actually existed. In doing so, 2 fields were added, which
although unclear, were already declared in the array. The result
was that the latter declarations trashed the former ones.
This patch places the array back in the correct order and removes
the offending NULL entries.
While we're at it, let's ensure this doesn't happen again by naming
each field properly and add a new *_LAST define to describe how
many fields there should be.
Signed-off-by: Lee Jones <[email protected]>
WARNING: Block comments use a trailing */ on a separate line
+ * not be accessed from here */
WARNING: Block comments use a trailing */ on a separate line
+ * not be accessed from here */
WARNING: Block comments use a trailing */ on a separate line
+ * the output is wanted in any case */
WARNING: Consecutive strings are generally better as a single string
+ " addr=0x%08X, mask=0x%X, shift=%d" "value=0x%X\n",
total: 0 errors, 4 warnings, 3331 lines checked
Cc: Linus Walleij <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Since commit 1c6c69525b ("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 <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.
See: commit 1f33c41c03 ("seq_file: Rename seq_overflow() to
seq_has_overflowed() and make public")
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
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]>