/* tty and write pointers required for talking to the modem
* are expected to be set by the line discipline initialization code */ if (!cx20442->tty || !cx20442->tty->ops->write) return -EIO;
old = cx20442->reg_cache;
cx20442->reg_cache = value;
vls = cx20442_pm_to_v253_vls(value); if (vls < 0) return vls;
vsp = cx20442_pm_to_v253_vsp(value); if (vsp < 0) return vsp;
if ((vls == V253_VLS_T) ||
(vls == cx20442_pm_to_v253_vls(old))) { if (vsp == cx20442_pm_to_v253_vsp(old)) return 0;
len = snprintf(buf, ARRAY_SIZE(buf), "at+vsp=%d\r", vsp);
} elseif (vsp == cx20442_pm_to_v253_vsp(old))
len = snprintf(buf, ARRAY_SIZE(buf), "at+vls=%d\r", vls); else
len = snprintf(buf, ARRAY_SIZE(buf), "at+vls=%d;+vsp=%d\r", vls, vsp);
if (unlikely(len > (ARRAY_SIZE(buf) - 1))) return -ENOMEM;
/* * Line discpline related code * * Any of the callback functions below can be used in two ways: * 1) registerd by a machine driver as one of line discipline operations, * 2) called from a machine's provided line discipline callback function * in case when extra machine specific code must be run as well.
*/
/* Line discipline .open() */ staticint v253_open(struct tty_struct *tty)
{ int ret, len = strlen(v253_init);
/* Doesn't make sense without write callback */ if (!tty->ops->write) return -EINVAL;
/* Won't work if no codec pointer has been passed by a card driver */ if (!tty->disc_data) return -ENODEV;
tty->receive_room = 16; if (tty->ops->write(tty, v253_init, len) != len) {
ret = -EIO; goto err;
} /* Actual setup will be performed after the modem responds. */ return 0;
err:
tty->disc_data = NULL; return ret;
}
cx20442->por = regulator_get(component->dev, "POR"); if (IS_ERR(cx20442->por)) { int err = PTR_ERR(cx20442->por);
dev_warn(component->dev, "failed to get POR supply (%d)", err); /* * When running on a non-dt platform and requested regulator * is not available, regulator_get() never returns * -EPROBE_DEFER as it is not able to justify if the regulator * may still appear later. On the other hand, the board can * still set full constraints flag at late_initcall in order * to instruct regulator_get() to return a dummy one if * sufficient. Hence, if we get -ENODEV here, let's convert * it to -EPROBE_DEFER and wait for the board to decide or * let Deferred Probe infrastructure handle this error.
*/ if (err == -ENODEV)
err = -EPROBE_DEFER;
kfree(cx20442); return err;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.