From patchwork Tue Sep 12 08:44:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13381093 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 82021CA0EC3 for ; Tue, 12 Sep 2023 08:45:39 +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:Cc:To:Message-Id:MIME-Version:Subject: Date: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=Sdp7RCnb8GEhzSzTH0KnACU3KJGlc1UGrOm/1mOP578=; b=k0X6A+yfSOO9Kp RXojkR8qRKLMgQtSZtmcrjcvTQidELHN29KlU0d58fI9aUWuhzTibGj0Ha2Wi+e9lkhVogaY95jRi CCHfwNtnC4LW4tC6yxQaXzCUbxyKDVviVfw0iHGg767iZHr5NIjtgO5zmDEtRDww5VMrbkdJHOBri DVkyvG+nPvaLfWzZeHSJ0LX7i8VSV2BA14T8wt8JT7HHvIAZaDihY8QeB6V5AcsMReFmFqfYVhrN3 CvN9loaHxf8Wue44eG/fkDzXVG8ezcmSPg/E2Ktdj1ykGkHiqrY4ziheoHOKz56BjbBSZ67RqbyNx g6mdHkr0AKSjEQJRd2+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qfz18-002cJJ-2B; Tue, 12 Sep 2023 08:45:06 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qfz15-002cIR-2C for linux-arm-kernel@lists.infradead.org; Tue, 12 Sep 2023 08:45:05 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4ff8f2630e3so9097553e87.1 for ; Tue, 12 Sep 2023 01:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694508299; x=1695113099; darn=lists.infradead.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=A9cYVknfBAeu75UVlteP6kQhTPhNkOUCF7HIJ1iSBek=; b=e8TPAHyMMFV9OVExwpy53K4togF6M8QsEGq/MNkjs5yR6JGkto7yg3t+WAIni9Aghv +k8GxIozE1KIQnlubGGO4PJd13SLBekXue/awVW1twHn60+izwsmtSsbXXWOu0HsLAc+ jGJS/vhu20hec9t/xJWptsto2swBp96tMDSz3bYRfcHfbnwc8QE5YrCmKi1FQ7JlDsuA rBDrhcaWhmIfozgDUjgjJtS+6q9aHrRR0T5IReOs+xKK9smvhwgMQ8Ms/DeOpRQn38i9 2afTKdikEA5mkknHUHvOoOJGy2PMesqqzFVQtSSte1ZU2VVpmtKjrJcKRv4H0IUD09I1 Dvbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694508299; x=1695113099; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=A9cYVknfBAeu75UVlteP6kQhTPhNkOUCF7HIJ1iSBek=; b=auJmihGnacxm2ymTqBr7dI3xTkLc3t+6jYDGtBNEY5Hfpco3REUCVf44kVFhBp5C1W J6jPx5NRc8OcW8YkIg28EzSVuMax4L2BIlzCQoESDpyNwUagWiQ3NyUsJt0ttpj4UbVI R11JDQlAoLB0k4pgnwJX+CmKn6RiLAY7UF4eDdG8tAkooSSNSMapxQdO20YNuTP+Ujqd rLbNlhWZVDNFiMsPjjikADFLaKNIvj1KZ2lFC2HxT80VxHEhymgJBRo60d/kNNDxfU+3 Yy5BZexRkIZF0kmIsNG3YjLkOFtM5xNqTtM5ASAMQwPqYqMF/guKfj7SsLJ9NcHarKeC Yj7Q== X-Gm-Message-State: AOJu0YwWv459ff59p+CiKZbArxpuVJafYn6NYlvBu8tmgBgkXmWz9zRd MjdDI57BCIWfDbd3AywWJdEk6g== X-Google-Smtp-Source: AGHT+IGSOMHXkbKBRndy/P+lUWb4Fd6BypQox95rPMLgRNO93FsXEf3VhT1aIAsksiNcS/whalhFWg== X-Received: by 2002:ac2:498f:0:b0:500:d960:8b6f with SMTP id f15-20020ac2498f000000b00500d9608b6fmr8976952lfl.67.1694508299373; Tue, 12 Sep 2023 01:44:59 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id u4-20020a056512040400b004fdc0f2caafsm1671525lfk.48.2023.09.12.01.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:44:58 -0700 (PDT) From: Linus Walleij Date: Tue, 12 Sep 2023 10:44:52 +0200 Subject: [PATCH] OMAP/gpio: drop MPUIO static base MIME-Version: 1.0 Message-Id: <20230912-omap-mpuio-base-v1-1-290d9bd24b23@linaro.org> X-B4-Tracking: v=1; b=H4sIAAMlAGUC/x3MMQqAMAxA0atIZgO2CqJXEYdUU81gWxoUQby7x fEN/z+gnIUVxuqBzJeoxFBg6gqWncLGKGsx2Ma2zWAsxoMSHumUiI6UcaDV0eL7znoHpUqZvdz /cZrf9wPfdjC1YQAAAA== To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Bartosz Golaszewski , Andy Shevchenko Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230912_014503_726835_CD99F348 X-CRM114-Status: GOOD ( 14.43 ) 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 The OMAP GPIO driver hardcodes the MPIO chip base, but there is no point: we have already moved all consumers over to using descriptor look-ups. Drop the MPUIO GPIO base and use dynamic assignment. Root out the unused instances of the OMAP_MPUIO() macro and delete the unused OMAP_GPIO_IS_MPUIO() macro. Signed-off-by: Linus Walleij Reviewed-by: Tony Lindgren Tested-by: Janusz Krzysztofik --- Maybe Bartosz can merge this into the GPIO tree with Tony's et al blessing? --- arch/arm/mach-omap1/board-palmte.c | 5 ----- drivers/gpio/gpio-omap.c | 3 +-- include/linux/platform_data/gpio-omap.h | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) --- base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d change-id: 20230912-omap-mpuio-base-9adbacf742fb Best regards, diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c index 7e061d671fde..c917cb2c6e17 100644 --- a/arch/arm/mach-omap1/board-palmte.c +++ b/arch/arm/mach-omap1/board-palmte.c @@ -51,11 +51,6 @@ #define PALMTE_HDQ_GPIO 11 #define PALMTE_HEADPHONES_GPIO 14 #define PALMTE_SPEAKER_GPIO 15 -#define PALMTE_DC_GPIO OMAP_MPUIO(2) -#define PALMTE_MMC_SWITCH_GPIO OMAP_MPUIO(4) -#define PALMTE_MMC1_GPIO OMAP_MPUIO(6) -#define PALMTE_MMC2_GPIO OMAP_MPUIO(7) -#define PALMTE_MMC3_GPIO OMAP_MPUIO(11) static const unsigned int palmte_keymap[] = { KEY(0, 0, KEY_F1), /* Calendar */ diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index a927680c66f8..262ec0c1c658 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1048,15 +1048,14 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct device *pm_dev) bank->chip.label = "mpuio"; if (bank->regs->wkup_en) bank->chip.parent = &omap_mpuio_device.dev; - bank->chip.base = OMAP_MPUIO(0); } else { label = devm_kasprintf(bank->chip.parent, GFP_KERNEL, "gpio-%d-%d", gpio, gpio + bank->width - 1); if (!label) return -ENOMEM; bank->chip.label = label; - bank->chip.base = -1; } + bank->chip.base = -1; bank->chip.ngpio = bank->width; irq = &bank->chip.irq; diff --git a/include/linux/platform_data/gpio-omap.h b/include/linux/platform_data/gpio-omap.h index f377817ce75c..cdd8cfb424f5 100644 --- a/include/linux/platform_data/gpio-omap.h +++ b/include/linux/platform_data/gpio-omap.h @@ -144,9 +144,6 @@ #define OMAP_MAX_GPIO_LINES 192 -#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr)) -#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES) - #ifndef __ASSEMBLER__ struct omap_gpio_reg_offs { u16 revision;