Commit 4a6eac2b authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Bartosz Golaszewski

gpio: tegra: Support building driver as a loadable module

Support building driver as a loadable kernel module. This allows to
reduce size of a kernel zImage, which is important for some devices
since size of kernel partition may be limited and since some bootloader
variants have known problems in regards to the initrd placement if kernel
image is too big.

$ lsmod
Module                  Size  Used by
gpio_tegra             16384  27
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent 66f7aaa4
...@@ -595,7 +595,7 @@ config GPIO_TB10X ...@@ -595,7 +595,7 @@ config GPIO_TB10X
select OF_GPIO select OF_GPIO
config GPIO_TEGRA config GPIO_TEGRA
bool "NVIDIA Tegra GPIO support" tristate "NVIDIA Tegra GPIO support"
default ARCH_TEGRA default ARCH_TEGRA
depends on ARCH_TEGRA || COMPILE_TEST depends on ARCH_TEGRA || COMPILE_TEST
depends on OF_GPIO depends on OF_GPIO
......
...@@ -802,6 +802,7 @@ static const struct of_device_id tegra_gpio_of_match[] = { ...@@ -802,6 +802,7 @@ static const struct of_device_id tegra_gpio_of_match[] = {
{ .compatible = "nvidia,tegra20-gpio", .data = &tegra20_gpio_config }, { .compatible = "nvidia,tegra20-gpio", .data = &tegra20_gpio_config },
{ }, { },
}; };
MODULE_DEVICE_TABLE(of, tegra_gpio_of_match);
static struct platform_driver tegra_gpio_driver = { static struct platform_driver tegra_gpio_driver = {
.driver = { .driver = {
...@@ -811,9 +812,11 @@ static struct platform_driver tegra_gpio_driver = { ...@@ -811,9 +812,11 @@ static struct platform_driver tegra_gpio_driver = {
}, },
.probe = tegra_gpio_probe, .probe = tegra_gpio_probe,
}; };
module_platform_driver(tegra_gpio_driver);
static int __init tegra_gpio_init(void)
{ MODULE_DESCRIPTION("NVIDIA Tegra GPIO controller driver");
return platform_driver_register(&tegra_gpio_driver); MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
} MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>");
subsys_initcall(tegra_gpio_init); MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
MODULE_AUTHOR("Erik Gilling <konkers@google.com>");
MODULE_LICENSE("GPL v2");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment