void pxa_i2s_init (void) { unsigned long flags; /* Setup the uarts */ local_irq_save(flags); pxa_gpio_mode(GPIO28_BITCLK_OUT_I2S_MD); pxa_gpio_mode(GPIO29_SDATA_IN_I2S_MD); pxa_gpio_mode(GPIO30_SDATA_OUT_I2S_MD); pxa_gpio_mode(GPIO31_SYNC_I2S_MD); #if CONFIG_MACH_H4700 if (machine_is_h4700()) pxa_gpio_mode(GPIO_NR_HX4700_I2S_SYSCLK); else #endif pxa_gpio_mode(GPIO32_SYSCLK_I2S_MD); /* enable the clock to I2S unit */ CKEN |= CKEN8_I2S; SACR0 = SACR0_RST; SACR0 = SACR0_ENB | SACR0_BCKD | SACR0_RFTH(8) | SACR0_TFTH(8); SACR1 = 0; SADIV = pxa_i2s_sample_rate_divisor(PXA_I2S_44_1KHZ); SACR0 |= SACR0_ENB; local_irq_restore(flags); }
static int hx4700_audio_probe(struct platform_device *pdev) { int ret; if (!machine_is_h4700()) return -ENODEV; ret = gpio_request_array(hx4700_audio_gpios, ARRAY_SIZE(hx4700_audio_gpios)); if (ret) return ret; snd_soc_card_hx4700.dev = &pdev->dev; ret = snd_soc_register_card(&snd_soc_card_hx4700); if (ret) gpio_free_array(hx4700_audio_gpios, ARRAY_SIZE(hx4700_audio_gpios)); return ret; }