10 Mar, 2015
4 commits
-
Definition of _GNU_SOURCE is needed to get rid of some warnings, such
as:
warning: implicit declaration of function `asprintf'.generic_buffer.c and iio_event_monitor.c define _GNU_SOURCE,
but it is also needed in lsiio.c and iio_utils.c. For this reason,
this patch adds the definition in Makefile and removes it from where
it already exists.Signed-off-by: Roberta Dobrescu
Signed-off-by: Jonathan Cameron -
This patch moves iio userspace applications out of staging, to tools/iio/
and adds a Makefile in order to compile them easily. It also adds tools/iio/
to MAINTAINERS file.Signed-off-by: Roberta Dobrescu
Signed-off-by: Jonathan Cameron -
This patch removes inline functions from iio_utils.h in order to clean the
code. iio_utils.c contains the implementation of the functions used by
iio_event_monitor.c, lsiio.c or generic_buffer.c and iio_utils.h contains
the declarations of these functions.Since iio_utils.h is modified, generic_buffer.c and iio_event_monitor.c
must include stdlib.h.Signed-off-by: Roberta Dobrescu
Signed-off-by: Jonathan Cameron -
By adding this line and installing the kernel headers with
make headers_install, iio_event_monitor can be compiled without
any hacks.Signed-off-by: Roberta Dobrescu
Signed-off-by: Jonathan Cameron
09 Mar, 2015
6 commits
-
The defined registers only make sense when used for accessing RAM. Make
MLX90614_OP_RAM part of the symbol definition to avoid accidental access
to the wrong register.Signed-off-by: Vianney le Clément de Saint-Marcq
Cc: Arnout Vandecappelle (Essensium/Mind)
Signed-off-by: Jonathan Cameron -
Unless we put the device to sleep when not it use, it wastes
6mA.If the device is asleep on probe, the 'id' register
sometimes mis-reads - so reset first. If the device responds
at all a command sent to the address, it is almost certainly
the correct device already.Acked-by: Manuel Stahl
Acked-by: Hartmut Knaack
Signed-off-by: NeilBrown
Signed-off-by: Jonathan Cameron -
Signed-off-by: Martin Fuzzey
Signed-off-by: Jonathan Cameron -
The return value of gpiod_to_irq should be checked before giving
it to devm_request_threaded_irq in order to not pass an error
code in case it fails.Signed-off-by: Roberta Dobrescu
Reviewed-by: Vlad Dogaru
Acked-by: Uwe Kleine-König
Signed-off-by: Jonathan Cameron -
Adding binding documentation for ADC MCP3422.
Signed-off-by: Angelo Compagnucci
Signed-off-by: Jonathan Cameron -
Adding binding documentation for Texas Instruments' ADC128S052 ADC chip.
Signed-off-by: Angelo Compagnucci
Signed-off-by: Jonathan Cameron
08 Mar, 2015
4 commits
-
Added Power Management Support.
Signed-off-by: Kevin Tsai
Signed-off-by: Jonathan Cameron -
Code reformatting based on checkpatch.pl with --strict:
Comparison to NULL rewritten as !indio_devSigned-off-by: Tolga Ceylan
Signed-off-by: Jonathan Cameron -
Code reformatting based on checkpatch.pl with --strict:
Alignment should match open paranthesis cases correctedSigned-off-by: Tolga Ceylan
Signed-off-by: Jonathan Cameron -
This patch fix spelling typo in MODULE_DESCRIPTION
Signed-off-by: Masanari Iida
Signed-off-by: Jonathan Cameron
25 Feb, 2015
3 commits
-
This is a follow up patches after adding i2c mux adapter for bypass
mode. Potentially many different types of sensor can be attached to
INVMPU6XXX device, which can be connected to main cpu i2c bus in
bypass mode.
Why do we need this?
The system ACPI table entry will consist of only one device for
INV6XXX, assuming that this driver will handle all connected sensors.
That is not true for the Linux driver. There are bunch of IIO drivers
for each sensors, hence we created a mux on this device. So to load
these additional drivers, we need to create i2c devices for them
in this driver using this mux adapter.There are multiple options:
1. Use the auto detect feature, this needs a new i2c class for the
adapter as the existing HWMON class is not acceptable. Also the
autodetect has overhead of executing detect method for each
matching class of adapters.
This is a simple implementation. This option was previously submitted
with not a happy feedback.2. Option is use ACPI magic and parse the configuration data. What
we need to create a i2c device at a minimum is address and a name.
Address can be obtained for secondary device in more or less in a
standard way from using _CRS element. But there is no name. To get
name we need to process proprietary vendor data. Not having name is
not fun, as you have to create device using the device name of
INVN6XXXX, respecting driver duplicate name space restriction.
Also each client driver needs to have this name in the id table.
Since multiple driver can be loaded, the driver should be able to
detect its presence and gracefully exit for the other client driver
to take it over.
So we use two step process:
- Use DMI to id platform and parse propritery data. This is not uncommon
for many x86 platform specific driver. We will get both name and address.
The change created necessary infrastructure to add more properitery vendor
data parsing.
- If DMI match fails, then create device on INV6XXX-client (we can't
create with same name as INV6XXX as it will cause duplicate name and driver
model will reject.) With this each client sensor driver which needs to get
attached via INV6XXXX, need this name in the id table and detect the
physical presence of sensor in probe and exit if not found.Signed-off-by: Srinivas Pandruvada
Signed-off-by: Jonathan Cameron -
The regmap_config struct may be const because it is not modified by the
driver and regmap_init() accepts pointer to const.Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Jonathan Cameron -
The regmap_access_table and regmap_config structures may be const
because they are not modified by the driver and regmap_init() accepts
pointer to const.Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Jonathan Cameron
22 Feb, 2015
2 commits
-
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for
outputs.Signed-off-by: Uwe Kleine-König
Reviewed-by: Linus Walleij
Reviewed-by: Alexandre Courbot
Reviewed-by: Daniel Baluta
Signed-off-by: Jonathan Cameron -
Change struct iio_prtc_trigger_info frequency
type from int to unsigned int.
Since it is always treated as such in the driver
so they type should probably reflect this.Signed-off-by: Rickard Strandqvist
Signed-off-by: Jonathan Cameron
15 Feb, 2015
2 commits
-
This patch introduces the use of function put_unaligned_le32.
This is done using Coccinelle and semantic patch used is as follows:
@@ identifier tmp; expression ptr; expression y,e; type T; @@
- tmp = cpu_to_le32(y);
? tmp = e@@ type T; identifier tmp; @@
- T tmp;
...when != tmpSigned-off-by: Vaishali Thakkar
Signed-off-by: Jonathan Cameron -
After UAPI header file split [1] all user-kernel interfaces were
placed under include/uapi/.This patch moves IIO user specific API from:
* include/linux/iio/events.h => include/uapi/linux/iio/events.h
* include/linux/types.h => include/uapi/linux/types.hNow there is no need for nasty tricks to compile userspace programs
(e.g iio_event_monitor). Just installing the kernel headers with
make headers_install command does the job.[1] http://lwn.net/Articles/507794/
Signed-off-by: Daniel Baluta
Signed-off-by: Jonathan Cameron
08 Feb, 2015
7 commits
-
Wrong type in printf format string, requires 'int'
but the argument type is 'unsigned int'This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist
Reviewed-by: Marek Vasut
Signed-off-by: Jonathan Cameron -
Wrong type in printf format string, requires 'int'
but the argument type is 'unsigned int'This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist
Signed-off-by: Jonathan Cameron -
Line over 80 characters corrected
Signed-off-by: Tolga Ceylan
Signed-off-by: Jonathan Cameron -
Indentation corrections in struct initializations and
one line over 80 characters split into two linesSigned-off-by: Tolga Ceylan
Signed-off-by: Jonathan Cameron -
Previous of this patch the check was only done if we enabled the event
and it was already enabled. We can do the same if the event is
disabled and we want to disable it.The patch also adds the same check on the trigger code.
Signed-off-by: Octavian Purdila
Acked-by: Srinivas Pandruvada
Signed-off-by: Jonathan Cameron -
This patch combines the any motion and new data interrupts function
into a single, generic, interrupt enable function. On top of this, we
can later refactor triggers to make it easier to add new triggers.Signed-off-by: Octavian Purdila
Acked-by: Srinivas Pandruvada
Signed-off-by: Jonathan Cameron -
Move the slope duration and threshold update in a separate function to
reduce code duplicate between chip init and motion interrupt setup.Also move the slope update code from the interrupt setup function to
the trigger set state function so that we can later refactor the
interrupt code.Signed-off-by: Octavian Purdila
Acked-by: Srinivas Pandruvada
Signed-off-by: Jonathan Cameron
05 Feb, 2015
2 commits
-
Move all core (non-custom) buffer attributes to a vector to make it
easier to add more of them in the future.Signed-off-by: Octavian Purdila
Signed-off-by: Jonathan Cameron -
return type of wait_for_completion_timeout is unsigned long not int, this
patch only fixes up the return handling.Signed-off-by: Nicholas Mc Guire
Signed-off-by: Jonathan Cameron
04 Feb, 2015
3 commits
-
odr_bits values are between 0 and 11, so we can use the index
in kmx61_samp_freq_table instead of odr_bits structure member.Signed-off-by: Daniel Baluta
Reviewed-by: Hartmut Knaack
Signed-off-by: Jonathan Cameron -
This patch adds the error handling for the value returned from
ade7759_spi_read_reg_16. With this patch, the following randconfig
warnings get fixed automatically.drivers/staging/iio/meter/ade7759.c:224:6: warning: ‘val’ may be
used uninitialized in this function [-Wmaybe-uninitialized]
drivers/staging/iio/meter/ade7759.c:309:6: warning: ‘val’ may be
used uninitialized in this function [-Wmaybe-uninitialized]Signed-off-by: Devendra Naga
Signed-off-by: Jonathan Cameron -
This patch adds the error handling for the value returned from
ade7754_spi_read_reg_8. With this patch, the following randconfig
warnings get fixed automatically.drivers/staging/iio/meter/ade7754.c:222:6: warning: ‘val’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
drivers/staging/iio/meter/ade7754.c:368:6: warning: ‘val’ may be used
uninitialized in this function [-Wmaybe-uninitialized]Signed-off-by: Devendra Naga
Signed-off-by: Jonathan Cameron
03 Feb, 2015
1 commit
-
We want those fixes in here for testing.
Signed-off-by: Greg Kroah-Hartman
02 Feb, 2015
6 commits
-
Pull ARM SoC fixes from Olof Johansson:
"One more week's worth of fixes. Worth pointing out here are:- A patch fixing detaching of iommu registrations when a device is
removed -- earlier the ops pointer wasn't managed properly
- Another set of Renesas boards get the same GIC setup fixup as
others have in previous -rcs
- Serial port aliases fixups for sunxi. We did the same to tegra but
we caught that in time before the merge window due to more machines
being affected. Here it took longer for anyone to notice.
- A couple more DT tweaks on sunxi
- A follow-up patch for the mvebu coherency disabling in last -rc
batch"* tag 'armsoc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
arm: dma-mapping: Set DMA IOMMU ops in arm_iommu_attach_device()
ARM: shmobile: r8a7790: Instantiate GIC from C board code in legacy builds
ARM: shmobile: r8a73a4: Instantiate GIC from C board code in legacy builds
ARM: mvebu: don't set the PL310 in I/O coherency mode when I/O coherency is disabled
ARM: sunxi: dt: Fix aliases
ARM: dts: sun4i: Add simplefb node with de_fe0-de_be0-lcd0-hdmi pipeline
ARM: dts: sun6i: ippo-q8h-v5: Fix serial0 alias
ARM: dts: sunxi: Fix usb-phy support for sun4i/sun5i -
Pull input layer updates from Dmitry Torokhov:
"Just a few quirks for PS/2 this time"* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: elantech - add more Fujtisu notebooks to force crc_enabled
Input: i8042 - add noloop quirk for Medion Akoya E7225 (MD98857)
Input: synaptics - adjust min/max for Lenovo ThinkPad X1 Carbon 2nd -
Commit 8eb23b9f35aa ("sched: Debug nested sleeps") added code to report
on nested sleep conditions, which we generally want to avoid because the
inner sleeping operation can re-set the thread state to TASK_RUNNING,
but that will then cause the outer sleep loop not actually sleep when it
calls schedule.However, that's actually valid traditional behavior, with the inner
sleep being some fairly rare case (like taking a sleeping lock that
normally doesn't actually need to sleep).And the debug code would actually change the state of the task to
TASK_RUNNING internally, which makes that kind of traditional and
working code not work at all, because now the nested sleep doesn't just
sometimes cause the outer one to not block, but will cause it to happen
every time.In particular, it will cause the cardbus kernel daemon (pccardd) to
basically busy-loop doing scheduling, converting a laptop into a heater,
as reported by Bruno Prémont. But there may be other legacy uses of
that nested sleep model in other drivers that are also likely to never
get converted to the new model.This fixes both cases:
- don't set TASK_RUNNING when the nested condition happens (note: even
if WARN_ONCE() only _warns_ once, the return value isn't whether the
warning happened, but whether the condition for the warning was true.
So despite the warning only happening once, the "if (WARN_ON(..))"
would trigger for every nested sleep.- in the cases where we knowingly disable the warning by using
"sched_annotate_sleep()", don't change the task state (that is used
for all core scheduling decisions), instead use '->task_state_change'
that is used for the debugging decision itself.(Credit for the second part of the fix goes to Oleg Nesterov: "Can't we
avoid this subtle change in behaviour DEBUG_ATOMIC_SLEEP adds?" with the
suggested change to use 'task_state_change' as part of the test)Reported-and-bisected-by: Bruno Prémont
Tested-by: Rafael J Wysocki
Acked-by: Oleg Nesterov
Cc: Peter Zijlstra
Cc: Thomas Gleixner ,
Cc: Ilya Dryomov ,
Cc: Mike Galbraith
Cc: Ingo Molnar
Cc: Peter Hurley ,
Cc: Davidlohr Bueso ,
Signed-off-by: Linus Torvalds -
Add two more Fujitsu LIFEBOOK models that also ship with the Elantech
touchpad and don't work with crc_disabled to the quirk list.Signed-off-by: Rainer Koenig
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov -
…ernel/git/horms/renesas into fixes
Merge "Third Round of Renesas ARM Based SoC Fixes for v3.19" from Simon Horman:
* Instantiate GIC from C board code in legacy builds on r8a7790 and r8a73a4
* tag 'renesas-soc-fixes3-for-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
ARM: shmobile: r8a7790: Instantiate GIC from C board code in legacy builds
ARM: shmobile: r8a73a4: Instantiate GIC from C board code in legacy buildsSigned-off-by: Olof Johansson <olof@lixom.net>