diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2011-06-30 02:31:59 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-07-05 23:29:16 -0400 |
commit | 857f727674f45157ec9a5d788c8954d9f082acb7 (patch) | |
tree | c4dc5b9d13bd38184582d939faa97cdd3ecb40c4 | |
parent | 6977a271d45951b8e7ed5eb8caf659fbd69ee365 (diff) |
staging: ste_rmi4: remove cross-dependent platform data
The ux500 machine was actually defining platform data for the
staging driver ste_rmi4, which is not OK. Let us instead define
some __weak platform data in the machine so that the staging
driver can override it at compile-time and we can thus have the
driver self-contained in staging.
Reported-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-u8500uib.c | 24 | ||||
-rw-r--r-- | drivers/staging/ste_rmi4/Makefile | 1 | ||||
-rw-r--r-- | drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c | 32 |
3 files changed, 35 insertions, 22 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-u8500uib.c b/arch/arm/mach-ux500/board-mop500-u8500uib.c index d8a8734a0eba..8ce46c0fdfd5 100644 --- a/arch/arm/mach-ux500/board-mop500-u8500uib.c +++ b/arch/arm/mach-ux500/board-mop500-u8500uib.c | |||
@@ -12,34 +12,14 @@ | |||
12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
13 | #include <linux/mfd/tc3589x.h> | 13 | #include <linux/mfd/tc3589x.h> |
14 | #include <linux/input/matrix_keypad.h> | 14 | #include <linux/input/matrix_keypad.h> |
15 | #include <../drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h> | ||
16 | 15 | ||
17 | #include <mach/gpio.h> | 16 | #include <mach/gpio.h> |
18 | #include <mach/irqs.h> | 17 | #include <mach/irqs.h> |
19 | 18 | ||
20 | #include "board-mop500.h" | 19 | #include "board-mop500.h" |
21 | 20 | ||
22 | /* | 21 | /* Dummy data that can be overridden by staging driver */ |
23 | * Synaptics RMI4 touchscreen interface on the U8500 UIB | 22 | struct i2c_board_info __initdata __weak mop500_i2c3_devices_u8500[] = { |
24 | */ | ||
25 | |||
26 | /* | ||
27 | * Descriptor structure. | ||
28 | * Describes the number of i2c devices on the bus that speak RMI. | ||
29 | */ | ||
30 | static struct synaptics_rmi4_platform_data rmi4_i2c_dev_platformdata = { | ||
31 | .irq_number = NOMADIK_GPIO_TO_IRQ(84), | ||
32 | .irq_type = (IRQF_TRIGGER_FALLING | IRQF_SHARED), | ||
33 | .x_flip = false, | ||
34 | .y_flip = true, | ||
35 | .regulator_en = false, | ||
36 | }; | ||
37 | |||
38 | static struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = { | ||
39 | { | ||
40 | I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B), | ||
41 | .platform_data = &rmi4_i2c_dev_platformdata, | ||
42 | }, | ||
43 | }; | 23 | }; |
44 | 24 | ||
45 | /* | 25 | /* |
diff --git a/drivers/staging/ste_rmi4/Makefile b/drivers/staging/ste_rmi4/Makefile index 6cce2ed187ef..176f46900571 100644 --- a/drivers/staging/ste_rmi4/Makefile +++ b/drivers/staging/ste_rmi4/Makefile | |||
@@ -2,3 +2,4 @@ | |||
2 | # Makefile for the RMI4 touchscreen driver. | 2 | # Makefile for the RMI4 touchscreen driver. |
3 | # | 3 | # |
4 | obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += synaptics_i2c_rmi4.o | 4 | obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += synaptics_i2c_rmi4.o |
5 | obj-$(CONFIG_MACH_U8500) += board-mop500-u8500uib-rmi4.o | ||
diff --git a/drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c b/drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c new file mode 100644 index 000000000000..a272e488e5b9 --- /dev/null +++ b/drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * Some platform data for the RMI4 touchscreen that will override the __weak | ||
3 | * platform data in the Ux500 machine if this driver is activated. | ||
4 | */ | ||
5 | #include <linux/i2c.h> | ||
6 | #include <linux/gpio.h> | ||
7 | #include <linux/interrupt.h> | ||
8 | #include <mach/gpio.h> | ||
9 | #include <mach/irqs.h> | ||
10 | #include "synaptics_i2c_rmi4.h" | ||
11 | |||
12 | /* | ||
13 | * Synaptics RMI4 touchscreen interface on the U8500 UIB | ||
14 | */ | ||
15 | |||
16 | /* | ||
17 | * Descriptor structure. | ||
18 | * Describes the number of i2c devices on the bus that speak RMI. | ||
19 | */ | ||
20 | static struct synaptics_rmi4_platform_data rmi4_i2c_dev_platformdata = { | ||
21 | .irq_number = NOMADIK_GPIO_TO_IRQ(84), | ||
22 | .irq_type = (IRQF_TRIGGER_FALLING | IRQF_SHARED), | ||
23 | .x_flip = false, | ||
24 | .y_flip = true, | ||
25 | }; | ||
26 | |||
27 | struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = { | ||
28 | { | ||
29 | I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B), | ||
30 | .platform_data = &rmi4_i2c_dev_platformdata, | ||
31 | }, | ||
32 | }; | ||