aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx2
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-02-08 10:42:28 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2010-02-10 05:05:18 -0500
commitc8a6885f2153087668b64d4ee25f78a7dda1dadb (patch)
treede055663a11b6029677f7462e94e9da4c2b1dd72 /arch/arm/mach-mx2
parentd9e557e5cb2052164f04af75c7d3d9bdd4111054 (diff)
pca100: add sound support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2')
-rw-r--r--arch/arm/mach-mx2/mach-pca100.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/arm/mach-mx2/mach-pca100.c b/arch/arm/mach-mx2/mach-pca100.c
index cda52a6a3290..d12bdb1fcabb 100644
--- a/arch/arm/mach-mx2/mach-pca100.c
+++ b/arch/arm/mach-mx2/mach-pca100.c
@@ -25,6 +25,7 @@
25#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
26#include <linux/spi/eeprom.h> 26#include <linux/spi/eeprom.h>
27#include <linux/irq.h> 27#include <linux/irq.h>
28#include <linux/delay.h>
28#include <linux/gpio.h> 29#include <linux/gpio.h>
29#include <linux/usb/otg.h> 30#include <linux/usb/otg.h>
30#include <linux/usb/ulpi.h> 31#include <linux/usb/ulpi.h>
@@ -41,6 +42,8 @@
41#include <mach/spi.h> 42#include <mach/spi.h>
42#endif 43#endif
43#include <mach/imx-uart.h> 44#include <mach/imx-uart.h>
45#include <mach/audmux.h>
46#include <mach/ssi.h>
44#include <mach/mxc_nand.h> 47#include <mach/mxc_nand.h>
45#include <mach/irqs.h> 48#include <mach/irqs.h>
46#include <mach/mmc.h> 49#include <mach/mmc.h>
@@ -193,6 +196,37 @@ static struct spi_imx_master pca100_spi_0_data = {
193}; 196};
194#endif 197#endif
195 198
199static void pca100_ac97_warm_reset(struct snd_ac97 *ac97)
200{
201 mxc_gpio_mode(GPIO_PORTC | 20 | GPIO_GPIO | GPIO_OUT);
202 gpio_set_value(GPIO_PORTC + 20, 1);
203 udelay(2);
204 gpio_set_value(GPIO_PORTC + 20, 0);
205 mxc_gpio_mode(PC20_PF_SSI1_FS);
206 msleep(2);
207}
208
209static void pca100_ac97_cold_reset(struct snd_ac97 *ac97)
210{
211 mxc_gpio_mode(GPIO_PORTC | 20 | GPIO_GPIO | GPIO_OUT); /* FS */
212 gpio_set_value(GPIO_PORTC + 20, 0);
213 mxc_gpio_mode(GPIO_PORTC | 22 | GPIO_GPIO | GPIO_OUT); /* TX */
214 gpio_set_value(GPIO_PORTC + 22, 0);
215 mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_OUT); /* reset */
216 gpio_set_value(GPIO_PORTC + 28, 0);
217 udelay(10);
218 gpio_set_value(GPIO_PORTC + 28, 1);
219 mxc_gpio_mode(PC20_PF_SSI1_FS);
220 mxc_gpio_mode(PC22_PF_SSI1_TXD);
221 msleep(2);
222}
223
224static struct imx_ssi_platform_data pca100_ssi_pdata = {
225 .ac97_reset = pca100_ac97_cold_reset,
226 .ac97_warm_reset = pca100_ac97_warm_reset,
227 .flags = IMX_SSI_USE_AC97,
228};
229
196static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq, 230static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
197 void *data) 231 void *data)
198{ 232{
@@ -266,11 +300,25 @@ static void __init pca100_init(void)
266{ 300{
267 int ret; 301 int ret;
268 302
303 /* SSI unit */
304 mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
305 MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
306 MXC_AUDMUX_V1_PCR_TFCSEL(3) |
307 MXC_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */
308 MXC_AUDMUX_V1_PCR_RXDSEL(3));
309 mxc_audmux_v1_configure_port(3,
310 MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
311 MXC_AUDMUX_V1_PCR_TFCSEL(0) |
312 MXC_AUDMUX_V1_PCR_TFSDIR |
313 MXC_AUDMUX_V1_PCR_RXDSEL(0));
314
269 ret = mxc_gpio_setup_multiple_pins(pca100_pins, 315 ret = mxc_gpio_setup_multiple_pins(pca100_pins,
270 ARRAY_SIZE(pca100_pins), "PCA100"); 316 ARRAY_SIZE(pca100_pins), "PCA100");
271 if (ret) 317 if (ret)
272 printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret); 318 printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret);
273 319
320 mxc_register_device(&imx_ssi_device0, &pca100_ssi_pdata);
321
274 mxc_register_device(&mxc_uart_device0, &uart_pdata); 322 mxc_register_device(&mxc_uart_device0, &uart_pdata);
275 323
276 mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN); 324 mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN);