From patchwork Tue Oct 3 07:39:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13406955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1D9AE75432 for ; Tue, 3 Oct 2023 07:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=SNvx0cApMBkPkkamNBg/uLUrcPwB58XI7BkHnkbIpEg=; b=DmEi5IC8mpi8QQ 67boePChIHndoXXaRqaAtH8OpKpYn/4kmN18G0PvVK/bvcfswE5Mb2LGvvNvqaG2+Wdpdckht7D4x 3hh2o325edKNM73iMwPx07uK/6ZHBUOMmeozemLY2d+vAMHsWvw+DAhJBTpOaeZKLZg0nvNlbHEY3 aXDYuY9RVrGzl1O9Tc9M9lJXIBCea1E+kvwZbRyaFdInmyK8rKWzFzH5/voSHqTmrVK5ngyn549o9 eQTmQsX7Oudn/qSpXcR0afixZImJuuE8kSAkD9KWaFu6D0kjMZO0HQ3cx7F2emc4AT3FHpkKjfPoK K4phtGyIu3xAFdSz4ItQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qna0T-00E0Ug-05; Tue, 03 Oct 2023 07:39:49 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qna0Q-00E0Ty-0L for linux-arm-kernel@lists.infradead.org; Tue, 03 Oct 2023 07:39:47 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50307acd445so707800e87.0 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=lists.infradead.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=Gr2dhOhSdGiM9VI9kP4Dhh8fEchmyfDqdrVctTHvdMSYyHv3MW7ACmyCN29SFBzHQE RIddRy1+rtqZqiDCJI2oK28rUBTGxyCAPXiZH7ruHioFrgSGzblyXUf1kIdpSsIIbbJm wSjUPlscmopeQmJyZeQ0tjTRFP4MICROIQiI4W1CFwi99vXBZomPuGTlTkqQQC0tGHvD kM04ZxsWZ0BT4NyRTMLClJIq5PqFRgrwVZ6P+esLBS3Z3X4tSFh4o7h777YuZru6tw91 YC6VhafKqERuqyyMqm6fJSe+VhBG2O98/sbIiybCngfadCPk3RGCasf3Xf7AmR9NCRC7 nX5Q== 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=PouWUrgK3R82/qZMDWNzjP0WKEMBfivZhjeGgvxfREKefvA9LYWYXZxVZ7lTdOfwrK syLDC/abvwzlK2JuZbXnSFnIdoEyB2B21GD3DXbzuJ5jAUJptDVQzGSGBUPikl+MdRdI f0N7Kq1b7tCcqLHUU50RSPkrZ3WljgWe1wE62fXhriN59rvmSReSkRYgDRntd7T4FNza SozI88/i1KhvthKIe5cJbfPQrt/xfTtbljCAHQ8K/C91tDDoL1OsoleeAiaGxMD5KMlX istFXAEWh9940FIiw4lcSzgIVMIiRwaeP9A7bczFXFsWgniMiIgWy9+8BNbAOOd0YnOD Bt+g== X-Gm-Message-State: AOJu0YyJ2rPgLGpP/P7Bz/7ukQu58b6EEkh3Hu283/ELOIb47YpIYQ5m 6oVduzMRotNaWebGHQPv26cbFg== X-Google-Smtp-Source: AGHT+IHvsE0u2jtEjXnhMBmdfrInIMp2SgRhm3O6etKbIOM9cTHyQjMpPOT4GNx3cIxDcZSUH1zWBg== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231003_003946_360028_A5B89E9E X-CRM114-Status: GOOD ( 13.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Andy Shevchenko Reviewed-by: Andrew Jeffery --- 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 */