Skip to content

Commit fc51149

Browse files
author
Bartosz Golaszewski
committed
Merge tag 'ib-mfd-gpio-input-pinctrl-pwm-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into gpio/for-next
Pull changes from the immutable branch between MFD, GPIO, Input, Pinctrl and PWM trees containing the GPIO driver for max7360.
2 parents b80c59a + 32d4ced commit fc51149

24 files changed

Lines changed: 1869 additions & 2 deletions

File tree

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/gpio/maxim,max7360-gpio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Maxim MAX7360 GPIO controller
8+
9+
maintainers:
10+
- Kamel Bouhara <kamel.bouhara@bootlin.com>
11+
- Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
12+
13+
description: |
14+
Maxim MAX7360 GPIO controller, in MAX7360 chipset
15+
https://www.analog.com/en/products/max7360.html
16+
17+
The device provides two series of GPIOs, referred here as GPIOs and GPOs.
18+
19+
PORT0 to PORT7 pins can be used as GPIOs, with support for interrupts and
20+
constant-current mode. These pins will also be used by the rotary encoder and
21+
PWM functionalities.
22+
23+
COL2 to COL7 pins can be used as GPOs, there is no input capability. COL pins
24+
will be partitioned, with the first pins being affected to the keypad
25+
functionality and the last ones as GPOs.
26+
27+
properties:
28+
compatible:
29+
enum:
30+
- maxim,max7360-gpio
31+
- maxim,max7360-gpo
32+
33+
gpio-controller: true
34+
35+
"#gpio-cells":
36+
const: 2
37+
38+
interrupt-controller: true
39+
40+
"#interrupt-cells":
41+
const: 2
42+
43+
maxim,constant-current-disable:
44+
$ref: /schemas/types.yaml#/definitions/uint32
45+
description:
46+
Bit field, each bit disables constant-current output of the associated
47+
GPIO, starting from the least significant bit for the first GPIO.
48+
maximum: 0xff
49+
50+
required:
51+
- compatible
52+
- gpio-controller
53+
54+
allOf:
55+
- if:
56+
properties:
57+
compatible:
58+
contains:
59+
enum:
60+
- maxim,max7360-gpio
61+
ngpios: false
62+
then:
63+
required:
64+
- interrupt-controller
65+
else:
66+
properties:
67+
interrupt-controller: false
68+
maxim,constant-current-disable: false
69+
70+
additionalProperties: false
71+
72+
examples:
73+
- |
74+
gpio {
75+
compatible = "maxim,max7360-gpio";
76+
77+
gpio-controller;
78+
#gpio-cells = <2>;
79+
maxim,constant-current-disable = <0x06>;
80+
81+
interrupt-controller;
82+
#interrupt-cells = <2>;
83+
};
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mfd/maxim,max7360.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Maxim MAX7360 Keypad, Rotary encoder, PWM and GPIO controller
8+
9+
maintainers:
10+
- Kamel Bouhara <kamel.bouhara@bootlin.com>
11+
- Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
12+
13+
description: |
14+
Maxim MAX7360 device, with following functions:
15+
- keypad controller
16+
- rotary controller
17+
- GPIO and GPO controller
18+
- PWM controller
19+
20+
https://www.analog.com/en/products/max7360.html
21+
22+
allOf:
23+
- $ref: /schemas/input/matrix-keymap.yaml#
24+
- $ref: /schemas/input/input.yaml#
25+
26+
properties:
27+
compatible:
28+
enum:
29+
- maxim,max7360
30+
31+
reg:
32+
maxItems: 1
33+
34+
interrupts:
35+
maxItems: 2
36+
37+
interrupt-names:
38+
items:
39+
- const: inti
40+
- const: intk
41+
42+
keypad-debounce-delay-ms:
43+
description: Keypad debounce delay in ms
44+
minimum: 9
45+
maximum: 40
46+
default: 9
47+
48+
rotary-debounce-delay-ms:
49+
description: Rotary encoder debounce delay in ms
50+
minimum: 0
51+
maximum: 15
52+
default: 0
53+
54+
linux,axis:
55+
$ref: /schemas/input/rotary-encoder.yaml#/properties/linux,axis
56+
57+
rotary-encoder,relative-axis:
58+
$ref: /schemas/types.yaml#/definitions/flag
59+
description:
60+
Register a relative axis rather than an absolute one.
61+
62+
rotary-encoder,steps:
63+
$ref: /schemas/types.yaml#/definitions/uint32
64+
default: 24
65+
description:
66+
Number of steps in a full turnaround of the
67+
encoder. Only relevant for absolute axis. Defaults to 24 which is a
68+
typical value for such devices.
69+
70+
rotary-encoder,rollover:
71+
$ref: /schemas/types.yaml#/definitions/flag
72+
description:
73+
Automatic rollover when the rotary value becomes
74+
greater than the specified steps or smaller than 0. For absolute axis only.
75+
76+
"#pwm-cells":
77+
const: 3
78+
79+
gpio:
80+
$ref: /schemas/gpio/maxim,max7360-gpio.yaml#
81+
description:
82+
PORT0 to PORT7 general purpose input/output pins configuration.
83+
84+
gpo:
85+
$ref: /schemas/gpio/maxim,max7360-gpio.yaml#
86+
description: >
87+
COL2 to COL7 general purpose output pins configuration. Allows to use
88+
unused keypad columns as outputs.
89+
90+
The MAX7360 has 8 column lines and 6 of them can be used as GPOs. GPIOs
91+
numbers used for this gpio-controller node do correspond to the column
92+
numbers: values 0 and 1 are never valid, values from 2 to 7 might be valid
93+
depending on the value of the keypad,num-column property.
94+
95+
patternProperties:
96+
'-pins$':
97+
type: object
98+
description:
99+
Pinctrl node's client devices use subnodes for desired pin configuration.
100+
Client device subnodes use below standard properties.
101+
$ref: /schemas/pinctrl/pincfg-node.yaml
102+
103+
properties:
104+
pins:
105+
description:
106+
List of gpio pins affected by the properties specified in this
107+
subnode.
108+
items:
109+
pattern: '^(PORT[0-7]|ROTARY)$'
110+
minItems: 1
111+
maxItems: 8
112+
113+
function:
114+
description:
115+
Specify the alternative function to be configured for the specified
116+
pins.
117+
enum: [gpio, pwm, rotary]
118+
119+
additionalProperties: false
120+
121+
required:
122+
- compatible
123+
- reg
124+
- interrupts
125+
- interrupt-names
126+
- linux,keymap
127+
- linux,axis
128+
- "#pwm-cells"
129+
- gpio
130+
- gpo
131+
132+
unevaluatedProperties: false
133+
134+
examples:
135+
- |
136+
#include <dt-bindings/input/input.h>
137+
#include <dt-bindings/interrupt-controller/arm-gic.h>
138+
139+
i2c {
140+
#address-cells = <1>;
141+
#size-cells = <0>;
142+
143+
io-expander@38 {
144+
compatible = "maxim,max7360";
145+
reg = <0x38>;
146+
147+
interrupt-parent = <&gpio1>;
148+
interrupts = <23 IRQ_TYPE_LEVEL_LOW>,
149+
<24 IRQ_TYPE_LEVEL_LOW>;
150+
interrupt-names = "inti", "intk";
151+
152+
keypad,num-rows = <8>;
153+
keypad,num-columns = <4>;
154+
linux,keymap = <
155+
MATRIX_KEY(0x00, 0x00, KEY_F5)
156+
MATRIX_KEY(0x01, 0x00, KEY_F4)
157+
MATRIX_KEY(0x02, 0x01, KEY_F6)
158+
>;
159+
keypad-debounce-delay-ms = <10>;
160+
autorepeat;
161+
162+
rotary-debounce-delay-ms = <2>;
163+
linux,axis = <0>; /* REL_X */
164+
rotary-encoder,relative-axis;
165+
166+
#pwm-cells = <3>;
167+
168+
max7360_gpio: gpio {
169+
compatible = "maxim,max7360-gpio";
170+
171+
gpio-controller;
172+
#gpio-cells = <2>;
173+
maxim,constant-current-disable = <0x06>;
174+
175+
interrupt-controller;
176+
#interrupt-cells = <0x2>;
177+
};
178+
179+
max7360_gpo: gpo {
180+
compatible = "maxim,max7360-gpo";
181+
182+
gpio-controller;
183+
#gpio-cells = <2>;
184+
};
185+
186+
backlight_pins: backlight-pins {
187+
pins = "PORT2";
188+
function = "pwm";
189+
};
190+
};
191+
};

MAINTAINERS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15023,6 +15023,19 @@ L: linux-iio@vger.kernel.org
1502315023
S: Maintained
1502415024
F: drivers/iio/temperature/max30208.c
1502515025

15026+
MAXIM MAX7360 KEYPAD LED MFD DRIVER
15027+
M: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
15028+
S: Maintained
15029+
F: Documentation/devicetree/bindings/gpio/maxim,max7360-gpio.yaml
15030+
F: Documentation/devicetree/bindings/mfd/maxim,max7360.yaml
15031+
F: drivers/gpio/gpio-max7360.c
15032+
F: drivers/input/keyboard/max7360-keypad.c
15033+
F: drivers/input/misc/max7360-rotary.c
15034+
F: drivers/mfd/max7360.c
15035+
F: drivers/pinctrl/pinctrl-max7360.c
15036+
F: drivers/pwm/pwm-max7360.c
15037+
F: include/linux/mfd/max7360.h
15038+
1502615039
MAXIM MAX77650 PMIC MFD DRIVER
1502715040
M: Bartosz Golaszewski <brgl@bgdev.pl>
1502815041
L: linux-kernel@vger.kernel.org

drivers/gpio/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,18 @@ config GPIO_MADERA
14971497
help
14981498
Support for GPIOs on Cirrus Logic Madera class codecs.
14991499

1500+
config GPIO_MAX7360
1501+
tristate "MAX7360 GPIO support"
1502+
depends on MFD_MAX7360
1503+
select GPIO_REGMAP
1504+
select REGMAP_IRQ
1505+
help
1506+
Allows to use MAX7360 I/O Expander PWM lines as GPIO and keypad COL
1507+
lines as GPO.
1508+
1509+
This driver can also be built as a module. If so, the module will be
1510+
called gpio-max7360.
1511+
15001512
config GPIO_MAX77620
15011513
tristate "GPIO support for PMIC MAX77620 and MAX20024"
15021514
depends on MFD_MAX77620

drivers/gpio/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ obj-$(CONFIG_GPIO_MAX7300) += gpio-max7300.o
106106
obj-$(CONFIG_GPIO_MAX7301) += gpio-max7301.o
107107
obj-$(CONFIG_GPIO_MAX730X) += gpio-max730x.o
108108
obj-$(CONFIG_GPIO_MAX732X) += gpio-max732x.o
109+
obj-$(CONFIG_GPIO_MAX7360) += gpio-max7360.o
109110
obj-$(CONFIG_GPIO_MAX77620) += gpio-max77620.o
110111
obj-$(CONFIG_GPIO_MAX77650) += gpio-max77650.o
111112
obj-$(CONFIG_GPIO_MAX77759) += gpio-max77759.o

0 commit comments

Comments
 (0)