From patchwork Fri Nov 21 17:46:29 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: 41336 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6DAF723C27 for ; Fri, 21 Nov 2014 17:47:54 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id c13sf3653612eek.2 for ; Fri, 21 Nov 2014 09:47:53 -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=uziYVFirv6WG4clp+xxipFSi4W59RkAyuAoOEQNqgC4=; b=GNFDzh+sTYb9fGpJaXOyJlhJnNehgV+U2cd6ZqOYvB+WaFxJ0qJT3KQiJzqlQ0zLmy lccJg/OMVU/Pvd272gMKcKNQ7mtQ9vWYztn+FLpOzIL7nOGe2ZrneD9nNwhwm3r7V6UI 2YEUC5bwkyIiDT/mw/2jZL2xxsK+I2bWasXHNVVQnXzonfsW/eWBTjkI0UARmjHSi54I LQGPAlPN49MqE+nY5Dg6PLjR5UV4RibpQaFntiXW58q0fhoQCKXpap5Q/FKgjJHTDraf gdxJlT9mnmUZUXSb8L+pFm1XEBmXeS/zA8PNzRoibaxSYt6wI2k3Ho1YxZu3XG6+Re2S uXlw== X-Gm-Message-State: ALoCoQl5qwi730k3uEVIaZO20FT2XWyvJK07z4aC2c7Krwqjw8elHNN7nBzNLW8UAT3guOlESupo X-Received: by 10.152.29.226 with SMTP id n2mr1235473lah.9.1416592073715; Fri, 21 Nov 2014 09:47:53 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.200 with SMTP id y8ls217929lad.14.gmail; Fri, 21 Nov 2014 09:47:53 -0800 (PST) X-Received: by 10.112.137.234 with SMTP id ql10mr5619909lbb.91.1416592073249; Fri, 21 Nov 2014 09:47:53 -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 r5si6748237lal.3.2014.11.21.09.47.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 09:47:53 -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 f15so3327186lbj.9 for ; Fri, 21 Nov 2014 09:47:53 -0800 (PST) X-Received: by 10.152.43.79 with SMTP id u15mr2885384lal.29.1416592073090; Fri, 21 Nov 2014 09:47:53 -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 ew9csp135832lbc; Fri, 21 Nov 2014 09:47:52 -0800 (PST) X-Received: by 10.66.157.161 with SMTP id wn1mr9574278pab.40.1416592071199; Fri, 21 Nov 2014 09:47:51 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cy7si9680749pdb.250.2014.11.21.09.47.50 for ; Fri, 21 Nov 2014 09:47:51 -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 S1750907AbaKURrt (ORCPT + 26 others); Fri, 21 Nov 2014 12:47:49 -0500 Received: from mail-pd0-f171.google.com ([209.85.192.171]:62166 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703AbaKURrr (ORCPT ); Fri, 21 Nov 2014 12:47:47 -0500 Received: by mail-pd0-f171.google.com with SMTP id v10so5720991pde.30 for ; Fri, 21 Nov 2014 09:47:47 -0800 (PST) X-Received: by 10.66.145.166 with SMTP id sv6mr9593445pab.140.1416592067065; Fri, 21 Nov 2014 09:47:47 -0800 (PST) Received: from localhost.localdomain ([124.123.151.231]) by mx.google.com with ESMTPSA id ra4sm5428477pab.33.2014.11.21.09.47.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Nov 2014 09:47:46 -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 v2 1/3] usb: phy: introduce usb_phy_set_event interface Date: Fri, 21 Nov 2014 23:16:29 +0530 Message-Id: <1416591991-18925-1-git-send-email-kiran.kumar@linaro.org> X-Mailer: git-send-email 1.9.1 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: , 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