Sean Nyekjaer
269efcf0bb
iio: accel: fxls8962af: add wake on event
...
This adds ways for the SoC to wake from accelerometer wake events.
In the suspend function we skip disabling the sensor if wakeup-source
and events are activated.
If buffered reads are enabled they will be deactivated before suspend.
As the onboard buffer is only holding up to 32 12-bit X/Y/Z data
triplets.
Signed-off-by: Sean Nyekjaer <sean@geanix.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20210920114221.1595543-2-sean@geanix.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Sean Nyekjaer
131fb9f2b9
iio: accel: fxls8962af: add threshold event handling
...
Add event channels that control the creation of motion events.
Signed-off-by: Sean Nyekjaer <sean@geanix.com >
Link: https://lore.kernel.org/r/20210920114221.1595543-1-sean@geanix.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
d0a4c17b40
iio: adc: aspeed: Get and set trimming data.
...
The ADC controller has a trimming register for fine-tune the reference
voltage. The trimming value comes from the OTP register which will be
written during chip production. This patch will read this OTP value and
configure it to the ADC register when the ADC controller probes and using
dts property "aspeed,trim-data-valid" to determine whether to execute this
flow.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-12-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
df05f384a7
iio: adc: aspeed: Support battery sensing.
...
In ast2600, ADC integrate dividing circuit at last input channel for
battery sensing. This patch use the dts property "battery-sensing" to
enable this feature makes the last channel of each adc can tolerance
higher voltage than reference voltage. The offset interface of ch7 will
be separated when enabling the battery sensing mode.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-11-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
f2836e8c4c
iio: adc: aspeed: Add compensation phase.
...
This patch adds a compensation phase to improve the accuracy of ADC
measurement. This is the built-in function through input half of the
reference voltage to get the ADC offset.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-10-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
13d4f9df33
iio: adc: aspeed: Add func to set sampling rate.
...
Add the function to set the sampling rate and keep the sampling period
for a driver used to wait the fresh value.
In addition, since the ADC clock is required when initializing the ADC
device, move clk_prepare_enable ahead of the initialization phase.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-9-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
90f9647753
iio: adc: aspeed: Fix the calculate error of clock.
...
The ADC clock formula is
ast2400/2500:
ADC clock period = PCLK * 2 * (ADC0C[31:17] + 1) * (ADC0C[9:0] + 1)
ast2600:
ADC clock period = PCLK * 2 * (ADC0C[15:0] + 1)
They all have one fixed divided 2 and the legacy driver didn't handle it.
This patch register the fixed factory clock device as the parent of ADC
clock scaler to fix this issue.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-8-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
1b5ceb55fe
iio: adc: aspeed: Support ast2600 adc.
...
Make driver to support ast2600 adc device.
- Use shared reset controller
- Complete the vref configure function
- Add the model data for ast2600 adc
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-7-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
4c56572c26
iio: adc: aspeed: Use devm_add_action_or_reset.
...
This patch use devm_add_action_or_reset to handle the error in probe
phase.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-6-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
9223bd0471
iio: adc: aspeed: Use model_data to set clk scaler.
...
This patch uses need_prescaler and scaler_bit_width to set the ADC clock
scaler.
Reported-by: kernel test robot <lkp@intel.com >
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-5-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
1de952a4b1
iio: adc: aspeed: Add vref config function
...
Add the function to check the vref_fixed_mv and set the value to driver
data.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-4-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
eaa74a8d51
iio: adc: aspeed: Restructure the model data
...
This patch refactors the model data structure to distinguish the
function form different versions of aspeed ADC.
- Rename the vref_voltage to vref_fixed_mv and add vref_mv driver data
When driver probe will check vref_fixed_mv value and store it to vref_mv
which isn't const value.
- Add num_channels
Make num_channles of iio device can be changed by different model_data
- Add need_prescaler flag and scaler_bit_width
The need_prescaler flag is used to tell the driver the clock divider needs
another Prescaler and the scaler_bit_width to set the clock divider
bitfield width.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-3-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Billy Tsai
89c65417da
iio: adc: aspeed: Keep model data to driver data.
...
Keep the model data pointer to driver data for reducing the usage of
of_device_get_match_data().
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20210922081520.30580-2-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:32 +01:00
Jacopo Mondi
f840f41fa5
iio: ABI: Document in_concentration_co2_scale
...
Document the 'in_concentration_co2_scale' standard IIO attribute.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org >
Link: https://lore.kernel.org/r/20210920135413.140310-5-jacopo+renesas@jmondi.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:31 +01:00
Jacopo Mondi
c397894e24
iio: chemical: Add Senseair Sunrise 006-0-007 driver
...
Add support for the Senseair Sunrise 006-0-0007 driver through the
IIO subsystem.
Datasheet: https://rmtplusstoragesenseair.blob.core.windows.net/docs/Dev/publicerat/TDE5531.pdf
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org >
Link: https://lore.kernel.org/r/20210920135413.140310-4-jacopo+renesas@jmondi.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:31 +01:00
Jacopo Mondi
c3c780ef76
iio: ABI: docs: Document Senseair Sunrise ABI
...
Add documentation for the sysfs attributes of the sunrise_co2 driver.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org >
Link: https://lore.kernel.org/r/20210920135413.140310-3-jacopo+renesas@jmondi.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:31 +01:00
Jacopo Mondi
c6cb6ac7b3
dt-bindings: iio: chemical: Document senseair,sunrise CO2 sensor
...
Add documentation for the Senseair Sunrise 006-0-0007 CO2 NDIR sensor.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20210920135413.140310-2-jacopo+renesas@jmondi.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:31 +01:00
David Heidelberg
42e1e82441
dt-bindings: iio: magnetometer: asahi-kasei,ak8975 add vid reg
...
Driver and device-tree also use vid-supply regulator.
Fixes: 7e000fbff7 ("dt-bindings: iio: magnetometer: ak8975: convert format to yaml, add maintainer")
Signed-off-by: David Heidelberg <david@ixit.cz >
Acked-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20210913181949.83179-1-david@ixit.cz
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:27:26 +01:00
David Heidelberg
2eacfc13c6
dt-bindings: iio: kionix,kxcjk1013: driver support interrupts
...
Device has interrupts support, which description was missing in the bindings.
Signed-off-by: David Heidelberg <david@ixit.cz >
Acked-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20210919203656.119742-1-david@ixit.cz
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-17 11:05:55 +01:00
Krzysztof Kozlowski
de37b16462
iio: adc: exynos: describe drivers in KConfig
...
Describe better which driver applies to which SoC, to make configuring
kernel for Samsung SoC easier.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com >
Link: https://lore.kernel.org/r/20210924133515.112357-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-17 11:05:54 +01:00
Cai Huoqing
948b3b3daf
iio: adc: rockchip_saradc: Make use of the helper function devm_platform_ioremap_resource()
...
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com >
Link: https://lore.kernel.org/r/20210908105631.1474-1-caihuoqing@baidu.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-17 11:05:54 +01:00
Cai Huoqing
7685f50798
iio: dac: stm32-dac: Make use of the helper function devm_platform_ioremap_resource()
...
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com >
Link: https://lore.kernel.org/r/20210908105638.1525-1-caihuoqing@baidu.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-17 11:05:54 +01:00
Daniel Palmer
0fe1402069
iio: accel: mma7660: Mark acpi match table as maybe unused
...
When building kernels without ACPI support the table is declared
but is not used because ACPI_PTR() turns it into a NULL.
Add the __maybe_unused attribute to stop the compiler whining.
Signed-off-by: Daniel Palmer <daniel@0x0f.com >
Link: https://lore.kernel.org/r/20210919072616.3849723-1-daniel@0x0f.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-17 11:05:54 +01:00
Alexandru Ardelean
2b025c92cd
iio: light: max44000: use device-managed functions in probe
...
This is a simple conversion. Both iio_device_register() and
iio_triggered_buffer_setup() functions have device-managed variants.
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com >
Link: https://lore.kernel.org/r/20210913120002.306280-1-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-17 11:05:54 +01:00
Alexandru Ardelean
da6fd25909
iio: gyro: adis16080: use devm_iio_device_register() in probe
...
There is nothing else that needs to be done for this driver. The remove
hook calls only the iio_device_unregister() hook.
So this driver can use devm_iio_device_register() directly.
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com >
Link: https://lore.kernel.org/r/20210913115308.301877-1-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-17 11:05:54 +01:00