Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git

This commit is contained in:
Stephen Rothwell 2024-12-20 14:42:52 +11:00
commit 858de01436
10 changed files with 1851 additions and 18 deletions

View File

@ -79,8 +79,8 @@ $defs:
qdss_cti_trig_out_b0, qdss_cti_trig_in_b1, qdss_cti_trig_out_b1,
qdss_traceclk_a, qdss_tracectl_a, qdss_tracedata_a, qspi_clk,
qspi_cs, qspi_data, resout, rx0, rx1, rx2, sdc_clk, sdc_cmd,
sdc_data, spi0, spi1, spi10, spi11, tsens_max, uart0, uart1,
wci_txd, wci_rxd, wsi_clk, wsi_data ]
sdc_data, spi0_cs, spi0_clk, spi0_miso, spi0_mosi, spi1, spi10,
spi11, tsens_max, uart0, uart1, wci_txd, wci_rxd, wsi_clk, wsi_data ]
required:
- pins

View File

@ -0,0 +1,160 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/qcom,msm8917-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm MSM8917 TLMM pin controller
maintainers:
- Barnabas Czeman <barnabas.czeman@mainlining.org>
description:
Top Level Mode Multiplexer pin controller in Qualcomm MSM8917 SoC.
properties:
compatible:
const: qcom,msm8917-pinctrl
reg:
maxItems: 1
interrupts:
maxItems: 1
gpio-reserved-ranges:
minItems: 1
maxItems: 66
gpio-line-names:
maxItems: 134
patternProperties:
"-state$":
oneOf:
- $ref: "#/$defs/qcom-msm8917-tlmm-state"
- patternProperties:
"-pins$":
$ref: "#/$defs/qcom-msm8917-tlmm-state"
additionalProperties: false
$defs:
qcom-msm8917-tlmm-state:
type: object
description:
Pinctrl node's client devices use subnodes for desired pin configuration.
Client device subnodes use below standard properties.
$ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
unevaluatedProperties: false
properties:
pins:
description:
List of gpio pins affected by the properties specified in this
subnode.
items:
oneOf:
- pattern: "^gpio([0-9]|[1-9][0-9]|1[0-2][0-9]|13[0-3])$"
- enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc1_rclk, sdc2_clk,
sdc2_cmd, sdc2_data, qdsd_clk, qdsd_cmd, qdsd_data0,
qdsd_data1, qdsd_data2, qdsd_data3 ]
minItems: 1
maxItems: 16
function:
description:
Specify the alternative function to be configured for the specified
pins.
enum: [ accel_int, adsp_ext, alsp_int, atest_bbrx0, atest_bbrx1,
atest_char, atest_char0, atest_char1, atest_char2,
atest_char3, atest_combodac_to_gpio_native,
atest_gpsadc_dtest0_native, atest_gpsadc_dtest1_native,
atest_tsens, atest_wlan0, atest_wlan1, audio_ref,
audio_reset, bimc_dte0, bimc_dte1, blsp6_spi, blsp8_spi,
blsp_i2c1, blsp_i2c2, blsp_i2c3, blsp_i2c4, blsp_i2c5,
blsp_i2c6, blsp_i2c7, blsp_i2c8, blsp_spi1, blsp_spi2,
blsp_spi3, blsp_spi4, blsp_spi5, blsp_spi6, blsp_spi7,
blsp_spi8, blsp_uart1, blsp_uart2, blsp_uart3, blsp_uart4,
blsp_uart5, blsp_uart6, blsp_uart7, blsp_uart8, cam0_ldo,
cam1_rst, cam1_standby, cam2_rst, cam2_standby, cam_mclk,
cci_async, cci_i2c, cci_timer0, cci_timer1, cdc_pdm0,
codec_int1, codec_int2, codec_mad, coex_uart, cri_trng,
cri_trng0, cri_trng1, dbg_out, dmic0_clk, dmic0_data,
ebi_cdc, ebi_ch0, ext_lpass, forced_usb, fp_gpio, fp_int,
gcc_gp1_clk_a, gcc_gp1_clk_b, gcc_gp2_clk_a, gcc_gp2_clk_b,
gcc_gp3_clk_a, gcc_gp3_clk_b, gcc_plltest, gcc_tlmm, gpio,
gsm0_tx, key_focus, key_snapshot, key_volp, ldo_en,
ldo_update, lpass_slimbus, lpass_slimbus0, lpass_slimbus1,
m_voc, mag_int, mdp_vsync, mipi_dsi0, modem_tsync, nav_pps,
nav_pps_in_a, nav_pps_in_b, nav_tsync, nfc_pwr, ov_ldo,
pa_indicator, pbs0, pbs1, pbs2, pri_mi2s, pri_mi2s_mclk_a,
pri_mi2s_mclk_b, pri_mi2s_ws, prng_rosc,
pwr_crypto_enabled_a, pwr_crypto_enabled_b,
pwr_modem_enabled_a, pwr_modem_enabled_b, pwr_nav_enabled_a,
pwr_nav_enabled_b, qdss_cti_trig_in_a0, qdss_cti_trig_in_a1,
qdss_cti_trig_in_b0, qdss_cti_trig_in_b1,
qdss_cti_trig_out_a0, qdss_cti_trig_out_a1,
qdss_cti_trig_out_b0, qdss_cti_trig_out_b1, qdss_traceclk_a,
qdss_traceclk_b, qdss_tracectl_a, qdss_tracectl_b,
qdss_tracedata_a, qdss_tracedata_b, sd_write, sdcard_det,
sec_mi2s, sec_mi2s_mclk_a, sec_mi2s_mclk_b, sensor_rst,
smb_int, ssbi_wtr1, ts_resout, ts_sample, uim1_clk,
uim1_data, uim1_present, uim1_reset, uim2_clk, uim2_data,
uim2_present, uim2_reset, uim_batt, us_emitter, us_euro,
wcss_bt, wcss_fm, wcss_wlan, wcss_wlan0, wcss_wlan1,
wcss_wlan2, webcam_rst, webcam_standby, wsa_io, wsa_irq ]
required:
- pins
allOf:
- $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
tlmm: pinctrl@1000000 {
compatible = "qcom,msm8917-pinctrl";
reg = <0x01000000 0x300000>;
interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
gpio-controller;
gpio-ranges = <&tlmm 0 0 134>;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
blsp1-uart2-sleep-state {
pins = "gpio4", "gpio5";
function = "gpio";
drive-strength = <2>;
bias-pull-down;
};
spi1-default-state {
spi-pins {
pins = "gpio0", "gpio1", "gpio3";
function = "blsp_spi1";
drive-strength = <12>;
bias-disable;
};
cs-pins {
pins = "gpio2";
function = "gpio";
drive-strength = <16>;
bias-disable;
output-high;
};
};
};

View File

@ -6,6 +6,7 @@ menuconfig ARCH_MXC
select CLKSRC_IMX_GPT
select GENERIC_IRQ_CHIP
select GPIOLIB
select PINCTRL
select PM_OPP if PM
select SOC_BUS
select SRAM

View File

@ -438,9 +438,9 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct,
* - Any spurious wake up event during switch sequence to be ignored and
* cleared
*/
static void nmk_gpio_glitch_slpm_init(unsigned int *slpm)
static int nmk_gpio_glitch_slpm_init(unsigned int *slpm)
{
int i;
int i, j, ret;
for (i = 0; i < NMK_MAX_BANKS; i++) {
struct nmk_gpio_chip *chip = nmk_gpio_chips[i];
@ -449,11 +449,21 @@ static void nmk_gpio_glitch_slpm_init(unsigned int *slpm)
if (!chip)
break;
clk_enable(chip->clk);
ret = clk_enable(chip->clk);
if (ret) {
for (j = 0; j < i; j++) {
chip = nmk_gpio_chips[j];
clk_disable(chip->clk);
}
return ret;
}
slpm[i] = readl(chip->addr + NMK_GPIO_SLPC);
writel(temp, chip->addr + NMK_GPIO_SLPC);
}
return 0;
}
static void nmk_gpio_glitch_slpm_restore(unsigned int *slpm)
@ -923,7 +933,9 @@ static int nmk_pmx_set(struct pinctrl_dev *pctldev, unsigned int function,
slpm[nmk_chip->bank] &= ~BIT(bit);
}
nmk_gpio_glitch_slpm_init(slpm);
ret = nmk_gpio_glitch_slpm_init(slpm);
if (ret)
goto out_pre_slpm_init;
}
for (i = 0; i < g->grp.npins; i++) {
@ -940,7 +952,10 @@ static int nmk_pmx_set(struct pinctrl_dev *pctldev, unsigned int function,
dev_dbg(npct->dev, "setting pin %d to altsetting %d\n",
g->grp.pins[i], g->altsetting);
clk_enable(nmk_chip->clk);
ret = clk_enable(nmk_chip->clk);
if (ret)
goto out_glitch;
/*
* If the pin is switching to altfunc, and there was an
* interrupt installed on it which has been lazy disabled,
@ -988,6 +1003,7 @@ static int nmk_gpio_request_enable(struct pinctrl_dev *pctldev,
struct nmk_gpio_chip *nmk_chip;
struct gpio_chip *chip;
unsigned int bit;
int ret;
if (!range) {
dev_err(npct->dev, "invalid range\n");
@ -1004,7 +1020,9 @@ static int nmk_gpio_request_enable(struct pinctrl_dev *pctldev,
find_nmk_gpio_from_pin(pin, &bit);
clk_enable(nmk_chip->clk);
ret = clk_enable(nmk_chip->clk);
if (ret)
return ret;
/* There is no glitch when converting any pin to GPIO */
__nmk_gpio_set_mode(nmk_chip, bit, NMK_GPIO_ALT_GPIO);
clk_disable(nmk_chip->clk);
@ -1058,6 +1076,7 @@ static int nmk_pin_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long cfg;
int pull, slpm, output, val, i;
bool lowemi, gpiomode, sleep;
int ret;
nmk_chip = find_nmk_gpio_from_pin(pin, &bit);
if (!nmk_chip) {
@ -1116,7 +1135,9 @@ static int nmk_pin_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
output ? (val ? "high" : "low") : "",
lowemi ? "on" : "off");
clk_enable(nmk_chip->clk);
ret = clk_enable(nmk_chip->clk);
if (ret)
return ret;
if (gpiomode)
/* No glitch when going to GPIO mode */
__nmk_gpio_set_mode(nmk_chip, bit, NMK_GPIO_ALT_GPIO);

View File

@ -3699,7 +3699,7 @@ static void ingenic_gpio_irq_print_chip(struct irq_data *data, struct seq_file *
{
struct gpio_chip *gpio_chip = irq_data_get_irq_chip_data(data);
seq_printf(p, "%s", gpio_chip->label);
seq_puts(p, gpio_chip->label);
}
static const struct irq_chip ingenic_gpio_irqchip = {

View File

@ -86,6 +86,7 @@ const struct regmap_config mcp23x08_regmap = {
.num_reg_defaults = ARRAY_SIZE(mcp23x08_defaults),
.cache_type = REGCACHE_FLAT,
.max_register = MCP_OLAT,
.disable_locking = true, /* mcp->lock protects the regmap */
};
EXPORT_SYMBOL_GPL(mcp23x08_regmap);
@ -132,6 +133,7 @@ const struct regmap_config mcp23x17_regmap = {
.num_reg_defaults = ARRAY_SIZE(mcp23x17_defaults),
.cache_type = REGCACHE_FLAT,
.val_format_endian = REGMAP_ENDIAN_LITTLE,
.disable_locking = true, /* mcp->lock protects the regmap */
};
EXPORT_SYMBOL_GPL(mcp23x17_regmap);
@ -228,7 +230,9 @@ static int mcp_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
switch (param) {
case PIN_CONFIG_BIAS_PULL_UP:
mutex_lock(&mcp->lock);
ret = mcp_read(mcp, MCP_GPPU, &data);
mutex_unlock(&mcp->lock);
if (ret < 0)
return ret;
status = (data & BIT(pin)) ? 1 : 0;
@ -257,7 +261,9 @@ static int mcp_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
switch (param) {
case PIN_CONFIG_BIAS_PULL_UP:
mutex_lock(&mcp->lock);
ret = mcp_set_bit(mcp, MCP_GPPU, pin, arg);
mutex_unlock(&mcp->lock);
break;
default:
dev_dbg(mcp->dev, "Invalid config param %04x\n", param);

View File

@ -137,6 +137,12 @@ config PINCTRL_MSM8916
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
Qualcomm TLMM block found on the Qualcomm 8916 platform.
config PINCTRL_MSM8917
tristate "Qualcomm 8917 pin controller driver"
help
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
Qualcomm TLMM block found on the Qualcomm MSM8917 platform.
config PINCTRL_MSM8953
tristate "Qualcomm 8953 pin controller driver"
depends on ARM64 || COMPILE_TEST

View File

@ -17,6 +17,7 @@ obj-$(CONFIG_PINCTRL_MSM8960) += pinctrl-msm8960.o
obj-$(CONFIG_PINCTRL_MSM8X74) += pinctrl-msm8x74.o
obj-$(CONFIG_PINCTRL_MSM8909) += pinctrl-msm8909.o
obj-$(CONFIG_PINCTRL_MSM8916) += pinctrl-msm8916.o
obj-$(CONFIG_PINCTRL_MSM8917) += pinctrl-msm8917.o
obj-$(CONFIG_PINCTRL_MSM8953) += pinctrl-msm8953.o
obj-$(CONFIG_PINCTRL_MSM8976) += pinctrl-msm8976.o
obj-$(CONFIG_PINCTRL_MSM8994) += pinctrl-msm8994.o

View File

@ -233,7 +233,10 @@ enum ipq5424_functions {
msm_mux_sdc_clk,
msm_mux_sdc_cmd,
msm_mux_sdc_data,
msm_mux_spi0,
msm_mux_spi0_clk,
msm_mux_spi0_cs,
msm_mux_spi0_miso,
msm_mux_spi0_mosi,
msm_mux_spi1,
msm_mux_spi10,
msm_mux_spi11,
@ -297,8 +300,8 @@ static const char * const qspi_clk_groups[] = {
"gpio5",
};
static const char * const spi0_groups[] = {
"gpio6", "gpio7", "gpio8", "gpio9",
static const char * const spi0_clk_groups[] = {
"gpio6",
};
static const char * const pwm1_groups[] = {
@ -315,14 +318,26 @@ static const char * const qdss_tracedata_a_groups[] = {
"gpio38", "gpio39",
};
static const char * const spi0_cs_groups[] = {
"gpio7",
};
static const char * const cri_trng1_groups[] = {
"gpio7",
};
static const char * const spi0_miso_groups[] = {
"gpio8",
};
static const char * const cri_trng2_groups[] = {
"gpio8",
};
static const char * const spi0_mosi_groups[] = {
"gpio9",
};
static const char * const cri_trng3_groups[] = {
"gpio9",
};
@ -680,7 +695,10 @@ static const struct pinfunction ipq5424_functions[] = {
MSM_PIN_FUNCTION(sdc_clk),
MSM_PIN_FUNCTION(sdc_cmd),
MSM_PIN_FUNCTION(sdc_data),
MSM_PIN_FUNCTION(spi0),
MSM_PIN_FUNCTION(spi0_clk),
MSM_PIN_FUNCTION(spi0_cs),
MSM_PIN_FUNCTION(spi0_miso),
MSM_PIN_FUNCTION(spi0_mosi),
MSM_PIN_FUNCTION(spi1),
MSM_PIN_FUNCTION(spi10),
MSM_PIN_FUNCTION(spi11),
@ -700,10 +718,10 @@ static const struct msm_pingroup ipq5424_groups[] = {
PINGROUP(3, sdc_data, qspi_data, pwm2, _, _, _, _, _, _),
PINGROUP(4, sdc_cmd, qspi_cs, _, _, _, _, _, _, _),
PINGROUP(5, sdc_clk, qspi_clk, _, _, _, _, _, _, _),
PINGROUP(6, spi0, pwm1, _, cri_trng0, qdss_tracedata_a, _, _, _, _),
PINGROUP(7, spi0, pwm1, _, cri_trng1, qdss_tracedata_a, _, _, _, _),
PINGROUP(8, spi0, pwm1, wci_txd, wci_rxd, _, cri_trng2, qdss_tracedata_a, _, _),
PINGROUP(9, spi0, pwm1, _, cri_trng3, qdss_tracedata_a, _, _, _, _),
PINGROUP(6, spi0_clk, pwm1, _, cri_trng0, qdss_tracedata_a, _, _, _, _),
PINGROUP(7, spi0_cs, pwm1, _, cri_trng1, qdss_tracedata_a, _, _, _, _),
PINGROUP(8, spi0_miso, pwm1, wci_txd, wci_rxd, _, cri_trng2, qdss_tracedata_a, _, _),
PINGROUP(9, spi0_mosi, pwm1, _, cri_trng3, qdss_tracedata_a, _, _, _, _),
PINGROUP(10, uart0, pwm0, spi11, _, wci_txd, wci_rxd, _, qdss_tracedata_a, _),
PINGROUP(11, uart0, pwm0, spi1, _, wci_txd, wci_rxd, _, qdss_tracedata_a, _),
PINGROUP(12, uart0, pwm0, spi11, _, prng_rosc0, qdss_tracedata_a, _, _, _),

File diff suppressed because it is too large Load Diff