From patchwork Mon Nov 24 17:24:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kiran Kumar Raparthy X-Patchwork-Id: 41416 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4EB4D23FFA for ; Mon, 24 Nov 2014 17:27:18 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gd6sf5716043lab.0 for ; Mon, 24 Nov 2014 09:27:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:content-type:content-transfer-encoding:sender :precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=8RmevHfGTFZ0I7pOCPSwKjX84pEquKwOVeqrxl8Ip70=; b=Asf+VePBXOzBnSCCcvhKKf0h7Ur0ZH0oBCZFSYwJ5X+g35arRjyboKW8NB9yIi3YtL 4Trxry9hSYCa3mKps8bKW4FmRG9UiLG+ExHfZfo+62K77k5+MzGMlgv4URzDz/qb4MX7 JR4p8TKYR5M4ij7wztz7bDy1/wV6BjCdc6Xg2+Q0bg2HdFf0jbJ62tfotzLenUm0wllk 3VCjinFmj7SwP50l0xb4e4luIKcDk0CC+ZCWvC9bczsAjDp+SmvrbPbx6eEQVP8zLenY 7CQxwXCNAZEc0IAYU0Qnf5GU+5TyW9+L4Te8BNnGOzjV89i7H8U3H0wYiSp2NLDokX+D XvxA== X-Gm-Message-State: ALoCoQmWBMJvcRtIPTiLS6PgRXe4wXjKCuwGkxV7cWtUT7nXwJagWJeGylzIxXb8dJBuTOWifEjH X-Received: by 10.112.50.243 with SMTP id f19mr6487638lbo.1.1416850037254; Mon, 24 Nov 2014 09:27:17 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.39 with SMTP id b7ls399702lae.38.gmail; Mon, 24 Nov 2014 09:27:17 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr21377058lbc.23.1416850037110; Mon, 24 Nov 2014 09:27:17 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id jc4si15779372lbc.137.2014.11.24.09.27.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Nov 2014 09:27:17 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so7997013lab.36 for ; Mon, 24 Nov 2014 09:27:17 -0800 (PST) X-Received: by 10.112.138.137 with SMTP id qq9mr21548822lbb.80.1416850036953; Mon, 24 Nov 2014 09:27:16 -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 ew9csp296525lbc; Mon, 24 Nov 2014 09:27:15 -0800 (PST) X-Received: by 10.66.66.234 with SMTP id i10mr35076331pat.44.1416850034813; Mon, 24 Nov 2014 09:27:14 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si6014721pdp.89.2014.11.24.09.27.14 for ; Mon, 24 Nov 2014 09:27:14 -0800 (PST) Received-SPF: none (google.com: linux-usb-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 S1753806AbaKXR1M (ORCPT + 3 others); Mon, 24 Nov 2014 12:27:12 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:39519 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753430AbaKXR1L (ORCPT ); Mon, 24 Nov 2014 12:27:11 -0500 Received: by mail-pa0-f49.google.com with SMTP id eu11so9760527pac.8 for ; Mon, 24 Nov 2014 09:27:11 -0800 (PST) X-Received: by 10.66.255.100 with SMTP id ap4mr34331369pad.133.1416850030979; Mon, 24 Nov 2014 09:27:10 -0800 (PST) Received: from localhost.localdomain ([124.123.151.231]) by mx.google.com with ESMTPSA id bj11sm12985159pdb.1.2014.11.24.09.27.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Nov 2014 09:27:09 -0800 (PST) From: Kiran Raparthy To: linux-kernel@vger.kernel.org Cc: Kiran Raparthy , Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Android Kernel Team , John Stultz , Sumit Semwal , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Benoit Goby , Todd Poynor Subject: [PATCH v3 1/3] usb: phy: introduce usb_phy_set_event interface Date: Mon, 24 Nov 2014 22:54:58 +0530 Message-Id: <1416849900-29959-1-git-send-email-kiran.kumar@linaro.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@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.49 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: , PHY drivers require a generic interface to handle per-PHY events. usb_phy_set_event interface sets event to phy event. PHY drivers call this interface for each phy event. Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: Android Kernel Team Cc: John Stultz Cc: Sumit Semwal Cc: Arve Hjønnevåg Cc: Benoit Goby [Original patch in Android from Todd] Cc: Todd Poynor Signed-off-by: Kiran Raparthy Signed-off-by: Felipe Balbi --- drivers/usb/phy/phy.c | 12 ++++++++++++ include/linux/usb/phy.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index e6bf801..b4066a0 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -446,3 +446,15 @@ int usb_bind_phy(const char *dev_name, u8 index, return 0; } EXPORT_SYMBOL_GPL(usb_bind_phy); + +/** + * usb_phy_set_event - set event to phy event + * @x: the phy returned by usb_get_phy(); + * + * This sets event to phy event + */ +void usb_phy_set_event(struct usb_phy *x, unsigned long event) +{ + x->last_event = event; +} +EXPORT_SYMBOL_GPL(usb_phy_set_event); diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index ac7d791..f499c23 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -209,6 +209,7 @@ extern void usb_put_phy(struct usb_phy *); extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); extern int usb_bind_phy(const char *dev_name, u8 index, const char *phy_dev_name); +extern void usb_phy_set_event(struct usb_phy *x, unsigned long event); #else static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) { @@ -250,6 +251,10 @@ static inline int usb_bind_phy(const char *dev_name, u8 index, { return -EOPNOTSUPP; } + +static inline void usb_phy_set_event(struct usb_phy *x, unsigned long event) +{ +} #endif static inline int