#if defined(CONFIG_MFD_RK616)
#define RK616_RST_PIN RK30_PIN3_PB2
#define RK616_PWREN_PIN RK30_PIN0_PC5
-#define RK616_SPK_CTL2 RK30_PIN0_PD5
#define RK616_SCL_RATE (80*1000) //i2c scl rate
static int rk616_power_on_init(void)
{
int ret;
-#if 1
- if(RK616_SPK_CTL2 != INVALID_GPIO)
- {
- ret = gpio_request(RK616_SPK_CTL2, "rk616 spk ctl2");
- if (ret)
- {
- printk(KERN_ERR "rk616 spk_ctl2 gpio request fail\n");
- }
- else
- {
- gpio_direction_output(RK616_SPK_CTL2,GPIO_HIGH);
- }
- }
-#endif
+
if(RK616_PWREN_PIN != INVALID_GPIO)
{
ret = gpio_request(RK616_PWREN_PIN, "rk616 pwren");
return -EINVAL;
}
- switch (params_channels(params)) {
+ /*switch (params_channels(params)) {
case RK616_MONO:
adc_aif1 |= RK616_ADC_TYPE_MONO;
break;
break;
default:
return -EINVAL;
- }
+ }*/
+
+ //MIC1N/P and MIC2N/P can only line to ADCL, so set mono type.
+ adc_aif1 |= RK616_ADC_TYPE_MONO;
adc_aif1 |= RK616_ADC_SWAP_DIS;
adc_aif2 |= RK616_ADC_RST_DIS;
{
DBG("%s\n", __func__);
+ if (!rk616_priv) {
+ printk("%s : rk616_priv is NULL\n", __func__);
+ return 0;
+ }
+
+ if (rk616_priv->spk_ctl_gpio != INVALID_GPIO)
+ gpio_set_value(rk616_priv->spk_ctl_gpio, GPIO_LOW);
+
+ if (rk616_priv->hp_ctl_gpio != INVALID_GPIO)
+ gpio_set_value(rk616_priv->hp_ctl_gpio, GPIO_LOW);
+
+ mdelay(10);
+
if (rk616_for_mid)
{
cancel_delayed_work_sync(&capture_delayed_work);
if (rk616_codec_work_capture_type != RK616_CODEC_WORK_NULL) {
rk616_codec_work_capture_type = RK616_CODEC_WORK_NULL;
}
- rk616_codec_power_down(RK616_CODEC_ALL);
- }
- else
- {
- snd_soc_write(codec, RK616_RESET, 0xfc);
- mdelay(10);
- snd_soc_write(codec, RK616_RESET, 0x3);
- mdelay(10);
}
+ snd_soc_write(codec, RK616_RESET, 0xfc);
+ mdelay(10);
+ snd_soc_write(codec, RK616_RESET, 0x3);
+ mdelay(10);
+
if (rk616_priv)
kfree(rk616_priv);
if (rk616_codec_work_capture_type != RK616_CODEC_WORK_NULL) {
rk616_codec_work_capture_type = RK616_CODEC_WORK_NULL;
}
- rk616_codec_power_down(RK616_CODEC_ALL);
- } else {
- snd_soc_write(rk616_priv->codec, RK616_RESET, 0xfc);
- mdelay(10);
- snd_soc_write(rk616_priv->codec, RK616_RESET, 0x3);
}
+
+ snd_soc_write(rk616_priv->codec, RK616_RESET, 0xfc);
+ mdelay(10);
+ snd_soc_write(rk616_priv->codec, RK616_RESET, 0x3);
+
+ if (rk616_priv)
+ kfree(rk616_priv);
}
static struct platform_driver rk616_codec_driver = {