tsa_serial
ret = tsa_serial_get_info(qmc->tsa_serial, &info);
ret = tsa_serial_get_info(qmc->tsa_serial, &info);
ucc_num = tsa_serial_get_num(qmc->tsa_serial);
ret = tsa_serial_connect(qmc->tsa_serial);
ret = tsa_serial_connect(qmc->tsa_serial);
tsa_serial_disconnect(qmc->tsa_serial);
tsa_serial_disconnect(qmc->tsa_serial);
qmc->tsa_serial = devm_tsa_serial_get_byphandle(qmc->dev, np, "fsl,tsa-serial");
if (IS_ERR(qmc->tsa_serial)) {
return dev_err_probe(qmc->dev, PTR_ERR(qmc->tsa_serial),
struct tsa_serial *tsa_serial;
ret = tsa_serial_get_info(chan->qmc->tsa_serial, &tsa_info);
ret = tsa_serial_get_info(chan->qmc->tsa_serial, &info);
ret = tsa_serial_get_info(chan->qmc->tsa_serial, &info);
ret = tsa_serial_get_info(chan->qmc->tsa_serial, &info);
struct tsa_serial *tsa_serial_get_byphandle(struct device_node *np,
struct tsa_serial *tsa_serial;
tsa_serial = &tsa->serials[out_args.args[0]];
if (WARN_ON(tsa_serial->id != out_args.args[0])) {
return tsa_serial;
void tsa_serial_put(struct tsa_serial *tsa_serial)
struct tsa *tsa = tsa_serial_get_tsa(tsa_serial);
struct tsa_serial **tsa_serial = res;
tsa_serial_put(*tsa_serial);
struct tsa_serial *devm_tsa_serial_get_byphandle(struct device *dev,
struct tsa_serial *tsa_serial;
struct tsa_serial **dr;
tsa_serial = tsa_serial_get_byphandle(np, phandle_name);
if (!IS_ERR(tsa_serial)) {
*dr = tsa_serial;
return tsa_serial;
static inline struct tsa *tsa_serial_get_tsa(struct tsa_serial *tsa_serial)
return container_of(tsa_serial, struct tsa, serials[tsa_serial->id]);
static int tsa_qe_serial_get_num(struct tsa_serial *tsa_serial)
struct tsa *tsa = tsa_serial_get_tsa(tsa_serial);
switch (tsa_serial->id) {
dev_err(tsa->dev, "Unsupported serial id %u\n", tsa_serial->id);
int tsa_serial_get_num(struct tsa_serial *tsa_serial)
struct tsa *tsa = tsa_serial_get_tsa(tsa_serial);
return tsa_is_qe(tsa) ? tsa_qe_serial_get_num(tsa_serial) : -EOPNOTSUPP;
static int tsa_cpm1_serial_connect(struct tsa_serial *tsa_serial, bool connect)
struct tsa *tsa = tsa_serial_get_tsa(tsa_serial);
switch (tsa_serial->id) {
dev_err(tsa->dev, "Unsupported serial id %u\n", tsa_serial->id);
static int tsa_qe_serial_connect(struct tsa_serial *tsa_serial, bool connect)
struct tsa *tsa = tsa_serial_get_tsa(tsa_serial);
ucc_num = tsa_qe_serial_get_num(tsa_serial);
tsa_serial->id, ret);
int tsa_serial_connect(struct tsa_serial *tsa_serial)
struct tsa *tsa = tsa_serial_get_tsa(tsa_serial);
tsa_qe_serial_connect(tsa_serial, true) :
tsa_cpm1_serial_connect(tsa_serial, true);
int tsa_serial_disconnect(struct tsa_serial *tsa_serial)
struct tsa *tsa = tsa_serial_get_tsa(tsa_serial);
tsa_qe_serial_connect(tsa_serial, false) :
tsa_cpm1_serial_connect(tsa_serial, false);
int tsa_serial_get_info(struct tsa_serial *tsa_serial, struct tsa_serial_info *info)
memcpy(info, &tsa_serial->info, sizeof(*info));
struct tsa_serial;
struct tsa_serial *tsa_serial_get_byphandle(struct device_node *np,
void tsa_serial_put(struct tsa_serial *tsa_serial);
struct tsa_serial *devm_tsa_serial_get_byphandle(struct device *dev,
int tsa_serial_connect(struct tsa_serial *tsa_serial);
int tsa_serial_disconnect(struct tsa_serial *tsa_serial);
int tsa_serial_get_info(struct tsa_serial *tsa_serial, struct tsa_serial_info *info);
int tsa_serial_get_num(struct tsa_serial *tsa_serial);