Lines Matching refs:component
1200 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in rt5659_hp_vol_put() local
1203 if (snd_soc_component_read(component, RT5659_STO_NG2_CTRL_1) & RT5659_NG2_EN) { in rt5659_hp_vol_put()
1204 snd_soc_component_update_bits(component, RT5659_STO_NG2_CTRL_1, in rt5659_hp_vol_put()
1206 snd_soc_component_update_bits(component, RT5659_STO_NG2_CTRL_1, in rt5659_hp_vol_put()
1213 static void rt5659_enable_push_button_irq(struct snd_soc_component *component, in rt5659_enable_push_button_irq() argument
1216 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in rt5659_enable_push_button_irq()
1219 snd_soc_component_write(component, RT5659_4BTN_IL_CMD_1, 0x000b); in rt5659_enable_push_button_irq()
1227 snd_soc_component_update_bits(component, RT5659_PWR_ANLG_2, in rt5659_enable_push_button_irq()
1229 snd_soc_component_update_bits(component, RT5659_PWR_VOL, in rt5659_enable_push_button_irq()
1232 snd_soc_component_update_bits(component, RT5659_IRQ_CTRL_2, in rt5659_enable_push_button_irq()
1234 snd_soc_component_update_bits(component, RT5659_4BTN_IL_CMD_2, in rt5659_enable_push_button_irq()
1237 snd_soc_component_update_bits(component, RT5659_4BTN_IL_CMD_2, in rt5659_enable_push_button_irq()
1239 snd_soc_component_update_bits(component, RT5659_IRQ_CTRL_2, in rt5659_enable_push_button_irq()
1258 static int rt5659_headset_detect(struct snd_soc_component *component, int jack_insert) in rt5659_headset_detect() argument
1260 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in rt5659_headset_detect()
1264 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_headset_detect()
1270 reg_63 = snd_soc_component_read(component, RT5659_PWR_ANLG_1); in rt5659_headset_detect()
1272 snd_soc_component_update_bits(component, RT5659_PWR_ANLG_1, in rt5659_headset_detect()
1276 snd_soc_component_update_bits(component, RT5659_PWR_ANLG_1, in rt5659_headset_detect()
1279 snd_soc_component_write(component, RT5659_EJD_CTRL_2, 0x4160); in rt5659_headset_detect()
1280 snd_soc_component_update_bits(component, RT5659_EJD_CTRL_1, in rt5659_headset_detect()
1283 snd_soc_component_update_bits(component, RT5659_EJD_CTRL_1, in rt5659_headset_detect()
1288 val = snd_soc_component_read(component, RT5659_EJD_CTRL_2) & 0x0003; in rt5659_headset_detect()
1297 rt5659_enable_push_button_irq(component, true); in rt5659_headset_detect()
1300 snd_soc_component_write(component, RT5659_PWR_ANLG_1, reg_63); in rt5659_headset_detect()
1310 rt5659_enable_push_button_irq(component, false); in rt5659_headset_detect()
1314 dev_dbg(component->dev, "jack_type = %d\n", rt5659->jack_type); in rt5659_headset_detect()
1318 static int rt5659_button_detect(struct snd_soc_component *component) in rt5659_button_detect() argument
1322 val = snd_soc_component_read(component, RT5659_4BTN_IL_CMD_1); in rt5659_button_detect()
1324 snd_soc_component_write(component, RT5659_4BTN_IL_CMD_1, val); in rt5659_button_detect()
1339 int rt5659_set_jack_detect(struct snd_soc_component *component, in rt5659_set_jack_detect() argument
1342 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_set_jack_detect()
1358 if (!rt5659->component) in rt5659_jack_detect_work()
1361 val = snd_soc_component_read(rt5659->component, RT5659_INT_ST_1) & 0x0080; in rt5659_jack_detect_work()
1366 report = rt5659_headset_detect(rt5659->component, 1); in rt5659_jack_detect_work()
1370 btn_type = rt5659_button_detect(rt5659->component); in rt5659_jack_detect_work()
1403 dev_err(rt5659->component->dev, in rt5659_jack_detect_work()
1415 report = rt5659_headset_detect(rt5659->component, 0); in rt5659_jack_detect_work()
1567 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in set_dmic_clk() local
1568 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in set_dmic_clk()
1576 dev_err(component->dev, "Failed to set DMIC clock\n"); in set_dmic_clk()
1578 snd_soc_component_update_bits(component, RT5659_DMIC_CTRL_1, in set_dmic_clk()
1587 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in set_adc1_clk() local
1591 snd_soc_component_update_bits(component, RT5659_CHOP_ADC, in set_adc1_clk()
1597 snd_soc_component_update_bits(component, RT5659_CHOP_ADC, in set_adc1_clk()
1612 struct snd_soc_component *component = in set_adc2_clk() local
1617 snd_soc_component_update_bits(component, RT5659_CHOP_ADC, in set_adc2_clk()
1623 snd_soc_component_update_bits(component, RT5659_CHOP_ADC, in set_adc2_clk()
1638 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rt5659_charge_pump_event() local
1643 snd_soc_component_write(component, RT5659_DEPOP_1, 0x0009); in rt5659_charge_pump_event()
1646 snd_soc_component_write(component, RT5659_HP_CHARGE_PUMP_1, 0x0c16); in rt5659_charge_pump_event()
1659 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in is_sys_clk_from_pll() local
1661 val = snd_soc_component_read(component, RT5659_GLB_CLK); in is_sys_clk_from_pll()
1673 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in is_using_asrc() local
1704 val = (snd_soc_component_read(component, reg) >> shift) & 0xf; in is_using_asrc()
1710 snd_soc_component_update_bits(component, RT5659_ADDA_CLK_1, in is_using_asrc()
2346 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rt5659_spk_event() local
2350 snd_soc_component_update_bits(component, RT5659_CLASSD_CTRL_1, in rt5659_spk_event()
2352 snd_soc_component_update_bits(component, RT5659_CLASSD_2, in rt5659_spk_event()
2354 snd_soc_component_write(component, RT5659_CLASSD_1, 0x0803); in rt5659_spk_event()
2355 snd_soc_component_write(component, RT5659_SPK_DC_CAILB_CTRL_3, 0x0000); in rt5659_spk_event()
2359 snd_soc_component_write(component, RT5659_CLASSD_1, 0x0011); in rt5659_spk_event()
2360 snd_soc_component_update_bits(component, RT5659_CLASSD_2, in rt5659_spk_event()
2362 snd_soc_component_write(component, RT5659_SPK_DC_CAILB_CTRL_3, 0x0003); in rt5659_spk_event()
2363 snd_soc_component_update_bits(component, RT5659_CLASSD_CTRL_1, in rt5659_spk_event()
2378 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rt5659_mono_event() local
2382 snd_soc_component_write(component, RT5659_MONO_AMP_CALIB_CTRL_1, 0x1e00); in rt5659_mono_event()
2386 snd_soc_component_write(component, RT5659_MONO_AMP_CALIB_CTRL_1, 0x1e04); in rt5659_mono_event()
2400 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rt5659_hp_event() local
2404 snd_soc_component_write(component, RT5659_HP_CHARGE_PUMP_1, 0x0e1e); in rt5659_hp_event()
2405 snd_soc_component_update_bits(component, RT5659_DEPOP_1, 0x0010, 0x0010); in rt5659_hp_event()
2409 snd_soc_component_write(component, RT5659_DEPOP_1, 0x0000); in rt5659_hp_event()
3278 struct snd_soc_component *component = dai->component; in rt5659_hw_params() local
3279 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_hw_params()
3286 dev_err(component->dev, "Unsupported clock setting %d for DAI %d\n", in rt5659_hw_params()
3292 dev_err(component->dev, "Unsupported frame size: %d\n", frame_size); in rt5659_hw_params()
3319 snd_soc_component_update_bits(component, RT5659_I2S1_SDP, in rt5659_hw_params()
3325 snd_soc_component_update_bits(component, RT5659_I2S2_SDP, in rt5659_hw_params()
3331 snd_soc_component_update_bits(component, RT5659_I2S3_SDP, in rt5659_hw_params()
3335 dev_err(component->dev, "Invalid dai->id: %d\n", dai->id); in rt5659_hw_params()
3339 snd_soc_component_update_bits(component, RT5659_ADDA_CLK_1, mask_clk, val_clk); in rt5659_hw_params()
3343 snd_soc_component_update_bits(component, RT5659_ADDA_CLK_1, in rt5659_hw_params()
3347 snd_soc_component_update_bits(component, RT5659_ADDA_CLK_1, in rt5659_hw_params()
3351 snd_soc_component_update_bits(component, RT5659_ADDA_CLK_1, in rt5659_hw_params()
3361 struct snd_soc_component *component = dai->component; in rt5659_set_dai_fmt() local
3362 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_set_dai_fmt()
3405 snd_soc_component_update_bits(component, RT5659_I2S1_SDP, in rt5659_set_dai_fmt()
3410 snd_soc_component_update_bits(component, RT5659_I2S2_SDP, in rt5659_set_dai_fmt()
3415 snd_soc_component_update_bits(component, RT5659_I2S3_SDP, in rt5659_set_dai_fmt()
3420 dev_err(component->dev, "Invalid dai->id: %d\n", dai->id); in rt5659_set_dai_fmt()
3426 static int rt5659_set_component_sysclk(struct snd_soc_component *component, int clk_id, in rt5659_set_component_sysclk() argument
3429 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_set_component_sysclk()
3451 dev_err(component->dev, "Invalid clock id (%d)\n", clk_id); in rt5659_set_component_sysclk()
3454 snd_soc_component_update_bits(component, RT5659_GLB_CLK, in rt5659_set_component_sysclk()
3459 dev_dbg(component->dev, "Sysclk is %dHz and clock id is %d\n", in rt5659_set_component_sysclk()
3465 static int rt5659_set_component_pll(struct snd_soc_component *component, int pll_id, in rt5659_set_component_pll() argument
3469 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_set_component_pll()
3478 dev_dbg(component->dev, "PLL disabled\n"); in rt5659_set_component_pll()
3482 snd_soc_component_update_bits(component, RT5659_GLB_CLK, in rt5659_set_component_pll()
3489 snd_soc_component_update_bits(component, RT5659_GLB_CLK, in rt5659_set_component_pll()
3493 snd_soc_component_update_bits(component, RT5659_GLB_CLK, in rt5659_set_component_pll()
3497 snd_soc_component_update_bits(component, RT5659_GLB_CLK, in rt5659_set_component_pll()
3501 snd_soc_component_update_bits(component, RT5659_GLB_CLK, in rt5659_set_component_pll()
3505 dev_err(component->dev, "Unknown PLL source %d\n", source); in rt5659_set_component_pll()
3511 dev_err(component->dev, "Unsupported input clock %d\n", freq_in); in rt5659_set_component_pll()
3515 dev_dbg(component->dev, "bypass=%d m=%d n=%d k=%d\n", in rt5659_set_component_pll()
3519 snd_soc_component_write(component, RT5659_PLL_CTRL_1, in rt5659_set_component_pll()
3521 snd_soc_component_write(component, RT5659_PLL_CTRL_2, in rt5659_set_component_pll()
3535 struct snd_soc_component *component = dai->component; in rt5659_set_tdm_slot() local
3579 snd_soc_component_update_bits(component, RT5659_TDM_CTRL_1, 0x8ff0, val); in rt5659_set_tdm_slot()
3586 struct snd_soc_component *component = dai->component; in rt5659_set_bclk_ratio() local
3587 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_set_bclk_ratio()
3589 dev_dbg(component->dev, "%s ratio=%d\n", __func__, ratio); in rt5659_set_bclk_ratio()
3596 snd_soc_component_update_bits(component, RT5659_ADDA_CLK_1, in rt5659_set_bclk_ratio()
3601 snd_soc_component_update_bits(component, RT5659_ADDA_CLK_1, in rt5659_set_bclk_ratio()
3611 static int rt5659_set_bias_level(struct snd_soc_component *component, in rt5659_set_bias_level() argument
3614 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in rt5659_set_bias_level()
3615 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_set_bias_level()
3637 dev_err(component->dev, in rt5659_set_bias_level()
3663 static int rt5659_probe(struct snd_soc_component *component) in rt5659_probe() argument
3666 snd_soc_component_get_dapm(component); in rt5659_probe()
3667 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_probe()
3669 rt5659->component = component; in rt5659_probe()
3685 static void rt5659_remove(struct snd_soc_component *component) in rt5659_remove() argument
3687 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_remove()
3693 static int rt5659_suspend(struct snd_soc_component *component) in rt5659_suspend() argument
3695 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_suspend()
3702 static int rt5659_resume(struct snd_soc_component *component) in rt5659_resume() argument
3704 struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); in rt5659_resume()
3905 dev_err(rt5659->component->dev, in rt5659_calibrate()
3930 dev_err(rt5659->component->dev, in rt5659_calibrate()
3978 dev_err(rt5659->component->dev, in rt5659_calibrate()
4011 dev_err(rt5659->component->dev, in rt5659_calibrate()