From patchwork Tue Nov 18 06:50:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiran Kumar Raparthy X-Patchwork-Id: 41000 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E0B43241C9 for ; Tue, 18 Nov 2014 06:52:40 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e53sf486545eek.7 for ; Mon, 17 Nov 2014 22:52:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=luYDLjz70V4bDRopgjRFzUHmdaCftz6NRS0JZcT6uno=; b=g4MT+TKPjltTG1DPaRU5Yp1qtVgsDEErVpUVIGFfG5ETWfSGj+Wqi4qOsQZQj7C/Qj pr5NUeRr/qPHqPl5G22wlUf49Jz0rEi1LQ1oHp1VoUiKPPIAN1wzfNu9uVjJP84pxSlP h9rSw9EtIKwL5P4F1UpomYsZ2AsmH/y+V2B1ocQNV+S0RCeliPu/2CFe3IgqVl22F2iv DMKfqU+mAFvPOHvz8blM72/kSAvvNlQGxIh6rfwi1XVEqSW/SFuohZltwpVB8WeFR1Qp 9o29vt/5SYc5IwkWKxOMA1VP3dYKc2mPnQS7UC/l5VuJnFtAR7dksmCoPDx9CWQABP78 cH7A== X-Gm-Message-State: ALoCoQn14DBERVwl+9/aCMfGWPJ/tAlzsKk0GRiNwjCyoR9n5nSlPDlBlCegEOJ2GwBhzyzhYzse X-Received: by 10.194.71.19 with SMTP id q19mr42939wju.5.1416293559634; Mon, 17 Nov 2014 22:52:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.229 with SMTP id p5ls977943laf.4.gmail; Mon, 17 Nov 2014 22:52:38 -0800 (PST) X-Received: by 10.152.28.131 with SMTP id b3mr32468461lah.12.1416293558950; Mon, 17 Nov 2014 22:52:38 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id t8si40909487lbw.102.2014.11.17.22.52.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 22:52:38 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id q1so618730lam.16 for ; Mon, 17 Nov 2014 22:52:38 -0800 (PST) X-Received: by 10.112.14.69 with SMTP id n5mr33560420lbc.34.1416293558778; Mon, 17 Nov 2014 22:52:38 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp1283639lbc; Mon, 17 Nov 2014 22:52:38 -0800 (PST) X-Received: by 10.66.197.195 with SMTP id iw3mr34340081pac.12.1416293557250; Mon, 17 Nov 2014 22:52:37 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sl3si37254595pac.138.2014.11.17.22.52.36 for ; Mon, 17 Nov 2014 22:52:37 -0800 (PST) Received-SPF: none (google.com: linux-serial-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752315AbaKRGwe (ORCPT ); Tue, 18 Nov 2014 01:52:34 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:64099 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbaKRGwd (ORCPT ); Tue, 18 Nov 2014 01:52:33 -0500 Received: by mail-pa0-f50.google.com with SMTP id bj1so3693018pad.23 for ; Mon, 17 Nov 2014 22:52:32 -0800 (PST) X-Received: by 10.68.231.33 with SMTP id td1mr35476941pbc.26.1416293552858; Mon, 17 Nov 2014 22:52:32 -0800 (PST) Received: from c-krapar-linux.qualcomm.com ([202.46.23.54]) by mx.google.com with ESMTPSA id fv6sm36930920pdb.83.2014.11.17.22.52.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Nov 2014 22:52:32 -0800 (PST) From: Kiran Kumar Raparthy To: linux-kernel@vger.kernel.org Cc: San Mehat , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, Android Kernel Team , John Stultz , Sumit Semwal , Kiran Raparthy Subject: [RFC] serial_core: Add wake_peer uart operation Date: Tue, 18 Nov 2014 12:20:01 +0530 Message-Id: <1416293401-7714-1-git-send-email-kiran.kumar@linaro.org> X-Mailer: git-send-email 1.8.2.1 Sender: linux-serial-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-serial@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kiran.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: San Mehat serial_core: Add wake_peer uart operation Add wake_peer which is called before starting UART TX. The idea here is to provide a mechanism where we can wakeup our peer before sending data. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Android Kernel Team Cc: John Stultz Cc: Sumit Semwal Signed-off-by: San Mehat [Kiran: Added context to commit message] Signed-off-by: Kiran Raparthy --- This is one of the number of patches from the Android AOSP common.git tree, which is used on almost all Android devices. I wanted to submit it for review to see if it should go upstream. drivers/tty/serial/serial_core.c | 3 +++ include/linux/serial_core.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index df3a8c7..dc45c4b 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -95,6 +95,9 @@ static void __uart_start(struct tty_struct *tty) struct uart_state *state = tty->driver_data; struct uart_port *port = state->uart_port; + if (port->ops->wake_peer) + port->ops->wake_peer(port); + if (!uart_tx_stopped(port)) port->ops->start_tx(port); } diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 21c2e05..219b6a3 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -66,6 +66,7 @@ struct uart_ops { void (*set_ldisc)(struct uart_port *, int new); void (*pm)(struct uart_port *, unsigned int state, unsigned int oldstate); + void (*wake_peer)(struct uart_port *); /* * Return a string describing the type of the port