20 Apr, 2016
5 commits
-
Some types of ST Sensors can be connected to the same IRQ line
as other peripherals using open drain. Add a device tree binding
and a sensor data property to flip the right bit in the interrupt
control register to enable open drain mode on the INT line.If the line is set to be open drain, also tag on IRQF_SHARED
to the IRQ flags when requesting the interrupt, as the whole
point of using open drain interrupt lines is to share them with
more than one peripheral (wire-or).Cc: devicetree@vger.kernel.org
Cc: Giuseppe Barba
Cc: Denis Ciocca
Acked-by: Rob Herring
Signed-off-by: Linus Walleij
Signed-off-by: Jonathan Cameron -
This makes all ST sensor drivers check that they actually have
new data available for the requested channel(s) before claiming
an IRQ, by reading the status register (which is conveniently
the same for all ST sensors) and check that the channel has new
data before proceeding to read it and fill the buffer.This way sensors can share an interrupt line: it can be flaged
as shared and then the sensor that did not fire will return
NO_IRQ, and the sensor that fired will handle the IRQ and
return IRQ_HANDLED.Cc: Giuseppe Barba
Cc: Denis Ciocca
Signed-off-by: Linus Walleij
Signed-off-by: Jonathan Cameron -
The current buffer read code tries to optimize reads from the
sensor data registers by issuing a single read operation across
all the indata registers.This doesn't work: when the LIS331DL accelerometer sensor is
configured to open drain, active low interrupt mode, this will
just clear the XDA (X-axis data available) bit in the STATUS_REG
register (0x27), while YDA, ZDA and even ZYXDA remain set to 1,
and the internal logic of the sensor holds the DRDY (INT1) line
asserted (the value of the status register is 0xee).If we instead issue one read operation per enabled channel
(X, Y, Z) things start working and we can use open drain and
active low interrupts.Note that a backported patch fixing this issue will be heading
via the fixes branch but changes in this file already in staging-next
will make that patch 'look' rather different. The code in here
is the correct one when that clash hits.Cc: Giuseppe Barba
Cc: Denis Ciocca
Signed-off-by: Linus Walleij
Signed-off-by: Jonathan Cameron -
This patch moves the STMP reset out of ADC init function so as to remove
the possiblity of an error return which will be necessary for PM ops support
patches to follow.Signed-off-by: Stefan Wahren
Tested-by: Marek Vasut
Signed-off-by: Jonathan Cameron -
This patch moves the touchscreen type configuration into
a more suitable function. Btw this simplifies PM ops later.Signed-off-by: Stefan Wahren
Reviewed-by: Marek Vasut
Tested-by: Marek Vasut
Acked-by: Dmitry Torokhov
Signed-off-by: Jonathan Cameron
19 Apr, 2016
2 commits
-
Signed-off-by: Daniel Baluta
Signed-off-by: Jonathan Cameron -
This is useful for easily adding SPI support in later patches.
Now bmc150_magn exports core functions to be used by I2C/SPI drivers
instances. For the moment only I2C driver is supported.Signed-off-by: Daniel Baluta
Acked-by: Irina Tirdea
Signed-off-by: Jonathan Cameron
17 Apr, 2016
6 commits
-
Set INPUT_PROP_DIRECT to indicate that it is a touchscreen on the
device to help userspace classify it.Signed-off-by: Ksenija Stanojevic
Acked-by: Dmitry Torokhov
Signed-off-by: Jonathan Cameron -
Using this requires software triggers like CONFIG_IIO_HRTIMER_TRIGGER.
The device can be configured to do internal periodic sampling but does not
offer some sort of interrupt on data ready. Interrupts can only trigger when
values get out of a specific range.Signed-off-by: Crestez Dan Leonard
Signed-off-by: Jonathan Cameron -
These chips have an almost identical interface but support a different
number of value bits. Datasheet links for comparison:* http://www.ti.com/lit/ds/symlink/adc081c021.pdf
* http://www.ti.com/lit/ds/symlink/adc101c021.pdf
* http://www.ti.com/lit/ds/symlink/adc121c021.pdfSigned-off-by: Crestez Dan Leonard
Signed-off-by: Jonathan Cameron -
This fix checkpatch warnings:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
This is a reimplementation of the old misc device driver for the
ROHM BH1780 ambient light sensor (drivers/misc/bh1780gli.c).Differences from the old driver:
- Uses the IIO framework
- Uses runtime PM to idle the hardware after 5 seconds
- No weird custom power management from userspace
- No homebrewn values in sysfsThis uses the same (undocumented) device tree compatible-string
as the old driver ("rohm,bh1780gli").Cc: Arnd Bergmann
Cc: Ulf Hansson
Cc: Daniel Mack
Cc: Peter Meerwald-Stadler
Signed-off-by: Linus Walleij
Reviewed-by: Ulf Hansson
Signed-off-by: Jonathan Cameron -
Indent lines inside if statement.
Signed-off-by: Ksenija Stanojevic
Signed-off-by: Jonathan Cameron
16 Apr, 2016
16 commits
-
The ADIS16201 does not automatically clear the self test flag bit the self
test has been, so clear it manually. Otherwise we'll see a offset caused by
the self-test bias on the output values during normal operation.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The ADIS16201 does not automatically clear the self test flag bit the self
test has been, so clear it manually. Otherwise we'll see a offset caused by
the self-test bias on the output values during normal operation.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The ADIS16201 does not automatically clear the self test flag bit the self
test has been, so clear it manually. Otherwise we'll see a offset caused by
the self-test bias on the output values during normal operation.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The ADIS16201 does not automatically clear the self test flag bit the self
test has been, so clear it manually. Otherwise we'll see a offset caused by
the self-test bias on the output values during normal operation.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
Some variants of the devices from the ADIS family don't auto-clear the
self-test bit after the self-test has completed. Instead we have to
manually clear. Add support for this to the ADIS library.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
This fixes the errors reported by checkpatch.pl:
ERROR: code indent should use tabs where possible
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
This fixes the error reported by checkpatch.pl:
ERROR: else should follow close brace '}'
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
This fixes the error reported by checkpatch.pl:
ERROR: code indent should use tabs where possible
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
This fixes the error reported by checkpatch.pl:
ERROR: code indent should use tabs where possible
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
This fixes the error reported by checkpatch.pl:
ERROR: space prohibited before that ',' (ctx:WxW)
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
This fixes the errors reported by checkpatch.pl:
ERROR: space prohibited before that ',' (ctx:WxW)
ERROR: code indent should use tabs where possibleSigned-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
This fixes the error reported by checkpatch.pl:
ERROR: space prohibited before that ',' (ctx:WxW)
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
This fixes the error reported by checkpatch.pl:
ERROR: switch and case should be at the same indent
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
This fixes the error reported by checkpatch.pl:
ERROR: space required before the open parenthesis '('
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
This fixes the error reported by checkpatch.pl:
ERROR: that open brace { should be on the previous line
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron -
BMI160 is an Inertial Measurement Unit (IMU) which provides acceleration
and angular rate measurement. It also offers a secondary I2C interface
for connecting a magnetometer sensor (usually BMM160).Current driver offers support for accelerometer and gyroscope readings
via sysfs or via buffer interface using an external trigger (e.g.
hrtimer). Data is retrieved from IMU via I2C or SPI interface.Datasheet is at:
http://www.mouser.com/ds/2/783/BST-BMI160-DS000-07-786474.pdfSigned-off-by: Daniel Baluta
Signed-off-by: Jonathan Cameron
11 Apr, 2016
1 commit
-
* Unify log messages
* Add more DEBUG messagesApparently this driver is working unreliably on some platforms that I can't
test. Therefore I want an easy way for bug reporters to provide useful
information without making the driver too chatty by default.Signed-off-by: Harald Geyer
Signed-off-by: Jonathan Cameron
10 Apr, 2016
6 commits
-
Replace the code that guarantees the device stays in direct mode with
iio_device_{claim|release}_direct_mode() which does same.Signed-off-by: Alison Schofield
Acked-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
Driver includes struct regmap and struct device in its global data.
Remove the struct device and use regmap API to retrieve device info.Patch created using Coccinelle plus manual edits.
Signed-off-by: Alison Schofield
Acked-by: Joachim Eastwood
Signed-off-by: Jonathan Cameron -
This patch adds support for the AD5592R (spi) and AD5593R (i2c)
ADC/DAC/GPIO devices.Signed-off-by: Paul Cercueil
Signed-off-by: Michael Hennerich
Reviewed-by: Linus Walleij
Acked-by: Rob Herring
Signed-off-by: Jonathan Cameron -
commit f836c45922446df872250a12dd08e48978aceb2f moved mxs-lradc driver
out of staging. However the binding document was left in the old place.Signed-off-by: Harald Geyer
Signed-off-by: Jonathan Cameron -
This will be used together with an external trigger (e.g hrtimer based
software trigger).Signed-off-by: Gregor Boirie
Signed-off-by: Jonathan Cameron -
The following functions are supported:
- write, read potentiometer value
- potentiometer scaleDatasheet: https://datasheets.maximintegrated.com/en/ds/DS1803.pdf
Signed-off-by: Slawomir Stepien
Signed-off-by: Jonathan Cameron
05 Apr, 2016
4 commits
-
fix checkpatch.pl warning about 'Prefer 'unsigned int' to bare use of
'unsigned''Signed-off-by: Clifton Barnes
Acked-by: Martyn Welch
Signed-off-by: Greg Kroah-Hartman -
fix checkpatch.pl warning about 'Avoid CamelCase'
Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
The "ch->ch_bd" is already assined to "bd" but this is only
for checking null or MAGIC number.
in the dgnc_tty_ioctl function, bd can be used for referencing
to board_ops structure.Signed-off-by: Daeseok Youn
Signed-off-by: Greg Kroah-Hartman -
Currently, lowmemorykiller (LMK) is using TIF_MEMDIE for two purposes.
One is to remember processes killed by LMK, and the other is to
accelerate termination of processes killed by LMK.But since LMK is invoked as a memory shrinker function, there still
should be some memory available. It is very likely that memory
allocations by processes killed by LMK will succeed without using
ALLOC_NO_WATERMARKS via TIF_MEMDIE. Even if their allocations cannot
escape from memory allocation loop unless they use ALLOC_NO_WATERMARKS,
lowmem_deathpending_timeout can guarantee forward progress by choosing
next victim process.On the other hand, mark_oom_victim() assumes that it must be called with
oom_lock held and it must not be called after oom_killer_disable() was
called. But LMK is calling it without holding oom_lock and checking
oom_killer_disabled. It is possible that LMK calls mark_oom_victim()
due to allocation requests by kernel threads after current thread
returned from oom_killer_disabled(). This will break synchronization
for PM/suspend.This patch introduces per a task_struct flag for remembering processes
killed by LMK, and replaces TIF_MEMDIE with that flag. By applying this
patch, assumption by mark_oom_victim() becomes true.Signed-off-by: Tetsuo Handa
Acked-by: Michal Hocko
Cc: Arve Hjonnevag
Cc: Riley Andrews
Signed-off-by: Greg Kroah-Hartman