From patchwork Mon Dec 15 14:14:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 5493041 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 51F1F9F443 for ; Mon, 15 Dec 2014 14:14:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78E1720995 for ; Mon, 15 Dec 2014 14:14:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86A4420A0B for ; Mon, 15 Dec 2014 14:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752631AbaLOOOd (ORCPT ); Mon, 15 Dec 2014 09:14:33 -0500 Received: from mail-pd0-f179.google.com ([209.85.192.179]:52619 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751993AbaLOOOb (ORCPT ); Mon, 15 Dec 2014 09:14:31 -0500 Received: by mail-pd0-f179.google.com with SMTP id fp1so11669055pdb.24 for ; Mon, 15 Dec 2014 06:14:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=75uY2DqW35tJVFLZyR7cSVtWiJ7wZv3Vj0mwSGl3+xo=; b=k4qLhAn3E1TNc0MCiSPrA2sWJSWgMmpZZSdo7lJ7tTLGb7LxNE2W93y/229U5uWKSx RUATzay1+owK45S3VF093sy27Wne1tpv8iW21S4XTCeonAU8NrxWvmuB30Fb7tyG8W9T AXLCsNrn6meEcGYlwRmiHS85sGpMhSRV06FVAYVNQe33rFJ7BG62AKFUN9X0YUNev67/ 6U8twfl5PSg880n23OfwDrgl3UyFom467oeOGHqDe7ukml0L1jUeDu7Dp3qzb5Y4Jr6Z qf6ZY3P7Mk3gt7VI031ZwMIF6il0UhIEoi30XZvFHM2Hflac9CYnwi4XwuA8SnYOH/qX sB6g== X-Received: by 10.68.135.226 with SMTP id pv2mr40229493pbb.48.1418652869745; Mon, 15 Dec 2014 06:14:29 -0800 (PST) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by mx.google.com with ESMTPSA id g13sm9501099pat.45.2014.12.15.06.14.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Dec 2014 06:14:29 -0800 (PST) From: Yoshihiro Kaneko To: linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Simon Horman , Magnus Damm , linux-sh@vger.kernel.org Subject: [PATCH/RFC] serial: sh-sci: Add hardware flow control support of R-Car HSCIF Date: Mon, 15 Dec 2014 23:14:06 +0900 Message-Id: <1418652846-6821-1-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 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: Hisashi Nakamura TIOCM_CTS is enabled to use hardware flow control of HSCIF. And hardware flow control of HSCIF is handled by device tree. Signed-off-by: Hisashi Nakamura Signed-off-by: Yoshihiro Kaneko --- This patch is based on the tty-next branch of Greg Kroah-Hartman's tty tree. drivers/tty/serial/sh-sci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index bcec10a..6744702 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1216,7 +1216,11 @@ static unsigned int sci_get_mctrl(struct uart_port *port) * CTS/RTS is handled in hardware when supported, while nothing * else is wired up. Keep it simple and simply assert DSR/CAR. */ - return TIOCM_DSR | TIOCM_CAR; + unsigned int mctrl = TIOCM_DSR | TIOCM_CAR; + + if (port->type == PORT_HSCIF) + mctrl |= TIOCM_CTS; + return mctrl; } #ifdef CONFIG_SERIAL_SH_SCI_DMA @@ -2611,6 +2615,8 @@ sci_parse_dt(struct platform_device *pdev, unsigned int *dev_id) p->type = info->type; p->regtype = info->regtype; p->scscr = SCSCR_RE | SCSCR_TE; + if (of_property_read_bool(np, "ctsrts")) + p->capabilities = SCIx_HAVE_RTSCTS; return p; }