Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3109283rdg; Tue, 17 Oct 2023 05:08:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhrs6L2uIJQ55XVdqQ2/nrCBesk9hHFix/A6nNxFcgy2i+u2KI4pxOR26U1a53+/Jy572F X-Received: by 2002:a05:6a20:3c9e:b0:16b:80b4:c39a with SMTP id b30-20020a056a203c9e00b0016b80b4c39amr1890157pzj.19.1697544509060; Tue, 17 Oct 2023 05:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697544509; cv=none; d=google.com; s=arc-20160816; b=aXoCac732Ty3W1f8QmEVnJHUel9bvgDEqz4st5MJWD6b3XoNWlRRe+3akMkrl5dPoC fzlFsJ4SG+ZSXEGK093Ty8wY1FLxxGlIjgPX/v+jwXh6MKOgv6GubyNzJbY2JICxV0Rb VOmqvUWK+b+j3AQ+FwTSDG+yXfJRrMKO7y3HoerSN1LBvFwr4VXN1XCEj6B6muiQIlds jsk1J6TjVXy9m8afjzb+aFc5am981b6bK1JPV/HuoCvc/svUpmgOoet6P2b/pGhxjqlx 3QSrDb7VppM/RoBtGEpoHnIldBFFlbLlybTY6He6RnKilP83I8d8xnHHcvqbATflJ9Gs puTA== 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=DqYDdpwSMHdixfarzmEYN9Owj/ALsHDXsFbQ9TIrKwc=; fh=kOxmq+prcfKKX/dgMaMxTb6TRjzyc//QKXZBiaS/a94=; b=w7Jmn5ahmoFoSXyX8enrGYA2OATNepjbctD556zccgz0c4/kzISOPeehKnpjD4bcOd iXspacqjnkOibgVoYvHMQPdx8Ru3XUmZ+MZ/OOeZFb1eQ/GIF1zYGgKVz5kUGCiD+cjv dw+uMRWFgwNg0LrDIUPVVZfZZaw2+rB/wxbmtQ9uxdbOmi18FgFKDFB/RkbmcDrs8MXM zVNViOeus2Ae2y/LtnL21TpbuNTb4u1bCZTo37lLO/zQK0CcDqFCuYhjkaEbWimUV5ka sn6JnmEzT5Avw+mFf6PSPiaKJA7z2t3teS2kvE3QvG/7xyaJ3jNtf16q+k4Td8PpbnHp Gp8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=flztOwpW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id x3-20020a634a03000000b00584e731e7fbsi1589755pga.280.2023.10.17.05.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:08:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=flztOwpW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id BE1FD801DDB1; Tue, 17 Oct 2023 05:08:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234932AbjJQMHr (ORCPT + 99 others); Tue, 17 Oct 2023 08:07:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343793AbjJQMHE (ORCPT ); Tue, 17 Oct 2023 08:07:04 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DF632100 for ; Tue, 17 Oct 2023 05:05:37 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4064867903cso62410605e9.2 for ; Tue, 17 Oct 2023 05:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1697544335; x=1698149135; 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=DqYDdpwSMHdixfarzmEYN9Owj/ALsHDXsFbQ9TIrKwc=; b=flztOwpWuuW2aUJbyYp//Q2Uqamnmhj4YctQ/aZ5PzmpE2c7tfR8raBKy3ZVmRRPTM p9ay+QTQreDqGW+DWRicnKl2M2aUMeHaX17B1AT3kAnwce2d23XRsRKlTMh4iQ5Uf9h8 dehkQ9ODUdGbOoBqq0X2/Y9iGxnyzZHibjHfvD7JYDXDv7maSPeCe4ZjwUmMzBaRJmXT tFBREOe4y4E9hjarWZGSQ6RyRuuoAB0aJqzPze/zQbSOEkxqoFLeKqS9JvPORCsnIoik rDiCrbpJBbk+fstZ5JPk9nt7StLbqtJC6Gw3G30bOj+k7GLQrJYwo6By1kVGpQDoX+HU VhHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697544335; x=1698149135; 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=DqYDdpwSMHdixfarzmEYN9Owj/ALsHDXsFbQ9TIrKwc=; b=ik7TyHccGW7Fn/IwYmLgZC77dsDBVqdXM6ZbHZ9nlcZyNI+4gcE/jwKAriVbLTMM28 xizuN7WgnaQrEBNRex5bKNm/Pg5WXPK6wh/9K77XKbP8O0ggAd2uQOj3o8KS9oemDrmM ViaOx/tT5Eoy6MQDaOR8ssG+Wd8BoIzj3iedzJ/n2OHqu1IduC3M0scwT9ytIrDIAFom jRy1EtR9eUiiiqF0c5cIuxhEe3eqbuUNi41lkQ64HD5Hw+kM3MHfJ+YJPblaOrE0S3Oh W678NWfR/6tu/yev5REkVCeBnUzrJ/Kgd10MQfaDuC/WUiybbXTI0ZZXiNpIqEyB7zLf 1EAQ== X-Gm-Message-State: AOJu0YxvfuzBuu9REQlYFl3Yq7CsKozlT5Cq7/L95bIRsNbknKwDei/N X9ZPZ92uHuVkee52Pea1vZYHwQ== X-Received: by 2002:a05:600c:3590:b0:404:4b6f:d70d with SMTP id p16-20020a05600c359000b004044b6fd70dmr1539396wmq.17.1697544334471; Tue, 17 Oct 2023 05:05:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:05:34 -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 v3 48/73] pinctrl: change the signature of pinctrl_gpio_direction() Date: Tue, 17 Oct 2023 14:04:06 +0200 Message-Id: <20231017120431.68847-49-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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 17 Oct 2023 05:08:20 -0700 (PDT) From: Bartosz Golaszewski Modify pinctrl_gpio_direction() to be in line with public GPIO helpers and take a pair of GPIO chip & offset as arguments. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- drivers/pinctrl/core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index d4a615eb1c39..b92047af7b9f 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -850,14 +850,16 @@ void pinctrl_gpio_free(struct gpio_chip *gc, unsigned int offset) } EXPORT_SYMBOL_GPL(pinctrl_gpio_free); -static int pinctrl_gpio_direction(unsigned gpio, bool input) +static int pinctrl_gpio_direction(struct gpio_chip *gc, unsigned int offset, + bool input) { struct pinctrl_dev *pctldev; struct pinctrl_gpio_range *range; int ret; int pin; - ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); + ret = pinctrl_get_device_gpio_range(gc->base + offset, &pctldev, + &range); if (ret) { return ret; } @@ -865,7 +867,7 @@ static int pinctrl_gpio_direction(unsigned gpio, bool input) mutex_lock(&pctldev->mutex); /* Convert to the pin controllers number space */ - pin = gpio_to_pin(range, gpio); + pin = gpio_to_pin(range, gc->base + offset); ret = pinmux_gpio_direction(pctldev, range, pin, input); mutex_unlock(&pctldev->mutex); @@ -884,7 +886,7 @@ static int pinctrl_gpio_direction(unsigned gpio, bool input) */ int pinctrl_gpio_direction_input(struct gpio_chip *gc, unsigned int offset) { - return pinctrl_gpio_direction(gc->base + offset, true); + return pinctrl_gpio_direction(gc, offset, true); } EXPORT_SYMBOL_GPL(pinctrl_gpio_direction_input); @@ -899,7 +901,7 @@ EXPORT_SYMBOL_GPL(pinctrl_gpio_direction_input); */ int pinctrl_gpio_direction_output(struct gpio_chip *gc, unsigned int offset) { - return pinctrl_gpio_direction(gc->base + offset, false); + return pinctrl_gpio_direction(gc, offset, false); } EXPORT_SYMBOL_GPL(pinctrl_gpio_direction_output); -- 2.39.2