rt5631 : optimize boot speed

This commit is contained in:
qjb
2014-04-24 15:45:15 +08:00
parent f1b1c98775
commit 1c3eb8f8ff

View File

@@ -56,6 +56,9 @@ struct rt5631_priv {
int eq_mode;
int phone_det_level;
int pll_used_flag;
struct workqueue_struct *irq_wq;
struct delayed_work rt5631_delayed_work;
};
#if (RT5631_SPK_TIMER == 1)
static struct timer_list spk_timer;
@@ -1988,23 +1991,14 @@ static int rt5631_set_bias_level(struct snd_soc_codec *codec,
return 0;
}
static int rt5631_probe(struct snd_soc_codec *codec)
static void rt5631_init_work(struct work_struct *work)
{
struct snd_soc_codec *codec = rt5631_codec;
struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
int val;
int ret;
ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C);
if (ret != 0) {
dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
return ret;
}
codec->cache_bypass = 1;
int val,ret;
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
val = rt5631_read_index(codec, RT5631_ADDA_MIXER_INTL_REG3);
if(val < 0)
{
return -ENODEV;
}
if (val & 0x0002)
rt5631->codec_version = 1;
else
@@ -2031,7 +2025,6 @@ static int rt5631_probe(struct snd_soc_codec *codec)
0, 0x2000);
codec->dapm.bias_level = SND_SOC_BIAS_STANDBY;
rt5631_codec = codec;
#if (RT5631_SPK_TIMER == 1)
/* Timer module installing */
@@ -2042,6 +2035,31 @@ static int rt5631_probe(struct snd_soc_codec *codec)
INIT_WORK(&spk_work, spk_work_handler);
#endif
}
static int rt5631_probe(struct snd_soc_codec *codec)
{
struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
int val;
int ret;
rt5631_codec = codec;
ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C);
if (ret != 0) {
dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
return ret;
}
codec->cache_bypass = 1;
rt5631->irq_wq = create_singlethread_workqueue("rt5631-irq_wq");
if (!rt5631->irq_wq) {
printk( "Failed to rt5631 allocate IRQ worker\n");
return -ESRCH;
}
INIT_DELAYED_WORK(&rt5631->rt5631_delayed_work, rt5631_init_work);
queue_delayed_work(rt5631->irq_wq, &rt5631->rt5631_delayed_work, msecs_to_jiffies(10));
//bard 7-16 s
INIT_DELAYED_WORK(&rt5631_delay_cap,rt5631_adc_on);
//bard 7-16 e