diff options
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/irqs-board-mop500.h | 15 |
3 files changed, 41 insertions, 2 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index d0076453d7ff..6ac0164db6e8 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/mfd/ab8500.h> | 22 | #include <linux/mfd/ab8500.h> |
23 | #include <linux/regulator/ab8500.h> | 23 | #include <linux/regulator/ab8500.h> |
24 | #include <linux/mfd/tc3589x.h> | 24 | #include <linux/mfd/tc3589x.h> |
25 | #include <linux/mfd/ab8500/gpio.h> | ||
25 | #include <linux/leds-lp5521.h> | 26 | #include <linux/leds-lp5521.h> |
26 | #include <linux/input.h> | 27 | #include <linux/input.h> |
27 | #include <linux/gpio_keys.h> | 28 | #include <linux/gpio_keys.h> |
@@ -42,10 +43,33 @@ | |||
42 | #include "board-mop500.h" | 43 | #include "board-mop500.h" |
43 | #include "board-mop500-regulators.h" | 44 | #include "board-mop500-regulators.h" |
44 | 45 | ||
46 | static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { | ||
47 | .gpio_base = MOP500_AB8500_GPIO(0), | ||
48 | .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, | ||
49 | /* config_reg is the initial configuration of ab8500 pins. | ||
50 | * The pins can be configured as GPIO or alt functions based | ||
51 | * on value present in GpioSel1 to GpioSel6 and AlternatFunction | ||
52 | * register. This is the array of 7 configuration settings. | ||
53 | * One has to compile time decide these settings. Below is the | ||
54 | * explaination of these setting | ||
55 | * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO | ||
56 | * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO | ||
57 | * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO | ||
58 | * GpioSel4 = 0x01 => Pin GPIo25 is configured as GPIO | ||
59 | * GpioSel5 = 0x7A => Pins GPIO34, GPIO36 to GPIO39 are conf as GPIO | ||
60 | * GpioSel6 = 0x00 => Pins GPIO41 & GPIo42 are not configured as GPIO | ||
61 | * AlternaFunction = 0x00 => If Pins GPIO10 to 13 are not configured | ||
62 | * as GPIO then this register selectes the alternate fucntions | ||
63 | */ | ||
64 | .config_reg = {0x00, 0x1E, 0x80, 0x01, | ||
65 | 0x7A, 0x00, 0x00}, | ||
66 | }; | ||
67 | |||
45 | static struct ab8500_platform_data ab8500_platdata = { | 68 | static struct ab8500_platform_data ab8500_platdata = { |
46 | .irq_base = MOP500_AB8500_IRQ_BASE, | 69 | .irq_base = MOP500_AB8500_IRQ_BASE, |
47 | .regulator = ab8500_regulators, | 70 | .regulator = ab8500_regulators, |
48 | .num_regulator = ARRAY_SIZE(ab8500_regulators), | 71 | .num_regulator = ARRAY_SIZE(ab8500_regulators), |
72 | .gpio = &ab8500_gpio_pdata, | ||
49 | }; | 73 | }; |
50 | 74 | ||
51 | static struct resource ab8500_resources[] = { | 75 | static struct resource ab8500_resources[] = { |
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index 56722f4be71b..03a31cc9b084 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h | |||
@@ -27,6 +27,10 @@ | |||
27 | #define GPIO_BU21013_CS MOP500_EGPIO(13) | 27 | #define GPIO_BU21013_CS MOP500_EGPIO(13) |
28 | #define GPIO_SDMMC_EN MOP500_EGPIO(17) | 28 | #define GPIO_SDMMC_EN MOP500_EGPIO(17) |
29 | #define GPIO_SDMMC_1V8_3V_SEL MOP500_EGPIO(18) | 29 | #define GPIO_SDMMC_1V8_3V_SEL MOP500_EGPIO(18) |
30 | #define MOP500_EGPIO_END MOP500_EGPIO(24) | ||
31 | |||
32 | /* GPIOs on the AB8500 mixed-signals circuit */ | ||
33 | #define MOP500_AB8500_GPIO(x) (MOP500_EGPIO_END + (x)) | ||
30 | 34 | ||
31 | struct i2c_board_info; | 35 | struct i2c_board_info; |
32 | 36 | ||
diff --git a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h index 7cdeb2af0ebb..97ef55f84934 100644 --- a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h +++ b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h | |||
@@ -35,9 +35,20 @@ | |||
35 | #define MOP500_STMPE1601_IRQBASE MOP500_EGPIO_IRQ_END | 35 | #define MOP500_STMPE1601_IRQBASE MOP500_EGPIO_IRQ_END |
36 | #define MOP500_STMPE1601_IRQ(x) (MOP500_STMPE1601_IRQBASE + (x)) | 36 | #define MOP500_STMPE1601_IRQ(x) (MOP500_STMPE1601_IRQBASE + (x)) |
37 | 37 | ||
38 | #define MOP500_NR_IRQS MOP500_STMPE1601_IRQ(STMPE_NR_INTERNAL_IRQS) | 38 | #define MOP500_STMPE1601_IRQ_END \ |
39 | MOP500_STMPE1601_IRQ(STMPE_NR_INTERNAL_IRQS) | ||
39 | 40 | ||
40 | #define MOP500_IRQ_END MOP500_NR_IRQS | 41 | /* AB8500 virtual gpio IRQ */ |
42 | #define AB8500_VIR_GPIO_NR_IRQS 16 | ||
43 | |||
44 | #define MOP500_AB8500_VIR_GPIO_IRQ_BASE \ | ||
45 | MOP500_STMPE1601_IRQ_END | ||
46 | #define MOP500_AB8500_VIR_GPIO_IRQ_END \ | ||
47 | (MOP500_AB8500_VIR_GPIO_IRQ_BASE + AB8500_VIR_GPIO_NR_IRQS) | ||
48 | |||
49 | #define MOP500_NR_IRQS MOP500_AB8500_VIR_GPIO_IRQ_END | ||
50 | |||
51 | #define MOP500_IRQ_END MOP500_NR_IRQS | ||
41 | 52 | ||
42 | #if MOP500_IRQ_END > IRQ_BOARD_END | 53 | #if MOP500_IRQ_END > IRQ_BOARD_END |
43 | #undef IRQ_BOARD_END | 54 | #undef IRQ_BOARD_END |