Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp834600imm; Mon, 1 Oct 2018 20:50:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV61pPf1bbn+y8F7JIRzxO++kDx/c8nPCvliwUz0xLm3XnGl2tr0Z/3wESQhL1XnzQpOV7rqa X-Received: by 2002:a17:902:c6:: with SMTP id a64-v6mr14809996pla.180.1538452243310; Mon, 01 Oct 2018 20:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538452243; cv=none; d=google.com; s=arc-20160816; b=OhOHlW66gzimlf6/SdvVjtzOH+YAjIMnGAAU4mmua943OIdMilF6z44JTklXb2amGd 4ZacIzdpkFGgW/r3FhWkAaYd7em0T3HcsMyR8BwMiQHl0Y+7MPqTQGDlSQOkCIiPHdAl xuvvFmMnHUOsBv8Ymph6grHgVFsUx31fkFRyglSDzOWHtzQEmNfKIZOG4YVX/XGOSem9 7Mp5+kIeojk8YzZm585957op3KwcrXTsov4p6nDdWSirkgTREAP0pVdFJEsmlvDV688E tqCFYlXdISh9q6bBgQYJDFy9vWxxIG3Hyh/K7RseotH+75JKfbb2zic8C/rz7D84825f 1b5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=v9Eqvx1jsn/JeXURoYS+mFE1D6zTcDXe3g4w2LJnyB0=; b=d2mFknrIvCqJ78CIpmo+TODW3m0C1mFoAvX0FLttb8tjGV2Owu/Zt2Nt81z1yGUTa9 GWGAJ0Bap7Hkii+g8J1Wh8y5zkLX1FAK4o2k6S9lYVasXw9fw2utwRz2zNwZAZ+UmJIG KoC/OvSYHw/cR+KCRzxBeO5U7ANTqZS1GgFvyrte20YMNX0OCe3wBUzKrE0sdFUAfw3h Ux6Dsqqu/Oz5XGMLy28ALBGuoed/OPl1KnaazfEgzlJLE5Q3PzeHjUs4lL5ZIzMkIqGi 8rWXrXEG2GTEv07E9THCoXZn3Gjy2KEjNM42T3EzHcm7y9b2eUfrKBhTqfe/iTUTcLcf KBZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="S/9ihYxg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7-v6si13113756pgj.443.2018.10.01.20.50.28; Mon, 01 Oct 2018 20:50:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="S/9ihYxg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726989AbeJBKbU (ORCPT + 99 others); Tue, 2 Oct 2018 06:31:20 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:36889 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726785AbeJBKbT (ORCPT ); Tue, 2 Oct 2018 06:31:19 -0400 Received: by mail-io1-f68.google.com with SMTP id v14-v6so834948iob.4 for ; Mon, 01 Oct 2018 20:50:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=v9Eqvx1jsn/JeXURoYS+mFE1D6zTcDXe3g4w2LJnyB0=; b=S/9ihYxgcKbznyaedaPooWJ5vIMhEp0YOzzYXh1AP8Fbqhz+sDZxq78z5KCBgkZuVF i7JACpAfeOaUK/ttilsMhim0M/ZxKIhPN0TJgwgUCtWtR60emWi1+fJt8Z4sFd+EOv+K soJRIwgWbnk6T6EK31nxCtvCKCwt8how3t2QI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=v9Eqvx1jsn/JeXURoYS+mFE1D6zTcDXe3g4w2LJnyB0=; b=YHfBnZ3MQK0+BvRo6DQ0nWnudn4Xi0KICBCe5nizABg9mOPyyKxodlVBgkrrTLarH7 M9ITBIbyl2EgcgTQSSogu67oAoVLCCB9TOdodaNclR3pRQIQ9Wb72T4I5KQFmAviYRur 1DL6pvYzCIGXSegnC9TtFUWwE0ax69rqxFRvmNJsLVxr1jJUmExJmGSRetBA6Tsvyk1X EYmGQB/AfaXMbfgi1sQ4+fvsR8LCv3dGBSniwJE9yIGAmHzNOWnyG4g+EnzSza/mKr7d 4RYM1lzbNa6TAq3qmX/2Y+NqvL7UsO3Cs5EqLoLwX5As1rIEM+5X04OEAWdMZLivquFC Ph0g== X-Gm-Message-State: ABuFfohkTg3lMlrgCJE4Q1EmJBD95VrbHeg7oeVJP/W0AQAk5XrriVlb tSYJO2Rhp1CzNPx2WNmrXIs3Rg== X-Received: by 2002:a62:cac4:: with SMTP id y65-v6mr14309812pfk.27.1538452213490; Mon, 01 Oct 2018 20:50:13 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id q24-v6sm36869742pfi.165.2018.10.01.20.50.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Oct 2018 20:50:12 -0700 (PDT) Date: Mon, 1 Oct 2018 20:50:10 -0700 From: Bjorn Andersson To: Stephen Boyd Cc: Linus Walleij , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, Doug Anderson , Niklas Cassel Subject: Re: [PATCH] pinctrl: msm: Actually use function 0 for gpio selection Message-ID: <20181002035010.GB5008@tuxbook-pro> References: <20181001214905.12149-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181001214905.12149-1-swboyd@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 01 Oct 14:49 PDT 2018, Stephen Boyd wrote: > This code needs to select function #0, which is the first int in the > array of functions, not the number 0 which may or may not be the > function for "GPIO mode" per the enum mapping. We were getting lucky on > SDM845, where this was tested, because the function 0 matched the enum > value for "GPIO mode". On other platforms, e.g. MSM8996, the gpio enum > value is the last one in the list so this code doesn't work and we see a > warning at boot. Fix it by grabbing the first element out of the array > of functions. > > Cc: Doug Anderson > Cc: Bjorn Andersson > Cc: Niklas Cassel > Reported-by: Niklas Cassel > Fixes: 1de7ddb3a15c ("pinctrl: msm: Mux out gpio function with gpio_request()") > Signed-off-by: Stephen Boyd Oops... Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/pinctrl/qcom/pinctrl-msm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c > index 1684b2da09d5..b925b8feac95 100644 > --- a/drivers/pinctrl/qcom/pinctrl-msm.c > +++ b/drivers/pinctrl/qcom/pinctrl-msm.c > @@ -188,7 +188,7 @@ static int msm_pinmux_request_gpio(struct pinctrl_dev *pctldev, > return 0; > > /* For now assume function 0 is GPIO because it always is */ > - return msm_pinmux_set_mux(pctldev, 0, offset); > + return msm_pinmux_set_mux(pctldev, g->funcs[0], offset); > } > > static const struct pinmux_ops msm_pinmux_ops = { > -- > Sent by a computer through tubes >