Message ID | 20231017120431.68847-32-brgl@bgdev.pl |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4094100vqb; Tue, 17 Oct 2023 05:23:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTvseLjKZ13qWIgpMvsG2/F+prgw1a9izQbCsblMZ2tJ3Qa7RDvp5ZLZxn05vZ5KBvl0wp X-Received: by 2002:a05:6830:6e9a:b0:6c7:aab5:6e50 with SMTP id ed26-20020a0568306e9a00b006c7aab56e50mr2817586otb.2.1697545409471; Tue, 17 Oct 2023 05:23:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697545409; cv=none; d=google.com; s=arc-20160816; b=DW2auaY1RLy3qi3Bfh9rJcCxYjbXvHq8voR8BOf8NpbJhPxXx97bd+W4wopQPzrMLb pz3mVmigs1Co+bB644YA1wDzv1YX9xIZZZ53gM7TgRmnV8obOXYYitEFuuc02800CZS8 Y9md7dol1lM/mmdzYxiyUwFUGGkecITd+MMe2fR0HuXPOQQ28B3Thrm0SGYr5+yrNrT/ 0nzToR9nVMOTGB3rKsWx+bY7h9gvFJJFnRIhzeNbZvFJkJrsfU2EPDVLQo+4x81frFts Tx5JWSGbZz1rEpXW0Yo28BAYfv1JaIsIFZq4Phg52PQRY6AT/zer5gQNMIkj+oDUpLxk IVkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gwciMDEJmwkjhMDgP1JPMADTRBiS8hEPWAh7DlNBT2c=; fh=kOxmq+prcfKKX/dgMaMxTb6TRjzyc//QKXZBiaS/a94=; b=ro3MiaoaKBaYwgMf5S2OcRu/slN7fvDVZ2XxGJcuZ6NeCPuFLCbsxS2R2RpK+nR0tJ /eER8/QLHlN33M1qtpDJbkV7PZkL07iVLXsK+5Q02zgRjQVfuQil1jzOBnNCtquXXfDA rpZtacQx54HhtQUnRHzYGZKXC6csACxRQDJe9rXata7jlw2QTlTe3gG9+9AanslTte48 VCfr+7FngLIKK521JAmwJaEaJtwWfQFK1i24n83BNntJde+DWXl7z/VML8K1g3Zj981g LGfk1Hx1z/QKW/ihwL+/LudJHWZeM3TloJHzNKEnMXN8YA/ExmBe4F1vkFd74WQK21my FTAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=KJ6Txorn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id c21-20020a056a00249500b006b440b5ace9si1613942pfv.44.2023.10.17.05.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:23:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=KJ6Txorn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 725EF8049D34; Tue, 17 Oct 2023 05:23:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235267AbjJQMXT (ORCPT <rfc822;hjfbswb@gmail.com> + 19 others); Tue, 17 Oct 2023 08:23:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235263AbjJQMXB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 17 Oct 2023 08:23:01 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5B1A1988 for <linux-kernel@vger.kernel.org>; Tue, 17 Oct 2023 05:05:22 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2c5087d19a6so52217381fa.0 for <linux-kernel@vger.kernel.org>; Tue, 17 Oct 2023 05:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1697544318; x=1698149118; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gwciMDEJmwkjhMDgP1JPMADTRBiS8hEPWAh7DlNBT2c=; b=KJ6TxornkPx4ML8GSGSmxf6o4mZYPwV+vEtSFYpOPuaycfqCm5CI2ExoIV5MYzeBCb Ig80DTGZcqgLjKsYJ/12/UejLdQtw5zzUNabg4CYbc74qzr3G8iBIQOH+SgwlFTWYDGE jxEH50Npl6ZYkQVP3e25uXrUqq1K9tw/rcCo4W53WTSqtgDm5mKdZmRU3+0iqaVAleCa bWxWScKEPvqrU3fr8WSgbLejdRkzjg48APEkDrFZ/2NIexHJVHQvRnbvEACiYomo6u5P KUsEQDLTi+ZvBQnSL3t0wVPDQGeZu9EsAJRSIjDHBBtEwQcHE4obYjpSGvmjrVQAKMqK WJIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697544318; x=1698149118; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gwciMDEJmwkjhMDgP1JPMADTRBiS8hEPWAh7DlNBT2c=; b=MvMka2nFck+ssYZkeMfbx9dFnBh+ioOgOygMLG9evC8Uqs0ohoI1w7m0s6BcYGJXsZ KR9fiV3F2/vICuurQxSXt6TqGjGTSJuGj7jJ0D4FIjhT8P/5nwz2b6Rqn5MXTTfJlG5g 6+54kOmB7rbNnm8R8UbcsSOfNXiRsE2wLnIn07t3gLKEClUziDHOV2VJAAgA2P5afGNz ReFZuFXHhVbdLtkKEHaRuv4KmIGxu5zO/ktoIv3i4PHn/T8qNsDBxJA+6LRi5YRi7Ngz ZksZ3S3WgIeUaRNF/Enycm28rMhnOII2zBFaFyyGFHXhd3mmUQluM1kCNuDt3uGsFqGa s8iQ== X-Gm-Message-State: AOJu0YwaBcb28YLxKp0tSpnwvXK8komfDWS9WGYX6krfg5f246ZfuMxB /EvIE7uR8+lGCDoSKi5LZZC6yA== X-Received: by 2002:a2e:9902:0:b0:2b9:e6a0:5c3a with SMTP id v2-20020a2e9902000000b002b9e6a05c3amr1655865lji.48.1697544318317; Tue, 17 Oct 2023 05:05:18 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:f1ee:b000:ce90:ed14]) by smtp.gmail.com with ESMTPSA id a2-20020a05600c224200b00405442edc69sm1353859wmm.14.2023.10.17.05.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:05:17 -0700 (PDT) From: Bartosz Golaszewski <brgl@bgdev.pl> To: Linus Walleij <linus.walleij@linaro.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Subject: [PATCH v3 31/73] pinctrl: ingenic: use new pinctrl GPIO helpers Date: Tue, 17 Oct 2023 14:03:49 +0200 Message-Id: <20231017120431.68847-32-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017120431.68847-1-brgl@bgdev.pl> References: <20231017120431.68847-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 17 Oct 2023 05:23:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780005374893251051 X-GMAIL-MSGID: 1780005374893251051 |
Series |
pinctrl: don't use GPIOLIB global numberspace in helpers
|
|
Commit Message
Bartosz Golaszewski
Oct. 17, 2023, 12:03 p.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> --- drivers/pinctrl/pinctrl-ingenic.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c index 2f220a47b749..5072fb907193 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -133,6 +133,8 @@ struct ingenic_pinctrl { struct pinctrl_pin_desc *pdesc; const struct ingenic_chip_info *info; + + struct gpio_chip *gc; }; struct ingenic_gpio_chip { @@ -3561,14 +3563,14 @@ static int ingenic_gpio_get(struct gpio_chip *gc, unsigned int offset) static int ingenic_gpio_direction_input(struct gpio_chip *gc, unsigned int offset) { - return pinctrl_gpio_direction_input(gc->base + offset); + return pinctrl_gpio_direction_input_new(gc, offset); } static int ingenic_gpio_direction_output(struct gpio_chip *gc, unsigned int offset, int value) { ingenic_gpio_set(gc, offset, value); - return pinctrl_gpio_direction_output(gc->base + offset); + return pinctrl_gpio_direction_output_new(gc, offset); } static inline void ingenic_config_pin(struct ingenic_pinctrl *jzpc, @@ -4052,7 +4054,8 @@ static int ingenic_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, break; case PIN_CONFIG_OUTPUT: - ret = pinctrl_gpio_direction_output(pin); + ret = pinctrl_gpio_direction_output_new(jzpc->gc, + pin - jzpc->gc->base); if (ret) return ret; @@ -4172,6 +4175,8 @@ static int __init ingenic_gpio_probe(struct ingenic_pinctrl *jzpc, if (!jzgc) return -ENOMEM; + jzpc->gc = &jzgc->gc; + jzgc->jzpc = jzpc; jzgc->reg_base = bank * jzpc->info->reg_offset;