From 523817bd22617cd62199ae4ca2a6f5e1aa250654 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 14:44:57 +0100 Subject: ARM: amba: Auto-generate AMBA driver module aliases during modpost This patch adds the necessary support in file2alias.c to define suitable aliases based on the amba_id table in AMBA driver modules. This should be sufficient to allow such modules to be auto-loaded via udev. The AMBA bus driver's uevent hotplug code is also modified to pass an approriate MODALIAS string in the event. For simplicity, the AMBA ID is treated an an opaque 32-bit numeber. Module alises use patterns as appropriate to describe the value- mask pairs described in the driver's amba_id list. The proposed alias format is (extended regex): ^amba:d(HEX){8}$ Where HEX is a single upper-case HEX digit or a pattern (? or [] expression) matching a single upper-case HEX digit, as expected by udev. "d" is short for "device", following existing alias naming conventions for other device types. This adds some flexibility for unambiguously extending the alias format in the future by adding additional leading and trailing fields, if this turns out to be necessary. Signed-off-by: Dave Martin Acked-by: Pawel Moll --- drivers/amba/bus.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index bd230e80113..936c98cb247 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -52,6 +52,10 @@ static int amba_uevent(struct device *dev, struct kobj_uevent_env *env) int retval = 0; retval = add_uevent_var(env, "AMBA_ID=%08x", pcdev->periphid); + if (retval) + return retval; + + retval = add_uevent_var(env, "MODALIAS=amba:d%08X", pcdev->periphid); return retval; } #else -- cgit v1.2.3-18-g5258 From 4e3f3d53b8b5d597e36c075e01014e9019a44d55 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:20 +0100 Subject: hwrng: nomadik: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin --- drivers/char/hw_random/nomadik-rng.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/char/hw_random/nomadik-rng.c b/drivers/char/hw_random/nomadik-rng.c index 52e08ca3ccd..3d3c1e6703b 100644 --- a/drivers/char/hw_random/nomadik-rng.c +++ b/drivers/char/hw_random/nomadik-rng.c @@ -95,6 +95,8 @@ static struct amba_id nmk_rng_ids[] = { {0, 0}, }; +MODULE_DEVICE_TABLE(amba, nmk_rng_ids); + static struct amba_driver nmk_rng_driver = { .drv = { .owner = THIS_MODULE, -- cgit v1.2.3-18-g5258 From 037566df2a9274cec49cab131059e1bac538be08 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:20 +0100 Subject: dmaengine: pl08x: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin Acked-by: Vinod Koul --- drivers/dma/amba-pl08x.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index b7cbd1ab1db..0698695e8bf 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -2054,6 +2054,8 @@ static struct amba_id pl08x_ids[] = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, pl08x_ids); + static struct amba_driver pl08x_amba_driver = { .drv.name = DRIVER_NAME, .id_table = pl08x_ids, -- cgit v1.2.3-18-g5258 From e8fa516a4231682204d646df01c7bf3f0cfe4893 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:20 +0100 Subject: dmaengine: pl330: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin Acked-by: Jassi Brar Acked-by: Vinod Koul --- drivers/dma/pl330.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 571041477ab..2d8d1b041d9 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -990,6 +990,8 @@ static struct amba_id pl330_ids[] = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, pl330_ids); + #ifdef CONFIG_PM_RUNTIME static int pl330_runtime_suspend(struct device *dev) { -- cgit v1.2.3-18-g5258 From 955b678c03645117c4ad5e52c9946a25e3ca3199 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:21 +0100 Subject: gpio: pl061: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin Acked-by: Grant Likely --- drivers/gpio/gpio-pl061.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 093c90bd3c1..8efc3dd1286 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -350,6 +350,8 @@ static struct amba_id pl061_ids[] = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, pl061_ids); + static struct amba_driver pl061_gpio_driver = { .drv = { .name = "pl061_gpio", -- cgit v1.2.3-18-g5258 From 2dfff235918276638875a1d094f061083ccd6de8 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:21 +0100 Subject: input: ambakmi: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin Acked-by: Dmitry Torokhov --- drivers/input/serio/ambakmi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index 12abc50508e..8407d5b0ced 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c @@ -195,6 +195,8 @@ static struct amba_id amba_kmi_idtable[] = { { 0, 0 } }; +MODULE_DEVICE_TABLE(amba, amba_kmi_idtable); + static struct amba_driver ambakmi_driver = { .drv = { .name = "kmi-pl050", -- cgit v1.2.3-18-g5258 From 9f99835f1121bf81f1323b6267ea2957a179da2b Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:21 +0100 Subject: mmc: mmci: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin --- drivers/mmc/host/mmci.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 50b5f9926f6..05d6a91d038 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1496,6 +1496,8 @@ static struct amba_id mmci_ids[] = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, mmci_ids); + static struct amba_driver mmci_driver = { .drv = { .name = DRIVER_NAME, -- cgit v1.2.3-18-g5258 From 66bce5916b8d4c85876e59bb1db55071baea2680 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:21 +0100 Subject: rtc: pl030: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin --- drivers/rtc/rtc-pl030.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c index 1d28d4451da..02111fee077 100644 --- a/drivers/rtc/rtc-pl030.c +++ b/drivers/rtc/rtc-pl030.c @@ -174,6 +174,8 @@ static struct amba_id pl030_ids[] = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, pl030_ids); + static struct amba_driver pl030_driver = { .drv = { .name = "rtc-pl030", -- cgit v1.2.3-18-g5258 From f5feac2a333b2813a78d5d8749fa0a97cb26acee Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:22 +0100 Subject: rtc: pl031: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin --- drivers/rtc/rtc-pl031.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index ff1b84bd9bb..a952c8de1dd 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c @@ -420,6 +420,8 @@ static struct amba_id pl031_ids[] = { {0, 0}, }; +MODULE_DEVICE_TABLE(amba, pl031_ids); + static struct amba_driver pl031_driver = { .drv = { .name = "rtc-pl031", -- cgit v1.2.3-18-g5258 From 7eeac71b9fc9b3de3e0dc24ef34180a0bc0eb2f9 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:22 +0100 Subject: spi: pl022: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin Acked-by: Grant Likely Acked-by: Linus Walleij --- drivers/spi/spi-pl022.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index f103e470cb6..43abaf22ec4 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2424,6 +2424,8 @@ static struct amba_id pl022_ids[] = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, pl022_ids); + static struct amba_driver pl022_driver = { .drv = { .name = "ssp-pl022", -- cgit v1.2.3-18-g5258 From a664a119c05bd5784280b337e781b5e9432c6e12 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:22 +0100 Subject: serial: pl010: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin --- drivers/tty/serial/amba-pl010.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c index efdf92c3a35..0d91a540bf1 100644 --- a/drivers/tty/serial/amba-pl010.c +++ b/drivers/tty/serial/amba-pl010.c @@ -795,6 +795,8 @@ static struct amba_id pl010_ids[] = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, pl010_ids); + static struct amba_driver pl010_driver = { .drv = { .name = "uart-pl010", -- cgit v1.2.3-18-g5258 From 60f7a33b826148fd96cfa8a9e10b84ef444e78fe Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:22 +0100 Subject: serial: pl011: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin --- drivers/tty/serial/amba-pl011.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 00233af1acc..6958594f2fc 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1994,6 +1994,8 @@ static struct amba_id pl011_ids[] = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, pl011_ids); + static struct amba_driver pl011_driver = { .drv = { .name = "uart-pl011", -- cgit v1.2.3-18-g5258 From 6054f9b83cb62746bc0c002dd56364c262779856 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:23 +0100 Subject: fbdev: amba: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin --- drivers/video/amba-clcd.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index 2cda6ba0939..0a2cce7285b 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -621,6 +621,8 @@ static struct amba_id clcdfb_id_table[] = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, clcdfb_id_table); + static struct amba_driver clcd_driver = { .drv = { .name = "clcd-pl11x", -- cgit v1.2.3-18-g5258 From 17885b05b31c0d310f859982d2a56f167274547e Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Wed, 5 Oct 2011 15:15:23 +0100 Subject: watchdog: sp805: Enable module alias autogeneration for AMBA drivers Signed-off-by: Dave Martin --- drivers/watchdog/sp805_wdt.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index cc2cfbe33b3..c0a0ecec4d0 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c @@ -359,6 +359,8 @@ static struct amba_id sp805_wdt_ids[] __initdata = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, sp805_wdt_ids); + static struct amba_driver sp805_wdt_driver = { .drv = { .name = MODULE_NAME, -- cgit v1.2.3-18-g5258