/* set the line format on the internal serial adapter using the undocumented parameter setting command  */
static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
/* set the line format on the internal serial adapter using the undocumented parameter setting command  */
static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
{
	u16 val = 0;
	if (cflag & PARENB)
		val |= (cflag & PARODD) ? 0x10 : 0x20;
	switch (cflag & CSIZE) {
	case CS5:
		val |= 5 << 8; break;
	case CS6:
		val |= 6 << 8; break;
	case CS7:
		val |= 7 << 8; break;
	case CS8:
		val |= 8 << 8; break;
	default:
		dev_err(cs->dev, "CSIZE was not CS5-CS8, using default of 8\n");
		val |= 8 << 8;
		break;
	}
	if (cflag & CSTOPB) {
		if ((cflag & CSIZE) == CS5)
			val |= 1;
		else
			val |= 2;
	}
	return set_value(cs, 3, val);
}