Lines Matching +full:enable +full:- +full:delay +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0-only
3 // rt9123p.c -- RT9123 (HW Mode) ALSA SoC Codec driver
8 #include <linux/delay.h>
19 #include <sound/soc-dai.h>
20 #include <sound/soc-dapm.h>
23 struct gpio_desc *enable; member
31 struct snd_soc_component *comp = dai->component; in rt9123p_daiops_trigger()
34 if (!rt9123p->enable) in rt9123p_daiops_trigger()
41 mdelay(rt9123p->enable_delay); in rt9123p_daiops_trigger()
42 if (rt9123p->enable_switch) { in rt9123p_daiops_trigger()
43 gpiod_set_value(rt9123p->enable, 1); in rt9123p_daiops_trigger()
44 dev_dbg(comp->dev, "set enable to 1"); in rt9123p_daiops_trigger()
50 gpiod_set_value(rt9123p->enable, 0); in rt9123p_daiops_trigger()
51 dev_dbg(comp->dev, "set enable to 0"); in rt9123p_daiops_trigger()
63 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in rt9123p_enable_event()
67 rt9123p->enable_switch = 1; in rt9123p_enable_event()
69 rt9123p->enable_switch = 0; in rt9123p_enable_event()
120 struct device *dev = &pdev->dev; in rt9123p_platform_probe()
126 return -ENOMEM; in rt9123p_platform_probe()
128 rt9123p->enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW); in rt9123p_platform_probe()
129 if (IS_ERR(rt9123p->enable)) in rt9123p_platform_probe()
130 return PTR_ERR(rt9123p->enable); in rt9123p_platform_probe()
132 ret = device_property_read_u32(dev, "enable-delay-ms", &rt9123p->enable_delay); in rt9123p_platform_probe()
134 rt9123p->enable_delay = 0; in rt9123p_platform_probe()
135 dev_dbg(dev, "no optional property 'enable-delay-ms' found, default: no delay\n"); in rt9123p_platform_probe()