Skip to content

Commit 67470fb

Browse files
committed
Merge branch 'togreg' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
2 parents 3b30814 + 89e2233 commit 67470fb

File tree

22 files changed

+3342
-82
lines changed

22 files changed

+3342
-82
lines changed

Documentation/ABI/testing/sysfs-bus-iio

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,3 +2254,21 @@ Description:
22542254
If a label is defined for this event add that to the event
22552255
specific attributes. This is useful for userspace to be able to
22562256
better identify an individual event.
2257+
2258+
What: /sys/.../events/in_accel_gesture_tap_wait_timeout
2259+
KernelVersion: 6.7
2260+
Contact: linux-iio@vger.kernel.org
2261+
Description:
2262+
Enable tap gesture confirmation with timeout.
2263+
2264+
What: /sys/.../events/in_accel_gesture_tap_wait_dur
2265+
KernelVersion: 6.7
2266+
Contact: linux-iio@vger.kernel.org
2267+
Description:
2268+
Timeout value in seconds for tap gesture confirmation.
2269+
2270+
What: /sys/.../events/in_accel_gesture_tap_wait_dur_available
2271+
KernelVersion: 6.7
2272+
Contact: linux-iio@vger.kernel.org
2273+
Description:
2274+
List of available timeout value for tap gesture confirmation.
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/iio/adc/maxim,max34408.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Maxim MAX34408/MAX34409 current monitors with overcurrent control
8+
9+
maintainers:
10+
- Ivan Mikhaylov <fr0st61te@gmail.com>
11+
12+
description: |
13+
The MAX34408/MAX34409 are two- and four-channel current monitors that are
14+
configured and monitored with a standard I2C/SMBus serial interface. Each
15+
unidirectional current sensor offers precision high-side operation with a
16+
low full-scale sense voltage. The devices automatically sequence through
17+
two or four channels and collect the current-sense samples and average them
18+
to reduce the effect of impulse noise. The raw ADC samples are compared to
19+
user-programmable digital thresholds to indicate overcurrent conditions.
20+
Overcurrent conditions trigger a hardware output to provide an immediate
21+
indication to shut down any necessary external circuitry.
22+
23+
Specifications about the devices can be found at:
24+
https://www.analog.com/media/en/technical-documentation/data-sheets/MAX34408-MAX34409.pdf
25+
26+
properties:
27+
compatible:
28+
enum:
29+
- maxim,max34408
30+
- maxim,max34409
31+
32+
"#address-cells":
33+
const: 1
34+
35+
"#size-cells":
36+
const: 0
37+
38+
reg:
39+
maxItems: 1
40+
41+
interrupts:
42+
maxItems: 1
43+
44+
powerdown-gpios:
45+
description:
46+
Shutdown Output. Open-drain output. This output transitions to high impedance
47+
when any of the digital comparator thresholds are exceeded as long as the ENA
48+
pin is high.
49+
maxItems: 1
50+
51+
powerdown-status-gpios:
52+
description:
53+
SHTDN Enable Input. CMOS digital input. Connect to GND to clear the latch and
54+
unconditionally deassert (force low) the SHTDN output and reset the shutdown
55+
delay. Connect to VDD to enable normal latch operation of the SHTDN output.
56+
maxItems: 1
57+
58+
vdd-supply: true
59+
60+
patternProperties:
61+
"^channel@[0-3]$":
62+
$ref: adc.yaml
63+
type: object
64+
description:
65+
Represents the internal channels of the ADC.
66+
67+
properties:
68+
reg:
69+
items:
70+
- minimum: 0
71+
maximum: 3
72+
73+
maxim,rsense-val-micro-ohms:
74+
description:
75+
Adjust the Rsense value to monitor higher or lower current levels for
76+
input.
77+
enum: [250, 500, 1000, 5000, 10000, 50000, 100000, 200000, 500000]
78+
default: 1000
79+
80+
required:
81+
- reg
82+
- maxim,rsense-val-micro-ohms
83+
84+
unevaluatedProperties: false
85+
86+
required:
87+
- compatible
88+
- reg
89+
90+
allOf:
91+
- if:
92+
properties:
93+
compatible:
94+
contains:
95+
const: maxim,max34408
96+
then:
97+
patternProperties:
98+
"^channel@[2-3]$": false
99+
"^channel@[0-1]$":
100+
properties:
101+
reg:
102+
maximum: 1
103+
else:
104+
patternProperties:
105+
"^channel@[0-3]$":
106+
properties:
107+
reg:
108+
maximum: 3
109+
110+
additionalProperties: false
111+
112+
examples:
113+
- |
114+
#include <dt-bindings/gpio/gpio.h>
115+
116+
i2c {
117+
#address-cells = <1>;
118+
#size-cells = <0>;
119+
120+
adc@1e {
121+
compatible = "maxim,max34409";
122+
reg = <0x1e>;
123+
powerdown-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
124+
powerdown-status-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
125+
126+
#address-cells = <1>;
127+
#size-cells = <0>;
128+
129+
channel@0 {
130+
reg = <0x0>;
131+
maxim,rsense-val-micro-ohms = <5000>;
132+
};
133+
134+
channel@1 {
135+
reg = <0x1>;
136+
maxim,rsense-val-micro-ohms = <10000>;
137+
};
138+
};
139+
};
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/iio/imu/bosch,bmi323.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Bosch BMI323 6-Axis IMU
8+
9+
maintainers:
10+
- Jagath Jog J <jagathjog1996@gmail.com>
11+
12+
description:
13+
BMI323 is a 6-axis inertial measurement unit that supports acceleration and
14+
gyroscopic measurements with hardware fifo buffering. Sensor also provides
15+
events information such as motion, steps, orientation, single and double
16+
tap detection.
17+
18+
properties:
19+
compatible:
20+
const: bosch,bmi323
21+
22+
reg:
23+
maxItems: 1
24+
25+
vdd-supply: true
26+
vddio-supply: true
27+
28+
interrupts:
29+
minItems: 1
30+
maxItems: 2
31+
32+
interrupt-names:
33+
minItems: 1
34+
maxItems: 2
35+
items:
36+
enum:
37+
- INT1
38+
- INT2
39+
40+
drive-open-drain:
41+
description:
42+
set if the specified interrupt pin should be configured as
43+
open drain. If not set, defaults to push-pull.
44+
45+
mount-matrix:
46+
description:
47+
an optional 3x3 mounting rotation matrix.
48+
49+
required:
50+
- compatible
51+
- reg
52+
- vdd-supply
53+
- vddio-supply
54+
55+
allOf:
56+
- $ref: /schemas/spi/spi-peripheral-props.yaml#
57+
58+
unevaluatedProperties: false
59+
60+
examples:
61+
- |
62+
// Example for I2C
63+
#include <dt-bindings/interrupt-controller/irq.h>
64+
i2c {
65+
#address-cells = <1>;
66+
#size-cells = <0>;
67+
68+
imu@68 {
69+
compatible = "bosch,bmi323";
70+
reg = <0x68>;
71+
vddio-supply = <&vddio>;
72+
vdd-supply = <&vdd>;
73+
interrupt-parent = <&gpio1>;
74+
interrupts = <29 IRQ_TYPE_EDGE_RISING>;
75+
interrupt-names = "INT1";
76+
};
77+
};

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3640,6 +3640,13 @@ S: Maintained
36403640
F: Documentation/devicetree/bindings/iio/accel/bosch,bma400.yaml
36413641
F: drivers/iio/accel/bma400*
36423642

3643+
BOSCH SENSORTEC BMI323 IMU IIO DRIVER
3644+
M: Jagath Jog J <jagathjog1996@gmail.com>
3645+
L: linux-iio@vger.kernel.org
3646+
S: Maintained
3647+
F: Documentation/devicetree/bindings/iio/imu/bosch,bma400.yaml
3648+
F: drivers/iio/imu/bmi323/
3649+
36433650
BPF JIT for ARM
36443651
M: Russell King <linux@armlinux.org.uk>
36453652
M: Puranjay Mohan <puranjay12@gmail.com>

drivers/base/property.c

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ int fwnode_property_match_string(const struct fwnode_handle *fwnode,
473473
const char **values;
474474
int nval, ret;
475475

476-
nval = fwnode_property_read_string_array(fwnode, propname, NULL, 0);
476+
nval = fwnode_property_string_array_count(fwnode, propname);
477477
if (nval < 0)
478478
return nval;
479479

@@ -498,6 +498,41 @@ int fwnode_property_match_string(const struct fwnode_handle *fwnode,
498498
}
499499
EXPORT_SYMBOL_GPL(fwnode_property_match_string);
500500

501+
/**
502+
* fwnode_property_match_property_string - find a property string value in an array and return index
503+
* @fwnode: Firmware node to get the property of
504+
* @propname: Name of the property holding the string value
505+
* @array: String array to search in
506+
* @n: Size of the @array
507+
*
508+
* Find a property string value in a given @array and if it is found return
509+
* the index back.
510+
*
511+
* Return: index, starting from %0, if the string value was found in the @array (success),
512+
* %-ENOENT when the string value was not found in the @array,
513+
* %-EINVAL if given arguments are not valid,
514+
* %-ENODATA if the property does not have a value,
515+
* %-EPROTO or %-EILSEQ if the property is not a string,
516+
* %-ENXIO if no suitable firmware interface is present.
517+
*/
518+
int fwnode_property_match_property_string(const struct fwnode_handle *fwnode,
519+
const char *propname, const char * const *array, size_t n)
520+
{
521+
const char *string;
522+
int ret;
523+
524+
ret = fwnode_property_read_string(fwnode, propname, &string);
525+
if (ret)
526+
return ret;
527+
528+
ret = match_string(array, n, string);
529+
if (ret < 0)
530+
ret = -ENOENT;
531+
532+
return ret;
533+
}
534+
EXPORT_SYMBOL_GPL(fwnode_property_match_property_string);
535+
501536
/**
502537
* fwnode_property_get_reference_args() - Find a reference with arguments
503538
* @fwnode: Firmware node where to look for the reference

drivers/iio/adc/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,17 @@ config MAX1363
745745
To compile this driver as a module, choose M here: the module will be
746746
called max1363.
747747

748+
config MAX34408
749+
tristate "Maxim max34408/max344089 ADC driver"
750+
depends on I2C
751+
help
752+
Say yes here to build support for Maxim max34408/max34409 current sense
753+
monitor with 8-bits ADC interface with overcurrent delay/threshold and
754+
shutdown delay.
755+
756+
To compile this driver as a module, choose M here: the module will be
757+
called max34408.
758+
748759
config MAX77541_ADC
749760
tristate "Analog Devices MAX77541 ADC driver"
750761
depends on MFD_MAX77541

drivers/iio/adc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ obj-$(CONFIG_MAX11205) += max11205.o
6868
obj-$(CONFIG_MAX11410) += max11410.o
6969
obj-$(CONFIG_MAX1241) += max1241.o
7070
obj-$(CONFIG_MAX1363) += max1363.o
71+
obj-$(CONFIG_MAX34408) += max34408.o
7172
obj-$(CONFIG_MAX77541_ADC) += max77541-adc.o
7273
obj-$(CONFIG_MAX9611) += max9611.o
7374
obj-$(CONFIG_MCP320X) += mcp320x.o

0 commit comments

Comments
 (0)