Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2976361ybt; Mon, 29 Jun 2020 11:56:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqafZ50/afiKm4toka8XtVMjbPdOBYppAg0aSd0ESy7bXQZcKLnYF3H16rIGpOTzvLrFzb X-Received: by 2002:a17:906:d79c:: with SMTP id pj28mr14495222ejb.397.1593457007512; Mon, 29 Jun 2020 11:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593457007; cv=none; d=google.com; s=arc-20160816; b=GyZ58VOd55JwOqYMPceh6cOsmaHfu4gdB487Lw1ZYuykRqzgS2Q90PVeFE7aQxRAhE nbFRruBHH37hCj4g4B02IgebeCCFXAALKESewT/CiaT4wB9xWY2EqeU11XKI5S2zf5zt x6DRPLHoB9NJRCqm0vVXvSgWnNKaah+7ChEd/XUXXQBtZ2/Fzy1cI7ia8co5dz2Dv5Pp bQ9D5oJUpolkfGnARNbV0a834MLJnSxFDJQcD4WXXq1DCPlUtIp1Gc/kcZV1l6iqMM4c HTxEzCSoDW5+vJRvhWjSQmPD/Tp6noXL9dn6MEW24Tvu1KDTNRpLun7SoDqX39hmyK5Z /eJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=LjcMGzVQnwBc3aiAyPxX5KiANxxuBt9m5FSh1gM7GqA=; b=zGAYozDVHnqyimE4t/7cwZy2CzHAHZbWBFCLshz9sYD1mfGaJuR5zvLSq+Q/j0453y swHJfp9WKKifuPkVyX9tupJXYkRyhi5QrlTdc24nXyK6Cx5n1pyTcaOa/ucnHkT52zL7 TtBDxn+pINFobiWm7KVsXxJKofsFZDPzPBIeDdh5+a62Tdpy0+blpms2APjmaWossc2z vsTMbUeU6ZD2Ec8r3RSQSnplxQBZ8OmhIo9GO/GWW53KSGLHtUv0t6wjn30uUm9viLEv VdaoT6JU0sGRjp80rxq1PkGV428u9q049Yk4MVDHjNNgYuU1EyANI8GHK6Tk5husCMbX iX+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx8si206547edb.170.2020.06.29.11.56.23; Mon, 29 Jun 2020 11:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728139AbgF2SyG (ORCPT + 99 others); Mon, 29 Jun 2020 14:54:06 -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