diff options
| -rw-r--r-- | arch/arm/mach-tegra/board-harmony-pinmux.c | 8 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/board-paz00-pinmux.c | 8 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/board-seaboard-pinmux.c | 9 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/board-trimslice-pinmux.c | 7 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/devices.c | 84 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/devices.h | 2 |
6 files changed, 116 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-pinmux.c b/arch/arm/mach-tegra/board-harmony-pinmux.c index 4d63e2e97a8d..e99b45618cd0 100644 --- a/arch/arm/mach-tegra/board-harmony-pinmux.c +++ b/arch/arm/mach-tegra/board-harmony-pinmux.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include "gpio-names.h" | 21 | #include "gpio-names.h" |
| 22 | #include "board-harmony.h" | 22 | #include "board-harmony.h" |
| 23 | #include "devices.h" | ||
| 23 | 24 | ||
| 24 | static struct tegra_pingroup_config harmony_pinmux[] = { | 25 | static struct tegra_pingroup_config harmony_pinmux[] = { |
| 25 | {TEGRA_PINGROUP_ATA, TEGRA_MUX_IDE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 26 | {TEGRA_PINGROUP_ATA, TEGRA_MUX_IDE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
| @@ -140,6 +141,11 @@ static struct tegra_pingroup_config harmony_pinmux[] = { | |||
| 140 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 141 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
| 141 | }; | 142 | }; |
| 142 | 143 | ||
| 144 | static struct platform_device *pinmux_devices[] = { | ||
| 145 | &tegra_gpio_device, | ||
| 146 | &tegra_pinmux_device, | ||
| 147 | }; | ||
| 148 | |||
| 143 | static struct tegra_gpio_table gpio_table[] = { | 149 | static struct tegra_gpio_table gpio_table[] = { |
| 144 | { .gpio = TEGRA_GPIO_SD2_CD, .enable = true }, | 150 | { .gpio = TEGRA_GPIO_SD2_CD, .enable = true }, |
| 145 | { .gpio = TEGRA_GPIO_SD2_WP, .enable = true }, | 151 | { .gpio = TEGRA_GPIO_SD2_WP, .enable = true }, |
| @@ -155,6 +161,8 @@ static struct tegra_gpio_table gpio_table[] = { | |||
| 155 | 161 | ||
| 156 | void harmony_pinmux_init(void) | 162 | void harmony_pinmux_init(void) |
| 157 | { | 163 | { |
| 164 | platform_add_devices(pinmux_devices, ARRAY_SIZE(pinmux_devices)); | ||
| 165 | |||
| 158 | tegra_pinmux_config_table(harmony_pinmux, ARRAY_SIZE(harmony_pinmux)); | 166 | tegra_pinmux_config_table(harmony_pinmux, ARRAY_SIZE(harmony_pinmux)); |
| 159 | 167 | ||
| 160 | tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table)); | 168 | tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table)); |
diff --git a/arch/arm/mach-tegra/board-paz00-pinmux.c b/arch/arm/mach-tegra/board-paz00-pinmux.c index bdd2627dd87b..43633f4d4bcf 100644 --- a/arch/arm/mach-tegra/board-paz00-pinmux.c +++ b/arch/arm/mach-tegra/board-paz00-pinmux.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include "gpio-names.h" | 21 | #include "gpio-names.h" |
| 22 | #include "board-paz00.h" | 22 | #include "board-paz00.h" |
| 23 | #include "devices.h" | ||
| 23 | 24 | ||
| 24 | static struct tegra_pingroup_config paz00_pinmux[] = { | 25 | static struct tegra_pingroup_config paz00_pinmux[] = { |
| 25 | {TEGRA_PINGROUP_ATA, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 26 | {TEGRA_PINGROUP_ATA, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
| @@ -140,6 +141,11 @@ static struct tegra_pingroup_config paz00_pinmux[] = { | |||
| 140 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 141 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
| 141 | }; | 142 | }; |
| 142 | 143 | ||
| 144 | static struct platform_device *pinmux_devices[] = { | ||
| 145 | &tegra_gpio_device, | ||
| 146 | &tegra_pinmux_device, | ||
| 147 | }; | ||
| 148 | |||
| 143 | static struct tegra_gpio_table gpio_table[] = { | 149 | static struct tegra_gpio_table gpio_table[] = { |
| 144 | { .gpio = TEGRA_GPIO_SD1_CD, .enable = true }, | 150 | { .gpio = TEGRA_GPIO_SD1_CD, .enable = true }, |
| 145 | { .gpio = TEGRA_GPIO_SD1_WP, .enable = true }, | 151 | { .gpio = TEGRA_GPIO_SD1_WP, .enable = true }, |
| @@ -149,6 +155,8 @@ static struct tegra_gpio_table gpio_table[] = { | |||
| 149 | 155 | ||
| 150 | void paz00_pinmux_init(void) | 156 | void paz00_pinmux_init(void) |
| 151 | { | 157 | { |
| 158 | platform_add_devices(pinmux_devices, ARRAY_SIZE(pinmux_devices)); | ||
| 159 | |||
| 152 | tegra_pinmux_config_table(paz00_pinmux, ARRAY_SIZE(paz00_pinmux)); | 160 | tegra_pinmux_config_table(paz00_pinmux, ARRAY_SIZE(paz00_pinmux)); |
| 153 | 161 | ||
| 154 | tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table)); | 162 | tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table)); |
diff --git a/arch/arm/mach-tegra/board-seaboard-pinmux.c b/arch/arm/mach-tegra/board-seaboard-pinmux.c index 0bda495e9742..9c0f6d7527b9 100644 --- a/arch/arm/mach-tegra/board-seaboard-pinmux.c +++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | #include "gpio-names.h" | 22 | #include "gpio-names.h" |
| 23 | #include "board-seaboard.h" | 23 | #include "board-seaboard.h" |
| 24 | #include "devices.h" | ||
| 24 | 25 | ||
| 25 | #define DEFAULT_DRIVE(_name) \ | 26 | #define DEFAULT_DRIVE(_name) \ |
| 26 | { \ | 27 | { \ |
| @@ -157,8 +158,10 @@ static __initdata struct tegra_pingroup_config seaboard_pinmux[] = { | |||
| 157 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 158 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
| 158 | }; | 159 | }; |
| 159 | 160 | ||
| 160 | 161 | static struct platform_device *pinmux_devices[] = { | |
| 161 | 162 | &tegra_gpio_device, | |
| 163 | &tegra_pinmux_device, | ||
| 164 | }; | ||
| 162 | 165 | ||
| 163 | static struct tegra_gpio_table gpio_table[] = { | 166 | static struct tegra_gpio_table gpio_table[] = { |
| 164 | { .gpio = TEGRA_GPIO_SD2_CD, .enable = true }, | 167 | { .gpio = TEGRA_GPIO_SD2_CD, .enable = true }, |
| @@ -171,6 +174,8 @@ static struct tegra_gpio_table gpio_table[] = { | |||
| 171 | 174 | ||
| 172 | void __init seaboard_pinmux_init(void) | 175 | void __init seaboard_pinmux_init(void) |
| 173 | { | 176 | { |
| 177 | platform_add_devices(pinmux_devices, ARRAY_SIZE(pinmux_devices)); | ||
| 178 | |||
| 174 | tegra_pinmux_config_table(seaboard_pinmux, ARRAY_SIZE(seaboard_pinmux)); | 179 | tegra_pinmux_config_table(seaboard_pinmux, ARRAY_SIZE(seaboard_pinmux)); |
| 175 | 180 | ||
| 176 | tegra_drive_pinmux_config_table(seaboard_drive_pinmux, | 181 | tegra_drive_pinmux_config_table(seaboard_drive_pinmux, |
diff --git a/arch/arm/mach-tegra/board-trimslice-pinmux.c b/arch/arm/mach-tegra/board-trimslice-pinmux.c index 47c596cdbf32..8417ba77f765 100644 --- a/arch/arm/mach-tegra/board-trimslice-pinmux.c +++ b/arch/arm/mach-tegra/board-trimslice-pinmux.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | #include "gpio-names.h" | 23 | #include "gpio-names.h" |
| 24 | #include "board-trimslice.h" | 24 | #include "board-trimslice.h" |
| 25 | #include "devices.h" | ||
| 25 | 26 | ||
| 26 | static __initdata struct tegra_pingroup_config trimslice_pinmux[] = { | 27 | static __initdata struct tegra_pingroup_config trimslice_pinmux[] = { |
| 27 | {TEGRA_PINGROUP_ATA, TEGRA_MUX_IDE, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | 28 | {TEGRA_PINGROUP_ATA, TEGRA_MUX_IDE, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, |
| @@ -142,6 +143,11 @@ static __initdata struct tegra_pingroup_config trimslice_pinmux[] = { | |||
| 142 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 143 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
| 143 | }; | 144 | }; |
| 144 | 145 | ||
| 146 | static struct platform_device *pinmux_devices[] = { | ||
| 147 | &tegra_gpio_device, | ||
| 148 | &tegra_pinmux_device, | ||
| 149 | }; | ||
| 150 | |||
| 145 | static struct tegra_gpio_table gpio_table[] = { | 151 | static struct tegra_gpio_table gpio_table[] = { |
| 146 | { .gpio = TRIMSLICE_GPIO_SD4_CD, .enable = true }, /* mmc4 cd */ | 152 | { .gpio = TRIMSLICE_GPIO_SD4_CD, .enable = true }, /* mmc4 cd */ |
| 147 | { .gpio = TRIMSLICE_GPIO_SD4_WP, .enable = true }, /* mmc4 wp */ | 153 | { .gpio = TRIMSLICE_GPIO_SD4_WP, .enable = true }, /* mmc4 wp */ |
| @@ -152,6 +158,7 @@ static struct tegra_gpio_table gpio_table[] = { | |||
| 152 | 158 | ||
| 153 | void __init trimslice_pinmux_init(void) | 159 | void __init trimslice_pinmux_init(void) |
| 154 | { | 160 | { |
| 161 | platform_add_devices(pinmux_devices, ARRAY_SIZE(pinmux_devices)); | ||
| 155 | tegra_pinmux_config_table(trimslice_pinmux, ARRAY_SIZE(trimslice_pinmux)); | 162 | tegra_pinmux_config_table(trimslice_pinmux, ARRAY_SIZE(trimslice_pinmux)); |
| 156 | tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table)); | 163 | tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table)); |
| 157 | } | 164 | } |
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c index 57e35d20c24c..240d5dc58928 100644 --- a/arch/arm/mach-tegra/devices.c +++ b/arch/arm/mach-tegra/devices.c | |||
| @@ -31,6 +31,90 @@ | |||
| 31 | #include <mach/usb_phy.h> | 31 | #include <mach/usb_phy.h> |
| 32 | #include "gpio-names.h" | 32 | #include "gpio-names.h" |
| 33 | 33 | ||
| 34 | static struct resource gpio_resource[] = { | ||
| 35 | [0] = { | ||
| 36 | .start = TEGRA_GPIO_BASE, | ||
| 37 | .end = TEGRA_GPIO_BASE + TEGRA_GPIO_SIZE-1, | ||
| 38 | .flags = IORESOURCE_MEM, | ||
| 39 | }, | ||
| 40 | [1] = { | ||
| 41 | .start = INT_GPIO1, | ||
| 42 | .end = INT_GPIO1, | ||
| 43 | .flags = IORESOURCE_IRQ, | ||
| 44 | }, | ||
| 45 | [2] = { | ||
| 46 | .start = INT_GPIO2, | ||
| 47 | .end = INT_GPIO2, | ||
| 48 | .flags = IORESOURCE_IRQ, | ||
| 49 | }, | ||
| 50 | [3] = { | ||
| 51 | .start = INT_GPIO3, | ||
| 52 | .end = INT_GPIO3, | ||
