Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1877436pxk; Sun, 13 Sep 2020 20:37:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnLHO47NAu/1XfsMdXm59aZE9y1CizfPT8bl4X4KnxX8Xkx5mBolB0Hi/jJ0cc4GMp0BZ6 X-Received: by 2002:a17:906:2b48:: with SMTP id b8mr13188494ejg.125.1600054625348; Sun, 13 Sep 2020 20:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600054625; cv=none; d=google.com; s=arc-20160816; b=vbACwMXUKxk+1jHPaiSz42fJUgh1ptL0b35WnJKKSQQ7EbV2qLmtGixt6769Li8ecd xFdTV4HSSUIo3vJSmzZq71Zf3I3HdpA9vdvciv6sYAy2V03mOf1drsyyF5A1XUIva5rm +MgfBpIH1VlQVFWnWcMMR8urVibclPfl4HiW+I12cjrLxO+1gYLb7gP9UQHHA86lj3z5 nZD1rz7iE+xCDgruaoGv6AAeYspg5IRM0Pootkwv/TWyWDXisIZP3g6+GxnmPHN0LjZj iXAFnP19S52Wna7qLRnP/b75vmGCg8FVxrmQjCTKkz68PIz10sVUt0gh6YhzG0zMLGvQ I2pg== 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=i3Y0WXiRmExXOf0hN06UmLQj60zGNMWU4zEgcyhTvZ8=; b=mJdOLoDlY5vxjbvkZG0gx0ZgreZmxNou0NEJFDpXVt3YFLu6G+8IzO9Hpi/auyzTV6 ZQjRQrirR248hhT8tSv3yV6UWOO65Nxaxj+qZL5lmILctoJ1X+Iafi7gf+BcB1arj1bT LNPQjU24rmE0lv0D8FwfNQsQYETU2O2YIGauPVHN6Dr+zusVQ92x6RlbMx0EIW10G8tt rXlZEmAp5kFGCw2BAo3viwF0X+5cc8vF5dWqfgnp/UZu43psqVUVnxbhZFdPTrFI71SJ 1nTDRMhgsb452yZeJZ9hRBPlfi1nE4bN30U8Ebd7X1UWC534IakbIyESqQ1XQtvAQvtS KGzw== 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 b19si6547334edy.519.2020.09.13.20.36.41; Sun, 13 Sep 2020 20:37:05 -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 S1725993AbgINDgJ (ORCPT + 99 others); Sun, 13 Sep 2020 23:36:09 -0400 Received: from inva021.nxp.com ([92.121.34.21]:55890 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgINDgE (ORCPT ); Sun, 13 Sep 2020 23:36:04 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 56CEB200653; Mon, 14 Sep 2020 05:36:02 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A0C51200442; Mon, 14 Sep 2020 05:35:51 +0200 (CEST) Received: from 10.192.242.69 (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id DFE0F40299; Mon, 14 Sep 2020 05:35:37 +0200 (CEST) From: Anson Huang To: linux@armlinux.org.uk, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com, oleksandr.suvorov@toradex.com, peng.fan@nxp.com, andreas@kemnade.info, hverkuil-cisco@xs4all.nl, olof@lixom.net, krzk@kernel.org, geert+renesas@glider.be, prabhakar.mahadev-lad.rj@bp.renesas.com, aisheng.dong@nxp.com, lkundrak@v3.sk, joel@jms.id.au, bjorn.andersson@linaro.org, leoyang.li@nxp.com, vkoul@kernel.org, michael@walle.cc, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH V2 RESEND 1/4] gpio: mxc: Support module build Date: Mon, 14 Sep 2020 11:29:04 +0800 Message-Id: <1600054147-29997-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 Change config to tristate, add module device table, module author, description and license to support module build for i.MX GPIO driver. As this is a SoC GPIO module, it provides common functions for most of the peripheral devices, such as GPIO pins control, secondary interrupt controller for GPIO pins IRQ etc., without GPIO driver, most of the peripheral devices will NOT work properly, so GPIO module is similar with clock, pinctrl driver that should be loaded ONCE and never unloaded. Since MXC GPIO driver needs to have init function to register syscore ops once, here still use subsys_initcall(), NOT module_platform_driver(). Signed-off-by: Anson Huang --- Changes since V1: - no code change, just add detail explanation about why this patch does NOT support module unloaded. --- drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-mxc.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 5cfdaf3..c7292a5 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -397,7 +397,7 @@ config GPIO_MVEBU select REGMAP_MMIO config GPIO_MXC - def_bool y + tristate "i.MX GPIO support" depends on ARCH_MXC || COMPILE_TEST select GPIO_GENERIC select GENERIC_IRQ_CHIP diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 64278a4..643f4c55 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -158,6 +159,7 @@ static const struct of_device_id mxc_gpio_dt_ids[] = { { .compatible = "fsl,imx7d-gpio", .data = &mxc_gpio_devtype[IMX35_GPIO], }, { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, mxc_gpio_dt_ids); /* * MX2 has one interrupt *for all* gpio ports. The list is used @@ -604,3 +606,7 @@ static int __init gpio_mxc_init(void) return platform_driver_register(&mxc_gpio_driver); } subsys_initcall(gpio_mxc_init); + +MODULE_AUTHOR("Shawn Guo "); +MODULE_DESCRIPTION("i.MX GPIO Driver"); +MODULE_LICENSE("GPL"); -- 2.7.4