- if(rk312x_codec->codec_hp_det)
- {
- /*init codec_hp_det interrupt */
- ret =request_irq(96, codec_hp_det_isr, IRQF_TRIGGER_RISING, "codec_hp_det", NULL);
- if(ret < 0)
- {
- printk(" codec_hp_det request_irq failed %d\n", ret);
- }
- init_timer(&rk312x_codec->timer);
- rk312x_codec->timer.function = hp_det_timer_func;
- rk312x_codec->timer.expires = jiffies + HZ/100;
- rk312x_codec->sdev.name = "h2w";
- rk312x_codec->sdev.print_name = h2w_print_name;
- ret = switch_dev_register(&rk312x_codec->sdev);
- if(ret)
- printk(KERN_ERR"register switch dev failed\n");
- val = readl_relaxed(RK_GRF_VIRT + GRF_ACODEC_CON);
- writel_relaxed(0x1f001f, RK_GRF_VIRT + GRF_ACODEC_CON);
- val = readl_relaxed(RK_GRF_VIRT + GRF_ACODEC_CON);
- printk("GRF_ACODEC_CON 3334is 0x%x\n", val);
- snd_soc_write(codec, RK312x_DAC_CTL, 0x08);
- printk("0xa0 -- 0x%x\n",snd_soc_read(codec, RK312x_DAC_CTL));
- /* codec hp det once */
- add_timer(&rk312x_priv->timer);
- }
+ if(rk312x_codec->codec_hp_det)
+ {
+ /*init codec_hp_det interrupt */
+ ret =request_irq(96, codec_hp_det_isr, IRQF_TRIGGER_RISING, "codec_hp_det", NULL);
+ if(ret < 0) {
+ printk(" codec_hp_det request_irq failed %d\n", ret);
+ }
+ init_timer(&rk312x_codec->timer);
+ rk312x_codec->timer.function = hp_det_timer_func;
+ rk312x_codec->timer.expires = jiffies + HZ/100;
+ rk312x_codec->sdev.name = "h2w";
+ rk312x_codec->sdev.print_name = h2w_print_name;
+ ret = switch_dev_register(&rk312x_codec->sdev);
+ if(ret)
+ printk(KERN_ERR"register switch dev failed\n");
+ val = readl_relaxed(RK_GRF_VIRT + GRF_ACODEC_CON);
+ writel_relaxed(0x1f001f, RK_GRF_VIRT + GRF_ACODEC_CON);
+ val = readl_relaxed(RK_GRF_VIRT + GRF_ACODEC_CON);
+ printk("GRF_ACODEC_CON 3334is 0x%x\n", val);
+ snd_soc_write(codec, RK312x_DAC_CTL, 0x08);
+ printk("0xa0 -- 0x%x\n",snd_soc_read(codec, RK312x_DAC_CTL));
+ /* codec hp det once */
+ add_timer(&rk312x_priv->timer);
+ }
+