From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758847AbdJQEgU (ORCPT ); Tue, 17 Oct 2017 00:36:20 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:37224 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910AbdJQEgR (ORCPT ); Tue, 17 Oct 2017 00:36:17 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B004D609A8 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=fenglinw@codeaurora.org Subject: Re: [PATCH V1 2/2] pinctrl: qcom: spmi-gpio: Set is_enabled flag in set_mux() To: Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , linux-gpio@vger.kernel.org, collinsd@codeaurora.org, aghayal@codeaurora.org, wruan@codeaurora.org, subbaram@codeaurora.org, kgunda@codeaurora.org References: <20171013061550.996-1-fenglinw@codeaurora.org> <20171013061550.996-3-fenglinw@codeaurora.org> <20171016222955.GQ1165@minitux> From: Fenglin Wu Message-ID: <78f23ed8-7e3e-ffc9-bdbe-e10622e0c757@codeaurora.org> Date: Tue, 17 Oct 2017 12:36:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171016222955.GQ1165@minitux> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/17/2017 6:29 AM, Bjorn Andersson wrote: > On Thu 12 Oct 23:15 PDT 2017, fenglinw@codeaurora.org wrote: > >> From: Fenglin Wu >> >> The initial value of is_enabled flag is read out from hardware in >> pmic_gpio_populate(), and it will be set in pmic_gpio_config_set() if >> pinconf is defined. For any GPIOs disabled initially in hardware which >> only have pinmux defined, they won't be enabled in pmic_gpio_set_mux() >> calling. So set is_enabled flag in set_mux() to ensure the GPIO module >> could be enabled in above case. >> > > I'm still interested in knowing when it is valid to configure a pin with > only mux, no config. I.e. in what cases does setting a alternative > function make the pinconfig not count. I agreed that any pins should be configured with pinmux as well as pinconf, but the driver doesn't prevent the case of only pinmux defined, right? I am not sure if this is valid case but it would happen: The hardware or the sw prior to linux kernel has the default setting of the function and config for one GPIO but we need to keep it disabled until the consumer request it, in this case, we just need to define the pinmux and ignore the pinconf definition in its device node. > > Regards, > Bjorn > >> Signed-off-by: Fenglin Wu >> --- >> drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c >> index 0a1e173..219c934 100644 >> --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c >> +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c >> @@ -312,6 +312,7 @@ static int pmic_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned function, >> } >> >> pad = pctldev->desc->pins[pin].drv_data; >> + pad->is_enabled = true; >> /* >> * Non-LV/MV subtypes only support 2 special functions, >> * offsetting the dtestx function values by 2 >> -- >> Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, >> a Linux Foundation Collaborative Project. >> > -- > To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.