Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp571650imm; Mon, 1 Oct 2018 14:49:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV62NB/beYkxE60KYs9skas1/+54gFU5pJ7yAw4TTKkJqbuj79NUoBn5FEe4Mahjyuas3pShe X-Received: by 2002:a63:541e:: with SMTP id i30-v6mr11986804pgb.413.1538430587812; Mon, 01 Oct 2018 14:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538430587; cv=none; d=google.com; s=arc-20160816; b=VLWPNMTnOgLLV1yO2u7GUcPW/I9zPGvTUpmCeNSWsAAQ2qU7/1MazgJiQ3QPoUXXzL K8XbOQHg539cqIlyh63CB4NglIZzLN5iU4GD/xWnxs7jmIiBBeMUWlZIhQ/GEmpiDBTu OGPc46pseMi85LqCJ3tjQ+ba1pwBn/aXCkZJwQ8ZzDkLwclWZ/F7u364g8ZhzsZb7Aer uURmfaMaTtlT5Lu97BXd9RcRgt7ULytZcMMijDcre26ARkh5uVlf5o9d/2SHMm11uUB2 R8FuhcJEgygd9wll6r05rWpYo45GBdkf5iGSssAZ2Mti+ZpTLRUJQTMJizI5GuLhYxa7 3z5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ei10IMDTH9p7ZNfD8xEmYEMq7A1+pvhdDRd1zGw788U=; b=pKfmoX3ssg6BPA694D74j3tJvPQkQ08VkJW/TCXgJ3l68VQY/Zf5vS0qsJgqIDCB3F ZzS65Db1Zi8NAODinvwy513Sm2i0z1f4/thnhbRCj4eK1emlCswMAa3XH+NWie3bSylX 0G02IQ54EWipwXQ57oZJ1VaqIRNNL/+puCYsvTWWqTiy7WguNstSaLFqpKj5q2U+WrC+ 2Y/aINaqoVWmPcTMJfk8awzpUjwPa/joTuRId08n5Bm+tHhLQqDJPiHcR/IrZZwUxsUy B+w28gb2J5lb2Mfje0u+AoIoCUVbYSzQJ7y/Opcv32YA+ZxyruOG8UIJYKyRjC9Kby4L Ybfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HxgL1m8V; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4-v6si13681140pfa.274.2018.10.01.14.49.33; Mon, 01 Oct 2018 14:49:47 -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=@chromium.org header.s=google header.b=HxgL1m8V; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726488AbeJBE27 (ORCPT + 99 others); Tue, 2 Oct 2018 00:28:59 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36131 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbeJBE27 (ORCPT ); Tue, 2 Oct 2018 00:28:59 -0400 Received: by mail-pg1-f195.google.com with SMTP id f18-v6so6882962pgv.3 for ; Mon, 01 Oct 2018 14:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ei10IMDTH9p7ZNfD8xEmYEMq7A1+pvhdDRd1zGw788U=; b=HxgL1m8V0/yiK2g6wuzWbeSx9bV7dCYP0GOyp3bzaCftTGsCV3YAboTnIk2C9vC4I8 DPH3aiFUAq42F7ltfWOs8NCw/tSoxGQDOI0DpznF7K6yR42CYK1Gv6D+BzjA/0Bv6jrU D8vncwGl0f6fdpw8eDjHIJnSNEJZjsU+ydnRk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ei10IMDTH9p7ZNfD8xEmYEMq7A1+pvhdDRd1zGw788U=; b=nGa3V7UAbjUSsso5jwXgmkqv5Qf65m8PWScL9eHCaIkhjJf67/ydxD3dE1TnELdGmj dKqwcYqNVmaYRLKgIUSEL2VS8L5HRts/mI5giZMsRgjMCKYFwLrfW4RoIyZ6E5bYjr1d Grk0Ietqn1zFkdviFp0xHBEHTvu/qW8I9KpFoW/KBTrQcBkk7W2FOeJCCPHIk8GBKZ6e xiX9idVA2ncnr36HJNdusIctRimyDu0gh4CGRvt2o8wZ5Rz1GpKuLXSIDD+atfi+PCUn E4gzYzlttQrRBnjauKUj3uyyDqjPKzAjOWWrntIx7FfODNGdtk+RzUJN8eMfgw+BAoSO wgEA== X-Gm-Message-State: ABuFfoi2U+SSj8LGGviJho8m4PJN52X+kLK+rsq1XzfnlMIlnR03PERg 8zGdPtvINV0fFE09R5SqEzp+uw== X-Received: by 2002:a17:902:a9c9:: with SMTP id b9-v6mr13020814plr.225.1538430547028; Mon, 01 Oct 2018 14:49:07 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:7e28:b9f3:6afc:5326]) by smtp.gmail.com with ESMTPSA id g88-v6sm27159070pfd.181.2018.10.01.14.49.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 14:49:06 -0700 (PDT) From: Stephen Boyd To: Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, Doug Anderson , Bjorn Andersson , Niklas Cassel Subject: [PATCH] pinctrl: msm: Actually use function 0 for gpio selection Date: Mon, 1 Oct 2018 14:49:05 -0700 Message-Id: <20181001214905.12149-1-swboyd@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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