rt5645.c (e9159e7577cfd1ac8b3c5ea8916ad37bcd87e629) rt5645.c (917536aeb88d34e06c1353b0dd144f0987bb66bd)
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

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

2824 if (rt5645->en_button_func) {
2825 rt5645_enable_push_button_irq(codec, true);
2826 }
2827 } else {
2828 snd_soc_dapm_disable_pin(dapm, "Mic Det Power");
2829 snd_soc_dapm_sync(dapm);
2830 rt5645->jack_type = SND_JACK_HEADPHONE;
2831 }
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

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

2824 if (rt5645->en_button_func) {
2825 rt5645_enable_push_button_irq(codec, true);
2826 }
2827 } else {
2828 snd_soc_dapm_disable_pin(dapm, "Mic Det Power");
2829 snd_soc_dapm_sync(dapm);
2830 rt5645->jack_type = SND_JACK_HEADPHONE;
2831 }
2832 if (rt5645->pdata.jd_invert)
2833 regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2,
2834 RT5645_JD_1_1_MASK, RT5645_JD_1_1_INV);
2832 } else { /* jack out */
2833 rt5645->jack_type = 0;
2834
2835 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL2,
2836 RT5645_CBJ_MN_JD, RT5645_CBJ_MN_JD);
2837 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL1,
2838 RT5645_CBJ_BST1_EN, 0);
2839
2840 if (rt5645->en_button_func)
2841 rt5645_enable_push_button_irq(codec, false);
2842
2843 if (rt5645->pdata.jd_mode == 0)
2844 snd_soc_dapm_disable_pin(dapm, "LDO2");
2845 snd_soc_dapm_disable_pin(dapm, "Mic Det Power");
2846 snd_soc_dapm_sync(dapm);
2835 } else { /* jack out */
2836 rt5645->jack_type = 0;
2837
2838 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL2,
2839 RT5645_CBJ_MN_JD, RT5645_CBJ_MN_JD);
2840 regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL1,
2841 RT5645_CBJ_BST1_EN, 0);
2842
2843 if (rt5645->en_button_func)
2844 rt5645_enable_push_button_irq(codec, false);
2845
2846 if (rt5645->pdata.jd_mode == 0)
2847 snd_soc_dapm_disable_pin(dapm, "LDO2");
2848 snd_soc_dapm_disable_pin(dapm, "Mic Det Power");
2849 snd_soc_dapm_sync(dapm);
2850 if (rt5645->pdata.jd_invert)
2851 regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2,
2852 RT5645_JD_1_1_MASK, RT5645_JD_1_1_NOR);
2847 }
2848
2849 return rt5645->jack_type;
2850}
2851
2852static int rt5645_button_detect(struct snd_soc_codec *codec)
2853{
2854 int btn_type, val;

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

3208 },
3209 { }
3210};
3211
3212static struct rt5645_platform_data buddy_platform_data = {
3213 .dmic1_data_pin = RT5645_DMIC_DATA_GPIO5,
3214 .dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
3215 .jd_mode = 3,
2853 }
2854
2855 return rt5645->jack_type;
2856}
2857
2858static int rt5645_button_detect(struct snd_soc_codec *codec)
2859{
2860 int btn_type, val;

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

3214 },
3215 { }
3216};
3217
3218static struct rt5645_platform_data buddy_platform_data = {
3219 .dmic1_data_pin = RT5645_DMIC_DATA_GPIO5,
3220 .dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
3221 .jd_mode = 3,
3222 .jd_invert = true,
3216};
3217
3218static int buddy_quirk_cb(const struct dmi_system_id *id)
3219{
3220 rt5645_pdata = &buddy_platform_data;
3221
3222 return 1;
3223}

--- 291 unchanged lines hidden ---
3223};
3224
3225static int buddy_quirk_cb(const struct dmi_system_id *id)
3226{
3227 rt5645_pdata = &buddy_platform_data;
3228
3229 return 1;
3230}

--- 291 unchanged lines hidden ---