From patchwork Wed Nov 16 10:57:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 625296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0AD0C4321E for ; Wed, 16 Nov 2022 11:11:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239061AbiKPLLt (ORCPT ); Wed, 16 Nov 2022 06:11:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239063AbiKPLL0 (ORCPT ); Wed, 16 Nov 2022 06:11:26 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 478A0391E3 for ; Wed, 16 Nov 2022 02:58:00 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id w14so29264185wru.8 for ; Wed, 16 Nov 2022 02:58:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7vf8KRZdfaBvO4jd1EX+JdbvILNoxMZbDz5Ji3A29tI=; b=N9Rus8uVvrCqYXjXYKEiZBPrZkRm0Z2wIN4i7a1+VNTCRpPgeNjjXJsnwy3rg3QL4k xNyKVy5wdEsQF5LZsRZLoH23MtmFhIlnSGwPFNltOFEUxd1Sah2XB0YT92y5VVjH6F2c xy/KmqBhHKK25SmD/SJbOGPYa4IdFlEFx0nnVVdBNE5LunGwKd+dvTpV+OnY6IoAd30n 18pjbhzB6IeTxIx7L4EEfQKdD40Jf+xVCs+pU4bT5P3DwN80KovhwJhgwEsPtOnwaeuh SjJtoEdLc6pBJ9mAQbbd924VegDnKkSDIqQdwria4X+5JzJJDQoVktvXq/yvzjgKHoxG XOoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7vf8KRZdfaBvO4jd1EX+JdbvILNoxMZbDz5Ji3A29tI=; b=EuHL0MnYOFgB+SOaQ5keARJO4s22HijznNI9QakHtuTKL0k1Z0jNM+RC0/0NDTQbN3 ceVYGWX5onb5bbwe1FAFnqQWsYEHxeEWjeZSglW+/n9HxcTP8wAyTp5E7/aY2FiGCssz tZDJysaVUNBMksoJTFObJrVmoK9w9AGlxp07wtaeYaNVn4sq5BNbKVN2BwWFhkXQ98/i d1A6reLhsb+U4hV2tpMKMApEX1YiWAllB5obR4DukNCrIHLGLbmmcqVa1dWYbgg5TusC CY6UNI1RiRP6iJyW3G8B4Rp65SWdMs1xtr7PL0G7KU/FGsa5c4COiyib+8Ucxo3J3Wiv h8/w== X-Gm-Message-State: ANoB5plp8xsL6OlgVv+BCVYxnvLEuYrPPvArfMjvn4cWVN4CkVFkTZWv zoMgq+3h1XOIw/gDNlutyRVb3Q== X-Google-Smtp-Source: AA0mqf7y4cjfVDGOHvxbpoFUe4ZU72zWjYeVhNGQF2F3ING41MFKWBvQ2SM72+cCUxfrX4+473dtJA== X-Received: by 2002:a5d:540c:0:b0:22c:e002:74c0 with SMTP id g12-20020a5d540c000000b0022ce00274c0mr14096606wrv.593.1668596278813; Wed, 16 Nov 2022 02:57:58 -0800 (PST) Received: from localhost.localdomain ([94.52.112.99]) by smtp.gmail.com with ESMTPSA id p13-20020adfe60d000000b00236e9755c02sm14935053wrm.111.2022.11.16.02.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 02:57:58 -0800 (PST) From: Abel Vesa To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Linus Walleij , Rob Herring , Krzysztof Kozlowski Cc: Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, "linux-gpio@vger.kernel.org" Subject: [PATCH 1/4] dt-bindings: pinctrl: qcom: Add SM8550 pinctrl bindings Date: Wed, 16 Nov 2022 12:57:21 +0200 Message-Id: <20221116105724.2600349-2-abel.vesa@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221116105724.2600349-1-abel.vesa@linaro.org> References: <20221116105724.2600349-1-abel.vesa@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Add device tree binding Documentation details for Qualcomm SM8550 TLMM device Signed-off-by: Abel Vesa --- .../bindings/pinctrl/qcom,sm8550-pinctrl.yaml | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,sm8550-pinctrl.yaml diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,sm8550-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,sm8550-pinctrl.yaml new file mode 100644 index 000000000000..4c5a8b78315b --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/qcom,sm8550-pinctrl.yaml @@ -0,0 +1,184 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/qcom,sm8550-pinctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. SM8550 TLMM block + +maintainers: + - Abel Vesa + +description: | + This binding describes the Top Level Mode Multiplexer (TLMM) block found + in the SM8550 platform. + +allOf: + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# + +properties: + compatible: + const: qcom,sm8550-tlmm + + reg: + maxItems: 1 + + interrupts: true + interrupt-controller: true + '#interrupt-cells': true + gpio-controller: true + + gpio-reserved-ranges: + minItems: 1 + maxItems: 105 + + gpio-line-names: + maxItems: 209 + + '#gpio-cells': true + gpio-ranges: true + wakeup-parent: true + +required: + - compatible + - reg + +additionalProperties: false + +patternProperties: + '-state$': + oneOf: + - $ref: "#/$defs/qcom-sm8550-tlmm-state" + - patternProperties: + "-pins$": + $ref: "#/$defs/qcom-sm8550-tlmm-state" + additionalProperties: false + + "^.+-hog(-[0-9]+)?$": + type: object + properties: + gpio-hog: true + gpios: true + input: true + output-high: true + output-low: true + line-name: true + +$defs: + qcom-sm8550-tlmm-state: + type: object + description: + Pinctrl node's client devices use subnodes for desired pin configuration. + Client device subnodes use below standard properties. + + 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-9][0-9]|20[0-9])$" + - enum: [ ufs_reset, sdc2_clk, sdc2_cmd, sdc2_data ] + minItems: 1 + maxItems: 36 + + function: + description: + Specify the alternative function to be configured for the specified + pins. + enum: [ aon_cci, aoss_cti, atest_char, atest_usb, + audio_ext_mclk0, audio_ext_mclk1, audio_ref_clk, + cam_aon_mclk4, cam_mclk, cci_async_in, cci_i2c_scl, + cci_i2c_sda, cci_timer, cmu_rng, coex_uart1_rx, + coex_uart1_tx, coex_uart2_rx, coex_uart2_tx, + cri_trng, dbg_out_clk, ddr_bist_complete, + ddr_bist_fail, ddr_bist_start, ddr_bist_stop, + ddr_pxi0, ddr_pxi1, ddr_pxi2, ddr_pxi3, dp_hot, + gcc_gp1, gcc_gp2, gcc_gp3, gpio, i2chub0_se0, + i2chub0_se1, i2chub0_se2, i2chub0_se3, i2chub0_se4, + i2chub0_se5, i2chub0_se6, i2chub0_se7, i2chub0_se8, + i2chub0_se9, i2s0_data0, i2s0_data1, i2s0_sck, + i2s0_ws, i2s1_data0, i2s1_data1, i2s1_sck, i2s1_ws, + ibi_i3c, jitter_bist, mdp_vsync, mdp_vsync0_out, + mdp_vsync1_out, mdp_vsync2_out, mdp_vsync3_out, + mdp_vsync_e, nav_gpio0, nav_gpio1, nav_gpio2, + pcie0_clk_req_n, pcie1_clk_req_n, phase_flag, + pll_bist_sync, pll_clk_aux, prng_rosc0, prng_rosc1, + prng_rosc2, prng_rosc3, qdss_cti, qdss_gpio, + qlink0_enable, qlink0_request, qlink0_wmss, + qlink1_enable, qlink1_request, qlink1_wmss, + qlink2_enable, qlink2_request, qlink2_wmss, + qspi0, qspi1, qspi2, qspi3, qspi_clk, qspi_cs, + qup1_se0, qup1_se1, qup1_se2, qup1_se3, qup1_se4, + qup1_se5, qup1_se6, qup1_se7, qup2_se0, + qup2_se0_l0_mira, qup2_se0_l0_mirb, qup2_se0_l1_mira, + qup2_se0_l1_mirb, qup2_se0_l2_mira, qup2_se0_l2_mirb, + qup2_se0_l3_mira, qup2_se0_l3_mirb, qup2_se1, + qup2_se2, qup2_se3, qup2_se4, qup2_se5, qup2_se6, + qup2_se7, sd_write_protect, sdc40, sdc41, sdc42, + sdc43, sdc4_clk, sdc4_cmd, tb_trig_sdc2, tb_trig_sdc4, + tgu_ch0_trigout, tgu_ch1_trigout, tgu_ch2_trigout, + tgu_ch3_trigout, tmess_prng0, tmess_prng1, tmess_prng2, + tmess_prng3, tsense_pwm1, tsense_pwm2, tsense_pwm3, + uim0_clk, uim0_data, uim0_present, uim0_reset, + uim1_clk, uim1_data, uim1_present, uim1_reset, + usb1_hs, usb_phy, vfr_0, vfr_1, vsense_trigger_mirnat ] + + bias-disable: true + bias-pull-down: true + bias-pull-up: true + drive-strength: true + input-enable: true + output-high: true + output-low: true + qcom,i2c-pull: true + + required: + - pins + + allOf: + - $ref: "qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state" + - if: + properties: + pins: + pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9]|20[0-9])$" + then: + required: + - function + + additionalProperties: false + +examples: + - | + #include + pinctrl@f100000 { + compatible = "qcom,sm8550-tlmm"; + reg = <0x0f100000 0x300000>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&tlmm 0 0 211>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; + + gpio-wo-state { + pins = "gpio1"; + function = "gpio"; + }; + + uart-w-state { + rx-pins { + pins = "gpio26"; + function = "qup2_se7"; + bias-pull-up; + }; + + tx-pins { + pins = "gpio27"; + function = "qup2_se7"; + bias-disable; + }; + }; + }; +... From patchwork Wed Nov 16 10:57:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 625295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13668C3A59F for ; Wed, 16 Nov 2022 11:11:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239094AbiKPLLv (ORCPT ); Wed, 16 Nov 2022 06:11:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233007AbiKPLL2 (ORCPT ); Wed, 16 Nov 2022 06:11:28 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A60E23E08B for ; Wed, 16 Nov 2022 02:58:02 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id l14so29286599wrw.2 for ; Wed, 16 Nov 2022 02:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DAzQ5VogwJoLM/PM812FxjEr23ojJfulgqhylS8RB/4=; b=du6z2HXCGLOd50YcDKiIkpDXlZWW4NN/hQ4ghIy/UBXT+OiDecIiR8HqXY+w9ENgi5 6ezFesUKmEk0OGql+o6Dol7DkdHRJG40LluRYx0NvvPtP9wq8NtPaaiSPLV4pZHphMXQ DWo17mvj5u50wWXcilbGNi18syV2vumeFLBStOVOtLz4esp08vZ/DDQsGPLhwsrWKyuT Tudf1Y1XkeJFx0XFCogp2HF0d9M9EumJcx+OB9QaE5zoVvomPIyjUwzb22vsFJdjm2nr p6soSP4TFH5cpUX4PmizPH93ztTD7sbi9jNqBSeary0tU38mGScKPWJndVo17P97lXgN GWiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DAzQ5VogwJoLM/PM812FxjEr23ojJfulgqhylS8RB/4=; b=ASctldarJsLJkcmmacu+mXbydZq2JGXKCmYUsR4PrI8XkozdEpKBrJHeajL751YFtX OhGTwV+YcKn8kArPHWQU7QNU11afjR3TGAcQM1nT4Rx0PEv5mjSv8xkhiak6WI/OKUd8 TfG/5PYuTvI0BD/QneEHn6XlhWl0kcp//tyX7yCNX7ys6OvoLiKkYOXh8BT6gm4h2f/0 a0flvRGObFaDu/k8dsi5LPp1amKOxCJeiVyXcs4XpKE/Tc0k8k4UaU2gOPhnpJSqpZ9I y0p3dBr6n3Ytg/z+uXvLAYfi7S2ehCRu+gxmhJsFUa9YaV2dU5UZF3qRMACifoVAQo5E 5/tg== X-Gm-Message-State: ANoB5pnbGhL0tR+5+Fx+APhm0ZNxkVxmJY0A5ZYqV1lFZmXPHKzgG7bP lkSA2Ro4/s69//fUVNuCCw1SlBVgiH+22Q== X-Google-Smtp-Source: AA0mqf5mRpvjlTZwA5aXvgYUPTW0++QM93WGLr/rBYVjgvB8DwbSzx8YSicuntUWbaKjqQdLSVtqxQ== X-Received: by 2002:a5d:6412:0:b0:236:651d:60cb with SMTP id z18-20020a5d6412000000b00236651d60cbmr13480874wru.474.1668596281160; Wed, 16 Nov 2022 02:58:01 -0800 (PST) Received: from localhost.localdomain ([94.52.112.99]) by smtp.gmail.com with ESMTPSA id p13-20020adfe60d000000b00236e9755c02sm14935053wrm.111.2022.11.16.02.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 02:58:00 -0800 (PST) From: Abel Vesa To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Linus Walleij , Rob Herring , Krzysztof Kozlowski Cc: Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, "linux-gpio@vger.kernel.org" , Neil Armstrong Subject: [PATCH 3/4] pinctrl: qcom: add support for i2c specific pull feature Date: Wed, 16 Nov 2022 12:57:23 +0200 Message-Id: <20221116105724.2600349-4-abel.vesa@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221116105724.2600349-1-abel.vesa@linaro.org> References: <20221116105724.2600349-1-abel.vesa@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Neil Armstrong Add support for the new i2c_pull property introduced for SM8550 setting a I2C specific pull mode on I2C able pins. Signed-off-by: Neil Armstrong --- drivers/pinctrl/qcom/pinctrl-msm.c | 20 ++++++++++++++++++++ drivers/pinctrl/qcom/pinctrl-msm.h | 1 + 2 files changed, 21 insertions(+) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index 8fbb953c4bbe..f92082c1c805 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -83,6 +83,12 @@ struct msm_pinctrl { u32 phys_base[MAX_NR_TILES]; }; +#define PIN_CONFIG_QCOM_I2C_PULL (PIN_CONFIG_END + 1) + +static const struct pinconf_generic_params msm_pinconf_custom_bindings[] = { + {"qcom,i2c-pull", PIN_CONFIG_END + 1, 0}, +}; + #define MSM_ACCESSOR(name) \ static u32 msm_readl_##name(struct msm_pinctrl *pctrl, \ const struct msm_pingroup *g) \ @@ -324,6 +330,12 @@ static int msm_config_reg(struct msm_pinctrl *pctrl, *bit = g->oe_bit; *mask = 1; break; + case PIN_CONFIG_QCOM_I2C_PULL: + if (g->i2c_pull_bit == 0) + return -EOPNOTSUPP; + *bit = g->i2c_pull_bit; + *mask = 1; + break; default: return -ENOTSUPP; } @@ -415,6 +427,9 @@ static int msm_config_group_get(struct pinctrl_dev *pctldev, return -EINVAL; arg = 1; break; + case PIN_CONFIG_QCOM_I2C_PULL: + arg = 1; + break; default: return -ENOTSUPP; } @@ -498,6 +513,9 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev, /* disable output */ arg = 0; break; + case PIN_CONFIG_QCOM_I2C_PULL: + arg = 1; + break; default: dev_err(pctrl->dev, "Unsupported config parameter: %x\n", param); @@ -1495,6 +1513,8 @@ int msm_pinctrl_probe(struct platform_device *pdev, pctrl->desc.name = dev_name(&pdev->dev); pctrl->desc.pins = pctrl->soc->pins; pctrl->desc.npins = pctrl->soc->npins; + pctrl->desc.custom_params = msm_pinconf_custom_bindings; + pctrl->desc.num_custom_params = ARRAY_SIZE(msm_pinconf_custom_bindings); pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &pctrl->desc, pctrl); if (IS_ERR(pctrl->pctrl)) { diff --git a/drivers/pinctrl/qcom/pinctrl-msm.h b/drivers/pinctrl/qcom/pinctrl-msm.h index 05a1209bf9ae..985eceda2517 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.h +++ b/drivers/pinctrl/qcom/pinctrl-msm.h @@ -80,6 +80,7 @@ struct msm_pingroup { unsigned pull_bit:5; unsigned drv_bit:5; + unsigned i2c_pull_bit:5; unsigned od_bit:5; unsigned egpio_enable:5;