From nobody Fri Jun 19 02:02:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58E76C433F5 for ; Mon, 11 Apr 2022 09:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344884AbiDKJ5v (ORCPT ); Mon, 11 Apr 2022 05:57:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344898AbiDKJ5m (ORCPT ); Mon, 11 Apr 2022 05:57:42 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 813B41263F; Mon, 11 Apr 2022 02:55:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id F2638CE1714; Mon, 11 Apr 2022 09:55:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 386BBC385AA; Mon, 11 Apr 2022 09:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649670925; bh=HHV9Ri58ctEofpGBkf5IU36ecNuwh1ugqE59mUikbtE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=goujv62t7LQumqKPFRHX18SvYzGEFUh2LjbedAoxrR1fMrNZyyAcqwEOPETLOcNYA 3gHw8H/FOMoD4uTOI+lBVdK7UQQVBCqwF4MJquH4FifaKyFhAr088icWFJO2UYKoo9 lJ2fic6SWq2tO9s8OwwWCUMYJo5bGAJcckcEuW5Wf4DZRJo0qxZ4xspxwR7ekOWPGS +Wjmw0KZfNkOJSZl3gXFp3m5LVXC6aVcRa7ZCXwKd0OSOyJ6iCmc6OtVeuqsducrbJ OuZFNHFZSoNeFY2qrKOUfsjcEvWcYKhJi5lm5BqUzyTNKVArhmMEN4mQE7sejlJVd0 9VVcm9XV78QoA== From: Roger Quadros To: krzk@kernel.org Cc: miquel.raynal@bootlin.com, tony@atomide.com, vigneshr@ti.com, kishon@ti.com, nm@ti.com, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Roger Quadros Subject: [PATCH v3 1/2] memory: omap-gpmc: Make OMAP_GPMC config visible and selectable Date: Mon, 11 Apr 2022 12:55:15 +0300 Message-Id: <20220411095516.24754-2-rogerq@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220411095516.24754-1-rogerq@kernel.org> References: <20220411095516.24754-1-rogerq@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" So far for armv7 TI platforms, GPMC was being selected by arch/arm/mach-* architecture Kconfig files. For K3 platforms, GPMC is no longer required for basic boot and cannot be always enabled by default by mach- Kconfig. We need a way for user (or board defconfig) to enable it if required so ake OMAP_GPMC Kconfig option always visible. Signed-off-by: Roger Quadros Reviewed-by: Miquel Raynal --- drivers/memory/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig index 30bff6cb1b8d..da2af9c38fe3 100644 --- a/drivers/memory/Kconfig +++ b/drivers/memory/Kconfig @@ -103,8 +103,8 @@ config TI_EMIF temperature changes =20 config OMAP_GPMC - bool "Texas Instruments OMAP SoC GPMC driver" if COMPILE_TEST - depends on OF_ADDRESS + bool "Texas Instruments OMAP SoC GPMC driver" + depends on OF_ADDRESS || COMPILE_TEST select GPIOLIB help This driver is for the General Purpose Memory Controller (GPMC) --=20 2.17.1 From nobody Fri Jun 19 02:02:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02E34C433EF for ; Mon, 11 Apr 2022 09:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344897AbiDKJ5z (ORCPT ); Mon, 11 Apr 2022 05:57:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343781AbiDKJ5o (ORCPT ); Mon, 11 Apr 2022 05:57:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA61E1263F; Mon, 11 Apr 2022 02:55:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7297AB811CE; Mon, 11 Apr 2022 09:55:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E54F3C385AD; Mon, 11 Apr 2022 09:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649670928; bh=NCNYVToRizDs7+QdVooNoSbWYHm2S6GGdRBc+kHEwco=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MWsF6cj3sPT1ZRnjCYR+BGmmBNqmSHFJQq3UYVVDGtJfUUtblyfhdR6yNAQm3o0Fx dOoWAMG5tWjSaFXTfl+9viRYTkm+qOJXLmhGhO1X4qiDv/htwQO4DlbS2jypjIrp0a QXVozr5QP7pplllH3euxH/NJpkxR6XDeDril3NU1L/KKj0WCrklAhvgUskMTJvze4G +0zQXkwsP3oewZ3Dt7lblTJLxSXhFVpW7ApktP4cPkW/KS3eFz0rfsdAQOgGRX6YVi 9LfhCGolboHLAHGTtpt1A6nYVvAcxoCBWMe5S/+5JYgsHMY8Hdbf77qRaPEIBUGSHk DrVujxef5cExg== From: Roger Quadros To: krzk@kernel.org Cc: miquel.raynal@bootlin.com, tony@atomide.com, vigneshr@ti.com, kishon@ti.com, nm@ti.com, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Roger Quadros Subject: [PATCH v3 2/2] memory: omap-gpmc: Allow building as a module Date: Mon, 11 Apr 2022 12:55:16 +0300 Message-Id: <20220411095516.24754-3-rogerq@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220411095516.24754-1-rogerq@kernel.org> References: <20220411095516.24754-1-rogerq@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Allow OMAP_GPMC to be built as a module. When building this driver as a module, the symbol 'of_default_bus_match_table' will not be found as it is not being exported. The of_match_node() call is redundant anyways as of_platform_default_populate() already takes care of matching with 'of_default_bus_match_table'. So get rid of that call. This will also resolve the module build failure. Move compatible match table to the end where it is usually expected. Signed-off-by: Roger Quadros --- drivers/memory/Kconfig | 2 +- drivers/memory/omap-gpmc.c | 43 ++++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig index da2af9c38fe3..4debd4b2c8da 100644 --- a/drivers/memory/Kconfig +++ b/drivers/memory/Kconfig @@ -103,7 +103,7 @@ config TI_EMIF temperature changes =20 config OMAP_GPMC - bool "Texas Instruments OMAP SoC GPMC driver" + tristate "Texas Instruments OMAP SoC GPMC driver" depends on OF_ADDRESS || COMPILE_TEST select GPIOLIB help diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index ed11887c1b7c..de41c9795fb8 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -1889,16 +1890,6 @@ int gpmc_cs_program_settings(int cs, struct gpmc_set= tings *p) } =20 #ifdef CONFIG_OF -static const struct of_device_id gpmc_dt_ids[] =3D { - { .compatible =3D "ti,omap2420-gpmc" }, - { .compatible =3D "ti,omap2430-gpmc" }, - { .compatible =3D "ti,omap3430-gpmc" }, /* omap3430 & omap3630 */ - { .compatible =3D "ti,omap4430-gpmc" }, /* omap4430 & omap4460 & omap543x= */ - { .compatible =3D "ti,am3352-gpmc" }, /* am335x devices */ - { .compatible =3D "ti,am64-gpmc" }, - { } -}; - static void gpmc_cs_set_name(int cs, const char *name) { struct gpmc_cs_data *gpmc =3D &gpmc_cs[cs]; @@ -2257,11 +2248,9 @@ static int gpmc_probe_generic_child(struct platform_= device *pdev, if (!of_platform_device_create(child, NULL, &pdev->dev)) goto err_child_fail; =20 - /* is child a common bus? */ - if (of_match_node(of_default_bus_match_table, child)) - /* create children and other common bus children */ - if (of_platform_default_populate(child, NULL, &pdev->dev)) - goto err_child_fail; + /* create children and other common bus children */ + if (of_platform_default_populate(child, NULL, &pdev->dev)) + goto err_child_fail; =20 return 0; =20 @@ -2278,6 +2267,8 @@ static int gpmc_probe_generic_child(struct platform_d= evice *pdev, return ret; } =20 +static const struct of_device_id gpmc_dt_ids[]; + static int gpmc_probe_dt(struct platform_device *pdev) { int ret; @@ -2644,6 +2635,19 @@ static int gpmc_resume(struct device *dev) =20 static SIMPLE_DEV_PM_OPS(gpmc_pm_ops, gpmc_suspend, gpmc_resume); =20 +#ifdef CONFIG_OF +static const struct of_device_id gpmc_dt_ids[] =3D { + { .compatible =3D "ti,omap2420-gpmc" }, + { .compatible =3D "ti,omap2430-gpmc" }, + { .compatible =3D "ti,omap3430-gpmc" }, /* omap3430 & omap3630 */ + { .compatible =3D "ti,omap4430-gpmc" }, /* omap4430 & omap4460 & omap543x= */ + { .compatible =3D "ti,am3352-gpmc" }, /* am335x devices */ + { .compatible =3D "ti,am64-gpmc" }, + { } +}; +MODULE_DEVICE_TABLE(of, gpmc_dt_ids); +#endif + static struct platform_driver gpmc_driver =3D { .probe =3D gpmc_probe, .remove =3D gpmc_remove, @@ -2654,8 +2658,7 @@ static struct platform_driver gpmc_driver =3D { }, }; =20 -static __init int gpmc_init(void) -{ - return platform_driver_register(&gpmc_driver); -} -postcore_initcall(gpmc_init); +module_platform_driver(gpmc_driver); + +MODULE_DESCRIPTION("Texas Instruments GPMC driver"); +MODULE_LICENSE("GPL v2"); --=20 2.17.1