- 28 Apr, 2018 32 commits
-
-
David Veenstra authored
The iio resolver drivers in staging use angle channels. This patch add missing documentation for this type of channel. As was discussed in [1], radians is chosen as the unit, to match the unit of angular velocity. [1] https://marc.info/?l=linux-driver-devel&m=152190078308330&w=2Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Veenstra authored
The manual states that the data is contained in the upper 12 bits of the 16 bits read by spi. The code that extracts these 12 bits is correct for both be and le machines, but this is not clear from a first glance. To improve readability the relevant expressions are replaced with equivalent expressions that use be16_to_cpup. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Peter Rosin authored
If an ADC channel measures the midpoint of a voltage divider, the interesting voltage is often the voltage over the full resistance. E.g. if the full voltage is too big for the ADC to handle. Likewise, if an ADC channel measures the voltage across a shunt resistor, with or without amplification, the interesting value is often the current through the resistor. This driver solves these problems by allowing to linearly scale a channel and/or by allowing changes to the type of the channel. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Peter Rosin authored
Similar to current sense shunts, but an amplifier enables the use of a smaller sense resistance. Signed-off-by: Peter Rosin <peda@axentia.se> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Peter Rosin authored
An ADC is often used to measure other quantities indirectly. This binding describe one cases, a "big" voltage measured with the help of a voltage divider. Signed-off-by: Peter Rosin <peda@axentia.se> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Peter Rosin authored
An ADC is often used to measure other quantities indirectly. This binding describe one cases, a current through a shunt resistor measured by the voltage over it. Signed-off-by: Peter Rosin <peda@axentia.se> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Charles Keepax authored
The regmap core now handles splitting up transactions according to max_raw_read, so this code is no longer required in client drivers. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jean-Baptiste Maneyrol authored
Delete the useless ored result and give a second chance to turn the chip back off at the end. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jean-Baptiste Maneyrol authored
Factorize reading channel data in its own function. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jean-Baptiste Maneyrol authored
Use devm_* for iio_triggered_buffer_setup, iio_device_register, iio_trigger_register. Delete unneeded inv_mpu6050_remove_trigger, inv_mpu_core_remove, and inv_mpu_remove for spi driver. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jean-Baptiste Maneyrol authored
Some functions are turning the chip on and not back off in error path. With set_power function using a reference counter that would keep the chip on forever. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Fabrice Gasnier authored
spi-max-frequency is requested for SPI master mode (only), to tune output clock. It may happen requested frequency isn't reachable. Add explicit check, so probe fails with error in this case. Otherwise, output clock may simply be silently turned off (conversions fail). Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Fabrice Gasnier authored
reg property should be checked against number of available filters. BTW, dfsdm->num_fls wasn't used. But it can be used for this purpose. This prevents using data out of allocated dfsdm->fl_list array. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Fabrice Gasnier authored
Misc fixes & style improvements: - checkpatch warns about line over 80 characters. - remove extra spaces and a blank line (e.g. checkpatch --strict) - remove bad error message always printed in probe routine. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Veenstra authored
Add blank lines to improve readability. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Veenstra authored
Reorders the variable declarations to prefer a reverse Christmas tree order to improve readability. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Veenstra authored
This patches sorts all the includes in alphabetic order. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
David Veenstra authored
This patches removes unneeded slab.h header. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
The configuration register on the device is represented with the prox_config member on the tsl2x7x_settings structure. According to the TSL2772 data sheet, this register can hold: 1) the proximity drive level, 2) ALS/Proximity long wait, and 3) the ALS gain level. This patch renames prox_config to als_prox_config since ALS settings can be stored here as well. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
This patch removes several unnecessary comments, changes some comments so that the use as much of the allowable 80 characters as possible, adds the proper whitespace, removes some structure members from the kernel docs that are no longer present, and improves the existing kernel doc information for some existing structure members. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
This patch changes the defaults of the als_time, prox_time and wait_time to match the defaults according to the TSL2772 datasheet. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
The driver mostly uses the 'prox' naming convention for most of the proximity settings, however prx_time and tsl2x7x_prx_gain was present. This patch renames these to prox_time and tsl2x7x_prox_gain for consistency with everything else in the driver. The kernel documentation for prx_gain is corrected to prox_gain so that it matches what is actually in the structure. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
The power and diode defines are needed for the platform data so this patch moves the defines out of the .c file and into the header file. A comment for the diode is also cleaned up while this code is touched. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
This patch renames tsl2x7x_device_id() to tsl2x7x_device_id_verif(), removes the unnecessary pointer on the id parameter, and only calls the verification function once. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
tsl2x7x_write_interrupt_config() has an unnecessary return value check at the end of the function. This patch changes the function to just return the value from the call to tsl2x7x_invoke_change(). Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
tsl2x7x_suspend() and tsl2x7x_resume() both check to see what the current chip status is. These checks are not necessary so this patch removes those checks. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
tsl2x7x_clear_interrupts() takes a reg argument but there are only two callers to this function and both callers pass the same value. Since this function was introduced, interrupts are now working properly for this driver, and several unnecessary calls to tsl2x7x_clear_interrupts() were removed. This patch removes the tsl2x7x_clear_interrupts() function and replaces the two callers with the i2c_smbus_write_byte() call instead. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
tsl2x7x_event_handler() could return an error and this could cause the interrupt to remain masked. We shouldn't return an error in the interrupt handler so this patch always returns IRQ_HANDLED. An error will be logged if one occurs. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Brian Masney authored
The integration_time* attributes are currently associated with the IIO_LIGHT channel but should be associated with the IIO_INTENSITY channel. Directory listing of the sysfs attributes for a TSL2772 with this patch applied: dev events in_illuminance0_calibrate in_illuminance0_calibscale_available in_illuminance0_input in_illuminance0_lux_table in_illuminance0_target_input in_intensity0_calibbias in_intensity0_calibscale in_intensity0_integration_time in_intensity0_integration_time_available in_intensity0_raw in_intensity1_raw in_proximity0_calibrate in_proximity0_calibscale in_proximity0_calibscale_available in_proximity0_raw name of_node power subsystem uevent Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Wolfram Sang authored
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Wolfram Sang authored
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Wolfram Sang authored
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 21 Apr, 2018 7 commits
-
-
Hans de Goede authored
The Lenovo Ideapad Miix 320 uses an st accelerometer with an ACPI id of SMO8840, add support for this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Martin Kelly authored
Document that the hardware supports falling edge, rising edge, level low, and level high interrupt types, rather than just rising edge. The language used is the same as that in st_lsm6dsx.txt. Signed-off-by: Martin Kelly <mkelly@xevo.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Martin Kelly authored
Currently, we support only rising edge interrupts, and in fact we assume that the interrupt we're given is rising edge (and things won't work if it's not). However, the device supports rising edge, falling edge, level low, and level high interrupts. Empirically, on my system, switching to level interrupts has fixed a problem I had with significant (~40%) interrupt loss with edge interrupts. This issue is likely related to the SoC I'm using (Allwinner H3), but being able to switch the interrupt type is still a very useful workaround. I tested this with each interrupt type and verified correct behavior in a logic analyzer. Add support for these interrupt types while also eliminating the error case of the device tree and driver using different interrupt types. Signed-off-by: Martin Kelly <mkelly@xevo.com> Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jean-Baptiste Maneyrol authored
Set power function is rewritten manually inside i2c mux select. Better use the already identical existing function. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Jean-Baptiste Maneyrol authored
Rewrite set_power_itg. Failing when turning power off is no more decreasing the counter now and sleeping only happens when effectively turning the chip on. Fix also usage in init function (setting power on one time is sufficient to ensure chip is effectively on). Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Fabian Mewes authored
Update the example to use the compatible string including the vendor prefix instead of the ones deprecated in 3a872138. Signed-off-by: Fabian Mewes <architekt@coding4coffee.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
Hernán Gonzalez authored
Also remove unnecessary parenthesis Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 15 Apr, 2018 1 commit
-
-
Christophe JAILLET authored
'sca3000_configure_ring()' can fail, so test its return value and propagate it if needed. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-