From patchwork Mon Sep 23 12:07:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Prchal X-Patchwork-Id: 2927801 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 343BF9F3C4 for ; Mon, 23 Sep 2013 12:08:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9127D20398 for ; Mon, 23 Sep 2013 12:08:21 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 418F620336 for ; Mon, 23 Sep 2013 12:08:16 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VO4w1-0006nz-4G; Mon, 23 Sep 2013 12:08:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VO4vy-0004LE-RA; Mon, 23 Sep 2013 12:08:10 +0000 Received: from port.iol.cz ([194.228.1.9]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VO4vu-0004KH-Rx for linux-arm-kernel@lists.infradead.org; Mon, 23 Sep 2013 12:08:07 +0000 X-SBRS: None X-SBRS-none: None X-RECVLIST: ETMAIL-CZ X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoYGAAMuQFJVoCOj/2dsb2JhbABZgweuKZQSgRwXdIMCI4EaJRKICa4bjTeOGoFLhCUDnhqLWYMmOoEs X-IPAS-Result: AoYGAAMuQFJVoCOj/2dsb2JhbABZgweuKZQSgRwXdIMCI4EaJRKICa4bjTeOGoFLhCUDnhqLWYMmOoEs X-IronPort-AV: E=Sophos;i="4.90,962,1371074400"; d="scan'208";a="53205971" Received: from ip-85-160-35-163.eurotel.cz (HELO localhost.localdomain) ([85.160.35.163]) by smtp.etmail.cz with ESMTP; 23 Sep 2013 14:07:38 +0200 From: Jiri Prchal To: linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org Subject: [PATCH] serial: prepare for 9bit data Date: Mon, 23 Sep 2013 14:07:32 +0200 Message-Id: <1379938052-6026-1-git-send-email-jiri.prchal@aksignal.cz> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130923_080807_037918_8F13F756 X-CRM114-Status: GOOD ( 10.64 ) X-Spam-Score: -1.9 (-) Cc: gregkh@linuxfoundation.org, Jiri Prchal , nicolas.ferre@atmel.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds 9bit data possibility for serial_core. Please confirm that I did it right way at right place. I'll make atmel_serial driver for 9bit data later. Signed-off-by: Jiri Prchal --- drivers/tty/serial/serial_core.c | 4 ++++ include/uapi/asm-generic/termbits.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 0f02351..cbe83db 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -283,9 +283,13 @@ uart_update_timeout(struct uart_port *port, unsigned int cflag, case CS7: bits = 9; break; + case CS8: default: bits = 10; break; /* CS8 */ + case CS9: + bits = 11; + break; } if (cflag & CSTOPB) diff --git a/include/uapi/asm-generic/termbits.h b/include/uapi/asm-generic/termbits.h index 232b478..120650d 100644 --- a/include/uapi/asm-generic/termbits.h +++ b/include/uapi/asm-generic/termbits.h @@ -128,7 +128,7 @@ struct ktermios { #define B38400 0000017 #define EXTA B19200 #define EXTB B38400 -#define CSIZE 0000060 +#define CSIZE 004000000060 #define CS5 0000000 #define CS6 0000020 #define CS7 0000040 @@ -157,6 +157,7 @@ struct ktermios { #define B3500000 0010016 #define B4000000 0010017 #define CIBAUD 002003600000 /* input baud rate */ +#define CS9 004000000000 /* 9bit data */ #define CMSPAR 010000000000 /* mark or space (stick) parity */ #define CRTSCTS 020000000000 /* flow control */