Lines Matching refs:evea

107 static void evea_set_power_state_on(struct evea_priv *evea)  in evea_set_power_state_on()  argument
109 struct regmap *map = evea->regmap; in evea_set_power_state_on()
125 static void evea_set_power_state_off(struct evea_priv *evea) in evea_set_power_state_off() argument
127 struct regmap *map = evea->regmap; in evea_set_power_state_off()
144 static int evea_update_switch_lin(struct evea_priv *evea) in evea_update_switch_lin() argument
146 struct regmap *map = evea->regmap; in evea_update_switch_lin()
148 if (evea->switch_lin) { in evea_update_switch_lin()
168 static int evea_update_switch_lo(struct evea_priv *evea) in evea_update_switch_lo() argument
170 struct regmap *map = evea->regmap; in evea_update_switch_lo()
172 if (evea->switch_lo) { in evea_update_switch_lo()
196 static int evea_update_switch_hp(struct evea_priv *evea) in evea_update_switch_hp() argument
198 struct regmap *map = evea->regmap; in evea_update_switch_hp()
200 if (evea->switch_hp) { in evea_update_switch_hp()
221 static void evea_update_switch_all(struct evea_priv *evea) in evea_update_switch_all() argument
223 evea_update_switch_lin(evea); in evea_update_switch_all()
224 evea_update_switch_lo(evea); in evea_update_switch_all()
225 evea_update_switch_hp(evea); in evea_update_switch_all()
232 struct evea_priv *evea = snd_soc_component_get_drvdata(component); in evea_get_switch_lin() local
234 ucontrol->value.integer.value[0] = evea->switch_lin; in evea_get_switch_lin()
243 struct evea_priv *evea = snd_soc_component_get_drvdata(component); in evea_set_switch_lin() local
245 if (evea->switch_lin == ucontrol->value.integer.value[0]) in evea_set_switch_lin()
248 evea->switch_lin = ucontrol->value.integer.value[0]; in evea_set_switch_lin()
250 return evea_update_switch_lin(evea); in evea_set_switch_lin()
257 struct evea_priv *evea = snd_soc_component_get_drvdata(component); in evea_get_switch_lo() local
259 ucontrol->value.integer.value[0] = evea->switch_lo; in evea_get_switch_lo()
268 struct evea_priv *evea = snd_soc_component_get_drvdata(component); in evea_set_switch_lo() local
270 if (evea->switch_lo == ucontrol->value.integer.value[0]) in evea_set_switch_lo()
273 evea->switch_lo = ucontrol->value.integer.value[0]; in evea_set_switch_lo()
275 return evea_update_switch_lo(evea); in evea_set_switch_lo()
282 struct evea_priv *evea = snd_soc_component_get_drvdata(component); in evea_get_switch_hp() local
284 ucontrol->value.integer.value[0] = evea->switch_hp; in evea_get_switch_hp()
293 struct evea_priv *evea = snd_soc_component_get_drvdata(component); in evea_set_switch_hp() local
295 if (evea->switch_hp == ucontrol->value.integer.value[0]) in evea_set_switch_hp()
298 evea->switch_hp = ucontrol->value.integer.value[0]; in evea_set_switch_hp()
300 return evea_update_switch_hp(evea); in evea_set_switch_hp()
314 struct evea_priv *evea = snd_soc_component_get_drvdata(component); in evea_codec_probe() local
316 evea->switch_lin = 1; in evea_codec_probe()
317 evea->switch_lo = 1; in evea_codec_probe()
318 evea->switch_hp = 1; in evea_codec_probe()
320 evea_set_power_state_on(evea); in evea_codec_probe()
321 evea_update_switch_all(evea); in evea_codec_probe()
328 struct evea_priv *evea = snd_soc_component_get_drvdata(component); in evea_codec_suspend() local
330 evea_set_power_state_off(evea); in evea_codec_suspend()
332 reset_control_assert(evea->rst_adamv); in evea_codec_suspend()
333 reset_control_assert(evea->rst_exiv); in evea_codec_suspend()
334 reset_control_assert(evea->rst); in evea_codec_suspend()
336 clk_disable_unprepare(evea->clk_exiv); in evea_codec_suspend()
337 clk_disable_unprepare(evea->clk); in evea_codec_suspend()
344 struct evea_priv *evea = snd_soc_component_get_drvdata(component); in evea_codec_resume() local
347 ret = clk_prepare_enable(evea->clk); in evea_codec_resume()
351 ret = clk_prepare_enable(evea->clk_exiv); in evea_codec_resume()
355 ret = reset_control_deassert(evea->rst); in evea_codec_resume()
359 ret = reset_control_deassert(evea->rst_exiv); in evea_codec_resume()
363 ret = reset_control_deassert(evea->rst_adamv); in evea_codec_resume()
367 evea_set_power_state_on(evea); in evea_codec_resume()
368 evea_update_switch_all(evea); in evea_codec_resume()
373 reset_control_assert(evea->rst_exiv); in evea_codec_resume()
376 reset_control_assert(evea->rst); in evea_codec_resume()
379 clk_disable_unprepare(evea->clk_exiv); in evea_codec_resume()
382 clk_disable_unprepare(evea->clk); in evea_codec_resume()
452 struct evea_priv *evea; in evea_probe() local
456 evea = devm_kzalloc(&pdev->dev, sizeof(struct evea_priv), GFP_KERNEL); in evea_probe()
457 if (!evea) in evea_probe()
460 evea->clk = devm_clk_get(&pdev->dev, "evea"); in evea_probe()
461 if (IS_ERR(evea->clk)) in evea_probe()
462 return PTR_ERR(evea->clk); in evea_probe()
464 evea->clk_exiv = devm_clk_get(&pdev->dev, "exiv"); in evea_probe()
465 if (IS_ERR(evea->clk_exiv)) in evea_probe()
466 return PTR_ERR(evea->clk_exiv); in evea_probe()
468 evea->rst = devm_reset_control_get_shared(&pdev->dev, "evea"); in evea_probe()
469 if (IS_ERR(evea->rst)) in evea_probe()
470 return PTR_ERR(evea->rst); in evea_probe()
472 evea->rst_exiv = devm_reset_control_get_shared(&pdev->dev, "exiv"); in evea_probe()
473 if (IS_ERR(evea->rst_exiv)) in evea_probe()
474 return PTR_ERR(evea->rst_exiv); in evea_probe()
480 evea->regmap = devm_regmap_init_mmio(&pdev->dev, preg, in evea_probe()
482 if (IS_ERR(evea->regmap)) in evea_probe()
483 return PTR_ERR(evea->regmap); in evea_probe()
485 ret = clk_prepare_enable(evea->clk); in evea_probe()
489 ret = clk_prepare_enable(evea->clk_exiv); in evea_probe()
493 ret = reset_control_deassert(evea->rst); in evea_probe()
497 ret = reset_control_deassert(evea->rst_exiv); in evea_probe()
502 evea->rst_adamv = devm_reset_control_get_shared(&pdev->dev, "adamv"); in evea_probe()
503 if (IS_ERR(evea->rst_adamv)) { in evea_probe()
504 ret = PTR_ERR(evea->rst_adamv); in evea_probe()
508 ret = reset_control_deassert(evea->rst_adamv); in evea_probe()
512 platform_set_drvdata(pdev, evea); in evea_probe()
522 reset_control_assert(evea->rst_adamv); in evea_probe()
525 reset_control_assert(evea->rst_exiv); in evea_probe()
528 reset_control_assert(evea->rst); in evea_probe()
531 clk_disable_unprepare(evea->clk_exiv); in evea_probe()
534 clk_disable_unprepare(evea->clk); in evea_probe()
541 struct evea_priv *evea = platform_get_drvdata(pdev); in evea_remove() local
543 reset_control_assert(evea->rst_adamv); in evea_remove()
544 reset_control_assert(evea->rst_exiv); in evea_remove()
545 reset_control_assert(evea->rst); in evea_remove()
547 clk_disable_unprepare(evea->clk_exiv); in evea_remove()
548 clk_disable_unprepare(evea->clk); in evea_remove()