diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-09-17 01:34:31 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-17 07:35:08 -0400 |
commit | d41789b2660e5b18b8401bf83ebcd502916c2cb5 (patch) | |
tree | 847bc18e076d820d8956dce1f681a7e02c1c2ac1 /arch/arm | |
parent | 7f22fd9c03c0b67ee6aa138bd10ae91bb0d22151 (diff) |
ASoC: mx27vis: retrieve gpio numbers from platform_data
Rather than including mach/iomux-mx27.h to define gpio numbers and set
up the pins, the patch moves all these into machine code and has the
gpio numbers passed to driver via platform_data. As the result, we
can remove the mach/iomux-mx27.h inclusion from driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index f264ddddd47c..562722959666 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/dma-mapping.h> | 33 | #include <linux/dma-mapping.h> |
34 | #include <linux/leds.h> | 34 | #include <linux/leds.h> |
35 | #include <linux/memblock.h> | 35 | #include <linux/memblock.h> |
36 | #include <linux/platform_data/asoc-mx27vis.h> | ||
36 | #include <media/soc_camera.h> | 37 | #include <media/soc_camera.h> |
37 | #include <sound/tlv320aic32x4.h> | 38 | #include <sound/tlv320aic32x4.h> |
38 | #include <asm/mach-types.h> | 39 | #include <asm/mach-types.h> |
@@ -58,6 +59,11 @@ | |||
58 | #define EXPBOARD_BIT1 (GPIO_PORTD + 27) | 59 | #define EXPBOARD_BIT1 (GPIO_PORTD + 27) |
59 | #define EXPBOARD_BIT0 (GPIO_PORTD + 28) | 60 | #define EXPBOARD_BIT0 (GPIO_PORTD + 28) |
60 | 61 | ||
62 | #define AMP_GAIN_0 (GPIO_PORTF + 9) | ||
63 | #define AMP_GAIN_1 (GPIO_PORTF + 8) | ||
64 | #define AMP_MUTE_SDL (GPIO_PORTE + 5) | ||
65 | #define AMP_MUTE_SDR (GPIO_PORTF + 7) | ||
66 | |||
61 | static const int visstrim_m10_pins[] __initconst = { | 67 | static const int visstrim_m10_pins[] __initconst = { |
62 | /* UART1 (console) */ | 68 | /* UART1 (console) */ |
63 | PE12_PF_UART1_TXD, | 69 | PE12_PF_UART1_TXD, |
@@ -139,6 +145,11 @@ static const int visstrim_m10_pins[] __initconst = { | |||
139 | EXPBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, | 145 | EXPBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, |
140 | EXPBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, | 146 | EXPBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, |
141 | EXPBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, | 147 | EXPBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN, |
148 | /* Audio AMP control */ | ||
149 | AMP_GAIN_0 | GPIO_GPIO | GPIO_OUT, | ||
150 | AMP_GAIN_1 | GPIO_GPIO | GPIO_OUT, | ||
151 | AMP_MUTE_SDL | GPIO_GPIO | GPIO_OUT, | ||
152 | AMP_MUTE_SDR | GPIO_GPIO | GPIO_OUT, | ||
142 | }; | 153 | }; |
143 | 154 | ||
144 | static struct gpio visstrim_m10_version_gpios[] = { | 155 | static struct gpio visstrim_m10_version_gpios[] = { |
@@ -166,6 +177,26 @@ static const struct gpio visstrim_m10_gpios[] __initconst = { | |||
166 | .flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW, | 177 | .flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW, |
167 | .label = "usbotg_cs", | 178 | .label = "usbotg_cs", |
168 | }, | 179 | }, |
180 | { | ||
181 | .gpio = AMP_GAIN_0, | ||
182 | .flags = GPIOF_DIR_OUT, | ||
183 | .label = "amp-gain-0", | ||
184 | }, | ||
185 | { | ||
186 | .gpio = AMP_GAIN_1, | ||
187 | .flags = GPIOF_DIR_OUT, | ||
188 | .label = "amp-gain-1", | ||
189 | }, | ||
190 | { | ||
191 | .gpio = AMP_MUTE_SDL, | ||
192 | .flags = GPIOF_DIR_OUT, | ||
193 | .label = "amp-mute-sdl", | ||
194 | }, | ||
195 | { | ||
196 | .gpio = AMP_MUTE_SDR, | ||
197 | .flags = GPIOF_DIR_OUT, | ||
198 | .label = "amp-mute-sdr", | ||
199 | }, | ||
169 | }; | 200 | }; |
170 | 201 | ||
171 | /* Camera */ | 202 | /* Camera */ |
@@ -405,6 +436,14 @@ static const struct imx_ssi_platform_data visstrim_m10_ssi_pdata __initconst = { | |||
405 | .flags = IMX_SSI_DMA | IMX_SSI_SYN, | 436 | .flags = IMX_SSI_DMA | IMX_SSI_SYN, |
406 | }; | 437 | }; |
407 | 438 | ||
439 | /* Audio */ | ||
440 | static const struct snd_mx27vis_platform_data snd_mx27vis_pdata __initconst = { | ||
441 | .amp_gain0_gpio = AMP_GAIN_0, | ||
442 | .amp_gain1_gpio = AMP_GAIN_1, | ||
443 | .amp_mutel_gpio = AMP_MUTE_SDL, | ||
444 | .amp_muter_gpio = AMP_MUTE_SDR, | ||
445 | }; | ||
446 | |||
408 | static void __init visstrim_m10_revision(void) | 447 | static void __init visstrim_m10_revision(void) |
409 | { | 448 | { |
410 | int exp_version = 0; | 449 | int exp_version = 0; |
@@ -463,7 +502,8 @@ static void __init visstrim_m10_board_init(void) | |||
463 | imx27_add_fec(NULL); | 502 | imx27_add_fec(NULL); |
464 | imx_add_gpio_keys(&visstrim_gpio_keys_platform_data); | 503 | imx_add_gpio_keys(&visstrim_gpio_keys_platform_data); |
465 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 504 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
466 | imx_add_platform_device("mx27vis", 0, NULL, 0, NULL, 0); | 505 | imx_add_platform_device("mx27vis", 0, NULL, 0, &snd_mx27vis_pdata, |
506 | sizeof(snd_mx27vis_pdata)); | ||
467 | platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0, | 507 | platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0, |
468 | &iclink_tvp5150, sizeof(iclink_tvp5150)); | 508 | &iclink_tvp5150, sizeof(iclink_tvp5150)); |
469 | gpio_led_register_device(0, &visstrim_m10_led_data); | 509 | gpio_led_register_device(0, &visstrim_m10_led_data); |