Skip to content

Commit ba26342

Browse files
committed
Merge tag 'iio-for-6.12b' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes: IIO: 2nd set of new device support features and cleanup for 6.12 Late pull request as I was planing to include another series that is waiting for a fix to end up in char-misc-next. That can wait for next cycle. Includes one immutable branch merge from MFD to get a necessary header change. Usual mix of a few new drivers, additional device support for existing drivers, new features and a bunch of cleanup across tree. New device support ================== asahi-kasei,ak8975 - A few minor fixes as precursors to support for the AK09118 magnetometer that is very similar to the already supported AK09112 awinic,aw96103 - New driver for this capacitive proximity sensor. x-powers,axp202 - Add support for the axp717 (including merge of MFD immutable branch). sophgo,saradc - New driver for this SOC ADC. Features ======== adi,ad4695 - Add calibration support. bosch,bmi323 - Ensure device is in lowest power state on suspend. Cleanup and minor fixes ======================= treewide - Start to standardize formatting of id tables (ADC drivers done so far). adi,ad5449 - Drop platform data support as long unused in upstream kernel. bosch,bmc150 - Use fwnode_irq_get_by_name() in place of of_ variant. - Use ACPI_HANDLE() to get the handle directly rather than via ACPI_COMPANION() google,cros_ec_mkbp_proximity - Include mod_devicetable.h instead of broader of.h mirochip,mcp320x - Drop vendorless compatible entries as not needed for backwards compatibility and should not be used in new boards. st,lsm6dsx - Use iio_read_acpi_mount_matrix() helper instead of open coding the same. - Drop some unnecessary dev_fwnode() calls to check if a fwnode is available. All the calls made handle this anyway. xilinx,ams - Use device_for_each_child_node_scoped() to avoid manual release of fwnode handle. tools,generic-buffer - Handle failure to allocate trigger name. - Cleanup .*.cmd files if present. * tag 'iio-for-6.12b' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (28 commits) iio: adc: axp20x_adc: add support for AXP717 ADC dt-bindings: iio: adc: Add AXP717 compatible iio: adc: axp20x_adc: Add adc_en1 and adc_en2 to axp_data tools: iio: rm .*.cmd when make clean iio: adc: standardize on formatting for id match tables iio: proximity: aw96103: Add support for aw96103/aw96105 proximity sensor dt-bindings: iio: aw96103: Add bindings for aw96103/aw96105 sensor iio: adc: sophgo-saradc: Add driver for Sophgo CV1800B SARADC dt-bindings: iio: adc: sophgo,cv1800b-saradc: Add Sophgo CV1800B SARADC tools/iio: Add memory allocation failure check for trigger_name iio: imu: st_lsm6dsx: Remove useless dev_fwnode() calls iio: imu: st_lsm6dsx: Use iio_read_acpi_mount_matrix() helper iio: adc: mcp320x: Drop vendorless compatible strings iio: dac: ad5449: drop support for platform data iio: adc: xilinx-ams: use device_* to iterate over device child nodes iio: ABI: document ad4695 new attributes doc: iio: ad4695: update for calibration support iio: adc: ad4695: implement calibration support iio: adc: ad4695: add 2nd regmap for 16-bit registers iio: bmi323: peripheral in lowest power state on suspend ...
2 parents b391213 + 5ba0cb9 commit ba26342

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2128
-382
lines changed

Documentation/ABI/testing/sysfs-bus-iio

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ What: /sys/bus/iio/devices/iio:deviceX/in_proximity_calibbias
541541
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calibbias
542542
What: /sys/bus/iio/devices/iio:deviceX/in_resistance_calibbias
543543
What: /sys/bus/iio/devices/iio:deviceX/in_temp_calibbias
544+
What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_calibbias
544545
What: /sys/bus/iio/devices/iio:deviceX/out_currentY_calibbias
545546
What: /sys/bus/iio/devices/iio:deviceX/out_voltageY_calibbias
546547
KernelVersion: 2.6.35
@@ -556,6 +557,7 @@ What: /sys/bus/iio/devices/iio:deviceX/in_accel_calibbias_available
556557
What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_calibbias_available
557558
What: /sys/bus/iio/devices/iio:deviceX/in_temp_calibbias_available
558559
What: /sys/bus/iio/devices/iio:deviceX/in_proximity_calibbias_available
560+
What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_calibbias_available
559561
What: /sys/bus/iio/devices/iio:deviceX/out_voltageY_calibbias_available
560562
KernelVersion: 5.8
561563
@@ -603,6 +605,7 @@ Description:
603605
What: /sys/bus/iio/devices/iio:deviceX/in_illuminanceY_calibscale_available
604606
What: /sys/bus/iio/devices/iio:deviceX/in_intensityY_calibscale_available
605607
What: /sys/bus/iio/devices/iio:deviceX/in_proximityY_calibscale_available
608+
What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_calibscale_available
606609
KernelVersion: 4.8
607610
608611
Description:
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/iio/adc/sophgo,cv1800b-saradc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title:
8+
Sophgo CV1800B SoC 3 channels Successive Approximation Analog to
9+
Digital Converters
10+
11+
maintainers:
12+
- Thomas Bonnefille <[email protected]>
13+
14+
description:
15+
Datasheet at https://github.com/sophgo/sophgo-doc/releases
16+
17+
properties:
18+
compatible:
19+
const: sophgo,cv1800b-saradc
20+
21+
reg:
22+
maxItems: 1
23+
24+
interrupts:
25+
maxItems: 1
26+
27+
clocks:
28+
maxItems: 1
29+
30+
'#address-cells':
31+
const: 1
32+
33+
'#size-cells':
34+
const: 0
35+
36+
patternProperties:
37+
"^channel@[0-2]$":
38+
$ref: adc.yaml
39+
40+
properties:
41+
reg:
42+
items:
43+
- minimum: 0
44+
maximum: 2
45+
46+
required:
47+
- reg
48+
49+
additionalProperties: false
50+
51+
required:
52+
- compatible
53+
- reg
54+
- clocks
55+
- '#address-cells'
56+
- '#size-cells'
57+
58+
additionalProperties: false
59+
60+
examples:
61+
- |
62+
#include <dt-bindings/clock/sophgo,cv1800.h>
63+
#include <dt-bindings/interrupt-controller/irq.h>
64+
adc@30f0000 {
65+
compatible = "sophgo,cv1800b-saradc";
66+
reg = <0x030f0000 0x1000>;
67+
clocks = <&clk CLK_SARADC>;
68+
interrupts = <100 IRQ_TYPE_LEVEL_HIGH>;
69+
#address-cells = <1>;
70+
#size-cells = <0>;
71+
72+
channel@0 {
73+
reg = <0>;
74+
};
75+
76+
channel@1 {
77+
reg = <1>;
78+
};
79+
80+
channel@2 {
81+
reg = <2>;
82+
};
83+
};

Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ description: |
3737
3 | batt_dischrg_i
3838
4 | ts_v
3939
40+
AXP717
41+
------
42+
0 | batt_v
43+
1 | ts_v
44+
2 | vbus_v
45+
3 | vsys_v
46+
4 | pmic_temp
47+
5 | batt_chrg_i
48+
6 | vmid_v
49+
7 | bkup_batt_v
50+
4051
AXP813
4152
------
4253
0 | pmic_temp
@@ -52,6 +63,7 @@ properties:
5263
oneOf:
5364
- const: x-powers,axp209-adc
5465
- const: x-powers,axp221-adc
66+
- const: x-powers,axp717-adc
5567
- const: x-powers,axp813-adc
5668

5769
- items:

Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8975.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ properties:
1818
- asahi-kasei,ak09911
1919
- asahi-kasei,ak09912
2020
- asahi-kasei,ak09916
21+
- items:
22+
# ak09918 is register compatible with ak09912.
23+
- const: asahi-kasei,ak09918
24+
- const: asahi-kasei,ak09912
2125
- enum:
2226
- ak8975
2327
- ak8963
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/iio/proximity/awinic,aw96103.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Awinic's AW96103 capacitive proximity sensor and similar
8+
9+
maintainers:
10+
- Wang Shuaijie <[email protected]>
11+
12+
description: |
13+
Awinic's AW96103/AW96105 proximity sensor.
14+
The specific absorption rate (SAR) is a metric that measures
15+
the degree of absorption of electromagnetic radiation emitted by
16+
wireless devices, such as mobile phones and tablets, by human tissue.
17+
In mobile phone applications, the proximity sensor is primarily
18+
used to detect the proximity of the human body to the phone. When the
19+
phone approaches the human body, it will actively reduce the transmit
20+
power of the antenna to keep the SAR within a safe range. Therefore,
21+
we also refer to the proximity sensor as a SAR sensor.
22+
23+
properties:
24+
compatible:
25+
enum:
26+
- awinic,aw96103
27+
- awinic,aw96105
28+
29+
reg:
30+
maxItems: 1
31+
32+
interrupts:
33+
description:
34+
Generated by the device to announce that a close/far
35+
proximity event has happened.
36+
maxItems: 1
37+
38+
vcc-supply: true
39+
40+
required:
41+
- compatible
42+
- reg
43+
- interrupts
44+
- vcc-supply
45+
46+
additionalProperties: false
47+
48+
examples:
49+
- |
50+
#include <dt-bindings/interrupt-controller/irq.h>
51+
i2c {
52+
#address-cells = <1>;
53+
#size-cells = <0>;
54+
proximity@12 {
55+
compatible = "awinic,aw96103";
56+
reg = <0x12>;
57+
interrupt-parent = <&gpio>;
58+
interrupts = <23 IRQ_TYPE_EDGE_FALLING>;
59+
vcc-supply = <&pp1800_prox>;
60+
};
61+
};

Documentation/iio/ad4695.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,18 @@ present, then the external reference voltage is used and the internal buffer is
143143
disabled. If ``refin-supply`` is present, then the internal buffered reference
144144
voltage is used.
145145

146+
Gain/offset calibration
147+
-----------------------
148+
149+
System calibration is supported using the channel gain and offset registers via
150+
the ``calibscale`` and ``calibbias`` attributes respectively.
151+
146152
Unimplemented features
147153
----------------------
148154

149155
- Additional wiring modes
150156
- Threshold events
151157
- Oversampling
152-
- Gain/offset calibration
153158
- GPIO support
154159
- CRC support
155160

drivers/iio/accel/bmc150-accel-core.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#include <linux/delay.h>
1111
#include <linux/slab.h>
1212
#include <linux/acpi.h>
13-
#include <linux/of_irq.h>
1413
#include <linux/pm.h>
1514
#include <linux/pm_runtime.h>
15+
#include <linux/property.h>
1616
#include <linux/iio/iio.h>
1717
#include <linux/iio/sysfs.h>
1818
#include <linux/iio/buffer.h>
@@ -387,7 +387,7 @@ static bool bmc150_apply_bosc0200_acpi_orientation(struct device *dev,
387387
struct iio_mount_matrix *orientation)
388388
{
389389
struct iio_dev *indio_dev = dev_get_drvdata(dev);
390-
struct acpi_device *adev = ACPI_COMPANION(dev);
390+
acpi_handle handle = ACPI_HANDLE(dev);
391391
char *name, *alt_name, *label;
392392

393393
if (strcmp(dev_name(dev), "i2c-BOSC0200:base") == 0) {
@@ -398,9 +398,9 @@ static bool bmc150_apply_bosc0200_acpi_orientation(struct device *dev,
398398
label = "accel-display";
399399
}
400400

401-
if (acpi_has_method(adev->handle, "ROTM")) {
401+
if (acpi_has_method(handle, "ROTM")) {
402402
name = "ROTM";
403-
} else if (acpi_has_method(adev->handle, alt_name)) {
403+
} else if (acpi_has_method(handle, alt_name)) {
404404
name = alt_name;
405405
indio_dev->label = label;
406406
} else {
@@ -514,7 +514,7 @@ static void bmc150_accel_interrupts_setup(struct iio_dev *indio_dev,
514514
*/
515515
irq_info = bmc150_accel_interrupts_int1;
516516
if (data->type == BOSCH_BMC156 ||
517-
irq == of_irq_get_byname(dev->of_node, "INT2"))
517+
irq == fwnode_irq_get_byname(dev_fwnode(dev), "INT2"))
518518
irq_info = bmc150_accel_interrupts_int2;
519519

520520
for (i = 0; i < BMC150_ACCEL_INTERRUPTS; i++)

drivers/iio/adc/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,16 @@ config SC27XX_ADC
11921192
This driver can also be built as a module. If so, the module
11931193
will be called sc27xx_adc.
11941194

1195+
config SOPHGO_CV1800B_ADC
1196+
tristate "Sophgo CV1800B SARADC"
1197+
depends on ARCH_SOPHGO || COMPILE_TEST
1198+
help
1199+
Say yes here to build support for the SARADC integrated inside
1200+
the Sophgo CV1800B SoC.
1201+
1202+
This driver can also be built as a module. If so, the module
1203+
will be called sophgo_cv1800b_adc.
1204+
11951205
config SPEAR_ADC
11961206
tristate "ST SPEAr ADC"
11971207
depends on PLAT_SPEAR || COMPILE_TEST

drivers/iio/adc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ obj-$(CONFIG_ROCKCHIP_SARADC) += rockchip_saradc.o
108108
obj-$(CONFIG_RZG2L_ADC) += rzg2l_adc.o
109109
obj-$(CONFIG_SC27XX_ADC) += sc27xx_adc.o
110110
obj-$(CONFIG_SD_ADC_MODULATOR) += sd_adc_modulator.o
111+
obj-$(CONFIG_SOPHGO_CV1800B_ADC) += sophgo-cv1800b-adc.o
111112
obj-$(CONFIG_SPEAR_ADC) += spear_adc.o
112113
obj-$(CONFIG_STM32_ADC_CORE) += stm32-adc-core.o
113114
obj-$(CONFIG_STM32_ADC) += stm32-adc.o

0 commit comments

Comments
 (0)