Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp768641rdg; Wed, 11 Oct 2023 05:12:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDbOnEVJ1GHbpsztKlI+7IxD+GnJxBOQ0CoVDqxEWDSr49uv73k7wfTJEkBqpaSgpkxByB X-Received: by 2002:a05:6358:e48c:b0:143:7cc8:70b1 with SMTP id by12-20020a056358e48c00b001437cc870b1mr15549549rwb.6.1697026371253; Wed, 11 Oct 2023 05:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697026371; cv=none; d=google.com; s=arc-20160816; b=nrPfTSpBUBxsxjJxWRizz25VNLMYJ406MkBiouFrLfctxIcrsql3gglRsYMPnvLN1o cEztM8VJqBiXh+YZRHXVwucULmgEi1pPedBOh1WUNKhYaigHTWO/Ht3+DLGBf/bA1kLp 5PkRiH4FBKRfGmocMsnMGGv35cYcnuxz+Q82YCO5QJb6KaYbn2ZdkSuQ64YmFcWWweqn B9WopyHCBb1wH2Yt7UCjtWcOLuk9Jl7WZ22pA/FUsVBLJwovGGPbWFO9MpDsB+4edwiO 5YUmzzIP7gFZdnLEjAPkN6zJWTQ8Ml/HLNVKI0+PLJvzpNvOEUo3OMNnKEOcwx8vSWtO 8QyA== 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=TOPIjs/2NjXO1x2ZIpfSr3ZdCY21Cn/Jl2ta65tKWZi/wJk0TN83RcGd/AamzTVHNn KtJEWa73ecFaeeZO4aEuIzqIQdWInR5KZKyh36MTxytcJSczTh4vgUN66/EsPD5uRVm2 pTv5zrSTMOt/jYI8UCu4x0Rz4e6MACppZVOoaFfZY/ysjiH+0eXwiaDlxirbpEGO722e W+fXh9Am1jzdkjFn/ZIpU7G+k89RLuPbRj0Hlk0eoG3xxokC6MPnnXgs2McaGJN8DJJ/ GTb0yZUQ5WD74D82wb9OhSf0L3uG1YmhOrU/a3izqhdKCRILbShEVwiSYh7AcrzumCrp re1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b="IeF/GJxI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h14-20020a056a001a4e00b0068fefb0c039si12363439pfv.99.2023.10.11.05.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 05:12:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b="IeF/GJxI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id EF8EE824C4EF; Wed, 11 Oct 2023 05:12:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346752AbjJKMLa (ORCPT + 99 others); Wed, 11 Oct 2023 08:11:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346626AbjJKMK1 (ORCPT ); Wed, 11 Oct 2023 08:10:27 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A3F4D69 for ; Wed, 11 Oct 2023 05:09:45 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-406619b53caso63175915e9.1 for ; Wed, 11 Oct 2023 05:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1697026172; x=1697630972; 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=IeF/GJxIE74+XeiqYusm8Yjqc5X0YS/qq+OF1dKDPsGELgGWsbuLpe5oCEfe3Afm99 1MlGK4mrnqrrZgXKVMp8wUVpdz0uY/Ku50llimMeNFJ/jeJ0dZdtJ0UGQlW/Hum6NksW wMMOh8+ubLplMYlajETIrmcZjTjftbI9BoUUU1ORxbG6NNHzdztzVnt54HB93zlObwLD iYR+e/W1BXGQEif+d4q74+bz8zsHSQggms57TD/LJWT8c8ujcU5QWBECDcsas+sJNhTD N3TPhtjb5FB7wkSoBwAf07FbxJso4hUYtNooNbHFGQCVJsuySvwgo9XamrrD6rFelgNh GA7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697026172; x=1697630972; 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=fK0up5MwIsQV7uGvebR96GKKyyDblKGd7mrAuCdROrQrsXq6ys7AwTdwYYIKXNVi9h YRN7Hnko73gU1ZdJlLdfGxYZHP8MA6VD6rmiHkME9OvTWF2Tv9sl4i2sFSEn6ttHEjXF yd+3fZT6ZRj2mj5YUEzLFmv2rSEGdxtQmc2rzU4Nl76/Tyjq0JdjgDx68s+9inVSrnLj GHFKGCDqyqjrwj90jjqgZkRDaFpLSbliJA3s/fie8xRMkf7J9S4NY0x+0Jq0p+YCFMAJ GLe4el5DkO97CtvhJrgo1ynqWfzCyRvrLh2SVgUNmTBkgJROyr5nb6ZGgJH2eeGurhgI xCLA== X-Gm-Message-State: AOJu0Yy13V0x3V6k08r5qqyrRwujePcJAkhJhzVC06PC4cGPNAC2JLwp dUAqOpKuXtG1vt1aXr30k5JPdA== X-Received: by 2002:a7b:cc88:0:b0:401:bdf9:c336 with SMTP id p8-20020a7bcc88000000b00401bdf9c336mr19488682wma.27.1697026171852; Wed, 11 Oct 2023 05:09:31 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:e551:3946:26fc:f94]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c015500b0040652e8ca13sm19012253wmm.43.2023.10.11.05.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 05:09:31 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 27/62] pinctrl: ingenic: use new pinctrl GPIO helpers Date: Wed, 11 Oct 2023 14:07:55 +0200 Message-Id: <20231011120830.49324-28-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011120830.49324-1-brgl@bgdev.pl> References: <20231011120830.49324-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 11 Oct 2023 05:12:44 -0700 (PDT) X-Spam-Level: ** From: Bartosz Golaszewski 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 --- 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; -- 2.39.2