Here's the big staging and iio driver update for 4.7-rc1.
I think we almost broke even with this release, only adding a few more
lines than we removed, which isn't bad overall given that there's a
bunch of new iio drivers added. The Lustre developers seem to have
woken up from their sleep and have been doing a great job in cleaning up
the code and pruning unused or old cruft, the filesystem is almost
readable :)
Other than that, just a lot of basic coding style cleanups in the churn.
All have been in linux-next for a while with no reported issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEABECAAYFAlc/00QACgkQMUfUDdst+ynXYQCdG9oEsw4CCItbjGfQau5YVGbd
TOcAnA19tZz+Wcg3sLT8Zsm979dgVvDt
=9UG/
-----END PGP SIGNATURE-----
Merge tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging and IIO driver updates from Greg KH:
"Here's the big staging and iio driver update for 4.7-rc1.
I think we almost broke even with this release, only adding a few more
lines than we removed, which isn't bad overall given that there's a
bunch of new iio drivers added.
The Lustre developers seem to have woken up from their sleep and have
been doing a great job in cleaning up the code and pruning unused or
old cruft, the filesystem is almost readable :)
Other than that, just a lot of basic coding style cleanups in the
churn. All have been in linux-next for a while with no reported
issues"
* tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (938 commits)
Staging: emxx_udc: emxx_udc: fixed coding style issue
staging/gdm724x: fix "alignment should match open parenthesis" issues
staging/gdm724x: Fix avoid CamelCase
staging: unisys: rename misleading var ii with frag
staging: unisys: visorhba: switch success handling to error handling
staging: unisys: visorhba: main path needs to flow down the left margin
staging: unisys: visorinput: handle_locking_key() simplifications
staging: unisys: visorhba: fail gracefully for thread creation failures
staging: unisys: visornic: comment restructuring and removing bad diction
staging: unisys: fix format string %Lx to %llx for u64
staging: unisys: remove unused struct members
staging: unisys: visorchannel: correct variable misspelling
staging: unisys: visorhba: replace functionlike macro with function
staging: dgnc: Need to check for NULL of ch
staging: dgnc: remove redundant condition check
staging: dgnc: fix 'line over 80 characters'
staging: dgnc: clean up the dgnc_get_modem_info()
staging: lustre: lnet: enable configuration per NI interface
staging: lustre: o2iblnd: properly set ibr_why
staging: lustre: o2iblnd: remove last of kiblnd_tunables_fini
...
Here's the "big" driver core update for 4.7-rc1.
Mostly just debugfs changes, the long-known and messy races with removing
debugfs files should be fixed thanks to the great work of Nicolai Stange. We
also have some isa updates in here (the x86 maintainers told me to take it
through this tree), a new warning when we run out of dynamic char major
numbers, and a few other assorted changes, details in the shortlog.
All have been in linux-next for some time with no reported issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEABECAAYFAlc/0mwACgkQMUfUDdst+ynjXACgjNxR5nMUiM8ZuuD0i4Xj7VXd
hnIAoM08+XDCv41noGdAcKv+2WZVZWMC
=i+0H
-----END PGP SIGNATURE-----
Merge tag 'driver-core-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg KH:
"Here's the "big" driver core update for 4.7-rc1.
Mostly just debugfs changes, the long-known and messy races with
removing debugfs files should be fixed thanks to the great work of
Nicolai Stange. We also have some isa updates in here (the x86
maintainers told me to take it through this tree), a new warning when
we run out of dynamic char major numbers, and a few other assorted
changes, details in the shortlog.
All have been in linux-next for some time with no reported issues"
* tag 'driver-core-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (32 commits)
Revert "base: dd: don't remove driver_data in -EPROBE_DEFER case"
gpio: ws16c48: Utilize the ISA bus driver
gpio: 104-idio-16: Utilize the ISA bus driver
gpio: 104-idi-48: Utilize the ISA bus driver
gpio: 104-dio-48e: Utilize the ISA bus driver
watchdog: ebc-c384_wdt: Utilize the ISA bus driver
iio: stx104: Utilize the module_isa_driver and max_num_isa_dev macros
iio: stx104: Add X86 dependency to STX104 Kconfig option
Documentation: Add ISA bus driver documentation
isa: Implement the max_num_isa_dev macro
isa: Implement the module_isa_driver macro
pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS
isa: Decouple X86_32 dependency from the ISA Kconfig option
driver-core: use 'dev' argument in dev_dbg_ratelimited stub
base: dd: don't remove driver_data in -EPROBE_DEFER case
kernfs: Move faulting copy_user operations outside of the mutex
devcoredump: add scatterlist support
debugfs: unproxify files created through debugfs_create_u32_array()
debugfs: unproxify files created through debugfs_create_blob()
debugfs: unproxify files created through debugfs_create_bool()
...
Pull i2c updates from Wolfram Sang:
- Peter Rosin did some major rework on the locking of i2c muxes by
seperating parent-locked muxes and mux-locked muxes.
This avoids deadlocks/workarounds when the mux itself needs i2c
commands for muxing. And as a side-effect, other workarounds in the
media layer could be eliminated. Also, Peter stepped up as the i2c
mux maintainer and will keep an eye on these changes.
- major updates to the octeon driver
- add a helper to the core to generate the address+rw_bit octal and
make drivers use it
- quite a bunch of driver updates
* 'i2c/for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (84 commits)
i2c: rcar: add DMA support
i2c: st: Implement bus clear
i2c: only check scl functions when using generic recovery
i2c: algo-bit: declare i2c_bit_quirk_no_clk_stretch as static
i2c: tegra: disable clock before returning error
[media] rtl2832: regmap is aware of lockdep, drop local locking hack
[media] rtl2832_sdr: get rid of empty regmap wrappers
[media] rtl2832: change the i2c gate to be mux-locked
[media] si2168: change the i2c gate to be mux-locked
iio: imu: inv_mpu6050: change the i2c gate to be mux-locked
i2c: mux: document i2c muxes and elaborate on parent-/mux-locked muxes
i2c: mux: relax locking of the top i2c adapter during mux-locked muxing
i2c: muxes always lock the parent adapter
i2c: allow adapter drivers to override the adapter locking
i2c: uniphier: add "\n" at the end of error log
i2c: mv64xxx: remove CONFIG_HAVE_CLK conditionals
i2c: mv64xxx: use clk_{prepare_enable,disable_unprepare}
i2c: mv64xxx: handle probe deferral for the clock
i2c: mv64xxx: enable the driver on ARCH_MVEBU
i2c: octeon: Add workaround for broken irqs on CN3860
...
The root i2c adapter lock is then no longer held by the i2c mux during
accesses behind the i2c gate, and such accesses need to take that lock
just like any other ordinary i2c accesses do.
So, declare the i2c gate mux-locked, and zap the code that makes the
unlocked i2c accesses and just use ordinary regmap_write accesses.
This also happens to fix the deadlock described in
http://patchwork.ozlabs.org/patch/584776/ authored by
Adriana Reus <adriana.reus@intel.com> and submitted by
Daniel Baluta <daniel.baluta@intel.com>
----------8<----------
iio: imu: inv_mpu6050: Fix deadlock between i2c adapter lock and mpu lock
This deadlock occurs if the accel/gyro and the sensor on the auxiliary
I2C (in my setup it's an ak8975) are working at the same time.
Scenario:
T1 T2
==== ====
inv_mpu6050_read_fifo aux sensor op (eg. ak8975_read_raw)
| |
mutex_lock(&indio_dev->mlock) i2c_transfer
| |
i2c transaction i2c adapter lock
| |
i2c adapter lock i2c_mux_master_xfer
|
inv_mpu6050_select_bypass
|
mutex_lock(&indio_dev->mlock)
When we operate on an mpu sensor the order of locking is mpu lock
followed by the i2c adapter lock. However, when we operate the auxiliary
sensor the order of locking is the other way around.
...
----------8<----------
The reason this patch fixes the deadlock is that T2 does not grab the
i2c adapter lock until the very end (and grabs the newfangled i2c mux
lock where it previously grabbed the i2c adapter lock).
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Tested-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
When using ACPI, id is NULL and the current code automatically
defaults name to NULL and chip id to 0. We should instead use
the data provided in the ACPI device table.
Fixes: c816d9e7a5 ("iio: imu: mpu6050: fix possible NULL dereferences")
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Reviewed-By: Matt Ranostay <matt.ranostay@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Fix possible null dereferencing of i2c and spi driver data.
Signed-off-by: Matt Ranostay <matt.ranostay@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The Apex Embedded Systems STX104 DAC drivers does not do anything
special in module init/exit. This patch eliminates the module init/exit
boilerplate code by utilizing the module_isa_driver macro.
Additionally, the max_num_isa_dev macro is utilized to simplify the
determination of maximum possible STX104 devices in the system.
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The Apex Embedded Systems STX104 DAC driver expects the STX104 device to
be I/O port-mapped addressable on an X86 platform. This patch adds an
explicit X86 dependency to the STX104 configuration option to prevent
building on non-X86 architectures.
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bit of a bumper set for new drivers but plenty of other stuff here as well!
New device support
* ad5592R ADC/DAC
- new driver supporting ad5592r and ad5593r combined ADC/DAC and gpio chips.
* Aosong am2315 relative humidity
- new driver with triggered buffer support in follow up patch.
* bmi160 imu
- new driver
* bmp280
- bmp180 support - note there is support in the misc/bmp085 driver. Intent
is to remove that driver long term.
* invensense mpu6050
- cleanup leading to explicit support of mpu9150 with a good few cleanups
along the way.
* Hope RF hp03 pressure and temperature sensor.
- new driver
* maxim DS1803 potentiometer
- new driver
* maxim max44000 light and proximity sensor
- new driver built in a series of steps to support pretty much everything.
* ROHM BH1780 light sensor
- new driver. There is an existing driver in misc that this is pretty much
intended to replace. The discussion on whether to support the non standard
interface of that driver is some way is continuing.
* st-gyro
- lsm9ds0-gyro. The accel/magn side of this will take a while longer as
extensions to the st library are needed for cases where two types of sensor
share a single i2c address.
* ti-adc081c
- support the adc101c and adc121c
* Vishay VEML6070 UV sensor
- new driver.
New features
* core
- devm_ APIs for channel_get and channel_get_all. The first user of these
is the generic ADC based thermal driver. As it is going through the
thermal tree these will be picked up as a patch to that next cycle as that
is how the author preferred to do it.
- mounting matrix support. This new core support allows devices to provide
to userspace (typically from the device tree) allowing compensation for how
the sensor is mounted on the device. First examples are on UAVs but it
has a more mundane use on typical phone where the chip may be on the front
or the back of the circuit board and soldered at any angle. Includes
support for this ABI in ak8975 (which has an older interface, now
deprecated) and mpu6050.
* tools
- add a -a option to enable all available channels in generic_buffer sample.
Makes it somewhat easier to use.
* adis library and drivers
- support manual self test flag clearing. This has technically been broken
for a very long time - result is an offset on readings as the applied field
is on all the time.
* ak8975
- triggered buffer support
* bmc150
- spi support (including splitting the driver into core and i2c parts)
* bmp280
- oversampling support.
* dht11
- improved logging - useful to debug timing issues on this quirky device.
* st-sensors
- read each channel invidivually as not all support the optimization of
reading in bulk. This is technically a fix, but will need to be backported
if desired.
- support open drain and shared interrupts.
* ti-adc081c
- triggered buffer support.
Cleanups
* inkern
- white space fix.
* ad7606
- use the iio_device_claim_direct_mode call rather than open coding equiv.
* ad799x
- white space fix.
* ad9523
- unsigned -> unsigned int
* apds9660
- brace location tidying up.
- silence an uninitialized variable warning.
* ak8975
- else and brace on same line fix.
* at91_adc
- white space fixes.
* bmc150
- use regmap stored copy of the device pointer rather than having an
additional copy.
* bmg160
- use regmap stored copy of the device pointer rather than having an
additional copy.
* hid-sensors
- white space fixes.
* mcp3422
- white space fix.
* mma7455
- use regmap to retrieve the device struct rather than carrying another copy
in the private data.
* ms_sensors
- white space fix.
* mxs-lradc
- move current bindings out of staging - some will be shortly deprecated but
the reality is that we have device trees out there using them so they will
need to be supported for some time. They accidentally got left behind
when the driver graduated from staging.
- white space cleanup.
- set INPUT_PROP_DIRECT.
- move ts config into a better function.
- move the STMP reset out of the ADC init.
* vf610_adc
- case label indenting fix.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJXHnw8AAoJEFSFNJnE9BaIDsIP/jbvOSDgOyvh4iNqV3ppAfvL
yw/CWfKB5oMiqq/ENBNyMcD7kpGoh6ad/2JV1eXRnZsKArTwX6iN0Nu3yPxa+ySn
xYc/BoGFwnNei+FqnFEqvK9RFZ3okQEkTW+OJg6eDMGDdL9HojZnALX4BE66QF3E
W699vd3nA9SXqQ1UkQ+ozWdybBh2ksOfXknyN/S0sioIeG4MopCIyLMZzBGcDOCN
EjdBudZla8VGTWcrp1ofOap6gJ7wKpbtlTPXuAEXtAypnDvuRdH7loTxtzSovNYd
u6r9bujc1KUE4ilkYqODd5de4HvKm7aCR2ojlXeKlj+BNaF/uxQoYV/Al5e9CwR8
nnz7c0rVAWIGc2tCiejJOMXB0t4TjVdzXZG9G/maKk1PNFOdUPb9Ul9BsjM28q5s
yUneBuKlGFj2K/+E1AmTDRMhStMCMgrXZgyh0GSI07UZsVRnJR7ikUw7tly+J4ki
21qKvTgXMKU+Fzh1HeqVcocq2AHsjlnKWuaB4/YiQzG5V0oGM4rvt78ewSMkmVkR
IcIF9yI5XUfDAFdQUtvRlLP6p+qHylMH72aYq8pkMZ43Dq6hukyfx4vkc0Ztw7yS
A655/frXiGeU2MFVSM2PYVloLQ5sftL5jDSBiDunzXHAl2WoXppu5Rjc7QvLnzLr
vxvvN7MyGvi1GnKxcnYw
=zzV9
-----END PGP SIGNATURE-----
Merge tag 'iio-for-4.7b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-testing
Jonathan writes:
2nd set of new device support, features and cleanup for IIO in the 4.7 cycle.
Bit of a bumper set for new drivers but plenty of other stuff here as well!
New device support
* ad5592R ADC/DAC
- new driver supporting ad5592r and ad5593r combined ADC/DAC and gpio chips.
* Aosong am2315 relative humidity
- new driver with triggered buffer support in follow up patch.
* bmi160 imu
- new driver
* bmp280
- bmp180 support - note there is support in the misc/bmp085 driver. Intent
is to remove that driver long term.
* invensense mpu6050
- cleanup leading to explicit support of mpu9150 with a good few cleanups
along the way.
* Hope RF hp03 pressure and temperature sensor.
- new driver
* maxim DS1803 potentiometer
- new driver
* maxim max44000 light and proximity sensor
- new driver built in a series of steps to support pretty much everything.
* ROHM BH1780 light sensor
- new driver. There is an existing driver in misc that this is pretty much
intended to replace. The discussion on whether to support the non standard
interface of that driver is some way is continuing.
* st-gyro
- lsm9ds0-gyro. The accel/magn side of this will take a while longer as
extensions to the st library are needed for cases where two types of sensor
share a single i2c address.
* ti-adc081c
- support the adc101c and adc121c
* Vishay VEML6070 UV sensor
- new driver.
New features
* core
- devm_ APIs for channel_get and channel_get_all. The first user of these
is the generic ADC based thermal driver. As it is going through the
thermal tree these will be picked up as a patch to that next cycle as that
is how the author preferred to do it.
- mounting matrix support. This new core support allows devices to provide
to userspace (typically from the device tree) allowing compensation for how
the sensor is mounted on the device. First examples are on UAVs but it
has a more mundane use on typical phone where the chip may be on the front
or the back of the circuit board and soldered at any angle. Includes
support for this ABI in ak8975 (which has an older interface, now
deprecated) and mpu6050.
* tools
- add a -a option to enable all available channels in generic_buffer sample.
Makes it somewhat easier to use.
* adis library and drivers
- support manual self test flag clearing. This has technically been broken
for a very long time - result is an offset on readings as the applied field
is on all the time.
* ak8975
- triggered buffer support
* bmc150
- spi support (including splitting the driver into core and i2c parts)
* bmp280
- oversampling support.
* dht11
- improved logging - useful to debug timing issues on this quirky device.
* st-sensors
- read each channel invidivually as not all support the optimization of
reading in bulk. This is technically a fix, but will need to be backported
if desired.
- support open drain and shared interrupts.
* ti-adc081c
- triggered buffer support.
Cleanups
* inkern
- white space fix.
* ad7606
- use the iio_device_claim_direct_mode call rather than open coding equiv.
* ad799x
- white space fix.
* ad9523
- unsigned -> unsigned int
* apds9660
- brace location tidying up.
- silence an uninitialized variable warning.
* ak8975
- else and brace on same line fix.
* at91_adc
- white space fixes.
* bmc150
- use regmap stored copy of the device pointer rather than having an
additional copy.
* bmg160
- use regmap stored copy of the device pointer rather than having an
additional copy.
* hid-sensors
- white space fixes.
* mcp3422
- white space fix.
* mma7455
- use regmap to retrieve the device struct rather than carrying another copy
in the private data.
* ms_sensors
- white space fix.
* mxs-lradc
- move current bindings out of staging - some will be shortly deprecated but
the reality is that we have device trees out there using them so they will
need to be supported for some time. They accidentally got left behind
when the driver graduated from staging.
- white space cleanup.
- set INPUT_PROP_DIRECT.
- move ts config into a better function.
- move the STMP reset out of the ADC init.
* vf610_adc
- case label indenting fix.
This device is a package containing a MPU6050-like sensor and an AK8975
magnetometer. The magnetometer component is supported by the existing
ak8975 driver.
This patch also rephrases the Kconfig descriptions.
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Acked-by: Ge Gao <ggao@invensense.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Acked-by: Ge Gao <ggao@invensense.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This can be used to distinguish mpu6500. This is a warning rather than
an error because the differences are mostly irrelevant and it's nice to
avoid breaking users with slightly incorrect ACPI/DT.
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Acked-by: Ge Gao <ggao@invensense.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This field was unused and incorrect for mpu6500.
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The hw_info array was indexed by enum inv_devices chip_type despite the
fact that the enumeration had more members than the array and was
ordered differently.
The patch cleans this up and adds explicit chip_types to i2c/spi/acpi
IDs. It also adds some stricter checks inside the driver core.
This happened to work so far because the differences between the
supported models are very minor.
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Acked-by: Ge Gao <ggao@invensense.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This adds ability to control the oversampling ratio of the temperature
and pressure measurement for both bmp180 and bmp280.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Vlad Dogaru <vlad.dogaru@intel.com>
Cc: Christoph Mair <christoph.mair@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This adds support for the BMP180 to the bmp280 iio driver.
The BMP180 has already been supported by misc/bmp085 driver but it
doesn't use iio framework. This change adds the kconfig dependency
not to be selected both of them in order to avoid any issues.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Vlad Dogaru <vlad.dogaru@intel.com>
Cc: Christoph Mair <christoph.mair@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch exposes ALSTIM as illuminance_integration_time and ALSPGA as
illuminance_scale.
Changing ALSTIM also changes the number of bits available in the data
register. This is handled inside raw value reading because:
* It's very easy to shift a few bits
* It allows SCALE and INT_TIME to be completely independent controls
* Buffer support requires constant scan_type.realbits per-channel
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This is exposed as an output channel with "led" as an extend_name.
Other sensors also have support for controlling an external LED. It's
not clear that simply exposing an undecorated output channel is the
correct approach.
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The proximity sensor relies on sending pulses to an external IR led and
it is disabled by default on powerup. The driver will enable it with a
default power setting.
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This just adds support for reporting illuminance with default settings.
Important default registers are written on probe because the device
otherwise lacks a reset function.
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add basic support for the Aosong AM2315 relative humidity
and ambient temperature sensor.
Includes support for raw readings and ACPI detection.
Datasheet:
http://www.aosong.com/asp_bin/Products/en/AM2315.pdf
Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add support for HopeRF pressure and temperature sensor.
This device uses two fixed I2C addresses, one for storing
calibration coefficients and another for accessing the ADC.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Matt Ranostay <mranostay@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This device has an identical interface to other supported sensors and the patch
only adds IDs.
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
It causes a static checker warning if we use "buf" on the failure path
so move that inside the if statement.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add a new rotation matrix sysfs attribute compliant with IIO core
mounting matrix API.
Matrix is retrieved from "in_anglvel_mount_matrix" and
"in_accel_mount_matrix" sysfs attributes. It is declared into mpu6050 DTS
entry as a "mount-matrix" property.
Old interface is kept for backward userspace compatibility and may be
retrieved from legacy platform_data mechanism only.
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Expose a rotation matrix to indicate userspace the chip orientation with
respect to the overall hardware system.
Matrix is retrieved from "in_mount_matrix". It is declared into ak8975 DTS
entry as a "mount-matrix" property.
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Expose a rotation matrix to indicate userspace the chip placement with
respect to the overall hardware system. This is needed to adjust
coordinates sampled from a sensor chip when its position deviates from the
main hardware system.
Final coordinates computation is delegated to userspace since:
* computation may involve floating point arithmetics ;
* it allows an application to combine adjustments with arbitrary
transformations.
This 3 dimentional space rotation matrix is expressed as 3x3 array of
strings to support floating point numbers. It may be retrieved from a
"[<dir>_][<type>_]mount_matrix" sysfs attribute file. It is declared into a
device / driver specific DTS property or platform data.
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Allocate an explicit i2c mux core to handle parent and child adapters
etc. Update the select/deselect ops to be in terms of the i2c mux core
instead of the child adapter.
Acked-by: Jonathan Cameron <jic23@kernel.org>
Tested-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
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 <amsfield22@gmail.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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 <amsfield22@gmail.com>
Reviewed-by: Irina Tirdea <irina.tirdea@intel.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
ultraviolet (UV) light sensor with I2C interface with a peak
sensitivity at 355 nm
strangely, chip uses two addresses 0x38 and 0x39 for LSB and
MSB data, resp.
datasheet: http://www.vishay.com/docs/84277/veml6070.pdf
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Some of kernel driver uses the IIO framework to get the sensor
value via ADC or IIO HW driver. The client driver get iio channel
by iio_channel_get_all() and release it by calling
iio_channel_release_all().
Add resource managed version (devm_*) of these APIs so that if client
calls the devm_iio_channel_get_all() then it need not to release it
explicitly, it can be done by managed device framework when driver
get un-binded.
This reduces the code in error path and also need of .remove callback in
some cases.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Some of kernel driver uses the IIO framework to get the sensor
value via ADC or IIO HW driver. The client driver get iio channel
by iio_channel_get() and release it by calling iio_channel_release().
Add resource managed version (devm_*) of these APIs so that if client
calls the devm_iio_channel_get() then it need not to release it explicitly,
it can be done by managed device framework when driver get un-binded.
This reduces the code in error path and also need of .remove callback in
some cases.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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 <giuseppe.barba@st.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Acked-by: Rob Herring <rob@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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 <giuseppe.barba@st.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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 <giuseppe.barba@st.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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 <stefan.wahren@i2se.com>
Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch moves the touchscreen type configuration into
a more suitable function. Btw this simplifies PM ops later.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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 <daniel.baluta@intel.com>
Acked-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
If i2c_device_id *id is NULL and acpi_match_device returns NULL too,
then chipset may be unitialized when accessing &ak_def_array[chipset] in
ak8975_probe. Therefore initialize chipset to AK_MAX_TYPE, which will
return an error when not changed.
This patch fixes the following maybe-uninitialized warning:
drivers/iio/magnetometer/ak8975.c: In function ‘ak8975_probe’:
drivers/iio/magnetometer/ak8975.c:788:14: warning: ‘chipset’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
data->def = &ak_def_array[chipset];
Signed-off-by: Richard Leitner <dev@g0hl1n.net>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
In certain probe conditions the interrupt came right after registering
the handler causing a NULL pointer exception because of uninitialized
waitqueue:
$ udevadm trigger
i2c-gpio i2c-gpio-1: using pins 143 (SDA) and 144 (SCL)
i2c-gpio i2c-gpio-3: using pins 53 (SDA) and 52 (SCL)
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = e8b38000
[00000000] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in: snd_soc_i2s(+) i2c_gpio(+) snd_soc_idma snd_soc_s3c_dma snd_soc_core snd_pcm_dmaengine snd_pcm snd_timer snd soundcore ac97_bus spi_s3c64xx pwm_samsung dwc2 exynos_adc phy_exynos_usb2 exynosdrm exynos_rng rng_core rtc_s3c
CPU: 0 PID: 717 Comm: data-provider-m Not tainted 4.6.0-rc1-next-20160401-00011-g1b8d87473b9e-dirty #101
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
(...)
(__wake_up_common) from [<c0379624>] (__wake_up+0x38/0x4c)
(__wake_up) from [<c0a41d30>] (ak8975_irq_handler+0x28/0x30)
(ak8975_irq_handler) from [<c0386720>] (handle_irq_event_percpu+0x88/0x140)
(handle_irq_event_percpu) from [<c038681c>] (handle_irq_event+0x44/0x68)
(handle_irq_event) from [<c0389c40>] (handle_edge_irq+0xf0/0x19c)
(handle_edge_irq) from [<c0385e04>] (generic_handle_irq+0x24/0x34)
(generic_handle_irq) from [<c05ee360>] (exynos_eint_gpio_irq+0x50/0x68)
(exynos_eint_gpio_irq) from [<c0386720>] (handle_irq_event_percpu+0x88/0x140)
(handle_irq_event_percpu) from [<c038681c>] (handle_irq_event+0x44/0x68)
(handle_irq_event) from [<c0389a70>] (handle_fasteoi_irq+0xb4/0x194)
(handle_fasteoi_irq) from [<c0385e04>] (generic_handle_irq+0x24/0x34)
(generic_handle_irq) from [<c03860b4>] (__handle_domain_irq+0x5c/0xb4)
(__handle_domain_irq) from [<c0301774>] (gic_handle_irq+0x54/0x94)
(gic_handle_irq) from [<c030c910>] (__irq_usr+0x50/0x80)
The bug was reproduced on exynos4412-trats2 (with a max77693 device also
using i2c-gpio) after building max77693 as a module.
Cc: <stable@vger.kernel.org>
Fixes: 94a6d5cf7c ("iio:ak8975 Implement data ready interrupt handling")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Set INPUT_PROP_DIRECT to indicate that it is a touchscreen on the
device to help userspace classify it.
Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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 <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This fix checkpatch warnings:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
Signed-off-by: Slawomir Stepien <sst@poczta.fm>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>