From patchwork Tue Sep 26 12:17:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 114253 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3759567qgf; Tue, 26 Sep 2017 05:18:19 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCbqWhjJV1PPASqKjPnZXxp9pymUmwEyKdLMGbHOHCWkJnHhpwumM+WRKqgGSLvJaTKXjgN X-Received: by 10.101.76.141 with SMTP id m13mr11056755pgt.103.1506428299431; Tue, 26 Sep 2017 05:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506428299; cv=none; d=google.com; s=arc-20160816; b=sF3iYzd550Vu4Gr9ZgVYnBZbqyr78i/acVlyQPykgMHdyP9hvKywCzRvP7W4nBd6Fp vnwVpAsjMRSigg2pVn4gUQTK9rIqzMWyHvjQnTVVI5jowtJ42W/OYZceMnbD06Mjtp1f /Rxm96YWr6Gmnhyiyol10jwyRmgS+SGxzlaVrH8RIW5Z3J2/tMHo/sryyFlwtmqayy4P 68Rk7DQk9TfEqVaoddV5Hu57PnRKS/K+8O+kKXSuapvkWRzMnffqPT5kIKqmMeuSs2t8 HZwq5qYKUlRqrR2rPscS/bWm5u1Xc5Lod4J6jBA7XvoOngKlEd/oQQLsSDBgkZME2VX7 3rLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Pi3f5Kbu9exO5JncxhR6iE9+1rwQkDR/AYrkt8P6Rqs=; b=U2oPqTY6/4tLjqIKtEg82xrqyzqUZj7+3IZwNF34w7fbdMktUYUS4av5dnnelgvGNA zSmA2GFyNtuJAWiWSrqxBgOYRNTSQIazujKXhAqodoWJPrlKVhf81/Il/Oq5GEVXGK7g Q+f5pMvKL10/cdMJsRYKQhmZ3L+vZeKufUoy8XlcL75p1J4EZjg8pVGt/w9elc8iu15v 1Cbeuhsse5ARi1D0JTmh6/1efymF4Y/93uqhjdnWrYB/Ty3K8owQl/khfl25HVy28pe/ AML9WLiKvjd/1gD5d0aWwWaQRdc6Ungkf1k6zATIVi2KMVSHTJf/cMIgN2IFJyprdUPm NbyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si5652646plp.584.2017.09.26.05.18.19; Tue, 26 Sep 2017 05:18:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968594AbdIZMSR (ORCPT + 6 others); Tue, 26 Sep 2017 08:18:17 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:52130 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965758AbdIZMSQ (ORCPT ); Tue, 26 Sep 2017 08:18:16 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id 50CBB20934; Tue, 26 Sep 2017 14:18:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 8777E2088C; Tue, 26 Sep 2017 14:17:55 +0200 (CEST) From: Quentin Schulz To: linus.walleij@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, thomas.petazzoni@free-electrons.com, Quentin Schulz Subject: [PATCH v2 05/10] pinctrl: axp209: add programmable gpio_status_offset Date: Tue, 26 Sep 2017 14:17:15 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org To prepare for patches that will add support for a new PMIC that has a different GPIO input status register, add a gpio_status_offset within axp20x_pctl structure and use it. Signed-off-by: Quentin Schulz --- drivers/pinctrl/pinctrl-axp209.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- git-series 0.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/pinctrl-axp209.c b/drivers/pinctrl/pinctrl-axp209.c index 4be1aca..11f871e 100644 --- a/drivers/pinctrl/pinctrl-axp209.c +++ b/drivers/pinctrl/pinctrl-axp209.c @@ -89,6 +89,7 @@ struct axp20x_pctl { unsigned int ngroups; struct axp20x_pinctrl_function *functions; unsigned int nfunctions; + unsigned int gpio_status_offset; }; static const struct axp20x_desc_pin axp209_pins[] = { @@ -127,7 +128,7 @@ static int axp20x_gpio_get(struct gpio_chip *chip, unsigned offset) if (ret) return ret; - return !!(val & BIT(offset + 4)); + return !!(val & BIT(offset + pctl->gpio_status_offset)); } static int axp20x_gpio_get_direction(struct gpio_chip *chip, unsigned offset) @@ -509,6 +510,7 @@ static int axp20x_pctl_probe(struct platform_device *pdev) pctl->regmap = axp20x->regmap; pctl->desc = &axp20x_pinctrl_data; + pctl->gpio_status_offset = 4; pctl->dev = &pdev->dev; platform_set_drvdata(pdev, pctl);