From patchwork Thu Mar 19 01:49:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 6045081 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 59D36BF90F for ; Thu, 19 Mar 2015 01:49:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C72D20376 for ; Thu, 19 Mar 2015 01:49:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B90D320364 for ; Thu, 19 Mar 2015 01:49:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754833AbbCSBtA (ORCPT ); Wed, 18 Mar 2015 21:49:00 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:34543 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750964AbbCSBs7 (ORCPT ); Wed, 18 Mar 2015 21:48:59 -0400 Received: by pacwe9 with SMTP id we9so59709174pac.1; Wed, 18 Mar 2015 18:48:59 -0700 (PDT) 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=yGqMjwsox55qS3Xej7fMmSQdFrroesJHSdrzE0PDQsk=; b=DN3dV+rV4IbWIqfDQd2llgogcAj6uuC3MniKVA92G73LEZt5SZTI3Kyla/pkgi4pQf QkZCq3Kc/Zbu/PpGP6KdvJOIwR1wZuetAz5f+UnI/ekrjO74mEmSioe2zIDWqWBUStg0 2QsZKklm2VTxnv0rtXk5n67rSkbN397YVAdeVyL3Ck7USO4Q5NDRPJon5HCbJOgXty0S G49K2Ti7YH9BFk68iyMhiSYtKdgeu5ausG1/4mrdlzk0jf02dSu8Q0cdy/z1kqAH0BiE j7zFI7LTs8ZL4MGkACE7ZV23+IhY+ux7/nhAvNKevIdcvYlssac1SYfvirl0kezAJM0T z/DA== X-Received: by 10.67.7.195 with SMTP id de3mr62730488pad.79.1426729739158; Wed, 18 Mar 2015 18:48:59 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by mx.google.com with ESMTPSA id ey1sm29658089pdb.30.2015.03.18.18.48.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 18:48:58 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: gregkh@linuxfoundation.org, geert@glider.be, laurent.pinchart@ideasonboard.com, linux-serial@vger.kernel.org, Magnus Damm , jslaby@suse.cz Date: Thu, 19 Mar 2015 10:49:53 +0900 Message-Id: <20150319014953.14235.86134.sendpatchset@little-apple> In-Reply-To: <20150319014933.14235.44835.sendpatchset@little-apple> References: <20150319014933.14235.44835.sendpatchset@little-apple> Subject: [PATCH v2 02/05] serial: sh-sci: Fix default RTS handling 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 Fix the default SCIF handling in case CTS/RTS is available on the target board but disabled by user space. Without this patch the RTS output value is not set. Signed-off-by: Magnus Damm --- Changes since V1: - When modem control is disabled, set RTS to zero to keep it asserted. drivers/tty/serial/sh-sci.c | 7 +++++-- include/linux/serial_sci.h | 1 + 2 files changed, 6 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 --- 0002/drivers/tty/serial/sh-sci.c +++ work/drivers/tty/serial/sh-sci.c 2015-03-19 09:13:03.186797991 +0900 @@ -522,10 +522,13 @@ static void sci_init_ctsrts_default(stru if (!reg->size || hwflow_enabled) return; + /* Setup CTS/RTS in the case hardware flow is disabled by user space. + * The CTS signal is setup as input and RTS as output with value 0. + */ status = serial_port_in(port, SCSPTR); - status &= ~SCSPTR_CTSIO; + status &= ~(SCSPTR_CTSIO | SCSPTR_RTSDT); status |= SCSPTR_RTSIO; - serial_port_out(port, SCSPTR, status); /* Set RTS = 1 */ + serial_port_out(port, SCSPTR, status); /* Set RTS = 0 */ } static void sci_init_pins(struct uart_port *port, unsigned int cflag) --- 0001/include/linux/serial_sci.h +++ work/include/linux/serial_sci.h 2015-03-19 09:11:14.936798380 +0900 @@ -57,6 +57,7 @@ /* SCSPTR (Serial Port Register), optional */ #define SCSPTR_RTSIO (1 << 7) /* Serial Port RTS Pin Input/Output */ +#define SCSPTR_RTSDT (1 << 6) /* Serial Port RTS Pin Data */ #define SCSPTR_CTSIO (1 << 5) /* Serial Port CTS Pin Input/Output */ #define SCSPTR_SPB2IO (1 << 1) /* Serial Port Break Input/Output */ #define SCSPTR_SPB2DT (1 << 0) /* Serial Port Break Data */