]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ARM: sa1111: provide a generic way to prevent devices from registering
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 26 Jan 2012 13:34:21 +0000 (13:34 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 24 Mar 2012 11:29:52 +0000 (11:29 +0000)
Some platforms don't want certain devices to be registered, because,
eg, the interface is not wired.  Provide a way for platforms to
prevent various devices from being registered via a devid bitmask in
the platform data.

Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/common/sa1111.c
arch/arm/include/asm/hardware/sa1111.h
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-sa1100/badge4.c
arch/arm/mach-sa1100/jornada720.c
arch/arm/mach-sa1100/neponset.c

index 4bdf1bb283dc800d16228f70ef85c1efa4d2eeca..17694cf64aa6015a6a8470866949a70790596b73 100644 (file)
@@ -833,11 +833,8 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
        g_sa1111 = sachip;
 
        has_devs = ~0;
-       if (machine_is_assabet() || machine_is_jornada720() ||
-           machine_is_badge4())
-               has_devs &= ~SA1111_DEVID_PS2_MSE;
-       else
-               has_devs &= ~SA1111_DEVID_SAC;
+       if (pd)
+               has_devs &= ~pd->disable_devs;
 
        for (i = 0; i < ARRAY_SIZE(sa1111_devices); i++)
                if (sa1111_devices[i].devid & has_devs)
index 37ad29d482f434449ac9dd771b6911ad1056119c..74afe20fffff671cd2d514bba513e9aab9aa2649 100644 (file)
@@ -584,6 +584,7 @@ void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned i
 
 struct sa1111_platform_data {
        int     irq_base;       /* base for cascaded on-chip IRQs */
+       unsigned disable_devs;
        void    *data;
        int     (*enable)(void *, unsigned);
        void    (*disable)(void *, unsigned);
index 6ebd276aebeb484a93923689657d35867f3cf7d5..6bb3f47b1f14e7070cfeb5c3dbaff57949adac10 100644 (file)
@@ -223,6 +223,7 @@ static struct resource sa1111_resources[] = {
 
 static struct sa1111_platform_data sa1111_info = {
        .irq_base       = LUBBOCK_SA1111_IRQ_BASE,
+       .disable_devs   = SA1111_DEVID_SAC,
 };
 
 static struct platform_device sa1111_device = {
index d84924993bad4056e2c6fc0d09c7977f263e88fc..8fb80f02c2a922cdbc7728cb1efee3215640e6bb 100644 (file)
@@ -66,6 +66,7 @@ static void badge4_sa1111_disable(void *data, unsigned devid)
 
 static struct sa1111_platform_data sa1111_info = {
        .irq_base       = IRQ_BOARD_END,
+       .disable_devs   = SA1111_DEVID_PS2_MSE,
        .enable         = badge4_sa1111_enable,
        .disable        = badge4_sa1111_disable,
 };
index ee121d6f048021489f014728924904990d07a858..dcd6d026aa687886ec865860bb955e47d805586e 100644 (file)
@@ -211,6 +211,7 @@ static struct resource sa1111_resources[] = {
 
 static struct sa1111_platform_data sa1111_info = {
        .irq_base       = IRQ_BOARD_END,
+       .disable_devs   = SA1111_DEVID_PS2_MSE,
 };
 
 static u64 sa1111_dmamask = 0xffffffffUL;
index b4fa53a1427e437a8592c9d4f8f947ba32742ad2..b40a7192f09f94e17a6a0246e38c2fb649592d5f 100644 (file)
@@ -242,6 +242,7 @@ static struct resource sa1111_resources[] = {
 
 static struct sa1111_platform_data sa1111_info = {
        .irq_base       = IRQ_BOARD_END,
+       .disable_devs   = SA1111_DEVID_PS2_MSE,
 };
 
 static u64 sa1111_dmamask = 0xffffffffUL;