Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp497339imu; Wed, 12 Dec 2018 22:25:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/VISLljHulMGh1NcUL50kQu/gyBGRdGdazgiTcKOISE9BQ2b4OZ6uAWbCZSbm3zVyRZ6XcN X-Received: by 2002:a65:5a4c:: with SMTP id z12mr20793751pgs.188.1544682341169; Wed, 12 Dec 2018 22:25:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544682341; cv=none; d=google.com; s=arc-20160816; b=YBn65kUg7+qVgwNs9VNeJQpDP4iOBPc4wBqUjsmnoP5lCrksMO4zjCtkkVKosMLeQs zKDZNIpb6RUV1UH2N/vnaED6UCKYyFrQ9dameiGqD4uQNI0uVPDFmnThhopNi8Cz7NJz 2m8UeCPa/+55ytYEXxOHB5ZoQ0dlAHJivet6vLaySl0Tiuqtt94ksBxpUhOg2sO9PAQt ANaU0j4LXwGPKLko4Uz7CiWoh2uW+/4IvrVaFwVDKJtXRNfKCAH2GeUOnuQnb72Wc67b L+l34GHWxGZWNKgIpX9c3Wz8MMEnehefk7P7G1Mj2AHx1PcXHzh0cGozrd3J8X+X19ok NlzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=RBuSAUl+HhUZkMzKUMhPRMUPsIA1JK+/37vMrrLxhpo=; b=rONY5TsKEZrclah+o54Zoo29xnbYJM8JiNo740AZAeTzvT7UWWM8xLFxiJw3Xd++1d mUajYQnJfTOIC7i5+pkkG4OqWOJjPLfu3YyPGGpXwZV2B73c24Y1A/K7tnpVJdzjlviH znOq6SE5IQQ3j3cUEtYuWHrJGMI5XgwHcmm/6sILX6ArDhUf5TQhe3t5VtvDJcXM2ueg zzxHcBd9V5jnbUqUZZuPCtYolgGkYsJ0m4VnWtIMlpHPO4FXPRjRiPpvtGXe846XLP00 iF1TWJFFTUR+NW+GNqnaxq46mcC01/kktXt1tSH8DXLOeI5B5THVCPQAKImJJlaeD+53 UyAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2si854174pgo.544.2018.12.12.22.25.25; Wed, 12 Dec 2018 22:25:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726916AbeLMGYR (ORCPT + 99 others); Thu, 13 Dec 2018 01:24:17 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:19622 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726542AbeLMGYR (ORCPT ); Thu, 13 Dec 2018 01:24:17 -0500 X-UUID: 35a6abd02c5843f08f5d7c11ce4d7926-20181213 X-UUID: 35a6abd02c5843f08f5d7c11ce4d7926-20181213 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1569045343; Thu, 13 Dec 2018 14:24:09 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 13 Dec 2018 14:24:08 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 13 Dec 2018 14:24:08 +0800 From: Ryder Lee To: Andy Shevchenko , Greg Kroah-Hartman CC: Sean Wang , Matthias Brugger , Weijie Gao , Roy Luo , , , , , Ryder Lee , Sean Wang Subject: [PATCH] tty: serial: don't do termios for BTIF Date: Thu, 13 Dec 2018 14:24:03 +0800 Message-ID: <972976519be8e28ee600651fe14d1f6d5f23e697.1544679557.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MediaTek BTIF controller doesn't need to set termios so add a new capability 'UART_CAP_NMOD' for the unsupported case. Signed-off-by: Sean Wang Signed-off-by: Ryder Lee --- drivers/tty/serial/8250/8250.h | 1 + drivers/tty/serial/8250/8250_port.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index ebfb0bd..2b9ba39 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -80,6 +80,7 @@ struct serial8250_config { #define UART_CAP_MINI (1 << 17) /* Mini UART on BCM283X family lacks: * STOP PARITY EPAR SPAR WLEN5 WLEN6 */ +#define UART_CAP_NMOD (1 << 18) /* UART doesn't do termios */ #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index c39482b..e4a69a0 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -297,7 +297,7 @@ .tx_loadsz = 16, .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, - .flags = UART_CAP_FIFO, + .flags = UART_CAP_FIFO | UART_CAP_NMOD, }, [PORT_NPCM] = { .name = "Nuvoton 16550", @@ -2663,6 +2663,11 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port, unsigned long flags; unsigned int baud, quot, frac = 0; + if (up->capabilities & UART_CAP_NMOD) { + termios->c_cflag = 0; + return; + } + if (up->capabilities & UART_CAP_MINI) { termios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CMSPAR); if ((termios->c_cflag & CSIZE) == CS5 || -- 1.9.1