Lines Matching refs:component

52 	struct snd_soc_component *component;  member
334 static void wm8996_set_retune_mobile(struct snd_soc_component *component, int block) in wm8996_set_retune_mobile() argument
336 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_set_retune_mobile()
346 if (snd_soc_component_read(component, WM8996_POWER_MANAGEMENT_8) & in wm8996_set_retune_mobile()
354 if (snd_soc_component_read(component, WM8996_POWER_MANAGEMENT_8) & in wm8996_set_retune_mobile()
380 dev_dbg(component->dev, "ReTune Mobile %d %s/%dHz for %dHz sample rate\n", in wm8996_set_retune_mobile()
389 save = snd_soc_component_read(component, base); in wm8996_set_retune_mobile()
393 snd_soc_component_update_bits(component, base + i, 0xffff, in wm8996_set_retune_mobile()
396 snd_soc_component_update_bits(component, base, WM8996_DSP1RX_EQ_ENA, save); in wm8996_set_retune_mobile()
412 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8996_put_retune_mobile_enum() local
413 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_put_retune_mobile_enum()
426 wm8996_set_retune_mobile(component, block); in wm8996_put_retune_mobile_enum()
434 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8996_get_retune_mobile_enum() local
435 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_get_retune_mobile_enum()
574 static void wm8996_bg_enable(struct snd_soc_component *component) in wm8996_bg_enable() argument
576 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_bg_enable()
580 snd_soc_component_update_bits(component, WM8996_POWER_MANAGEMENT_1, in wm8996_bg_enable()
586 static void wm8996_bg_disable(struct snd_soc_component *component) in wm8996_bg_disable() argument
588 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_bg_disable()
592 snd_soc_component_update_bits(component, WM8996_POWER_MANAGEMENT_1, in wm8996_bg_disable()
599 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in bg_event() local
604 wm8996_bg_enable(component); in bg_event()
607 wm8996_bg_disable(component); in bg_event()
634 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in rmv_short_event() local
635 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in rmv_short_event()
653 static void wait_for_dc_servo(struct snd_soc_component *component, u16 mask) in wait_for_dc_servo() argument
655 struct i2c_client *i2c = to_i2c_client(component->dev); in wait_for_dc_servo()
656 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wait_for_dc_servo()
660 snd_soc_component_write(component, WM8996_DC_SERVO_2, mask); in wait_for_dc_servo()
668 dev_err(component->dev, "DC servo timed out\n"); in wait_for_dc_servo()
675 ret = snd_soc_component_read(component, WM8996_DC_SERVO_2); in wait_for_dc_servo()
676 dev_dbg(component->dev, "DC servo state: %x\n", ret); in wait_for_dc_servo()
680 dev_err(component->dev, "DC servo timed out for %x\n", mask); in wait_for_dc_servo()
682 dev_dbg(component->dev, "DC servo complete for %x\n", mask); in wait_for_dc_servo()
685 static void wm8996_seq_notifier(struct snd_soc_component *component, in wm8996_seq_notifier() argument
688 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_seq_notifier()
693 dev_dbg(component->dev, "Starting DC servo for %x\n", in wm8996_seq_notifier()
697 wait_for_dc_servo(component, wm8996->dcs_pending in wm8996_seq_notifier()
704 dev_dbg(component->dev, "Applying RMV_SHORTs %x->%x\n", in wm8996_seq_notifier()
727 snd_soc_component_update_bits(component, WM8996_ANALOGUE_HP_1, mask, val); in wm8996_seq_notifier()
749 snd_soc_component_update_bits(component, WM8996_ANALOGUE_HP_2, mask, val); in wm8996_seq_notifier()
758 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in dcs_start() local
759 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in dcs_start()
1531 static void wm8996_update_bclk(struct snd_soc_component *component) in wm8996_update_bclk() argument
1533 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_update_bclk()
1563 dev_dbg(component->dev, "Using BCLK_DIV %d for actual BCLK %dHz\n", in wm8996_update_bclk()
1566 snd_soc_component_update_bits(component, bclk_reg, in wm8996_update_bclk()
1571 static int wm8996_set_bias_level(struct snd_soc_component *component, in wm8996_set_bias_level() argument
1574 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_set_bias_level()
1582 snd_soc_component_update_bits(component, WM8996_MICBIAS_1, in wm8996_set_bias_level()
1584 snd_soc_component_update_bits(component, WM8996_MICBIAS_2, in wm8996_set_bias_level()
1589 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm8996_set_bias_level()
1593 dev_err(component->dev, in wm8996_set_bias_level()
1610 snd_soc_component_update_bits(component, WM8996_MICBIAS_1, in wm8996_set_bias_level()
1612 snd_soc_component_update_bits(component, WM8996_MICBIAS_2, in wm8996_set_bias_level()
1632 struct snd_soc_component *component = dai->component; in wm8996_set_fmt() local
1709 snd_soc_component_update_bits(component, aifctrl_reg, WM8996_AIF1_FMT_MASK, aifctrl); in wm8996_set_fmt()
1710 snd_soc_component_update_bits(component, bclk_reg, in wm8996_set_fmt()
1713 snd_soc_component_update_bits(component, lrclk_tx_reg, in wm8996_set_fmt()
1717 snd_soc_component_update_bits(component, lrclk_rx_reg, in wm8996_set_fmt()
1733 struct snd_soc_component *component = dai->component; in wm8996_hw_params() local
1734 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_hw_params()
1744 (snd_soc_component_read(component, WM8996_GPIO_1)) & WM8996_GP1_FN_MASK) { in wm8996_hw_params()
1755 (snd_soc_component_read(component, WM8996_GPIO_2)) & WM8996_GP2_FN_MASK) { in wm8996_hw_params()
1771 dev_err(component->dev, "Unsupported BCLK rate: %d\n", bclk_rate); in wm8996_hw_params()
1792 wm8996_update_bclk(component); in wm8996_hw_params()
1798 snd_soc_component_update_bits(component, aifdata_reg, in wm8996_hw_params()
1802 snd_soc_component_update_bits(component, lrclk_reg, WM8996_AIF1RX_RATE_MASK, in wm8996_hw_params()
1804 snd_soc_component_update_bits(component, WM8996_AIF_CLOCKING_2, in wm8996_hw_params()
1813 struct snd_soc_component *component = dai->component; in wm8996_set_sysclk() local
1814 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_set_sysclk()
1825 old = snd_soc_component_read(component, WM8996_AIF_CLOCKING_1) & WM8996_SYSCLK_ENA; in wm8996_set_sysclk()
1826 snd_soc_component_update_bits(component, WM8996_AIF_CLOCKING_1, in wm8996_set_sysclk()
1843 dev_err(component->dev, "Unsupported clock source %d\n", clk_id); in wm8996_set_sysclk()
1850 snd_soc_component_update_bits(component, WM8996_AIF_RATE, in wm8996_set_sysclk()
1860 snd_soc_component_update_bits(component, WM8996_AIF_RATE, in wm8996_set_sysclk()
1869 dev_warn(component->dev, "Unsupported clock rate %dHz\n", in wm8996_set_sysclk()
1874 wm8996_update_bclk(component); in wm8996_set_sysclk()
1876 snd_soc_component_update_bits(component, WM8996_AIF_CLOCKING_1, in wm8996_set_sysclk()
1879 snd_soc_component_update_bits(component, WM8996_CLOCKING_1, WM8996_LFCLK_ENA, lfclk); in wm8996_set_sysclk()
1880 snd_soc_component_update_bits(component, WM8996_CONTROL_INTERFACE_1, in wm8996_set_sysclk()
1882 snd_soc_component_update_bits(component, WM8996_AIF_CLOCKING_1, in wm8996_set_sysclk()
2001 static int wm8996_set_fll(struct snd_soc_component *component, int fll_id, int source, in wm8996_set_fll() argument
2004 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_set_fll()
2005 struct i2c_client *i2c = to_i2c_client(component->dev); in wm8996_set_fll()
2016 dev_dbg(component->dev, "FLL disabled\n"); in wm8996_set_fll()
2021 snd_soc_component_update_bits(component, WM8996_FLL_CONTROL_1, in wm8996_set_fll()
2024 wm8996_bg_disable(component); in wm8996_set_fll()
2047 dev_err(component->dev, "Unknown FLL source %d\n", ret); in wm8996_set_fll()
2054 snd_soc_component_update_bits(component, WM8996_FLL_CONTROL_5, in wm8996_set_fll()
2063 snd_soc_component_write(component, WM8996_FLL_EFS_2, reg); in wm8996_set_fll()
2065 snd_soc_component_update_bits(component, WM8996_FLL_CONTROL_2, in wm8996_set_fll()
2071 snd_soc_component_write(component, WM8996_FLL_CONTROL_3, fll_div.theta); in wm8996_set_fll()
2073 snd_soc_component_update_bits(component, WM8996_FLL_CONTROL_4, in wm8996_set_fll()
2078 snd_soc_component_write(component, WM8996_FLL_EFS_1, fll_div.lambda); in wm8996_set_fll()
2081 ret = snd_soc_component_read(component, WM8996_FLL_CONTROL_1); in wm8996_set_fll()
2083 wm8996_bg_enable(component); in wm8996_set_fll()
2088 snd_soc_component_update_bits(component, WM8996_FLL_CONTROL_1, in wm8996_set_fll()
2094 snd_soc_component_write(component, WM8996_FLL_CONTROL_6, WM8996_FLL_SWITCH_CLK); in wm8996_set_fll()
2120 ret = snd_soc_component_read(component, WM8996_INTERRUPT_RAW_STATUS_2); in wm8996_set_fll()
2125 dev_err(component->dev, "Timed out waiting for FLL\n"); in wm8996_set_fll()
2129 dev_dbg(component->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout); in wm8996_set_fll()
2239 int wm8996_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, in wm8996_detect() argument
2242 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_detect()
2243 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8996_detect()
2251 wm8996->polarity_cb(component, 0); in wm8996_detect()
2254 snd_soc_component_update_bits(component, WM8996_MICBIAS_1, in wm8996_detect()
2256 snd_soc_component_update_bits(component, WM8996_MICBIAS_2, in wm8996_detect()
2270 snd_soc_component_update_bits(component, WM8996_MIC_DETECT_1, in wm8996_detect()
2274 snd_soc_component_update_bits(component, WM8996_MIC_DETECT_1, in wm8996_detect()
2279 snd_soc_component_update_bits(component, WM8996_INTERRUPT_STATUS_2_MASK, in wm8996_detect()
2286 static void wm8996_hpdet_irq(struct snd_soc_component *component) in wm8996_hpdet_irq() argument
2288 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8996_hpdet_irq()
2289 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_hpdet_irq()
2297 reg = snd_soc_component_read(component, WM8996_HEADPHONE_DETECT_2); in wm8996_hpdet_irq()
2299 dev_err(component->dev, "Failed to read HPDET status\n"); in wm8996_hpdet_irq()
2304 dev_err(component->dev, "Got HPDET IRQ but HPDET is busy\n"); in wm8996_hpdet_irq()
2310 dev_dbg(component->dev, "HPDET measured %d ohms\n", val); in wm8996_hpdet_irq()
2330 if (!(snd_soc_component_read(component, WM8996_POWER_MANAGEMENT_1) & in wm8996_hpdet_irq()
2332 snd_soc_component_update_bits(component, WM8996_ANALOGUE_HP_1, in wm8996_hpdet_irq()
2337 snd_soc_component_update_bits(component, WM8996_ACCESSORY_DETECT_MODE_1, in wm8996_hpdet_irq()
2339 snd_soc_component_update_bits(component, WM8996_MIC_DETECT_1, WM8996_MICD_ENA, in wm8996_hpdet_irq()
2346 static void wm8996_hpdet_start(struct snd_soc_component *component) in wm8996_hpdet_start() argument
2348 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8996_hpdet_start()
2351 snd_soc_component_update_bits(component, WM8996_ANALOGUE_HP_1, in wm8996_hpdet_start()
2362 snd_soc_component_update_bits(component, WM8996_MIC_DETECT_1, WM8996_MICD_ENA, 0); in wm8996_hpdet_start()
2363 snd_soc_component_update_bits(component, WM8996_ACCESSORY_DETECT_MODE_1, in wm8996_hpdet_start()
2367 snd_soc_component_update_bits(component, WM8996_HEADPHONE_DETECT_1, in wm8996_hpdet_start()
2371 static void wm8996_report_headphone(struct snd_soc_component *component) in wm8996_report_headphone() argument
2373 dev_dbg(component->dev, "Headphone detected\n"); in wm8996_report_headphone()
2374 wm8996_hpdet_start(component); in wm8996_report_headphone()
2377 snd_soc_component_update_bits(component, WM8996_MIC_DETECT_1, in wm8996_report_headphone()
2384 static void wm8996_micd(struct snd_soc_component *component) in wm8996_micd() argument
2386 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_micd()
2389 val = snd_soc_component_read(component, WM8996_MIC_DETECT_3); in wm8996_micd()
2391 dev_dbg(component->dev, "Microphone event: %x\n", val); in wm8996_micd()
2394 dev_warn(component->dev, "Microphone detection state invalid\n"); in wm8996_micd()
2400 dev_dbg(component->dev, "Jack removal detected\n"); in wm8996_micd()
2408 snd_soc_component_update_bits(component, WM8996_MIC_DETECT_1, in wm8996_micd()
2422 dev_dbg(component->dev, "Microphone detected\n"); in wm8996_micd()
2424 wm8996_hpdet_start(component); in wm8996_micd()
2428 snd_soc_component_update_bits(component, WM8996_MIC_DETECT_1, in wm8996_micd()
2434 dev_dbg(component->dev, "Mic button up\n"); in wm8996_micd()
2451 wm8996_report_headphone(component); in wm8996_micd()
2455 reg = snd_soc_component_read(component, WM8996_ACCESSORY_DETECT_MODE_2); in wm8996_micd()
2458 snd_soc_component_update_bits(component, WM8996_ACCESSORY_DETECT_MODE_2, in wm8996_micd()
2463 wm8996->polarity_cb(component, in wm8996_micd()
2466 dev_dbg(component->dev, "Set microphone polarity to %d\n", in wm8996_micd()
2477 dev_dbg(component->dev, "Mic button detected\n"); in wm8996_micd()
2481 wm8996_report_headphone(component); in wm8996_micd()
2488 struct snd_soc_component *component = data; in wm8996_irq() local
2489 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_irq()
2492 irq_val = snd_soc_component_read(component, WM8996_INTERRUPT_STATUS_2); in wm8996_irq()
2494 dev_err(component->dev, "Failed to read IRQ status: %d\n", in wm8996_irq()
2498 irq_val &= ~snd_soc_component_read(component, WM8996_INTERRUPT_STATUS_2_MASK); in wm8996_irq()
2503 snd_soc_component_write(component, WM8996_INTERRUPT_STATUS_2, irq_val); in wm8996_irq()
2506 dev_dbg(component->dev, "DC servo IRQ\n"); in wm8996_irq()
2511 dev_err(component->dev, "Digital core FIFO error\n"); in wm8996_irq()
2514 dev_dbg(component->dev, "FLL locked\n"); in wm8996_irq()
2519 wm8996_micd(component); in wm8996_irq()
2522 wm8996_hpdet_irq(component); in wm8996_irq()
2541 static void wm8996_retune_mobile_pdata(struct snd_soc_component *component) in wm8996_retune_mobile_pdata() argument
2543 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_retune_mobile_pdata()
2592 dev_dbg(component->dev, "Allocated %d unique ReTune Mobile names\n", in wm8996_retune_mobile_pdata()
2598 ret = snd_soc_add_component_controls(component, controls, ARRAY_SIZE(controls)); in wm8996_retune_mobile_pdata()
2600 dev_err(component->dev, in wm8996_retune_mobile_pdata()
2616 static int wm8996_probe(struct snd_soc_component *component) in wm8996_probe() argument
2619 struct wm8996_priv *wm8996 = snd_soc_component_get_drvdata(component); in wm8996_probe()
2620 struct i2c_client *i2c = to_i2c_client(component->dev); in wm8996_probe()
2623 wm8996->component = component; in wm8996_probe()
2629 wm8996_retune_mobile_pdata(component); in wm8996_probe()
2631 snd_soc_add_component_controls(component, wm8996_eq_controls, in wm8996_probe()
2645 irq_flags, "wm8996", component); in wm8996_probe()
2648 irq_flags, "wm8996", component); in wm8996_probe()
2652 snd_soc_component_update_bits(component, WM8996_INTERRUPT_CONTROL, in wm8996_probe()
2656 snd_soc_component_update_bits(component, in wm8996_probe()
2664 dev_err(component->dev, "Failed to request IRQ: %d\n", in wm8996_probe()
2673 static void wm8996_remove(struct snd_soc_component *component) in wm8996_remove() argument
2675 struct i2c_client *i2c = to_i2c_client(component->dev); in wm8996_remove()
2677 snd_soc_component_update_bits(component, WM8996_INTERRUPT_CONTROL, in wm8996_remove()
2681 free_irq(i2c->irq, component); in wm8996_remove()