Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752461Ab3CBNZX (ORCPT ); Sat, 2 Mar 2013 08:25:23 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:12932 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752132Ab3CBNZT (ORCPT ); Sat, 2 Mar 2013 08:25:19 -0500 X-AuditID: cbfee68e-b7fa46d00000627e-e7-5131fdbe3617 From: Vivek Gautam To: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, gregkh@linuxfoundation.org, balbi@ti.com, sarah.a.sharp@linux.intel.com, kgene.kim@samsung.com, kishon@ti.com Subject: [PATCH v2 01/10] usb: phy: Add APIs for runtime power management Date: Sat, 02 Mar 2013 18:53:02 +0530 Message-id: <1362230590-20960-2-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1362230590-20960-1-git-send-email-gautam.vivek@samsung.com> References: <1362230590-20960-1-git-send-email-gautam.vivek@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHLMWRmVeSWpSXmKPExsWyRsSkWnffX8NAg657khYH79dbNC9ez2bR u+Aqm8WFpz1sFpd3zWGzmL2kn8Vixvl9TBaLlrUyWzSfOMXswOkx72Sgx/65a9g9+rasYvQ4 fmM7k8fnTXIBrFFcNimpOZllqUX6dglcGa93X2MruMVVse33TtYGxk0cXYwcHBICJhJP/8t3 MXICmWISF+6tZ+ti5OIQEljKKLH+6WxmiISJxLWbB9ghEtMZJb5seMMGkhASmMIkcXtRMIjN JqAr0fR2FyOILSIgK3H4ym9mkAZmgUuMEitWbGEBSQgLeEosfdLGBGKzCKhK7Gw7AzaIV8BD 4uen/4wQ2xQk3tx+BraZE6h++vXNrBDLPCT+3DsOdoWEwDp2iU17v7FCDBKQ+Db5EAvEO7IS mw5AXS0pcXDFDZYJjMILGBlWM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XymWiWzfv+bjFRlp9nrjMj5lpQ1Ol989vqewz+fj+sJ1At6W7u0Xjh3u 3M531qCoqqVu44HrC61d/50ViojXOz059YFUR/JB6S0+d2R36O9dWsz3e4GzQGOdEktxRqKh FnNRcSIAha8ZVu8CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1568 Lines: 52 Adding APIs to handle runtime power management on PHY devices. PHY consumers may need to wake-up/suspend PHYs when they work across autosuspend. Signed-off-by: Vivek Gautam --- include/linux/usb/phy.h | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 15847cb..0fe7cac 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -276,4 +276,30 @@ static inline const char *usb_phy_type_string(enum usb_phy_type type) return "UNKNOWN PHY TYPE"; } } + +#define USB_PHY_AUTOPM(function) \ +static inline int usb_phy_autopm_##function(struct usb_phy *x) \ +{ \ + if (!x || !x->dev) { \ + dev_err(x->dev, "no PHY or attached device available\n"); \ + return -ENODEV; \ + } \ + \ + pm_runtime_##function(x->dev); \ + \ + return 0; \ +} +USB_PHY_AUTOPM(enable) +USB_PHY_AUTOPM(disable) +USB_PHY_AUTOPM(get) +USB_PHY_AUTOPM(get_sync) +USB_PHY_AUTOPM(put) +USB_PHY_AUTOPM(put_sync) +USB_PHY_AUTOPM(allow) +USB_PHY_AUTOPM(forbid) +USB_PHY_AUTOPM(suspend) +USB_PHY_AUTOPM(autosuspend) +USB_PHY_AUTOPM(resume) +USB_PHY_AUTOPM(set_active) + #endif /* __LINUX_USB_PHY_H */ -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/