Lines Matching +full:vls +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * cx20442.c -- CX20442 ALSA Soc Audio driver
94 return -EINVAL; in cx20442_read_reg_cache()
96 return cx20442->reg_cache; in cx20442_read_reg_cache()
139 return -EINVAL; in cx20442_pm_to_v253_vls()
149 return (value & (1 << CX20442_AGC)) ? -EINVAL : 0; in cx20442_pm_to_v253_vsp()
156 int vls, vsp, old, len; in cx20442_write() local
160 return -EINVAL; in cx20442_write()
164 if (!cx20442->tty || !cx20442->tty->ops->write) in cx20442_write()
165 return -EIO; in cx20442_write()
167 old = cx20442->reg_cache; in cx20442_write()
168 cx20442->reg_cache = value; in cx20442_write()
170 vls = cx20442_pm_to_v253_vls(value); in cx20442_write()
171 if (vls < 0) in cx20442_write()
172 return vls; in cx20442_write()
178 if ((vls == V253_VLS_T) || in cx20442_write()
179 (vls == cx20442_pm_to_v253_vls(old))) { in cx20442_write()
184 len = snprintf(buf, ARRAY_SIZE(buf), "at+vls=%d\r", vls); in cx20442_write()
187 "at+vls=%d;+vsp=%d\r", vls, vsp); in cx20442_write()
189 if (unlikely(len > (ARRAY_SIZE(buf) - 1))) in cx20442_write()
190 return -ENOMEM; in cx20442_write()
192 dev_dbg(component->dev, "%s: %s\n", __func__, buf); in cx20442_write()
193 if (cx20442->tty->ops->write(cx20442->tty, buf, len) != len) in cx20442_write()
194 return -EIO; in cx20442_write()
217 if (!tty->ops->write) in v253_open()
218 return -EINVAL; in v253_open()
221 if (!tty->disc_data) in v253_open()
222 return -ENODEV; in v253_open()
224 tty->receive_room = 16; in v253_open()
225 if (tty->ops->write(tty, v253_init, len) != len) { in v253_open()
226 ret = -EIO; in v253_open()
232 tty->disc_data = NULL; in v253_open()
239 struct snd_soc_component *component = tty->disc_data; in v253_close()
242 tty->disc_data = NULL; in v253_close()
250 cx20442->tty = NULL; in v253_close()
251 component->card->pop_time = 0; in v253_close()
264 struct snd_soc_component *component = tty->disc_data; in v253_receive()
272 if (!cx20442->tty) { in v253_receive()
276 cx20442->tty = tty; in v253_receive()
277 component->card->pop_time = 1; in v253_receive()
297 .name = "cx20442-voice",
324 if (IS_ERR(cx20442->por)) in cx20442_set_bias_level()
325 err = PTR_ERR(cx20442->por); in cx20442_set_bias_level()
327 err = regulator_enable(cx20442->por); in cx20442_set_bias_level()
332 if (IS_ERR(cx20442->por)) in cx20442_set_bias_level()
333 err = PTR_ERR(cx20442->por); in cx20442_set_bias_level()
335 err = regulator_disable(cx20442->por); in cx20442_set_bias_level()
350 return -ENOMEM; in cx20442_component_probe()
352 cx20442->por = regulator_get(component->dev, "POR"); in cx20442_component_probe()
353 if (IS_ERR(cx20442->por)) { in cx20442_component_probe()
354 int err = PTR_ERR(cx20442->por); in cx20442_component_probe()
356 dev_warn(component->dev, "failed to get POR supply (%d)", err); in cx20442_component_probe()
358 * When running on a non-dt platform and requested regulator in cx20442_component_probe()
360 * -EPROBE_DEFER as it is not able to justify if the regulator in cx20442_component_probe()
364 * sufficient. Hence, if we get -ENODEV here, let's convert in cx20442_component_probe()
365 * it to -EPROBE_DEFER and wait for the board to decide or in cx20442_component_probe()
368 if (err == -ENODEV) in cx20442_component_probe()
369 err = -EPROBE_DEFER; in cx20442_component_probe()
374 cx20442->tty = NULL; in cx20442_component_probe()
377 component->card->pop_time = 0; in cx20442_component_probe()
387 if (cx20442->tty) { in cx20442_component_remove()
388 struct tty_struct *tty = cx20442->tty; in cx20442_component_remove()
392 if (!IS_ERR(cx20442->por)) { in cx20442_component_remove()
394 regulator_put(cx20442->por); in cx20442_component_remove()
418 return devm_snd_soc_register_component(&pdev->dev, in cx20442_platform_probe()
424 .name = "cx20442-codec",
431 MODULE_DESCRIPTION("ASoC CX20442-11 voice modem codec driver");
434 MODULE_ALIAS("platform:cx20442-codec");