Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1794251rdb; Tue, 3 Oct 2023 00:40:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEx2gffBfg+D60xY2KwbIMQS0pmMVd0OyBJBr1/1y7af60iALjxHJkTYKDNvRaKS799nE/J X-Received: by 2002:a17:902:ea8b:b0:1c2:82e:32de with SMTP id x11-20020a170902ea8b00b001c2082e32demr13251084plb.0.1696318803528; Tue, 03 Oct 2023 00:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696318803; cv=none; d=google.com; s=arc-20160816; b=Gvmyy8gPywGSqVRf/GCGDL4ykUWcficdGRJmUOgMq0udzDdN9K5zOx3/z8IXRtR5fB fZtxl9ZMS9Xi+Clps3J5Ux0ebsQLYomuA3iUxl1iEPRQP9Y2WM94bTf7w7sIGV42jjZl 4HokxHtkCGDjUyJhLzwDebZyYKooUpFtgSZOsPwW1p/Avw+PF1ylRQG0TV22Z8sGmTxR 0SHGLNlgcBm0hDepGAWcnHB/1fcdhyJk07A/usTreCT9Ic9UMVdhLAba9UQgNBSGXCN7 FsgQ7QfGYuCnu/ArXz38dy1Nn4LnDx+fhSBbHMcBofiHpf+salOoGb5GqpEWjRaLX1+9 GTFA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=3tmSPARAlc4pAu0fx6WWRS8V/BeHfaSNDUWviGGzaOk=; fh=/wIzTV0nXrHn70dQspPwWK3v5JwxMA1SU7GhGXBap9w=; b=Fr/D0QUSoCrjR5BRaVtInHMbRnVQkrMRD0keKfW4tldaX/pbORgRo7G/VYZ7zqVqfO g3nYnSKNZub0zBxhBWOi/1nlVg+UV5OkfzjRQR5FMAVelEnhc2PG8gGPVBjz0BiOWw5p JgGxAb4oKV5zkn+baWXEqDj852DY4lQ/fuLzWR3AZ62key/sBA1xLufiXDgmhnxckIM0 Rrr/nznofUjWRd/H7r1ks3u9VVLzczvLlCNzaNBVKzuSKkXFDIhdb+JvLvDw861CvIYo HGs6aqvAJVVlen2X21Ehw5lwIeptU5kipiJTf1Sy2aWQepsuDq3WyYyGLeNPRuRibceP fvtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=HpcVflxF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id p8-20020a170902e74800b001c6240dec44si913730plf.389.2023.10.03.00.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 00:40:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=HpcVflxF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 057A980DA313; Tue, 3 Oct 2023 00:40:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230359AbjJCHjs (ORCPT + 99 others); Tue, 3 Oct 2023 03:39:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbjJCHjq (ORCPT ); Tue, 3 Oct 2023 03:39:46 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13B5883 for ; Tue, 3 Oct 2023 00:39:44 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-50437c618b4so686532e87.2 for ; Tue, 03 Oct 2023 00:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1696318782; x=1696923582; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3tmSPARAlc4pAu0fx6WWRS8V/BeHfaSNDUWviGGzaOk=; b=HpcVflxFmsOT/dVDQJEHW2+djxuDOVeG/CJnGbc+icVXoV+wa2tm+SmmMX7btFOjwd JZRUTcKMu3Kz2Q1LL5qBBIesTkrPyIO/ZX6MOzI4OwjgBBUCoODiGF3DwDhUQ2h8nP6E ouO4tWhTCwpuPgPO8utz/G9s93VNbUG5wFu8QJQZJdQWXNHmjBdqWOAlJyGcaVTeQin6 R9EDmSHa7YYqJdPX7VT74Kz64CD9Z2PAmEwZr7gTe8t1ijn5JOvuJIIItoXxBJDy/pWe U4GGebu1DkZkih4uUCfVlHteLOFSqcmTZaKreFeZD4juVm3tp63seE5JMr3544jhdgEt r4mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696318782; x=1696923582; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3tmSPARAlc4pAu0fx6WWRS8V/BeHfaSNDUWviGGzaOk=; b=LEU9jCtOD8L9cuhdlgEX+G3nt4BBci/U/GLaL6ohHgRr5lGai9PJk6UeXWtXfld7nH ODeOGfOuy/mJPRtkorOxSyhIcTYYcdeu3UFVvJtT7f96t+4QqMR0avBZhPMdA3LhwcvD vBxYWusoWIWAeFpai+IOsBz85ZBMsR1z/HNDWgpEV5H48ihr5ErpRDpKClv6i5Tmv8Bx nSBVTb1bUuui/tORCi6I4C+namIzh1E7c+QjFbIso1v8TCIkEgx0k4+YSkbg1mqEtnbY qP2HK4Vr8EbHf/1AWN8BYAOqjErqoO7GVT69A7kqqa0QfpRRrihl54QHwqORL3YPdtLv MIZA== X-Gm-Message-State: AOJu0YzGanSyyB/jD1kIgxEmdkrEa+icIyCLASbbrLlk+lkf7bEh9Gea WVJLkc2DH42WpWg72Hjgwi3Ovy+DUo0HecqYsQ8= X-Received: by 2002:a19:644f:0:b0:501:bee7:487b with SMTP id b15-20020a19644f000000b00501bee7487bmr10092366lfj.11.1696318782149; Tue, 03 Oct 2023 00:39:42 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:1f2d:3479:a5de:fa35]) by smtp.gmail.com with ESMTPSA id o3-20020a5d6843000000b003143867d2ebsm889516wrw.63.2023.10.03.00.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 00:39:41 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko , Joel Stanley , Andrew Jeffery Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] gpio: aspeed: fix the GPIO number passed to pinctrl_gpio_set_config() Date: Tue, 3 Oct 2023 09:39:26 +0200 Message-Id: <20231003073926.10771-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 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 pete.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 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 00:40:01 -0700 (PDT) From: Bartosz Golaszewski pinctrl_gpio_set_config() expects the GPIO number from the global GPIO numberspace, not the controller-relative offset, which needs to be added to the chip base. Fixes: 5ae4cb94b313 ("gpio: aspeed: Add debounce support") Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index da33bbbdacb9..58f107194fda 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -973,7 +973,7 @@ static int aspeed_gpio_set_config(struct gpio_chip *chip, unsigned int offset, else if (param == PIN_CONFIG_BIAS_DISABLE || param == PIN_CONFIG_BIAS_PULL_DOWN || param == PIN_CONFIG_DRIVE_STRENGTH) - return pinctrl_gpio_set_config(offset, config); + return pinctrl_gpio_set_config(chip->base + offset, config); else if (param == PIN_CONFIG_DRIVE_OPEN_DRAIN || param == PIN_CONFIG_DRIVE_OPEN_SOURCE) /* Return -ENOTSUPP to trigger emulation, as per datasheet */ -- 2.39.2