static void cpm_uart_set_termios(struct uart_port *port,				 struct termios *termios, struct termios *old){	int baud;	unsigned long flags;	u16 cval, scval, prev_mode;	int bits, sbits;	struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;	volatile smc_t *smcp = pinfo->smcp;	volatile scc_t *sccp = pinfo->sccp;	pr_debug("CPM uart[%d]:set_termios\n", port->line);	baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16);	/* Character length programmed into the mode register is the	 * sum of: 1 start bit, number of data bits, 0 or 1 parity bit,	 * 1 or 2 stop bits, minus 1.	 * The value 'bits' counts this for us.	 */	cval = 0;	scval = 0;	/* byte size */	switch (termios->c_cflag & CSIZE) {	case CS5:		bits = 5;		break;	case CS6:		bits = 6;		break;	case CS7:		bits = 7;		break;	case CS8:		bits = 8;		break;		/* Never happens, but GCC is too dumb to figure it out */	default:		bits = 8;		break;	}	sbits = bits - 5;	if (termios->c_cflag & CSTOPB) {		cval |= SMCMR_SL;	/* Two stops */		scval |= SCU_PSMR_SL;		bits++;	}	if (termios->c_cflag & PARENB) {		cval |= SMCMR_PEN;		scval |= SCU_PSMR_PEN;		bits++;		if (!(termios->c_cflag & PARODD)) {			cval |= SMCMR_PM_EVEN;			scval |= (SCU_PSMR_REVP | SCU_PSMR_TEVP);		}	}	/*	 * Set up parity check flag	 */#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))	port->read_status_mask = (BD_SC_EMPTY | BD_SC_OV);	if (termios->c_iflag & INPCK)		port->read_status_mask |= BD_SC_FR | BD_SC_PR;	if ((termios->c_iflag & BRKINT) || (termios->c_iflag & PARMRK))		port->read_status_mask |= BD_SC_BR;	/*	 * Characters to ignore	 */	port->ignore_status_mask = 0;	if (termios->c_iflag & IGNPAR)		port->ignore_status_mask |= BD_SC_PR | BD_SC_FR;	if (termios->c_iflag & IGNBRK) {		port->ignore_status_mask |= BD_SC_BR;		/*		 * If we're ignore parity and break indicators, ignore		 * overruns too.  (For real raw support).		 */		if (termios->c_iflag & IGNPAR)			port->ignore_status_mask |= BD_SC_OV;	}	/*	 * !!! ignore all characters if CREAD is not set	 */	if ((termios->c_cflag & CREAD) == 0)		port->read_status_mask &= ~BD_SC_EMPTY;		spin_lock_irqsave(&port->lock, flags);	/* Start bit has not been added (so don't, because we would just	 * subtract it later), and we need to add one for the number of	 * stops bits (there is always at least one).	 */	bits++;	if (IS_SMC(pinfo)) {		/* Set the mode register.  We want to keep a copy of the		 * enables, because we want to put them back if they were		 * present.		 */		prev_mode = smcp->smc_smcmr;		smcp->smc_smcmr = smcr_mk_clen(bits) | cval | SMCMR_SM_UART;		smcp->smc_smcmr |= (prev_mode & (SMCMR_REN | SMCMR_TEN));	} else {		sccp->scc_psmr = (sbits << 12) | scval;	}	cpm_set_brg(pinfo->brg - 1, baud);	spin_unlock_irqrestore(&port->lock, flags);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/311c46273f0e8b140d4cc68e13128cbc22114807/cpm_uart_core.c/clean/drivers/serial/cpm_uart/cpm_uart_core.c