rt5645.c (0b2e4959ceacb26eb586698d9ceecc0a6bd30f72) rt5645.c (bb656add19764c7a3cf28b2b330ec0a189fe4f48)
1/*
2 * rt5645.c -- RT5645 ALSA SoC audio codec driver
3 *
4 * Copyright 2013 Realtek Semiconductor Corp.
5 * Author: Bard Liao <bardliao@realtek.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 2189 unchanged lines hidden (view full) ---

2198 struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
2199
2200 rt5645->codec = codec;
2201
2202 rt5645_set_bias_level(codec, SND_SOC_BIAS_OFF);
2203
2204 snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200);
2205
1/*
2 * rt5645.c -- RT5645 ALSA SoC audio codec driver
3 *
4 * Copyright 2013 Realtek Semiconductor Corp.
5 * Author: Bard Liao <bardliao@realtek.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 2189 unchanged lines hidden (view full) ---

2198 struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
2199
2200 rt5645->codec = codec;
2201
2202 rt5645_set_bias_level(codec, SND_SOC_BIAS_OFF);
2203
2204 snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200);
2205
2206 /* for JD function */
2207 if (rt5645->pdata.en_jd_func) {
2208 snd_soc_dapm_force_enable_pin(&codec->dapm, "JD Power");
2209 snd_soc_dapm_force_enable_pin(&codec->dapm, "LDO2");
2210 snd_soc_dapm_sync(&codec->dapm);
2211 }
2212
2206 return 0;
2207}
2208
2209static int rt5645_remove(struct snd_soc_codec *codec)
2210{
2211 rt5645_reset(codec);
2212 return 0;
2213}

--- 217 unchanged lines hidden (view full) ---

2431 break;
2432
2433 default:
2434 break;
2435 }
2436
2437 }
2438
2213 return 0;
2214}
2215
2216static int rt5645_remove(struct snd_soc_codec *codec)
2217{
2218 rt5645_reset(codec);
2219 return 0;
2220}

--- 217 unchanged lines hidden (view full) ---

2438 break;
2439
2440 default:
2441 break;
2442 }
2443
2444 }
2445
2446 if (rt5645->pdata.en_jd_func) {
2447 regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL3,
2448 RT5645_IRQ_CLK_GATE_CTRL | RT5645_MICINDET_MANU,
2449 RT5645_IRQ_CLK_GATE_CTRL | RT5645_MICINDET_MANU);
2450 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL1,
2451 RT5645_CBJ_BST1_EN, RT5645_CBJ_BST1_EN);
2452 regmap_update_bits(rt5645->regmap, RT5645_JD_CTRL3,
2453 RT5645_JD_CBJ_EN | RT5645_JD_CBJ_POL,
2454 RT5645_JD_CBJ_EN | RT5645_JD_CBJ_POL);
2455 regmap_update_bits(rt5645->regmap, RT5645_MICBIAS,
2456 RT5645_IRQ_CLK_INT, RT5645_IRQ_CLK_INT);
2457 }
2458
2439 if (rt5645->i2c->irq) {
2440 ret = request_threaded_irq(rt5645->i2c->irq, NULL, rt5645_irq,
2441 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
2442 | IRQF_ONESHOT, "rt5645", rt5645);
2443 if (ret)
2444 dev_err(&i2c->dev, "Failed to reguest IRQ: %d\n", ret);
2445 }
2446

--- 47 unchanged lines hidden ---
2459 if (rt5645->i2c->irq) {
2460 ret = request_threaded_irq(rt5645->i2c->irq, NULL, rt5645_irq,
2461 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
2462 | IRQF_ONESHOT, "rt5645", rt5645);
2463 if (ret)
2464 dev_err(&i2c->dev, "Failed to reguest IRQ: %d\n", ret);
2465 }
2466

--- 47 unchanged lines hidden ---