From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED72CC433E6 for ; Mon, 29 Jun 2020 18:54:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8925204EC for ; Mon, 29 Jun 2020 18:54:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729888AbgF2SyH (ORCPT ); Mon, 29 Jun 2020 14:54:07 -0400 Received: from inva020.nxp.com ([92.121.34.13]:41020 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729812AbgF2SyD (ORCPT ); Mon, 29 Jun 2020 14:54:03 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id AA4C91A12DD; Mon, 29 Jun 2020 17:17:25 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C14031A0239; Mon, 29 Jun 2020 17:17:14 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 9756E402E0; Mon, 29 Jun 2020 23:17:01 +0800 (SGT) From: Anson Huang To: catalin.marinas@arm.com, will@kernel.org, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com, p.zabel@pengutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, bjorn.andersson@linaro.org, leoyang.li@nxp.com, vkoul@kernel.org, geert+renesas@glider.be, olof@lixom.net, treding@nvidia.com, gustavo.pimentel@synopsys.com, amurray@thegoodpenguin.co.uk, vidyas@nvidia.com, xiaowei.bao@nxp.com, jonnyc@amazon.com, hayashi.kunihiko@socionext.com, eswara.kota@linux.intel.com, krzk@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH V2 1/3] reset: imx7: Support module build Date: Mon, 29 Jun 2020 23:05:27 +0800 Message-Id: <1593443129-18766-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add module device table, author, description and license to support module build, and CONFIG_RESET_IMX7 is changed to default 'y' ONLY for i.MX7D, other platforms need to select it in defconfig. Signed-off-by: Anson Huang --- Changes since V1: - make it default 'y' for SOC_IMX7D; - add module author, description; - use device_initcall instead of builtin_platform_driver() to support module unload. --- drivers/reset/Kconfig | 5 +++-- drivers/reset/reset-imx7.c | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index d9efbfd..19f9773 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -65,9 +65,10 @@ config RESET_HSDK This enables the reset controller driver for HSDK board. config RESET_IMX7 - bool "i.MX7/8 Reset Driver" if COMPILE_TEST + tristate "i.MX7/8 Reset Driver" depends on HAS_IOMEM - default SOC_IMX7D || (ARM64 && ARCH_MXC) + depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST + default y if SOC_IMX7D select MFD_SYSCON help This enables the reset controller driver for i.MX7 SoCs. diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c index d170fe6..c710f789 100644 --- a/drivers/reset/reset-imx7.c +++ b/drivers/reset/reset-imx7.c @@ -8,7 +8,7 @@ */ #include -#include +#include #include #include #include @@ -386,6 +386,7 @@ static const struct of_device_id imx7_reset_dt_ids[] = { { .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp }, { /* sentinel */ }, }; +MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids); static struct platform_driver imx7_reset_driver = { .probe = imx7_reset_probe, @@ -394,4 +395,13 @@ static struct platform_driver imx7_reset_driver = { .of_match_table = imx7_reset_dt_ids, }, }; -builtin_platform_driver(imx7_reset_driver); + +static int __init imx7_reset_init(void) +{ + return platform_driver_register(&imx7_reset_driver); +} +device_initcall(imx7_reset_init); + +MODULE_AUTHOR("Andrey Smirnov "); +MODULE_DESCRIPTION("NXP i.MX7 reset driver"); +MODULE_LICENSE("GPL v2"); -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FBF8C433E0 for ; Mon, 29 Jun 2020 15:37:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D8F5252C4 for ; Mon, 29 Jun 2020 15:37:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3UeDz9yg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D8F5252C4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=0A71ZhPRjexfYVhQQBaH6xiBrFXRx+fk8M777IEy+uA=; b=3UeDz9yggZUTjmcL3Mh20Nm5zp BJ5Hs92mKv9xreJ/fzow4WZbaJYUOV3BuwBSeNpEFJzfjjrWWO3jqr43dIZmtWX4twMrAhIeP5Vpa 5/bTimFaJuymRwOs9jieHwLpAOtifeemLxUtaTLPtmP/xojiFy1H0TUSjMnX6ifpP00lSeLzhCAOf mONCYWt+56RkK07rKQDmDP82TobNcBqdMyH5voUe3U6BMZAcERN3JjFHQdLv555Gs9uZn+pqtum9v zD7QXdYIsyHxuDv92x/ZSKtYHtp8Uu6VmiO70zfTatPPlLRzhw+ZQNNVsGw9/oKP3kkkWc9gbMPjP t5wcnpkw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpvoj-0006Rq-EQ; Mon, 29 Jun 2020 15:35:33 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpvXE-0006LJ-Hn for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 15:17:30 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id AA4C91A12DD; Mon, 29 Jun 2020 17:17:25 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C14031A0239; Mon, 29 Jun 2020 17:17:14 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 9756E402E0; Mon, 29 Jun 2020 23:17:01 +0800 (SGT) From: Anson Huang To: catalin.marinas@arm.com, will@kernel.org, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com, p.zabel@pengutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, bjorn.andersson@linaro.org, leoyang.li@nxp.com, vkoul@kernel.org, geert+renesas@glider.be, olof@lixom.net, treding@nvidia.com, gustavo.pimentel@synopsys.com, amurray@thegoodpenguin.co.uk, vidyas@nvidia.com, xiaowei.bao@nxp.com, jonnyc@amazon.com, hayashi.kunihiko@socionext.com, eswara.kota@linux.intel.com, krzk@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH V2 1/3] reset: imx7: Support module build Date: Mon, 29 Jun 2020 23:05:27 +0800 Message-Id: <1593443129-18766-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-imx@nxp.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add module device table, author, description and license to support module build, and CONFIG_RESET_IMX7 is changed to default 'y' ONLY for i.MX7D, other platforms need to select it in defconfig. Signed-off-by: Anson Huang --- Changes since V1: - make it default 'y' for SOC_IMX7D; - add module author, description; - use device_initcall instead of builtin_platform_driver() to support module unload. --- drivers/reset/Kconfig | 5 +++-- drivers/reset/reset-imx7.c | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index d9efbfd..19f9773 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -65,9 +65,10 @@ config RESET_HSDK This enables the reset controller driver for HSDK board. config RESET_IMX7 - bool "i.MX7/8 Reset Driver" if COMPILE_TEST + tristate "i.MX7/8 Reset Driver" depends on HAS_IOMEM - default SOC_IMX7D || (ARM64 && ARCH_MXC) + depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST + default y if SOC_IMX7D select MFD_SYSCON help This enables the reset controller driver for i.MX7 SoCs. diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c index d170fe6..c710f789 100644 --- a/drivers/reset/reset-imx7.c +++ b/drivers/reset/reset-imx7.c @@ -8,7 +8,7 @@ */ #include -#include +#include #include #include #include @@ -386,6 +386,7 @@ static const struct of_device_id imx7_reset_dt_ids[] = { { .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp }, { /* sentinel */ }, }; +MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids); static struct platform_driver imx7_reset_driver = { .probe = imx7_reset_probe, @@ -394,4 +395,13 @@ static struct platform_driver imx7_reset_driver = { .of_match_table = imx7_reset_dt_ids, }, }; -builtin_platform_driver(imx7_reset_driver); + +static int __init imx7_reset_init(void) +{ + return platform_driver_register(&imx7_reset_driver); +} +device_initcall(imx7_reset_init); + +MODULE_AUTHOR("Andrey Smirnov "); +MODULE_DESCRIPTION("NXP i.MX7 reset driver"); +MODULE_LICENSE("GPL v2"); -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel