Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283582
b: refs/heads/master
c: faf02f8
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Dec 2, 2011
1 parent c967164 commit 4582059
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dc7e3ef7dade7041fb1809f2a5403efac655a791
refs/heads/master: faf02f8fee5563ea7f950b3f5f08c654aa6c4525
31 changes: 20 additions & 11 deletions trunk/drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,15 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag)
if (!reg->size)
return;

if (!(cflag & CRTSCTS))
sci_out(port, SCSPTR, 0x0080); /* Set RTS = 1 */
if ((s->cfg->capabilities & SCIx_HAVE_RTSCTS) &&
((!(cflag & CRTSCTS)))) {
unsigned short status;

status = sci_in(port, SCSPTR);
status &= ~SCSPTR_CTSIO;
status |= SCSPTR_RTSIO;
sci_out(port, SCSPTR, status); /* Set RTS = 1 */
}
}

static int sci_txfill(struct uart_port *port)
Expand Down Expand Up @@ -1764,16 +1771,18 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,

sci_init_pins(port, termios->c_cflag);

reg = sci_getreg(port, SCFCR);
if (reg->size) {
unsigned short ctrl;
if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) {
reg = sci_getreg(port, SCFCR);
if (reg->size) {
unsigned short ctrl;

ctrl = sci_in(port, SCFCR);
if (termios->c_cflag & CRTSCTS)
ctrl |= SCFCR_MCE;
else
ctrl &= ~SCFCR_MCE;
sci_out(port, SCFCR, ctrl);
ctrl = sci_in(port, SCFCR);
if (termios->c_cflag & CRTSCTS)
ctrl |= SCFCR_MCE;
else
ctrl &= ~SCFCR_MCE;
sci_out(port, SCFCR, ctrl);
}
}

sci_out(port, SCSCR, s->cfg->scscr);
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/linux/serial_sci.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ enum {

#define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)

/* SCSPTR, optional */
#define SCSPTR_RTSIO (1 << 7)
#define SCSPTR_CTSIO (1 << 5)

/* Offsets into the sci_port->irqs array */
enum {
SCIx_ERI_IRQ,
Expand Down Expand Up @@ -108,6 +112,11 @@ struct plat_sci_port_ops {
void (*init_pins)(struct uart_port *, unsigned int cflag);
};

/*
* Port-specific capabilities
*/
#define SCIx_HAVE_RTSCTS (1 << 0)

/*
* Platform device specific platform_data struct
*/
Expand All @@ -116,6 +125,7 @@ struct plat_sci_port {
unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */
unsigned int type; /* SCI / SCIF / IRDA */
upf_t flags; /* UPF_* flags */
unsigned long capabilities; /* Port features/capabilities */

unsigned int scbrr_algo_id; /* SCBRR calculation algo */
unsigned int scscr; /* SCSCR initialization */
Expand Down

0 comments on commit 4582059

Please sign in to comment.