Lines Matching defs:component

3 // rt5682.c  --  RT5682 ALSA SoC audio component driver
827 * @component: SoC audio component device.
836 * set of filters specified by the mask. And the component driver will turn on
839 int rt5682_sel_asrc_clk_src(struct snd_soc_component *component,
853 snd_soc_component_update_bits(component, RT5682_PLL_TRACK_2,
859 snd_soc_component_update_bits(component, RT5682_PLL_TRACK_3,
868 static int rt5682_button_detect(struct snd_soc_component *component)
872 val = snd_soc_component_read(component, RT5682_4BTN_IL_CMD_1);
874 snd_soc_component_write(component, RT5682_4BTN_IL_CMD_1, val);
875 dev_dbg(component->dev, "%s btn_type=%x\n", __func__, btn_type);
876 snd_soc_component_update_bits(component,
882 static void rt5682_enable_push_button_irq(struct snd_soc_component *component,
885 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
888 snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_1,
890 snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_13,
892 snd_soc_component_write(component, RT5682_IL_CMD_1, 0x0040);
893 snd_soc_component_update_bits(component, RT5682_4BTN_IL_CMD_2,
897 snd_soc_component_update_bits(component,
902 snd_soc_component_update_bits(component,
906 snd_soc_component_update_bits(component, RT5682_IRQ_CTRL_3,
908 snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_1,
910 snd_soc_component_update_bits(component, RT5682_4BTN_IL_CMD_2,
912 snd_soc_component_update_bits(component, RT5682_4BTN_IL_CMD_2,
914 snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_13,
921 * @component: SoC audio component device.
928 static int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
930 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
931 struct snd_soc_dapm_context *dapm = &component->dapm;
935 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
938 snd_soc_component_update_bits(component,
941 snd_soc_component_update_bits(component,
943 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3,
945 snd_soc_component_update_bits(component,
948 rt5682_enable_push_button_irq(component, false);
949 snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
952 snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
956 val = snd_soc_component_read(component, RT5682_CBJ_CTRL_2)
960 val = snd_soc_component_read(component,
969 snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
971 rt5682_enable_push_button_irq(component, true);
978 snd_soc_component_update_bits(component,
982 snd_soc_component_update_bits(component, RT5682_MICBIAS_2,
986 rt5682_enable_push_button_irq(component, false);
987 snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
992 snd_soc_component_update_bits(component,
997 snd_soc_component_update_bits(component,
999 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3,
1001 snd_soc_component_update_bits(component, RT5682_MICBIAS_2,
1004 snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
1010 dev_dbg(component->dev, "jack_type = %d\n", rt5682->jack_type);
1014 static int rt5682_set_jack_detect(struct snd_soc_component *component,
1017 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
1037 snd_soc_component_update_bits(component,
1039 snd_soc_component_update_bits(component,
1042 snd_soc_component_write(component, RT5682_CBJ_CTRL_1,
1044 snd_soc_component_update_bits(component,
1047 snd_soc_component_update_bits(component,
1086 dev_warn(component->dev, "Wrong JD source\n");
1101 if (!rt5682->component ||
1102 !snd_soc_card_is_instantiated(rt5682->component->card)) {
1118 dapm = snd_soc_component_get_dapm(rt5682->component);
1123 val = snd_soc_component_read(rt5682->component, RT5682_AJD1_CTRL)
1130 rt5682_headset_detect(rt5682->component, 1);
1136 btn_type = rt5682_button_detect(rt5682->component);
1168 dev_err(rt5682->component->dev,
1176 rt5682->jack_type = rt5682_headset_detect(rt5682->component, 0);
1225 dev_err(rt5682->component->dev,
1231 dev_dbg(rt5682->component->dev, "div[%d]=%d\n", i, div[i]);
1235 dev_dbg(rt5682->component->dev,
1243 dev_err(rt5682->component->dev,
1262 struct snd_soc_component *component =
1264 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
1273 snd_soc_component_update_bits(component, RT5682_DMIC_CTRL_1,
1282 struct snd_soc_component *component =
1284 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
1292 val = snd_soc_component_read(component, RT5682_GPIO_CTRL_1) &
1307 snd_soc_component_update_bits(component, reg,
1316 snd_soc_component_update_bits(component, RT5682_ADDA_CLK_1,
1327 struct snd_soc_component *component =
1330 val = snd_soc_component_read(component, RT5682_GLB_CLK);
1342 struct snd_soc_component *component =
1345 val = snd_soc_component_read(component, RT5682_GLB_CLK);
1357 struct snd_soc_component *component =
1373 val = (snd_soc_component_read(component, reg) >> shift) & 0xf;
1542 struct snd_soc_component *component =
1547 snd_soc_component_update_bits(component, RT5682_HP_CTRL_2,
1549 snd_soc_component_update_bits(component, RT5682_HP_LOGIC_CTRL_2,
1551 snd_soc_component_update_bits(component,
1553 snd_soc_component_update_bits(component,
1555 snd_soc_component_update_bits(component, RT5682_HP_CTRL_2,
1559 snd_soc_component_update_bits(component, RT5682_CHARGE_PUMP_1,
1564 snd_soc_component_update_bits(component, RT5682_HP_CTRL_2,
1566 snd_soc_component_update_bits(component, RT5682_CHARGE_PUMP_1,
1568 snd_soc_component_update_bits(component,
1570 snd_soc_component_update_bits(component,
1581 struct snd_soc_component *component =
1583 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
1591 val = snd_soc_component_read(component, RT5682_GLB_CLK);
1594 snd_soc_component_update_bits(component,
1606 snd_soc_component_update_bits(component,
1609 snd_soc_component_update_bits(component,
1621 struct snd_soc_component *component =
1628 snd_soc_component_update_bits(component,
1633 snd_soc_component_update_bits(component,
1643 snd_soc_component_update_bits(component,
1649 snd_soc_component_update_bits(component,
2066 struct snd_soc_component *component = dai->component;
2070 snd_soc_component_update_bits(component, RT5682_TDM_ADDA_CTRL_2,
2073 snd_soc_component_update_bits(component, RT5682_TDM_ADDA_CTRL_2,
2095 snd_soc_component_update_bits(component, RT5682_TDM_CTRL,
2124 snd_soc_component_update_bits(component, RT5682_TDM_TCON_CTRL,
2126 snd_soc_component_update_bits(component, RT5682_I2S1_SDP,
2135 struct snd_soc_component *component = dai->component;
2136 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
2145 dev_err(component->dev, "Unsupported frame size: %d\n",
2178 snd_soc_component_update_bits(component, RT5682_I2S1_SDP,
2181 snd_soc_component_update_bits(component,
2188 snd_soc_component_update_bits(component,
2192 snd_soc_component_update_bits(component,
2197 snd_soc_component_update_bits(component, RT5682_I2S2_SDP,
2200 snd_soc_component_update_bits(component,
2205 snd_soc_component_update_bits(component,
2209 snd_soc_component_update_bits(component,
2214 dev_err(component->dev, "Invalid dai->id: %d\n", dai->id);
2223 struct snd_soc_component *component = dai->component;
2224 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
2283 snd_soc_component_update_bits(component, RT5682_I2S1_SDP,
2285 snd_soc_component_update_bits(component, RT5682_TDM_TCON_CTRL,
2294 snd_soc_component_update_bits(component, RT5682_I2S2_SDP,
2299 dev_err(component->dev, "Invalid dai->id: %d\n", dai->id);
2305 static int rt5682_set_component_sysclk(struct snd_soc_component *component,
2308 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
2332 dev_err(component->dev, "Invalid clock id (%d)\n", clk_id);
2335 snd_soc_component_update_bits(component, RT5682_GLB_CLK,
2339 snd_soc_component_update_bits(component,
2347 dev_dbg(component->dev, "Sysclk is %dHz and clock id is %d\n",
2353 static int rt5682_set_component_pll(struct snd_soc_component *component,
2357 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
2368 dev_dbg(component->dev, "PLL disabled\n");
2372 snd_soc_component_update_bits(component, RT5682_GLB_CLK,
2380 snd_soc_component_update_bits(component,
2385 dev_err(component->dev, "Unknown PLL2 Source %d\n",
2397 dev_err(component->dev, "Unsupported input clock %d\n",
2401 dev_dbg(component->dev, "PLL2F: fin=%d fout=%d bypass=%d m=%d n=%d k=%d\n",
2409 dev_err(component->dev, "Unsupported input clock %d\n",
2413 dev_dbg(component->dev, "PLL2B: fin=%d fout=%d bypass=%d m=%d n=%d k=%d\n",
2419 snd_soc_component_write(component, RT5682_PLL2_CTRL_1,
2423 snd_soc_component_write(component, RT5682_PLL2_CTRL_2,
2426 snd_soc_component_write(component, RT5682_PLL2_CTRL_3,
2433 snd_soc_component_update_bits(component, RT5682_PLL2_CTRL_4,
2443 snd_soc_component_update_bits(component,
2448 snd_soc_component_update_bits(component,
2453 dev_err(component->dev, "Unknown PLL1 Source %d\n",
2460 dev_err(component->dev, "Unsupported input clock %d\n",
2465 dev_dbg(component->dev, "bypass=%d m=%d n=%d k=%d\n",
2469 snd_soc_component_write(component, RT5682_PLL_CTRL_1,
2471 snd_soc_component_write(component, RT5682_PLL_CTRL_2,
2485 struct snd_soc_component *component = dai->component;
2486 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
2492 snd_soc_component_update_bits(component, RT5682_TDM_TCON_CTRL,
2496 snd_soc_component_update_bits(component, RT5682_TDM_TCON_CTRL,
2500 snd_soc_component_update_bits(component, RT5682_TDM_TCON_CTRL,
2504 snd_soc_component_update_bits(component, RT5682_TDM_TCON_CTRL,
2517 struct snd_soc_component *component = dai->component;
2518 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
2524 snd_soc_component_update_bits(component, RT5682_ADDA_CLK_2,
2529 snd_soc_component_update_bits(component, RT5682_ADDA_CLK_2,
2541 static int rt5682_set_bias_level(struct snd_soc_component *component,
2544 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
2591 struct snd_soc_component *component;
2597 component = rt5682->component;
2598 dapm = snd_soc_component_get_dapm(component);
2603 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
2607 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
2611 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
2629 struct snd_soc_component *component;
2635 component = rt5682->component;
2636 dapm = snd_soc_component_get_dapm(component);
2643 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
2707 struct snd_soc_component *component;
2716 component = rt5682->component;
2740 rt5682_set_component_pll(component, RT5682_PLL2, RT5682_PLL2_S_MCLK,
2743 rt5682_set_component_sysclk(component, RT5682_SCLK_S_PLL2, 0,
2750 snd_soc_component_update_bits(component, RT5682_ADDA_CLK_1,
2827 struct snd_soc_component *component;
2834 component = rt5682->component;
2838 for_each_component_dais(component, dai)
2842 dev_err(rt5682->i2c_dev, "dai %d not found in component\n",
2926 static int rt5682_probe(struct snd_soc_component *component)
2928 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
2931 struct snd_soc_dapm_context *dapm = &component->dapm;
2933 rt5682->component = component;
2952 static void rt5682_remove(struct snd_soc_component *component)
2954 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
2960 static int rt5682_suspend(struct snd_soc_component *component)
2962 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
2974 val = snd_soc_component_read(component,
2979 snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_1,
2984 snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_1,
2993 snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_1,
2997 snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
3001 snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_1,
3004 snd_soc_component_update_bits(component, RT5682_HP_CHARGE_PUMP_1,
3013 static int rt5682_resume(struct snd_soc_component *component)
3015 struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
3024 snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_1,
3028 snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
3031 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3,
3168 dev_err(rt5682->component->dev, "HP Calibration Failure\n");