Skip to content

Commit

Permalink
ARM: sa1111: provide a generic way to prevent devices from registering
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King committed Mar 24, 2012
1 parent e5c0fc4 commit 07be45f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
7 changes: 2 additions & 5 deletions arch/arm/common/sa1111.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/include/asm/hardware/sa1111.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/lubbock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-sa1100/badge4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-sa1100/jornada720.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-sa1100/neponset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 07be45f

Please sign in to comment.