Commit Graph

721926 Commits

Author SHA1 Message Date
Ashish Kalra
ba2d563f82 staging: android: Fix checkpatch.pl error
fixed CHECK: Lines should not end with a '('
reported by checkpatch.pl

Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 10:05:06 +01:00
Zebulon McCorkle
848d9eabca staging: olpc_dcon: Line up parentheses in func calls and defs
Line up arguments to opening parentheses and ensure lines stay under 80
columns, since checkpatch.pl was complaining about incorrect indentation
in function calls and definitions.

Signed-off-by: Zebulon McCorkle <zebmccorkle@zeb.fun>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 10:00:30 +01:00
Zebulon McCorkle
f3b7e9019d staging: olpc_dcon: Change bitshifts to BIT macro
checkpatch.pl reported the bitshifts (1<<x) as a style violation, so
change them to the BIT macro (BIT(x)).

Signed-off-by: Zebulon McCorkle <zebmccorkle@zeb.fun>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 10:00:30 +01:00
Joshua Abraham
f8de92c9f6 staging: xgifb: remove macros with hidden variable
This patch removes macros in XGI_main.h that contain a xgifb_info
variable.  These macros hurt readability by hiding said variable
behind a define.  It also uses a temporary variable to keep the
replaced code from getting too long.

Signed-off-by: Joshua Abraham <j.abraham1776@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:59:27 +01:00
Gilad Ben-Yossef
9911bac0cb staging: ccree: amend aead func def for readability
Func definitions in the aead implementation were did not adhere to
coding style. Fix them for better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:55:15 +01:00
Gilad Ben-Yossef
a05db75cfa staging: ccree: fix AEAD func naming convention
The aead files was using a func naming convention which was inconsistent
(ssi vs. cc), included a useless prefix (ssi_aead) and often used
too long function names producing monster func names such as
ssi_aead_gcm_setup_ghash_desc() that made the call site code hard
to read.

Make the code more readable by switching to a simpler, consistent naming
conventionfor all the function defined in the file.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:55:15 +01:00
Gilad Ben-Yossef
46df882498 staging: ccree: NULLify backup_info when unused
backup_info field is only allocated for decrypt code path.
The field was not nullified when not used causing a kfree
in an error handling path to attempt to free random
addresses as uncovered in stress testing.

Fixes: 737aed947f ("staging: ccree: save ciphertext for CTS IV")
Cc: stable@vger.kernel.org
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:55:15 +01:00
Gilad Ben-Yossef
0d527ecc48 staging: ccree: update TODO list
Update the ccree staging TODO list in light of recent work.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:55:15 +01:00
Gilad Ben-Yossef
d381f94894 staging: ccree: remove interim DT docs
As proper DT bindings doc where submitted and ACKed,
remove the interim one.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:55:15 +01:00
Gilad Ben-Yossef
40def03a52 staging: ccree: remove braces for single statement blocks
Remove braces from single statement if clause.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:55:15 +01:00
Gilad Ben-Yossef
1b37844735 staging: ccree: fix indentation of var assignment
Fix indentation of var assignment split across lines for
better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:55:15 +01:00
Gilad Ben-Yossef
38b6db1b5d staging: ccree: remove more unnecessary parentheses
The removal of likely/unlikely unearthed some more
unnecessary parentheses. Remove them for better readability.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:55:15 +01:00
Gilad Ben-Yossef
9db83b4e4e staging: ccree: remove unproven likely/unlikely
The ccree code made a lot of use of likely/unlikely qualifiers without
proven measurements showing any benefits. Remove them all until we
see what is justified and what is not.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:55:15 +01:00
Gilad Ben-Yossef
8977c8248f staging: ccree: remove inline qualifiers
The ccree drivers was marking a lot of big functions in C file as
static inline for no good reason. Remove the inline qualifier from
any but the few truly single line functions.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:55:15 +01:00
Genki Sky
44208cf32e staging: vc04_services: Use __func__
This was found using checkpatch.pl's EMBEDDED_FUNCTION_NAME warning.
It is easier to be consistent and always use __func__ instead of having
to remember to update any hardcoded references to the original name.

Signed-off-by: Genki Sky <sky@genki.is>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:48:54 +01:00
Genki Sky
baaa3e09c4 staging: vc04_services: Unsplit user-visible strings
This was found using checkpatch.pl's SPLIT_STRING warning. While joining
these strings makes for long lines, the kernel codebase consistently
does it this way to make user-visible strings easier to grep for.

Signed-off-by: Genki Sky <sky@genki.is>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:48:54 +01:00
Genki Sky
7260ea5fc3 staging: vc04_services: Join multiline dereferences
This was found using checkpatch.pl's MULTILINE_DEREFERENCE warning.
Putting the dereference onto one line makes them easier to read,
especially when part of a larger expression (in this case, function
arguments and ternary operator), and when the dereferences are short
(as they are here).

Signed-off-by: Genki Sky <sky@genki.is>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 09:48:54 +01:00
Greg Kroah-Hartman
82aec3ed46 First set of new device support, cleanups and features for IIO in the 4.16 cycle
New device support
 * IDT Z0PT2201 ambient light and UVB sensor
   - new driver and DT bindings.
 * MAX30102 (pulse oximetery sensor)
   - support for MAX30105 sensor (smoke detector)  Just goes to show
     how two supposedly totally different applications can use very similar
     devices.
 * UVIS25 UV sensor
   - new driver and DT bindings.
 
 Major new features
 * at91-sama5d2-adc
   - DMA support including bindings + a fix for an issue with acking the
     interrupt to prevent false overrun reports.
 * ina2xx
   - allow control of shunt voltage PGA and bus voltage range to give better
     accuracy in some cases.
 * stm32-adc
   - support differential channels (precursor patch reworked how channel names
     were created to enable this).
 
 Cleanups / minor fixes / features
 * core
   - mark a deliberate switch fallthrough.
   - macro to populate struct iio_map array elements.
 * docs
   - typo fix.
 * MAINTAINERS
   - add some missing entries for IIO ABI files.
 
 * ad7152
   - tidy up unlocking paths.
 * ad7746
   - tidy up unlocking paths.
 * ak8975
   - add an ACPI id found on a prototype board.
 * aspeed-adc
   - deassert reset in probe to ensure device is usable.
 * bfin-trigger
   - platform_get_irq return value fixing.
 * bmc150
   - OF device ID table for i2c (spi to be done).
 * cros_ec
   - unused variable cleanup.
 * da208
   - ACPI binding seen on Linx 820 tablet.
 * ina2xx
   - shift down raw value to drop status flags from value (likely to have
     been hidden in the noise).
   - tidy up a special case that wasn't needed.
 * inv_mpu6050
   - i2c_unregister_device knows about null values so don't check it twice.
 * kxsd9
   - fix missing MODULE_LICENSE and MODULE_DESCRIPTION.
 * max30102
   - missing new lines in dev_err.
   - inconsistent punctuation in error messages.
   - fix LED mode mask number of bits.
   - check return value of power mode functions to handle errors.
   - introduce an intensity channel macro to reduce duplication.
   - fix minor issue where device wasn't necessarily enabled during
     a get temperature.
   - use indicies for LED channels.
   - move the mode seetting to buffer_postenable - precursor to new device
     support.
   - prepare to allow copying of varying numbers of measurement.
 * meson-saradc
   - drop irrelevant clock and update bindings.
 * mma8452
   - a couple of renames for readability reasons.
 * qcom_vadc
   - fix missing MODULE_LICENSE and MODULE_DESCRIPTION.
 * st_accel
   - drop an unused variable.
 * sx9500
   - add an ACPI id found on a prototype board.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAloizUQRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FogGjA/9GmfFvAzoPyzcQvUFOSCIwHPcX72erA7v
 4CdHrFUQgISYMM2sMBA6Pk9YEHe392VVLARVWqm0jbPxapJ9P3Z3JXpQuX/0iGgo
 S2l577xt8xjYgd5st4oMxSG31Ayse7TnRxN/khySo6uFbWg5tfixjzCehCAkfbAE
 RD51MLS950RdTJeGtgujMCSY6Ax891qjJUdfJk5BqktSULdXqRKikuYoB7ugENpT
 buaJi8FGD87wb832QzpJ2lobL+TRVdNyJuxzHYSJiG2Y9TV5fs0nOJTcQQ4+pTtT
 MIoAupUg5hrgxYGfWYA+CA4IQEjJvl1PqZMRWat35VpLLD5Rd6bu2PFk7UJcJdt4
 IfjhNuGtfPqIb8a8VTTP8ksxyHjhTJjAtB52gxkyEa+1a+ZsP0BaRtSBni+k8NAI
 2ekzttML66Wvd3fDOkcG/ULOe+jo1E2JzFflHkVmLyiJOprWA4qb+lt1jiC/8Lrg
 9dE1DWc+ZLkDQaGjCU0YPqoP7rK9Gmdbh6wfIE2Hn/5r8l0MuSlYduxDyC2rB/O9
 AcdtSbZ0TVJrIkmcRk0/2VyFWKeqrqFLtR0UtsESYON2fUZWn83VkMa3kRuMFn22
 A2O1GKi+wzOgGKUUeTuYu5L2I3ltYEUHZT9L/Y3sf0+3/nm5vCNHJEN16eYyht3I
 7SHCdJRgWjU=
 =ICgu
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.16a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First set of new device support, cleanups and features for IIO in the 4.16 cycle

New device support
* IDT Z0PT2201 ambient light and UVB sensor
  - new driver and DT bindings.
* MAX30102 (pulse oximetery sensor)
  - support for MAX30105 sensor (smoke detector)  Just goes to show
    how two supposedly totally different applications can use very similar
    devices.
* UVIS25 UV sensor
  - new driver and DT bindings.

Major new features
* at91-sama5d2-adc
  - DMA support including bindings + a fix for an issue with acking the
    interrupt to prevent false overrun reports.
* ina2xx
  - allow control of shunt voltage PGA and bus voltage range to give better
    accuracy in some cases.
* stm32-adc
  - support differential channels (precursor patch reworked how channel names
    were created to enable this).

Cleanups / minor fixes / features
* core
  - mark a deliberate switch fallthrough.
  - macro to populate struct iio_map array elements.
* docs
  - typo fix.
* MAINTAINERS
  - add some missing entries for IIO ABI files.

* ad7152
  - tidy up unlocking paths.
* ad7746
  - tidy up unlocking paths.
* ak8975
  - add an ACPI id found on a prototype board.
* aspeed-adc
  - deassert reset in probe to ensure device is usable.
* bfin-trigger
  - platform_get_irq return value fixing.
* bmc150
  - OF device ID table for i2c (spi to be done).
* cros_ec
  - unused variable cleanup.
* da208
  - ACPI binding seen on Linx 820 tablet.
* ina2xx
  - shift down raw value to drop status flags from value (likely to have
    been hidden in the noise).
  - tidy up a special case that wasn't needed.
* inv_mpu6050
  - i2c_unregister_device knows about null values so don't check it twice.
* kxsd9
  - fix missing MODULE_LICENSE and MODULE_DESCRIPTION.
* max30102
  - missing new lines in dev_err.
  - inconsistent punctuation in error messages.
  - fix LED mode mask number of bits.
  - check return value of power mode functions to handle errors.
  - introduce an intensity channel macro to reduce duplication.
  - fix minor issue where device wasn't necessarily enabled during
    a get temperature.
  - use indicies for LED channels.
  - move the mode seetting to buffer_postenable - precursor to new device
    support.
  - prepare to allow copying of varying numbers of measurement.
* meson-saradc
  - drop irrelevant clock and update bindings.
* mma8452
  - a couple of renames for readability reasons.
* qcom_vadc
  - fix missing MODULE_LICENSE and MODULE_DESCRIPTION.
* st_accel
  - drop an unused variable.
* sx9500
  - add an ACPI id found on a prototype board.
2017-12-03 16:09:13 +01:00
Lukas Wunner
8d05ffd2b8 iio: Add macro to populate struct iio_map array
The GPIO core provides a handy GPIO_LOOKUP() macro to populate a struct
gpiod_lookup array without having to spell out attribute names (but
still avoid breakage when attributes within the struct are rearranged
or added).

The axp288_adc.c driver uses a similar macro to populate a struct
iio_map array.  Make it available to others.

Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 13:28:21 +00:00
Arvind Yadav
cccae60486 iio: trigger: Fix platform_get_irq's error checking
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 12:21:10 +00:00
Javier Martinez Canillas
798c3c9b4c iio: accel: bmc150: Add OF device ID table
The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

The I2C device ID table entries have the .driver_data field set, but they
are not used in the driver so weren't set in the OF device table entries.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 11:59:33 +00:00
Xingyu Chen
461774659a dt-bindings: iio: adc: update the doc for SAR ADC
Update the doc as the SAR ADC modules doesn't require "sana" clock.

Singed-off-by: Xingyu Chen <xingyu.chen@amlogic.com>
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 11:37:36 +00:00
Xingyu Chen
930df4d853 iio: adc: meson-saradc: remove irrelevant clock "sana"
The "sana" clock is not used at SAR ADC module in Amlogic Meson SoC,
it is irrelevant for the SAR ADC.

Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com>
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 11:33:53 +00:00
Colin Ian King
585ed27d06 iio: accel: st_accel: remove redundant pointer pdata
Pointer pdata is being assigned but it is never being used, hence
it is redundant and can be removed. Cleans up clang warning:

drivers/iio/accel/st_accel_core.c:952:3: warning: Value stored to 'pdata'
is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:41:38 +00:00
Luke Ross
4c42bef0d3 iio:accel:da280: Linx 820 Windows tablet has a da280 mapped via ACPI
This adds an ACPI table to the driver and the ACPI ID of the sensor
on the tablet.

Signed-off-by: Luke Ross <luke@lukeross.name>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:41:33 +00:00
Lorenzo Bianconi
eed48a3beb dt-bindings: iio: light: add UVIS25 device bindings
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:41:29 +00:00
Lorenzo Bianconi
3025c8688c iio: light: add support for UVIS25 sensor
add support for STMicroelectronics UVIS25 uv sensor
http://www.st.com/resource/en/datasheet/uvis25.pdf

- continuos mode support
- i2c support
- spi support
- trigger mode support
- system PM support

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:41:25 +00:00
Lukas Wunner
f4457f7b17 MAINTAINERS: Add missing IIO ABI entries
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Andreas Klinger <ak@it-klinger.de>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:41:20 +00:00
Joel Stanley
edf7550a1f iio: adc: aspeed: Deassert reset in probe
The ASPEED SoC must deassert a reset in order to use the ADC peripheral.

The device tree bindings are updated to document the resets phandle, and
the example is updated to match what is expected for both the reset and
clock phandle. Note that the bindings should have always had the reset
controller, as the hardware is unusable without it.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:41:15 +00:00
Peter Meerwald-Stadler
02c5dff52b dt-bindings: iio: health: Add MAX30105 support to max30102.txt
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:41:12 +00:00
Peter Meerwald-Stadler
90579b69e9 iio: health: max30102: Add MAX30105 support
The Maxim MAX30105 part adds a third LED (green) and uses a multi-LED
measuring mode producing three measurements

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:41:08 +00:00
Peter Meerwald-Stadler
fef79edc17 iio: health: max30102: Prepare for copying varying number of measurements
Current code assumes always 2 measurements (6 bytes) have to be copied,
prepare for more flexibility

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:41:05 +00:00
Peter Meerwald-Stadler
83e6415d56 iio: health: max30102: Move mode setting to buffer_postenable
Move the programming of the mode setting from init() to
buffer_postenable()

Split out a separate function to
only update the power/shutdown bit

This changes permits to more easily implement different
modes of measurements in further patches

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:41:01 +00:00
Peter Meerwald-Stadler
ad90e570e2 iio: health: max30102: Introduce indices for LED channels
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:57 +00:00
Peter Meerwald-Stadler
a9c47abbdd iio: health: max30102: Add power enable parameter to get_temp function
Chip must not be in shutdown for reading temperature, so briefly leave
shutdown if buffer is not already running

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:55 +00:00
Peter Meerwald-Stadler
839a74cde7 iio: health: max30102: Introduce intensity channel macro
Signed-off-by: Peter Meerwald-Stalder <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:50 +00:00
Peter Meerwald-Stadler
84b0ce05e4 iio: health: max30102: Add check for part ID
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:46 +00:00
Peter Meerwald-Stadler
d0b950c73d iio: health: max30102: Check retval of powermode function
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:44 +00:00
Peter Meerwald-Stadler
7b0b0ec157 iio: health: max30102: Fix mode config values
Table 4 of the datasheet specifies the mode control, these are not
individual bits; add multi LED mode

Add multi-LED mode and fix MODE_MASK (3 bits wide, not 2)

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:39 +00:00
Peter Meerwald-Stadler
c31c946af8 iio: health: max30102: Remove inconsistent full stop in error message
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:34 +00:00
Peter Meerwald-Stadler
dd86dbf94f iio: health: max30102: Fix missing newline in dev_err
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:31 +00:00
Fabrice Gasnier
3fb2e24ed7 iio: adc: stm32: add support for differential channels
STM32H7 ADC channels can be configured either as single ended or
differential with 'st,adc-channels' or 'st,adc-diff-channels'
(positive and negative input pair: <vinp vinn>, ...).

Differential channels have different offset and scale, from spec:
raw value = (full_scale / 2) * (1 + (vinp - vinn) / vref).
Add offset attribute.

Differential channels are selected by DIFSEL register. Negative
inputs must be added to pre-selected channels as well (PCSEL).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:28 +00:00
Fabrice Gasnier
0bae72aa8a iio: adc: stm32: remove const channel names definition
Remove const array that defines channels. Build channels definition
at probe time, when initializing channels (only for requested ones).
This will ease adding differential channels support.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:26 +00:00
Fabrice Gasnier
098c5a6a14 dt-bindings: iio: adc: stm32: add support for diff channels
STM32H7 ADC channels may be configured either as single-ended or
differential.
Add 'st,adc-diff-channels' property to support differential channels.
Differential channels are defined as a pair of positive and negative
inputs: vinp & vinn.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:23 +00:00
Stefan Brüns
ca6a2d86ac iio: adc: ina2xx: Allow setting Shunt Voltage PGA gain and Bus Voltage range
Reducing shunt and bus voltage range improves the accuracy, so allow
altering the default settings.

Both settings are exposed as gain values. While for the shunt voltage
this is straightforward, the bus range settings of 32V (default) and 16V
are mapped to gain values of 1 resp. 2, to provide a uniform API to
userspace.

As the gain settings are incorporated into the raw values by the sensor
itself, adjusting of the scale attributes is not necessary.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:20 +00:00
Stefan Brüns
2d8119d752 iio: adc: ina2xx: Use LSB specifier instead of divider in config
While the config uses the physical value corresponding to the LSB
for both the power and the bus voltage register, the shunt voltage is
specified as parts of 1 mV. Use the LSB physical value for all registers.

No functional change.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:17 +00:00
Stefan Brüns
2e64438487 iio: adc: ina2xx: Shift bus voltage register to mask flag bits
Lower bits of the INA219/220 bus voltage register are conversion
status flags, properly shift the value.

When reading via IIO buffer, the value is passed on unaltered,
shifting is the responsibility of the user.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:14 +00:00
Andy Shevchenko
e36c8c161c iio: imu: inv_mpu6050: Remove duplicate NULL check
Since i2c_unregister_device() became NULL-aware we may remove duplicate
NULL check.

Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:11 +00:00
Markus Elfring
aa6b707c14 staging: iio: ad7746: Improve unlocking of a mutex in ad7746_start_calib()
* Add a jump target so that a call of the function "mutex_unlock" is stored
  only twice in this function implementation.

* Replace two calls by goto statements.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:07 +00:00
Markus Elfring
71e083aaf7 staging: iio: ad7152: Improve unlocking of a mutex in ad7152_start_calib()
* Add a jump target so that a call of the function "mutex_unlock" is stored
  only twice in this function implementation.

* Replace two calls by goto statements.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:05 +00:00