int bcm4774_resume(struct platform_device *p) { struct tty_struct *ttypoint; struct file *ttyfile; if((NULL == priv) || (NULL == priv->tty) || (NULL == priv->tty->private_data)) { pr_err("%s priv is NOT init \n", __func__); return -1; } ttyfile = priv->tty; ttypoint = ((struct tty_file_private *)ttyfile->private_data)->tty; if((NULL == ttypoint) || (NULL == ttypoint->port)) { pr_err("%s ttypoint is NULL \n", __func__); return -1; } /* Enable uart RTS */ tty_port_lower_dtr_rts(ttypoint->port); /* Enable uart flow control */ if (bcm_tty_config(ttyfile)) { pr_err("%s can not change %s setting.\n", __func__, PORT_NAME); return -EIO; } pr_info("%s -- :%s\n", __func__, ttypoint->name); return 0; }
static void tty_port_shutdown(struct tty_port *port, struct tty_struct *tty) { mutex_lock(&port->mutex); if (port->console) goto out; if (test_and_clear_bit(ASYNCB_INITIALIZED, &port->flags)) { /* * Drop DTR/RTS if HUPCL is set. This causes any attached * modem to hang up the line. */ if (tty && C_HUPCL(tty)) tty_port_lower_dtr_rts(port); if (port->ops->shutdown) port->ops->shutdown(port); } out: mutex_unlock(&port->mutex); }
static void tty_port_shutdown(struct tty_port *port, struct tty_struct *tty) { mutex_lock(&port->mutex); if (port->console) goto out; if (tty_port_initialized(port)) { tty_port_set_initialized(port, 0); /* * Drop DTR/RTS if HUPCL is set. This causes any attached * modem to hang up the line. */ if (tty && C_HUPCL(tty)) tty_port_lower_dtr_rts(port); if (port->ops->shutdown) port->ops->shutdown(port); } out: mutex_unlock(&port->mutex); }