From patchwork Wed Dec 17 12:53:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 5506891 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@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 902889F1CD for ; Wed, 17 Dec 2014 12:50:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B536D20A16 for ; Wed, 17 Dec 2014 12:50:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 935DB209E5 for ; Wed, 17 Dec 2014 12:50:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751899AbaLQMum (ORCPT ); Wed, 17 Dec 2014 07:50:42 -0500 Received: from mail-pd0-f170.google.com ([209.85.192.170]:48623 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829AbaLQMul (ORCPT ); Wed, 17 Dec 2014 07:50:41 -0500 Received: by mail-pd0-f170.google.com with SMTP id v10so16071372pde.15 for ; Wed, 17 Dec 2014 04:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=Uw8wSTX8M6TKlJm6hZvXdjhp/pw/JHX9ECprhfJebcc=; b=ESt/cZ/Q+RSmwkoROW7mWBl1ZJry2NmiLPYmnyA3IqfDnFnAguayWCgslCWrWKSHh4 UQSZi9pZKwYtOhR20eyCShqqW5CuC/zibvJurNItekn/0jRauc34MHUFewe+S9EFjLgc mAex4nY8m6AEZOIv9RimhdKoiWvEIKlmX01Os6dlMLUPbq58VICNdostou7MlwzElT2u OIfC/xDQlolFPD8yUBRCJEifFLBRHmnSfyx0ny40tsdQd38f6Mv46DlFCjLhOp6ff9fH tK4l5ClxcaSZ0GTkqfCnF4oUN1nkgsRhHtwGWSYs86NuHIp8q5TWXOL9CI3ZzxKMEBhQ ra/g== X-Received: by 10.68.68.206 with SMTP id y14mr68842863pbt.165.1418820641249; Wed, 17 Dec 2014 04:50:41 -0800 (PST) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by mx.google.com with ESMTPSA id v5sm3931933pdn.20.2014.12.17.04.50.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Dec 2014 04:50:40 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: gregkh@linuxfoundation.org, Magnus Damm , jslaby@suse.cz, linux-serial@vger.kernel.org Date: Wed, 17 Dec 2014 21:53:25 +0900 Message-Id: <20141217125325.14480.79285.sendpatchset@w520> In-Reply-To: <20141217125236.14480.78833.sendpatchset@w520> References: <20141217125236.14480.78833.sendpatchset@w520> Subject: [PATCH 05/05] serial: sh-sci: Expose SCIFA/SCIFB CTS pin Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Magnus Damm Expose CTS pin to serial core for the SCIFA/SCIFB case. Signed-off-by: Magnus Damm --- drivers/tty/serial/sh-sci.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0023/drivers/tty/serial/sh-sci.c +++ work/drivers/tty/serial/sh-sci.c 2014-12-17 18:46:44.000000000 +0900 @@ -564,6 +564,11 @@ static void sci_init_pins_default(struct serial_port_out(port, SCSPTR, status); /* Set RTS = 1 */ } +static bool sci_cts_asserted_scifab(struct uart_port *port) +{ + return !(serial_port_in(port, SCPDR) & BIT(3)); +} + static void sci_init_pins_scifab(struct uart_port *port, bool hwflow_enabled) { unsigned short control, data; @@ -1304,8 +1309,16 @@ static unsigned int sci_get_mctrl(struct * else is wired up. Keep it simple and simply assert DSR/CAR. */ - if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) - cts_asserted = sci_cts_asserted_default(port); + if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) { + switch (s->cfg->type) { + case PORT_SCIFA: + case PORT_SCIFB: + cts_asserted = sci_cts_asserted_scifab(port); + break; + default: + cts_asserted = sci_cts_asserted_default(port); + } + } return TIOCM_DSR | TIOCM_CAR | (cts_asserted ? TIOCM_CTS : 0); }