Skip to content

Commit cd40a1f

Browse files
committed
Merge tag 'qcom-pinctrl-6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt into devel
Qualcomm pinctrl changes for v6.6 1. Add support for the SM6115 and SM8350 LPASS (Low Power Audio SubSystem) TLMM pin controllers. 2. Add bindings for the Qualcomm PMC8180 and PMC8180C PMICs GPIO pin controllers. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2 parents cfdb274 + 2422f74 commit cd40a1f

File tree

5 files changed

+323
-0
lines changed

5 files changed

+323
-0
lines changed

Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ properties:
5454
- qcom,pm8994-gpio
5555
- qcom,pm8998-gpio
5656
- qcom,pma8084-gpio
57+
- qcom,pmc8180-gpio
58+
- qcom,pmc8180c-gpio
5759
- qcom,pmi632-gpio
5860
- qcom,pmi8950-gpio
5961
- qcom,pmi8994-gpio
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pinctrl/qcom,sm8350-lpass-lpi-pinctrl.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm SM8350 SoC LPASS LPI TLMM
8+
9+
maintainers:
10+
- Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
11+
- Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
12+
13+
description:
14+
Top Level Mode Multiplexer pin controller in the Low Power Audio SubSystem
15+
(LPASS) Low Power Island (LPI) of Qualcomm SM8350 SoC.
16+
17+
properties:
18+
compatible:
19+
const: qcom,sm8350-lpass-lpi-pinctrl
20+
21+
reg:
22+
items:
23+
- description: LPASS LPI TLMM Control and Status registers
24+
- description: LPASS LPI MCC registers
25+
26+
clocks:
27+
items:
28+
- description: LPASS Core voting clock
29+
- description: LPASS Audio voting clock
30+
31+
clock-names:
32+
items:
33+
- const: core
34+
- const: audio
35+
36+
gpio-controller: true
37+
38+
"#gpio-cells":
39+
description: Specifying the pin number and flags, as defined in
40+
include/dt-bindings/gpio/gpio.h
41+
const: 2
42+
43+
gpio-ranges:
44+
maxItems: 1
45+
46+
patternProperties:
47+
"-state$":
48+
oneOf:
49+
- $ref: "#/$defs/qcom-sm8350-lpass-state"
50+
- patternProperties:
51+
"-pins$":
52+
$ref: "#/$defs/qcom-sm8350-lpass-state"
53+
additionalProperties: false
54+
55+
$defs:
56+
qcom-sm8350-lpass-state:
57+
type: object
58+
description:
59+
Pinctrl node's client devices use subnodes for desired pin configuration.
60+
Client device subnodes use below standard properties.
61+
$ref: /schemas/pinctrl/pincfg-node.yaml
62+
63+
properties:
64+
pins:
65+
description:
66+
List of gpio pins affected by the properties specified in this
67+
subnode.
68+
items:
69+
pattern: "^gpio([0-9]|1[0-9]|2[0-2])$"
70+
71+
function:
72+
enum: [ dmic1_clk, dmic1_data, dmic2_clk, dmic2_data, dmic3_clk,
73+
dmic3_data, dmic4_clk, dmic4_data, ext_mclk1_a, ext_mclk1_b,
74+
ext_mclk1_c, ext_mclk1_d, ext_mclk1_e, gpio, i2s0_clk,
75+
i2s0_data, i2s0_ws, i2s1_clk, i2s1_data, i2s1_ws, i2s2_clk,
76+
i2s2_data, i2s2_ws, i2s3_clk, i2s3_data, i2s3_ws, i2s4_clk,
77+
i2s4_data, i2s4_ws, slimbus_clk, slimbus_data, swr_rx_clk,
78+
swr_rx_data, swr_tx_clk, swr_tx_data, wsa_swr_clk,
79+
wsa_swr_data, wsa2_swr_clk, wsa2_swr_data ]
80+
description:
81+
Specify the alternative function to be configured for the specified
82+
pins.
83+
84+
drive-strength:
85+
enum: [2, 4, 6, 8, 10, 12, 14, 16]
86+
default: 2
87+
description:
88+
Selects the drive strength for the specified pins, in mA.
89+
90+
slew-rate:
91+
enum: [0, 1, 2, 3]
92+
default: 0
93+
description: |
94+
0: No adjustments
95+
1: Higher Slew rate (faster edges)
96+
2: Lower Slew rate (slower edges)
97+
3: Reserved (No adjustments)
98+
99+
bias-bus-hold: true
100+
bias-pull-down: true
101+
bias-pull-up: true
102+
bias-disable: true
103+
input-enable: true
104+
output-high: true
105+
output-low: true
106+
107+
required:
108+
- pins
109+
- function
110+
111+
additionalProperties: false
112+
113+
allOf:
114+
- $ref: pinctrl.yaml#
115+
116+
required:
117+
- compatible
118+
- reg
119+
- clocks
120+
- clock-names
121+
- gpio-controller
122+
- "#gpio-cells"
123+
- gpio-ranges
124+
125+
additionalProperties: false
126+
127+
examples:
128+
- |
129+
#include <dt-bindings/sound/qcom,q6afe.h>
130+
131+
lpass_tlmm: pinctrl@33c0000 {
132+
compatible = "qcom,sm8350-lpass-lpi-pinctrl";
133+
reg = <0x033c0000 0x20000>,
134+
<0x03550000 0x10000>;
135+
136+
clocks = <&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
137+
<&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
138+
clock-names = "core", "audio";
139+
140+
gpio-controller;
141+
#gpio-cells = <2>;
142+
gpio-ranges = <&lpass_tlmm 0 0 15>;
143+
};

drivers/pinctrl/qcom/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ config PINCTRL_SM8250_LPASS_LPI
8686
Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI
8787
(Low Power Island) found on the Qualcomm Technologies Inc SM8250 platform.
8888

89+
config PINCTRL_SM8350_LPASS_LPI
90+
tristate "Qualcomm Technologies Inc SM8350 LPASS LPI pin controller driver"
91+
depends on ARM64 || COMPILE_TEST
92+
depends on PINCTRL_LPASS_LPI
93+
help
94+
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
95+
Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI
96+
(Low Power Island) found on the Qualcomm Technologies Inc SM8350
97+
platform.
98+
8999
config PINCTRL_SM8450_LPASS_LPI
90100
tristate "Qualcomm Technologies Inc SM8450 LPASS LPI pin controller driver"
91101
depends on ARM64 || COMPILE_TEST

drivers/pinctrl/qcom/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ obj-$(CONFIG_PINCTRL_SM8150) += pinctrl-sm8150.o
5353
obj-$(CONFIG_PINCTRL_SM8250) += pinctrl-sm8250.o
5454
obj-$(CONFIG_PINCTRL_SM8250_LPASS_LPI) += pinctrl-sm8250-lpass-lpi.o
5555
obj-$(CONFIG_PINCTRL_SM8350) += pinctrl-sm8350.o
56+
obj-$(CONFIG_PINCTRL_SM8350_LPASS_LPI) += pinctrl-sm8350-lpass-lpi.o
5657
obj-$(CONFIG_PINCTRL_SM8450) += pinctrl-sm8450.o
5758
obj-$(CONFIG_PINCTRL_SM8450_LPASS_LPI) += pinctrl-sm8450-lpass-lpi.o
5859
obj-$(CONFIG_PINCTRL_SM8550) += pinctrl-sm8550.o
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
/*
3+
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
4+
* Copyright (c) 2020-2023 Linaro Ltd.
5+
*/
6+
7+
#include <linux/gpio/driver.h>
8+
#include <linux/module.h>
9+
#include <linux/platform_device.h>
10+
11+
#include "pinctrl-lpass-lpi.h"
12+
13+
enum lpass_lpi_functions {
14+
LPI_MUX_dmic1_clk,
15+
LPI_MUX_dmic1_data,
16+
LPI_MUX_dmic2_clk,
17+
LPI_MUX_dmic2_data,
18+
LPI_MUX_dmic3_clk,
19+
LPI_MUX_dmic3_data,
20+
LPI_MUX_i2s1_clk,
21+
LPI_MUX_i2s1_data,
22+
LPI_MUX_i2s1_ws,
23+
LPI_MUX_i2s2_clk,
24+
LPI_MUX_i2s2_data,
25+
LPI_MUX_i2s2_ws,
26+
LPI_MUX_qua_mi2s_data,
27+
LPI_MUX_qua_mi2s_sclk,
28+
LPI_MUX_qua_mi2s_ws,
29+
LPI_MUX_swr_rx_clk,
30+
LPI_MUX_swr_rx_data,
31+
LPI_MUX_swr_tx_clk,
32+
LPI_MUX_swr_tx_data,
33+
LPI_MUX_wsa_swr_clk,
34+
LPI_MUX_wsa_swr_data,
35+
LPI_MUX_gpio,
36+
LPI_MUX__,
37+
};
38+
39+
static int gpio0_pins[] = { 0 };
40+
static int gpio1_pins[] = { 1 };
41+
static int gpio2_pins[] = { 2 };
42+
static int gpio3_pins[] = { 3 };
43+
static int gpio4_pins[] = { 4 };
44+
static int gpio5_pins[] = { 5 };
45+
static int gpio6_pins[] = { 6 };
46+
static int gpio7_pins[] = { 7 };
47+
static int gpio8_pins[] = { 8 };
48+
static int gpio9_pins[] = { 9 };
49+
static int gpio10_pins[] = { 10 };
50+
static int gpio11_pins[] = { 11 };
51+
static int gpio12_pins[] = { 12 };
52+
static int gpio13_pins[] = { 13 };
53+
static int gpio14_pins[] = { 14 };
54+
55+
static const struct pinctrl_pin_desc sm8350_lpi_pins[] = {
56+
PINCTRL_PIN(0, "gpio0"),
57+
PINCTRL_PIN(1, "gpio1"),
58+
PINCTRL_PIN(2, "gpio2"),
59+
PINCTRL_PIN(3, "gpio3"),
60+
PINCTRL_PIN(4, "gpio4"),
61+
PINCTRL_PIN(5, "gpio5"),
62+
PINCTRL_PIN(6, "gpio6"),
63+
PINCTRL_PIN(7, "gpio7"),
64+
PINCTRL_PIN(8, "gpio8"),
65+
PINCTRL_PIN(9, "gpio9"),
66+
PINCTRL_PIN(10, "gpio10"),
67+
PINCTRL_PIN(11, "gpio11"),
68+
PINCTRL_PIN(12, "gpio12"),
69+
PINCTRL_PIN(13, "gpio13"),
70+
PINCTRL_PIN(14, "gpio14"),
71+
};
72+
73+
static const char * const swr_tx_clk_groups[] = { "gpio0" };
74+
static const char * const swr_tx_data_groups[] = { "gpio1", "gpio2", "gpio5", "gpio14" };
75+
static const char * const swr_rx_clk_groups[] = { "gpio3" };
76+
static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5" };
77+
static const char * const dmic1_clk_groups[] = { "gpio6" };
78+
static const char * const dmic1_data_groups[] = { "gpio7" };
79+
static const char * const dmic2_clk_groups[] = { "gpio8" };
80+
static const char * const dmic2_data_groups[] = { "gpio9" };
81+
static const char * const i2s2_clk_groups[] = { "gpio10" };
82+
static const char * const i2s2_ws_groups[] = { "gpio11" };
83+
static const char * const dmic3_clk_groups[] = { "gpio12" };
84+
static const char * const dmic3_data_groups[] = { "gpio13" };
85+
static const char * const qua_mi2s_sclk_groups[] = { "gpio0" };
86+
static const char * const qua_mi2s_ws_groups[] = { "gpio1" };
87+
static const char * const qua_mi2s_data_groups[] = { "gpio2", "gpio3", "gpio4" };
88+
static const char * const i2s1_clk_groups[] = { "gpio6" };
89+
static const char * const i2s1_ws_groups[] = { "gpio7" };
90+
static const char * const i2s1_data_groups[] = { "gpio8", "gpio9" };
91+
static const char * const wsa_swr_clk_groups[] = { "gpio10" };
92+
static const char * const wsa_swr_data_groups[] = { "gpio11" };
93+
static const char * const i2s2_data_groups[] = { "gpio12", "gpio12" };
94+
95+
static const struct lpi_pingroup sm8350_groups[] = {
96+
LPI_PINGROUP(0, 0, swr_tx_clk, qua_mi2s_sclk, _, _),
97+
LPI_PINGROUP(1, 2, swr_tx_data, qua_mi2s_ws, _, _),
98+
LPI_PINGROUP(2, 4, swr_tx_data, qua_mi2s_data, _, _),
99+
LPI_PINGROUP(3, 8, swr_rx_clk, qua_mi2s_data, _, _),
100+
LPI_PINGROUP(4, 10, swr_rx_data, qua_mi2s_data, _, _),
101+
LPI_PINGROUP(5, 12, swr_tx_data, swr_rx_data, _, _),
102+
LPI_PINGROUP(6, LPI_NO_SLEW, dmic1_clk, i2s1_clk, _, _),
103+
LPI_PINGROUP(7, LPI_NO_SLEW, dmic1_data, i2s1_ws, _, _),
104+
LPI_PINGROUP(8, LPI_NO_SLEW, dmic2_clk, i2s1_data, _, _),
105+
LPI_PINGROUP(9, LPI_NO_SLEW, dmic2_data, i2s1_data, _, _),
106+
LPI_PINGROUP(10, 16, i2s2_clk, wsa_swr_clk, _, _),
107+
LPI_PINGROUP(11, 18, i2s2_ws, wsa_swr_data, _, _),
108+
LPI_PINGROUP(12, LPI_NO_SLEW, dmic3_clk, i2s2_data, _, _),
109+
LPI_PINGROUP(13, LPI_NO_SLEW, dmic3_data, i2s2_data, _, _),
110+
LPI_PINGROUP(14, 6, swr_tx_data, _, _, _),
111+
};
112+
113+
static const struct lpi_function sm8350_functions[] = {
114+
LPI_FUNCTION(dmic1_clk),
115+
LPI_FUNCTION(dmic1_data),
116+
LPI_FUNCTION(dmic2_clk),
117+
LPI_FUNCTION(dmic2_data),
118+
LPI_FUNCTION(dmic3_clk),
119+
LPI_FUNCTION(dmic3_data),
120+
LPI_FUNCTION(i2s1_clk),
121+
LPI_FUNCTION(i2s1_data),
122+
LPI_FUNCTION(i2s1_ws),
123+
LPI_FUNCTION(i2s2_clk),
124+
LPI_FUNCTION(i2s2_data),
125+
LPI_FUNCTION(i2s2_ws),
126+
LPI_FUNCTION(qua_mi2s_data),
127+
LPI_FUNCTION(qua_mi2s_sclk),
128+
LPI_FUNCTION(qua_mi2s_ws),
129+
LPI_FUNCTION(swr_rx_clk),
130+
LPI_FUNCTION(swr_rx_data),
131+
LPI_FUNCTION(swr_tx_clk),
132+
LPI_FUNCTION(swr_tx_data),
133+
LPI_FUNCTION(wsa_swr_clk),
134+
LPI_FUNCTION(wsa_swr_data),
135+
};
136+
137+
static const struct lpi_pinctrl_variant_data sm8350_lpi_data = {
138+
.pins = sm8350_lpi_pins,
139+
.npins = ARRAY_SIZE(sm8350_lpi_pins),
140+
.groups = sm8350_groups,
141+
.ngroups = ARRAY_SIZE(sm8350_groups),
142+
.functions = sm8350_functions,
143+
.nfunctions = ARRAY_SIZE(sm8350_functions),
144+
};
145+
146+
static const struct of_device_id lpi_pinctrl_of_match[] = {
147+
{
148+
.compatible = "qcom,sm8350-lpass-lpi-pinctrl",
149+
.data = &sm8350_lpi_data,
150+
},
151+
{ }
152+
};
153+
MODULE_DEVICE_TABLE(of, lpi_pinctrl_of_match);
154+
155+
static struct platform_driver lpi_pinctrl_driver = {
156+
.driver = {
157+
.name = "qcom-sm8350-lpass-lpi-pinctrl",
158+
.of_match_table = lpi_pinctrl_of_match,
159+
},
160+
.probe = lpi_pinctrl_probe,
161+
.remove = lpi_pinctrl_remove,
162+
};
163+
module_platform_driver(lpi_pinctrl_driver);
164+
165+
MODULE_AUTHOR("Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>");
166+
MODULE_DESCRIPTION("QTI SM8350 LPI GPIO pin control driver");
167+
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)