From patchwork Sun Feb 28 02:52:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 388432 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp2354105jap; Sat, 27 Feb 2021 18:54:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9GORxUVgCj342AFgG6BqENR+73auPVG8W/IxyKv/eaxXs9JB8vxA7Vf52OWsFH7GIWXii X-Received: by 2002:a17:906:3b99:: with SMTP id u25mr9917216ejf.277.1614480899605; Sat, 27 Feb 2021 18:54:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614480899; cv=none; d=google.com; s=arc-20160816; b=x8CEcrLrJb4/BkR8O3f7CnNotEOHThV1Y4LzvTRoGEvDi8H0sBY1/i3NcBpMjcDOGj w8eeTQRxbjK8Nt8BJKsUjPXak6bMjbkll6f094QylPvqSn1LVIJpR/eOYXv6isjl5PYO 6ttVs1kzSZDnTORzBRh4CmZUB4hAyv3bUDXMWe2/ReMIPiWWCWxjZLBwJMlgIh6uqtd8 LFDciOOf23G54tbfpo3cOSr+amqTCFUS6HzMMHC/82G8GwfjJcMAm9nAMorbvbbMzFC3 gd8NAKjjx3v8pa6rlpO6XPMnNx8J4vjxlFFsrGVB+M2j7TZmjJCSbjMa9cfzqS1C4Ic/ 36sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=vpdHEyJD7sn/0eeQxVrrnQwX5J7unyGFY9KXLtypecU=; b=HUydmk8JfQYNqvYVuau/8I5Ta4VBVOHBRHYLh5On/kLm5AACgbwX786u4oK/JSjvsr 2Oe+fTTAuHeyTCrU+/3UOyQ6wDJ2MmjLi9UiPIN/ah3EfLmSgvHQKp7xq82TYieaRbTX lUnUxX/qM5z3MmQHtFW/+8XbbDe5pk4HuRkIRH6VC/6N9raYmecSPne9YXKDOSlure2f T1FO6ZJ3SnDpnh5ZROLvcaMb/SIuusJ7u1aCsdLeAEqwMhNgx5R5xA+v7viVS/5dCqMT 0KHCMICR03dQs8gpesh+tFX0RffoA/oH0J7ZrfqXzJ8DKYUddQXIJrj9pGvHlsCVXXpk Z0FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=egll23z+; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-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. [23.128.96.18]) by mx.google.com with ESMTP id f19si1109748ejc.312.2021.02.27.18.54.59; Sat, 27 Feb 2021 18:54:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=egll23z+; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-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 S230075AbhB1Cxh (ORCPT + 3 others); Sat, 27 Feb 2021 21:53:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbhB1Cxg (ORCPT ); Sat, 27 Feb 2021 21:53:36 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7757CC06174A for ; Sat, 27 Feb 2021 18:52:56 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id e9so8531282pjj.0 for ; Sat, 27 Feb 2021 18:52:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=vpdHEyJD7sn/0eeQxVrrnQwX5J7unyGFY9KXLtypecU=; b=egll23z+9j/zwj+FnnZEYgh9EoAkYvB3s/oloXSjkGOy9G/Ho2O2KtcALQ1aziXUHC PlCQE7JC4+PgnFu8tqTIgyxISn+IwXg6i94bNWWQTq1KfbXDME3cw6GA21juzkk5fWEg fniZFmCir4lgV1BsWZF2pHFuaZt17Ay45Dqb6Ue7PgoaCJsG5zC52UOjj/dgxHnN8glu 1H1HloI6R6a9q+B9RaHMbirIY8+W2J2fCrfoDI9dk94VB7zoHZt0Fg+rMx56Bbpy2RT6 2GORwpvwSNjmCe7Lghv4GUOHBuqMfYVyHTmAnDSm1Q5aC7vlOkcKEhFgCWvmQyiCfW31 hHHg== 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; bh=vpdHEyJD7sn/0eeQxVrrnQwX5J7unyGFY9KXLtypecU=; b=E5It9LZjyPhFbfRpuMn9u9QtwnXBerl1EDHAcv4pbxtWBC8vL2q27Mu295hhvB4Qmd dFRUbVwjSVn5j7MjEhGgE1I/YMqoGK11WLDXSwmP3PfEsa+hrgclSXxsRQL9zct6OeXQ JQw+9y6paxeZc+0Vwe6rzANKCeclpTjBBTy25khpzyQo1/WZcOmbh1uCw+vkRDyu24Yu 5pWQVtMgjhPWnan5SJTEkyRDhRCZ4GSqMQj5Qq4Tku7Kv7ik6AWm51T9vM8xEKFPD4Md Fbvp9nzrntlQDNq0fn2lEJ+3s8q6qLJve6c0NXZ/raGph0Bmp4lhNfC0jxiQ5IzJZ3++ 7vZQ== X-Gm-Message-State: AOAM531TlvYOeQ6uEGCAbxobhNIZ07hqxWa5gfxd4yMoe3NA7cgjnExf QYXIlXdK/CbgDMNhuC7xI6TM0A== X-Received: by 2002:a17:902:fe96:b029:e4:2f39:9083 with SMTP id x22-20020a170902fe96b02900e42f399083mr9684729plm.47.1614480775497; Sat, 27 Feb 2021 18:52:55 -0800 (PST) Received: from localhost.localdomain (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id s4sm7329527pji.2.2021.02.27.18.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Feb 2021 18:52:55 -0800 (PST) From: Shawn Guo To: Linus Walleij Cc: Bjorn Andersson , linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org, Shawn Guo Subject: [PATCH] pinctrl: qcom: support gpio_chip .set_config call Date: Sun, 28 Feb 2021 10:52:49 +0800 Message-Id: <20210228025249.19684-1-shawn.guo@linaro.org> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org In case of ACPI boot, GPIO core does the right thing to parse GPIO pin configs from ACPI table, and call into gpio_chip's .set_config hook for setting them up. It enables such support on qcom platform by using generic config function, which in turn calls into .pin_config_set of pinconf for setting up hardware. For qcom platform, it's possible to reuse pin group config functions for pin config hooks, because every pin is maintained as a single group. This change fixes the problem that Touchpad of Lenovo Flex 5G laptop doesn't work with ACPI boot, because PullUp config of Touchpad GpioInt pin is not set up by kernel driver. Signed-off-by: Shawn Guo --- drivers/pinctrl/qcom/pinctrl-msm.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index a591be9f380a..2526f299bdce 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -493,6 +493,8 @@ static const struct pinconf_ops msm_pinconf_ops = { .is_generic = true, .pin_config_group_get = msm_config_group_get, .pin_config_group_set = msm_config_group_set, + .pin_config_get = msm_config_group_get, + .pin_config_set = msm_config_group_set, }; static int msm_gpio_direction_input(struct gpio_chip *chip, unsigned offset) @@ -717,6 +719,7 @@ static const struct gpio_chip msm_gpio_template = { .get_direction = msm_gpio_get_direction, .get = msm_gpio_get, .set = msm_gpio_set, + .set_config = gpiochip_generic_config, .request = gpiochip_generic_request, .free = gpiochip_generic_free, .dbg_show = msm_gpio_dbg_show,