rt5670 435 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 457 sound/soc/codecs/rt5670.c rt5670->jack_type = SND_JACK_HEADSET; rt5670 464 sound/soc/codecs/rt5670.c rt5670->jack_type = SND_JACK_HEADPHONE; rt5670 471 sound/soc/codecs/rt5670.c rt5670->jack_type = 0; rt5670 476 sound/soc/codecs/rt5670.c return rt5670->jack_type; rt5670 481 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 483 sound/soc/codecs/rt5670.c rt5670->jack_type_saved = rt5670->jack_type; rt5670 490 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 492 sound/soc/codecs/rt5670.c if (rt5670->jack_type_saved) rt5670 515 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = (struct rt5670_priv *)data; rt5670 516 sound/soc/codecs/rt5670.c struct snd_soc_jack_gpio *gpio = &rt5670->hp_gpio; rt5670 517 sound/soc/codecs/rt5670.c struct snd_soc_jack *jack = rt5670->jack; rt5670 520 sound/soc/codecs/rt5670.c if (rt5670->pdata.jd_mode == 1) /* 2 port */ rt5670 521 sound/soc/codecs/rt5670.c val = snd_soc_component_read32(rt5670->component, RT5670_A_JD_CTRL1) & 0x0070; rt5670 523 sound/soc/codecs/rt5670.c val = snd_soc_component_read32(rt5670->component, RT5670_A_JD_CTRL1) & 0x0020; rt5670 529 sound/soc/codecs/rt5670.c if (rt5670->jack_type == 0) { rt5670 530 sound/soc/codecs/rt5670.c report = rt5670_headset_detect(rt5670->component, 1); rt5670 536 sound/soc/codecs/rt5670.c if (snd_soc_component_read32(rt5670->component, RT5670_INT_IRQ_ST) & 0x4) { rt5670 539 sound/soc/codecs/rt5670.c btn_type = rt5670_button_detect(rt5670->component); rt5670 551 sound/soc/codecs/rt5670.c dev_err(rt5670->component->dev, rt5670 558 sound/soc/codecs/rt5670.c report = rt5670->jack_type; rt5670 566 sound/soc/codecs/rt5670.c snd_soc_component_update_bits(rt5670->component, RT5670_INT_IRQ_ST, 0x1, 0x0); rt5670 567 sound/soc/codecs/rt5670.c rt5670_headset_detect(rt5670->component, 0); rt5670 580 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 583 sound/soc/codecs/rt5670.c rt5670->jack = jack; rt5670 584 sound/soc/codecs/rt5670.c rt5670->hp_gpio.gpiod_dev = component->dev; rt5670 585 sound/soc/codecs/rt5670.c rt5670->hp_gpio.name = "headset"; rt5670 586 sound/soc/codecs/rt5670.c rt5670->hp_gpio.report = SND_JACK_HEADSET | rt5670 588 sound/soc/codecs/rt5670.c rt5670->hp_gpio.debounce_time = 150; rt5670 589 sound/soc/codecs/rt5670.c rt5670->hp_gpio.wake = true; rt5670 590 sound/soc/codecs/rt5670.c rt5670->hp_gpio.data = (struct rt5670_priv *)rt5670; rt5670 591 sound/soc/codecs/rt5670.c rt5670->hp_gpio.jack_status_check = rt5670_irq_detection; rt5670 593 sound/soc/codecs/rt5670.c ret = snd_soc_jack_add_gpios(rt5670->jack, 1, rt5670 594 sound/soc/codecs/rt5670.c &rt5670->hp_gpio); rt5670 700 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 703 sound/soc/codecs/rt5670.c rate = rt5670->sysclk / rl6231_get_pre_div(rt5670->regmap, rt5670 718 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 720 sound/soc/codecs/rt5670.c if (rt5670->sysclk_src == RT5670_SCLK_S_PLL1) rt5670 782 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 784 sound/soc/codecs/rt5670.c if (rt5670->sysclk > rt5670->lrck[RT5670_AIF1] * 384) rt5670 1368 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 1372 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_CHARGE_PUMP, rt5670 1374 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_GEN_CTRL2, rt5670 1377 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_PWR_ANLG1, rt5670 1382 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M2, 0x3100); rt5670 1383 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M1, 0x8009); rt5670 1384 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_PR_BASE + rt5670 1387 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M1, 0x8019); rt5670 1390 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M1, 0x0004); rt5670 1404 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 1409 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_PR_BASE + rt5670 1411 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M3, 0x0772); rt5670 1412 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M1, 0x805d); rt5670 1413 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M1, 0x831d); rt5670 1414 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_GEN_CTRL2, rt5670 1416 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_HP_VOL, rt5670 1419 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M1, 0x8019); rt5670 1424 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_PR_BASE + rt5670 1426 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M3, 0x0772); rt5670 1427 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M1, 0x803d); rt5670 1429 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M1, 0x831d); rt5670 1431 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_HP_VOL, rt5670 1435 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, rt5670 1437 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M1, 0x8019); rt5670 1438 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_DEPOP_M3, 0x0707); rt5670 1439 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_PR_BASE + rt5670 2269 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 2273 sound/soc/codecs/rt5670.c rt5670->lrck[dai->id] = params_rate(params); rt5670 2274 sound/soc/codecs/rt5670.c pre_div = rl6231_get_clk_info(rt5670->sysclk, rt5670->lrck[dai->id]); rt5670 2277 sound/soc/codecs/rt5670.c rt5670->lrck[dai->id], dai->id); rt5670 2286 sound/soc/codecs/rt5670.c rt5670->bclk[dai->id] = rt5670->lrck[dai->id] * (32 << bclk_ms); rt5670 2289 sound/soc/codecs/rt5670.c rt5670->bclk[dai->id], rt5670->lrck[dai->id]); rt5670 2337 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 2342 sound/soc/codecs/rt5670.c rt5670->master[dai->id] = 1; rt5670 2346 sound/soc/codecs/rt5670.c rt5670->master[dai->id] = 0; rt5670 2399 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 2418 sound/soc/codecs/rt5670.c rt5670->sysclk = freq; rt5670 2420 sound/soc/codecs/rt5670.c rt5670->sysclk_src = clk_id; rt5670 2431 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 2435 sound/soc/codecs/rt5670.c if (source == rt5670->pll_src && freq_in == rt5670->pll_in && rt5670 2436 sound/soc/codecs/rt5670.c freq_out == rt5670->pll_out) rt5670 2442 sound/soc/codecs/rt5670.c rt5670->pll_in = 0; rt5670 2443 sound/soc/codecs/rt5670.c rt5670->pll_out = 0; rt5670 2493 sound/soc/codecs/rt5670.c rt5670->pll_in = freq_in; rt5670 2494 sound/soc/codecs/rt5670.c rt5670->pll_out = freq_out; rt5670 2495 sound/soc/codecs/rt5670.c rt5670->pll_src = source; rt5670 2567 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 2597 sound/soc/codecs/rt5670.c if (rt5670->pdata.jd_mode) rt5670 2622 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 2647 sound/soc/codecs/rt5670.c rt5670->component = component; rt5670 2654 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 2656 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_RESET, 0); rt5670 2657 sound/soc/codecs/rt5670.c snd_soc_jack_free_gpios(rt5670->jack, 1, &rt5670->hp_gpio); rt5670 2663 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 2665 sound/soc/codecs/rt5670.c regcache_cache_only(rt5670->regmap, true); rt5670 2666 sound/soc/codecs/rt5670.c regcache_mark_dirty(rt5670->regmap); rt5670 2672 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); rt5670 2674 sound/soc/codecs/rt5670.c regcache_cache_only(rt5670->regmap, false); rt5670 2675 sound/soc/codecs/rt5670.c regcache_sync(rt5670->regmap); rt5670 2901 sound/soc/codecs/rt5670.c struct rt5670_priv *rt5670; rt5670 2905 sound/soc/codecs/rt5670.c rt5670 = devm_kzalloc(&i2c->dev, rt5670 2908 sound/soc/codecs/rt5670.c if (NULL == rt5670) rt5670 2911 sound/soc/codecs/rt5670.c i2c_set_clientdata(i2c, rt5670); rt5670 2914 sound/soc/codecs/rt5670.c rt5670->pdata = *pdata; rt5670 2924 sound/soc/codecs/rt5670.c rt5670->pdata.dev_gpio = true; rt5670 2928 sound/soc/codecs/rt5670.c rt5670->pdata.in2_diff = true; rt5670 2932 sound/soc/codecs/rt5670.c rt5670->pdata.dmic_en = true; rt5670 2936 sound/soc/codecs/rt5670.c rt5670->pdata.dmic1_data_pin = RT5670_DMIC_DATA_IN2P; rt5670 2940 sound/soc/codecs/rt5670.c rt5670->pdata.dmic1_data_pin = RT5670_DMIC_DATA_GPIO6; rt5670 2944 sound/soc/codecs/rt5670.c rt5670->pdata.dmic1_data_pin = RT5670_DMIC_DATA_GPIO7; rt5670 2948 sound/soc/codecs/rt5670.c rt5670->pdata.dmic2_data_pin = RT5670_DMIC_DATA_IN3N; rt5670 2952 sound/soc/codecs/rt5670.c rt5670->pdata.dmic2_data_pin = RT5670_DMIC_DATA_GPIO8; rt5670 2956 sound/soc/codecs/rt5670.c rt5670->pdata.dmic3_data_pin = RT5670_DMIC_DATA_GPIO5; rt5670 2961 sound/soc/codecs/rt5670.c rt5670->pdata.jd_mode = 1; rt5670 2965 sound/soc/codecs/rt5670.c rt5670->pdata.jd_mode = 2; rt5670 2969 sound/soc/codecs/rt5670.c rt5670->pdata.jd_mode = 3; rt5670 2973 sound/soc/codecs/rt5670.c rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap); rt5670 2974 sound/soc/codecs/rt5670.c if (IS_ERR(rt5670->regmap)) { rt5670 2975 sound/soc/codecs/rt5670.c ret = PTR_ERR(rt5670->regmap); rt5670 2981 sound/soc/codecs/rt5670.c regmap_read(rt5670->regmap, RT5670_VENDOR_ID2, &val); rt5670 2988 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_RESET, 0); rt5670 2989 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_PWR_ANLG1, rt5670 2994 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_RESET, 0); rt5670 2996 sound/soc/codecs/rt5670.c regmap_read(rt5670->regmap, RT5670_VENDOR_ID, &val); rt5670 2998 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_GPIO_CTRL3, 0x0980); rt5670 3000 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_GPIO_CTRL3, 0x0d00); rt5670 3002 sound/soc/codecs/rt5670.c ret = regmap_register_patch(rt5670->regmap, init_list, rt5670 3007 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_DIG_MISC, rt5670 3010 sound/soc/codecs/rt5670.c if (rt5670->pdata.in2_diff) rt5670 3011 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_IN2, rt5670 3014 sound/soc/codecs/rt5670.c if (rt5670->pdata.dev_gpio) { rt5670 3016 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_IL_CMD, 0x0000); rt5670 3017 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_IL_CMD2, 0x0010); rt5670 3018 sound/soc/codecs/rt5670.c regmap_write(rt5670->regmap, RT5670_IL_CMD3, 0x0014); rt5670 3020 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL1, rt5670 3022 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL2, rt5670 3026 sound/soc/codecs/rt5670.c if (rt5670->pdata.jd_mode) { rt5670 3027 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_GLB_CLK, rt5670 3029 sound/soc/codecs/rt5670.c rt5670->sysclk = 0; rt5670 3030 sound/soc/codecs/rt5670.c rt5670->sysclk_src = RT5670_SCLK_S_RCCLK; rt5670 3031 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_PWR_ANLG1, rt5670 3033 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_PWR_ANLG2, rt5670 3035 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_IRQ_CTRL1, rt5670 3037 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_JD_CTRL3, rt5670 3041 sound/soc/codecs/rt5670.c switch (rt5670->pdata.jd_mode) { rt5670 3043 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_A_JD_CTRL1, rt5670 3048 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_A_JD_CTRL1, rt5670 3053 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_A_JD_CTRL1, rt5670 3062 sound/soc/codecs/rt5670.c if (rt5670->pdata.dmic_en) { rt5670 3063 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL1, rt5670 3067 sound/soc/codecs/rt5670.c switch (rt5670->pdata.dmic1_data_pin) { rt5670 3069 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_DMIC_CTRL1, rt5670 3075 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_DMIC_CTRL1, rt5670 3078 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL1, rt5670 3084 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_DMIC_CTRL1, rt5670 3087 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL1, rt5670 3096 sound/soc/codecs/rt5670.c switch (rt5670->pdata.dmic2_data_pin) { rt5670 3098 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_DMIC_CTRL1, rt5670 3104 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_DMIC_CTRL1, rt5670 3107 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL1, rt5670 3116 sound/soc/codecs/rt5670.c switch (rt5670->pdata.dmic3_data_pin) { rt5670 3118 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_DMIC_CTRL2, rt5670 3121 sound/soc/codecs/rt5670.c regmap_update_bits(rt5670->regmap, RT5670_GPIO_CTRL1,