aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-09 14:16:38 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-09 14:16:38 -0400
commitea1990c3796e7550e6f240983f2d1b8e5ecf3891 (patch)
treec253cf0dc315cbc0716f422b41abea70053601be /include/linux
parent335053fe8c94f50c7f1cd7011b3088547480df3c (diff)
parent88e670fe9d240c751fd9735ae3ee2906ed68e63d (diff)
Merge tag 'for_3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-next
Kishon writes: Add new PHY drivers for SATA and USB in exynos, for USB in sunxi, and a multi-purpose PHY in APM, all adapted to generic PHY framework. Adapted USB3 PHY driver in OMAP to generic PHY driver and also used the same driver for SATA in OMAP. It also includes miscellaneous cleanups and fixes.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/phy/omap_control_phy.h (renamed from include/linux/usb/omap_control_usb.h)36
-rw-r--r--include/linux/phy/omap_usb.h (renamed from include/linux/usb/omap_usb.h)14
-rw-r--r--include/linux/phy/phy.h15
3 files changed, 45 insertions, 20 deletions
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/phy/omap_control_phy.h
index 69ae383ee3cc..5450403c7546 100644
--- a/include/linux/usb/omap_control_usb.h
+++ b/include/linux/phy/omap_control_phy.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * omap_control_usb.h - Header file for the USB part of control module. 2 * omap_control_phy.h - Header file for the PHY part of control module.
3 * 3 *
4 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com 4 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
@@ -16,10 +16,10 @@
16 * 16 *
17 */ 17 */
18 18
19#ifndef __OMAP_CONTROL_USB_H__ 19#ifndef __OMAP_CONTROL_PHY_H__
20#define __OMAP_CONTROL_USB_H__ 20#define __OMAP_CONTROL_PHY_H__
21 21
22enum omap_control_usb_type { 22enum omap_control_phy_type {
23 OMAP_CTRL_TYPE_OTGHS = 1, /* Mailbox OTGHS_CONTROL */ 23 OMAP_CTRL_TYPE_OTGHS = 1, /* Mailbox OTGHS_CONTROL */
24 OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ 24 OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */
25 OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ 25 OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */
@@ -27,7 +27,7 @@ enum omap_control_usb_type {
27 OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */ 27 OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */
28}; 28};
29 29
30struct omap_control_usb { 30struct omap_control_phy {
31 struct device *dev; 31 struct device *dev;
32 32
33 u32 __iomem *otghs_control; 33 u32 __iomem *otghs_control;
@@ -36,7 +36,7 @@ struct omap_control_usb {
36 36
37 struct clk *sys_clk; 37 struct clk *sys_clk;
38 38
39 enum omap_control_usb_type type; 39 enum omap_control_phy_type type;
40}; 40};
41 41
42enum omap_control_usb_mode { 42enum omap_control_usb_mode {
@@ -54,14 +54,14 @@ enum omap_control_usb_mode {
54#define OMAP_CTRL_DEV_SESSEND BIT(3) 54#define OMAP_CTRL_DEV_SESSEND BIT(3)
55#define OMAP_CTRL_DEV_IDDIG BIT(4) 55#define OMAP_CTRL_DEV_IDDIG BIT(4)
56 56
57#define OMAP_CTRL_USB_PWRCTL_CLK_CMD_MASK 0x003FC000 57#define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_CMD_MASK 0x003FC000
58#define OMAP_CTRL_USB_PWRCTL_CLK_CMD_SHIFT 0xE 58#define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_CMD_SHIFT 0xE
59 59
60#define OMAP_CTRL_USB_PWRCTL_CLK_FREQ_MASK 0xFFC00000 60#define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_FREQ_MASK 0xFFC00000
61#define OMAP_CTRL_USB_PWRCTL_CLK_FREQ_SHIFT 0x16 61#define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_FREQ_SHIFT 0x16
62 62
63#define OMAP_CTRL_USB3_PHY_TX_RX_POWERON 0x3 63#define OMAP_CTRL_PIPE3_PHY_TX_RX_POWERON 0x3
64#define OMAP_CTRL_USB3_PHY_TX_RX_POWEROFF 0x0 64#define OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF 0x0
65 65
66#define OMAP_CTRL_USB2_PHY_PD BIT(28) 66#define OMAP_CTRL_USB2_PHY_PD BIT(28)
67 67
@@ -70,13 +70,13 @@ enum omap_control_usb_mode {
70#define AM437X_CTRL_USB2_OTGVDET_EN BIT(19) 70#define AM437X_CTRL_USB2_OTGVDET_EN BIT(19)
71#define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20) 71#define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20)
72 72
73#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) 73#if IS_ENABLED(CONFIG_OMAP_CONTROL_PHY)
74extern void omap_control_usb_phy_power(struct device *dev, int on); 74void omap_control_phy_power(struct device *dev, int on);
75extern void omap_control_usb_set_mode(struct device *dev, 75void omap_control_usb_set_mode(struct device *dev,
76 enum omap_control_usb_mode mode); 76 enum omap_control_usb_mode mode);
77#else 77#else
78 78
79static inline void omap_control_usb_phy_power(struct device *dev, int on) 79static inline void omap_control_phy_power(struct device *dev, int on)
80{ 80{
81} 81}
82 82
@@ -86,4 +86,4 @@ static inline void omap_control_usb_set_mode(struct device *dev,
86} 86}
87#endif 87#endif
88 88
89#endif /* __OMAP_CONTROL_USB_H__ */ 89#endif /* __OMAP_CONTROL_PHY_H__ */
diff --git a/include/linux/usb/omap_usb.h b/include/linux/phy/omap_usb.h
index 6ae29360e1d2..dc2c541a619b 100644
--- a/include/linux/usb/omap_usb.h
+++ b/include/linux/phy/omap_usb.h
@@ -34,14 +34,24 @@ struct omap_usb {
34 struct usb_phy phy; 34 struct usb_phy phy;
35 struct phy_companion *comparator; 35 struct phy_companion *comparator;
36 void __iomem *pll_ctrl_base; 36 void __iomem *pll_ctrl_base;
37 void __iomem *phy_base;
37 struct device *dev; 38 struct device *dev;
38 struct device *control_dev; 39 struct device *control_dev;
39 struct clk *wkupclk; 40 struct clk *wkupclk;
40 struct clk *sys_clk;
41 struct clk *optclk; 41 struct clk *optclk;
42 u8 is_suspended:1; 42 u8 flags;
43}; 43};
44 44
45struct usb_phy_data {
46 const char *label;
47 u8 flags;
48};
49
50/* Driver Flags */
51#define OMAP_USB2_HAS_START_SRP (1 << 0)
52#define OMAP_USB2_HAS_SET_VBUS (1 << 1)
53#define OMAP_USB2_CALIBRATE_FALSE_DISCONNECT (1 << 2)
54
45#define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) 55#define phy_to_omapusb(x) container_of((x), struct omap_usb, phy)
46 56
47#if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE) 57#if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE)
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 3f83459dbb20..e2f5ca96cddc 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -149,8 +149,11 @@ struct phy *phy_get(struct device *dev, const char *string);
149struct phy *phy_optional_get(struct device *dev, const char *string); 149struct phy *phy_optional_get(struct device *dev, const char *string);
150struct phy *devm_phy_get(struct device *dev, const char *string); 150struct phy *devm_phy_get(struct device *dev, const char *string);
151struct phy *devm_phy_optional_get(struct device *dev, const char *string); 151struct phy *devm_phy_optional_get(struct device *dev, const char *string);
152struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
153 const char *con_id);
152void phy_put(struct phy *phy); 154void phy_put(struct phy *phy);
153void devm_phy_put(struct device *dev, struct phy *phy); 155void devm_phy_put(struct device *dev, struct phy *phy);
156struct phy *of_phy_get(struct device_node *np, const char *con_id);
154struct phy *of_phy_simple_xlate(struct device *dev, 157struct phy *of_phy_simple_xlate(struct device *dev,
155 struct of_phandle_args *args); 158 struct of_phandle_args *args);
156struct phy *phy_create(struct device *dev, const struct phy_ops *ops, 159struct phy *phy_create(struct device *dev, const struct phy_ops *ops,
@@ -251,6 +254,13 @@ static inline struct phy *devm_phy_optional_get(struct device *dev,
251 return ERR_PTR(-ENOSYS); 254 return ERR_PTR(-ENOSYS);
252} 255}
253 256
257static inline struct phy *devm_of_phy_get(struct device *dev,
258 struct device_node *np,
259 const char *con_id)
260{
261 return ERR_PTR(-ENOSYS);
262}
263
254static inline void phy_put(struct phy *phy) 264static inline void phy_put(struct phy *phy)
255{ 265{
256} 266}
@@ -259,6 +269,11 @@ static inline void devm_phy_put(struct device *dev, struct phy *phy)
259{ 269{
260} 270}
261 271
272static inline struct phy *of_phy_get(struct device_node *np, const char *con_id)
273{
274 return ERR_PTR(-ENOSYS);
275}
276
262static inline struct phy *of_phy_simple_xlate(struct device *dev, 277static inline struct phy *of_phy_simple_xlate(struct device *dev,
263 struct of_phandle_args *args) 278 struct of_phandle_args *args)
264{ 279{