From patchwork Thu Dec 18 20:59:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 5516131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 23F4B9F507 for ; Thu, 18 Dec 2014 21:06:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F4522035E for ; Thu, 18 Dec 2014 21:06:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2271F200E8 for ; Thu, 18 Dec 2014 21:06:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y1iFH-00067m-1Q; Thu, 18 Dec 2014 21:04:27 +0000 Received: from smtp.codeaurora.org ([198.145.11.231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y1iEl-0005qQ-Hk for linux-arm-kernel@lists.infradead.org; Thu, 18 Dec 2014 21:03:57 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 2213014006C; Thu, 18 Dec 2014 21:03:38 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 1459E14006B; Thu, 18 Dec 2014 21:03:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (rrcs-67-52-129-61.west.biz.rr.com [67.52.129.61]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: agross@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4ED5014006C; Thu, 18 Dec 2014 21:03:37 +0000 (UTC) From: Andy Gross To: Linus Walleij Subject: [PATCH 4/4] pinctrl: qcom: msm8960: Add multi copy support Date: Thu, 18 Dec 2014 14:59:55 -0600 Message-Id: <1418936395-14623-5-git-send-email-agross@codeaurora.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1418936395-14623-1-git-send-email-agross@codeaurora.org> References: <1418936395-14623-1-git-send-email-agross@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141218_130355_724233_9DACE24F X-CRM114-Status: GOOD ( 14.64 ) X-Spam-Score: -0.0 (/) Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Kumar Gala , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds multiple copy support for functions that can be mapped to more than one pin and that also require an additional mux configuration setting to work properly. Signed-off-by: Andy Gross --- .../bindings/pinctrl/qcom,msm8960-pinctrl.txt | 19 ++++++------ drivers/pinctrl/qcom/pinctrl-msm8960.c | 32 +++++++++++++++----- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,msm8960-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/qcom,msm8960-pinctrl.txt index eb8d8aa..c73ed5c 100644 --- a/Documentation/devicetree/bindings/pinctrl/qcom,msm8960-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/qcom,msm8960-pinctrl.txt @@ -103,15 +103,16 @@ to specify in a pin configuration subnode: gsbi12, hdmi_cec, hdmi_ddc_clock, hdmi_ddc_data, hdmi_hot_plug_detect, hsic, mdp_vsync, mi2s, mic_i2s, pmb_clk, pmb_ext_ctrl, ps_hold, rpm_wdog, sdc2, sdc4, sdc5, - slimbus1, slimbus2, spkr_i2s, ssbi1, ssbi2, ssbi_ext_gps, - ssbi_pmic2, ssbi_qpa1, ssbi_ts, tsif1, tsif2, ts_eoc, - usb_fs1, usb_fs1_oe, usb_fs1_oe_n, usb_fs2, usb_fs2_oe, - usb_fs2_oe_n, vfe_camif_timer1_a, vfe_camif_timer1_b, - vfe_camif_timer2, vfe_camif_timer3_a, vfe_camif_timer3_b, - vfe_camif_timer4_a, vfe_camif_timer4_b, vfe_camif_timer4_c, - vfe_camif_timer5_a, vfe_camif_timer5_b, vfe_camif_timer6_a, - vfe_camif_timer6_b, vfe_camif_timer6_c, vfe_camif_timer7_a, - vfe_camif_timer7_b, vfe_camif_timer7_c, wlan + slimbus1_a, slimbus1_b, slimbus2, spkr_i2s, ssbi1, ssbi2, + ssbi_ext_gps, ssbi_pmic2, ssbi_qpa1, ssbi_ts, tsif1, tsif2, + ts_eoc, usb_fs1, usb_fs1_oe, usb_fs1_oe_n, usb_fs2, + usb_fs2_oe, usb_fs2_oe_n, vfe_camif_timer1_a, + vfe_camif_timer1_b, vfe_camif_timer2, vfe_camif_timer3_a, + vfe_camif_timer3_b, vfe_camif_timer4_a, vfe_camif_timer4_b, + vfe_camif_timer4_c, vfe_camif_timer5_a, vfe_camif_timer5_b, + vfe_camif_timer6_a, vfe_camif_timer6_b, vfe_camif_timer6_c, + vfe_camif_timer7_a, vfe_camif_timer7_b, vfe_camif_timer7_c, + wlan - bias-disable: Usage: optional diff --git a/drivers/pinctrl/qcom/pinctrl-msm8960.c b/drivers/pinctrl/qcom/pinctrl-msm8960.c index ed23e36..39e76b9 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm8960.c +++ b/drivers/pinctrl/qcom/pinctrl-msm8960.c @@ -349,6 +349,16 @@ static const unsigned int sdc3_data_pins[] = { 157 }; .ngroups = ARRAY_SIZE(fname##_groups), \ } +#define FUNCTION_MULTI_COPY(fname, reg, value) \ + [MSM_MUX_##fname] = { \ + .name = #fname, \ + .groups = fname##_groups, \ + .ngroups = ARRAY_SIZE(fname##_groups), \ + .requires_copy_select = 1, \ + .copy_select_reg = reg, \ + .copy_select_value = value, \ + } + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11) \ { \ .name = "gpio" #id, \ @@ -487,7 +497,8 @@ enum msm8960_functions { MSM_MUX_sdc2, MSM_MUX_sdc4, MSM_MUX_sdc5, - MSM_MUX_slimbus1, + MSM_MUX_slimbus1_a, + MSM_MUX_slimbus1_b, MSM_MUX_slimbus2, MSM_MUX_spkr_i2s, MSM_MUX_ssbi1, @@ -824,8 +835,12 @@ static const char * const sdc5_groups[] = { "gpio77", "gpio78", "gpio79", "gpio80", "gpio81", "gpio82" }; -static const char * const slimbus1_groups[] = { - "gpio50", "gpio51", "gpio60", "gpio61" +static const char * const slimbus1_a_groups[] = { + "gpio60", "gpio61" +}; + +static const char * const slimbus1_b_groups[] = { + "gpio50", "gpio51", }; static const char * const slimbus2_groups[] = { @@ -1034,7 +1049,8 @@ static const struct msm_function msm8960_functions[] = { FUNCTION(sdc2), FUNCTION(sdc4), FUNCTION(sdc5), - FUNCTION(slimbus1), + FUNCTION_MULTI_COPY(slimbus1_a, 0x2074, 0), + FUNCTION_MULTI_COPY(slimbus1_b, 0x2074, 1), FUNCTION(slimbus2), FUNCTION(spkr_i2s), FUNCTION(ssbi1), @@ -1122,8 +1138,8 @@ static const struct msm_pingroup msm8960_groups[] = { PINGROUP(47, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), PINGROUP(48, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), PINGROUP(49, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(50, mi2s, slimbus1, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(51, mi2s, slimbus1, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(50, mi2s, slimbus1_b, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(51, mi2s, slimbus1_b, NA, NA, NA, NA, NA, NA, NA, NA, NA), PINGROUP(52, mi2s, gp_clk_2a, gsbi2_spi_cs1_n, NA, NA, NA, NA, NA, NA, NA, NA), PINGROUP(53, mi2s, gp_pdm_2b, NA, NA, NA, NA, NA, NA, NA, NA, NA), PINGROUP(54, codec_mic_i2s, gp_clk_0b, NA, NA, NA, NA, NA, NA, NA, NA, NA), @@ -1132,8 +1148,8 @@ static const struct msm_pingroup msm8960_groups[] = { PINGROUP(57, codec_mic_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), PINGROUP(58, codec_mic_i2s, gp_pdm_0a, NA, NA, NA, NA, NA, NA, NA, NA, NA), PINGROUP(59, codec_spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(60, slimbus1, codec_spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(61, slimbus1, codec_spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(60, slimbus1_a, codec_spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(61, slimbus1_a, codec_spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), PINGROUP(62, codec_spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), PINGROUP(63, audio_pcm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), PINGROUP(64, audio_pcm, gp_pdm_1b, NA, NA, NA, NA, NA, NA, NA, NA, NA),