[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1393173467-12240-1-git-send-email-vladimir.barinov@cogentembedded.com>
Date: Sun, 23 Feb 2014 20:37:47 +0400
From: <vladimir.barinov@...entembedded.com>
To: <linux-sh@...r.kernel.org>
Cc: <linus.walleij@...aro.org>, linux-gpio@...r.kernel.org,
<magnus.damm@...il.com>, <horms@...ge.net.au>, <gnurou@...il.com>,
<linux-kernel@...r.kernel.org>, <kuninori.morimoto.gx@...esas.com>
Subject: [PATCH] gpio: gpio-rcar: init at postcore level
From: Vladimir Barinov <vladimir.barinov@...entembedded.com>
This adds ability to use gpio API at board init_machine level.
F.e. it can be used in the following situation.
Many reference hardware has onboard switches that selects which periferals
to connect to the system. The gpio input state from switches can be used
in choosing platform devices runtime in board code instead of ifdefs/defconfig
changes.
Signed-off-by: <vladimir.barinov@...entembedded.com>
---
drivers/gpio/gpio-rcar.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
Index: build/drivers/gpio/gpio-rcar.c
===================================================================
--- build.orig/drivers/gpio/gpio-rcar.c 2014-02-22 23:21:51.456229152 +0400
+++ build/drivers/gpio/gpio-rcar.c 2014-02-22 23:21:52.320229133 +0400
@@ -485,7 +485,17 @@
}
};
-module_platform_driver(gpio_rcar_device_driver);
+static int __init gpio_rcar_init(void)
+{
+ return platform_driver_register(&gpio_rcar_device_driver);
+}
+postcore_initcall(gpio_rcar_init);
+
+static void __exit gpio_rcar_exit(void)
+{
+ platform_driver_unregister(&gpio_rcar_device_driver);
+}
+module_exit(gpio_rcar_exit);
MODULE_AUTHOR("Magnus Damm");
MODULE_DESCRIPTION("Renesas R-Car GPIO Driver");
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists