diff options
Diffstat (limited to 'sound/soc/codecs/rt5645.c')
| -rw-r--r-- | sound/soc/codecs/rt5645.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index ef88b506a017..6e9cd8e743a7 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c | |||
| @@ -2239,7 +2239,8 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec) | |||
| 2239 | 2239 | ||
| 2240 | snd_soc_dapm_disable_pin(&codec->dapm, "micbias1"); | 2240 | snd_soc_dapm_disable_pin(&codec->dapm, "micbias1"); |
| 2241 | snd_soc_dapm_disable_pin(&codec->dapm, "micbias2"); | 2241 | snd_soc_dapm_disable_pin(&codec->dapm, "micbias2"); |
| 2242 | snd_soc_dapm_disable_pin(&codec->dapm, "LDO2"); | 2242 | if (rt5645->pdata.jd_mode == 0) |
| 2243 | snd_soc_dapm_disable_pin(&codec->dapm, "LDO2"); | ||
| 2243 | snd_soc_dapm_disable_pin(&codec->dapm, "Mic Det Power"); | 2244 | snd_soc_dapm_disable_pin(&codec->dapm, "Mic Det Power"); |
| 2244 | snd_soc_dapm_sync(&codec->dapm); | 2245 | snd_soc_dapm_sync(&codec->dapm); |
| 2245 | } | 2246 | } |
| @@ -2543,6 +2544,38 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, | |||
| 2543 | RT5645_IRQ_CLK_INT, RT5645_IRQ_CLK_INT); | 2544 | RT5645_IRQ_CLK_INT, RT5645_IRQ_CLK_INT); |
| 2544 | } | 2545 | } |
| 2545 | 2546 | ||
| 2547 | if (rt5645->pdata.jd_mode) { | ||
| 2548 | regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2, | ||
| 2549 | RT5645_IRQ_JD_1_1_EN, RT5645_IRQ_JD_1_1_EN); | ||
| 2550 | regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL3, | ||
| 2551 | RT5645_JD_PSV_MODE, RT5645_JD_PSV_MODE); | ||
| 2552 | regmap_update_bits(rt5645->regmap, RT5645_HPO_MIXER, | ||
| 2553 | RT5645_IRQ_PSV_MODE, RT5645_IRQ_PSV_MODE); | ||
| 2554 | regmap_update_bits(rt5645->regmap, RT5645_MICBIAS, | ||
| 2555 | RT5645_MIC2_OVCD_EN, RT5645_MIC2_OVCD_EN); | ||
| 2556 | regmap_update_bits(rt5645->regmap, RT5645_GPIO_CTRL1, | ||
| 2557 | RT5645_GP1_PIN_IRQ, RT5645_GP1_PIN_IRQ); | ||
| 2558 | switch (rt5645->pdata.jd_mode) { | ||
| 2559 | case 1: | ||
| 2560 | regmap_update_bits(rt5645->regmap, RT5645_A_JD_CTRL1, | ||
| 2561 | RT5645_JD1_MODE_MASK, | ||
| 2562 | RT5645_JD1_MODE_0); | ||
| 2563 | break; | ||
| 2564 | case 2: | ||
| 2565 | regmap_update_bits(rt5645->regmap, RT5645_A_JD_CTRL1, | ||
| 2566 | RT5645_JD1_MODE_MASK, | ||
| 2567 | RT5645_JD1_MODE_1); | ||
| 2568 | break; | ||
| 2569 | case 3: | ||
| 2570 | regmap_update_bits(rt5645->regmap, RT5645_A_JD_CTRL1, | ||
| 2571 | RT5645_JD1_MODE_MASK, | ||
| 2572 | RT5645_JD1_MODE_2); | ||
| 2573 | break; | ||
| 2574 | default: | ||
| 2575 | break; | ||
| 2576 | } | ||
| 2577 | } | ||
| 2578 | |||
| 2546 | if (rt5645->i2c->irq) { | 2579 | if (rt5645->i2c->irq) { |
| 2547 | ret = request_threaded_irq(rt5645->i2c->irq, NULL, rt5645_irq, | 2580 | ret = request_threaded_irq(rt5645->i2c->irq, NULL, rt5645_irq, |
| 2548 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | 2581 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
