From patchwork Fri Nov 21 06:01:20 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: 41276 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C297D23C27 for ; Fri, 21 Nov 2014 06:04:29 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id l18sf2531709wgh.10 for ; Thu, 20 Nov 2014 22:04:29 -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 :in-reply-to:references:in-reply-to:references: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=BJHGdVoOSea6esC+Lox54ejFziJmLcUF5R68Jjksxk4=; b=Ik4NqzNR0xqB7IVzE+9/cOVyBUV7cIB8g71tigzUB4uhQfyHh4v6X9ByyQp/7vTYZ4 KI97pOUkr3321F7ykkk2eLNEDBxxCdEZc50phK7RuWKwPMDixN+9LEEmsYUlpvmCgr82 LBRcsbbMHvnIQBfwPPcnTJ9HYOWeJwn9D6toGHYLmEQ2ewferu0IxOjwAzWN0AbqnKWR DJs1Zj/BJ122dI6uKqPn5vn5rY0FLYn80RUIFlryut+xrnfIMgtUGrRwLrjdEj8r57Tz M8Bi79ufFDuseKIMGk1EiymtEwJOKK7YjvFkQNW26eM780wpWgJdN2HgCGM/lwb7y9cz Iuqw== X-Gm-Message-State: ALoCoQlwpCrnJ8MpQhv25015k1ClBhVe7rRkFzJ8eby0aUNfq5as6lbXv2sPXkNNTihq/wkc2pNL X-Received: by 10.152.8.67 with SMTP id p3mr892368laa.4.1416549868976; Thu, 20 Nov 2014 22:04:28 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.232 with SMTP id m8ls135959laa.45.gmail; Thu, 20 Nov 2014 22:04:28 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr2039855laz.27.1416549868708; Thu, 20 Nov 2014 22:04:28 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id jb8si3979388lbc.58.2014.11.20.22.04.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Nov 2014 22:04:28 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id f15so2212449lbj.9 for ; Thu, 20 Nov 2014 22:04:28 -0800 (PST) X-Received: by 10.112.14.69 with SMTP id n5mr2173185lbc.34.1416549868615; Thu, 20 Nov 2014 22:04:28 -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 ew9csp26004lbc; Thu, 20 Nov 2014 22:04:27 -0800 (PST) X-Received: by 10.66.186.101 with SMTP id fj5mr3320576pac.145.1416549866653; Thu, 20 Nov 2014 22:04:26 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ml2si6387930pab.144.2014.11.20.22.04.25 for ; Thu, 20 Nov 2014 22:04:26 -0800 (PST) Received-SPF: none (google.com: linux-kernel-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 S1757558AbaKUGEY (ORCPT + 26 others); Fri, 21 Nov 2014 01:04:24 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:64200 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756967AbaKUGEV (ORCPT ); Fri, 21 Nov 2014 01:04:21 -0500 Received: by mail-pa0-f42.google.com with SMTP id et14so4183550pad.1 for ; Thu, 20 Nov 2014 22:04:20 -0800 (PST) X-Received: by 10.67.14.129 with SMTP id fg1mr3685830pad.114.1416549860425; Thu, 20 Nov 2014 22:04:20 -0800 (PST) Received: from c-krapar-linux.qualcomm.com ([202.46.23.54]) by mx.google.com with ESMTPSA id sq2sm3651516pbc.73.2014.11.20.22.04.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 20 Nov 2014 22:04:19 -0800 (PST) From: Kiran Raparthy To: linux-kernel@vger.kernel.org Cc: balbi@ti.com, john.stultz@linaro.org, sumit.semwal@linaro.org, Kiran Raparthy , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Android Kernel Team , =?UTF-8?q?Arve=20Hj=F8nnev=E5g?= , Benoit Goby , Todd Poynor Subject: [PATCH v1 1/3] usb: phy: introduce usb_phy_set_event interface Date: Fri, 21 Nov 2014 11:31:20 +0530 Message-Id: <8efd7b62ddb475cdac507387cbe25301818489c4.1416547297.git.kiran.kumar@linaro.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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.217.178 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: , usb: phy: introduce usb_phy_set_event interface 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 --- 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 045cd30..2b1039e 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -444,3 +444,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 353053a..3c713ff 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -210,6 +210,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) { @@ -251,6 +252,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