diff options
| author | Olof Johansson <olof@lixom.net> | 2014-07-19 17:59:07 -0400 |
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2014-07-19 17:59:07 -0400 |
| commit | 4e9816d012dbc28dc89559261c6ffbf8ffc440dd (patch) | |
| tree | dee9f8b31f3d6d2fb141541da88e1cc1329b017e /include/linux/usb | |
| parent | da98f44f27d81d7fe9a41f69af4fe08c18d13b56 (diff) | |
| parent | 1795cd9b3a91d4b5473c97f491d63892442212ab (diff) | |
Merge tag 'v3.16-rc5' into next/fixes-non-critical
Linux 3.16-rc5
Diffstat (limited to 'include/linux/usb')
| -rw-r--r-- | include/linux/usb/cdc_ncm.h | 35 | ||||
| -rw-r--r-- | include/linux/usb/composite.h | 79 | ||||
| -rw-r--r-- | include/linux/usb/msm_hsusb.h | 39 | ||||
| -rw-r--r-- | include/linux/usb/msm_hsusb_hw.h | 14 | ||||
| -rw-r--r-- | include/linux/usb/usb_phy_generic.h (renamed from include/linux/usb/usb_phy_gen_xceiv.h) | 13 |
5 files changed, 134 insertions, 46 deletions
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index 44b38b92236a..7c9b484735c5 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h | |||
| @@ -52,6 +52,10 @@ | |||
| 52 | #define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */ | 52 | #define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */ |
| 53 | #define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */ | 53 | #define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */ |
| 54 | 54 | ||
| 55 | /* Initial NTB length */ | ||
| 56 | #define CDC_NCM_NTB_DEF_SIZE_TX 16384 /* bytes */ | ||
| 57 | #define CDC_NCM_NTB_DEF_SIZE_RX 16384 /* bytes */ | ||
| 58 | |||
| 55 | /* Minimum value for MaxDatagramSize, ch. 6.2.9 */ | 59 | /* Minimum value for MaxDatagramSize, ch. 6.2.9 */ |
| 56 | #define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */ | 60 | #define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */ |
| 57 | 61 | ||
| @@ -72,16 +76,9 @@ | |||
| 72 | /* Restart the timer, if amount of datagrams is less than given value */ | 76 | /* Restart the timer, if amount of datagrams is less than given value */ |
| 73 | #define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3 | 77 | #define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3 |
| 74 | #define CDC_NCM_TIMER_PENDING_CNT 2 | 78 | #define CDC_NCM_TIMER_PENDING_CNT 2 |
| 75 | #define CDC_NCM_TIMER_INTERVAL (400UL * NSEC_PER_USEC) | 79 | #define CDC_NCM_TIMER_INTERVAL_USEC 400UL |
| 76 | 80 | #define CDC_NCM_TIMER_INTERVAL_MIN 5UL | |
| 77 | /* The following macro defines the minimum header space */ | 81 | #define CDC_NCM_TIMER_INTERVAL_MAX (U32_MAX / NSEC_PER_USEC) |
| 78 | #define CDC_NCM_MIN_HDR_SIZE \ | ||
| 79 | (sizeof(struct usb_cdc_ncm_nth16) + sizeof(struct usb_cdc_ncm_ndp16) + \ | ||
| 80 | (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16)) | ||
| 81 | |||
| 82 | #define CDC_NCM_NDP_SIZE \ | ||
| 83 | (sizeof(struct usb_cdc_ncm_ndp16) + \ | ||
| 84 | (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16)) | ||
| 85 | 82 | ||
| 86 | #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \ | 83 | #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \ |
| 87 | (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE) | 84 | (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE) |
| @@ -107,6 +104,9 @@ struct cdc_ncm_ctx { | |||
| 107 | spinlock_t mtx; | 104 | spinlock_t mtx; |
| 108 | atomic_t stop; | 105 | atomic_t stop; |
| 109 | 106 | ||
| 107 | u32 timer_interval; | ||
| 108 | u32 max_ndp_size; | ||
| 109 | |||
| 110 | u32 tx_timer_pending; | 110 | u32 tx_timer_pending; |
| 111 | u32 tx_curr_frame_num; | 111 | u32 tx_curr_frame_num; |
| 112 | u32 rx_max; | 112 | u32 rx_max; |
| @@ -118,10 +118,21 @@ struct cdc_ncm_ctx { | |||
| 118 | u16 tx_ndp_modulus; | 118 | u16 tx_ndp_modulus; |
| 119 | u16 tx_seq; | 119 | u16 tx_seq; |
| 120 | u16 rx_seq; | 120 | u16 rx_seq; |
| 121 | u16 connected; | 121 | u16 min_tx_pkt; |
| 122 | |||
| 123 | /* statistics */ | ||
| 124 | u32 tx_curr_frame_payload; | ||
| 125 | u32 tx_reason_ntb_full; | ||
| 126 | u32 tx_reason_ndp_full; | ||
| 127 | u32 tx_reason_timeout; | ||
| 128 | u32 tx_reason_max_datagram; | ||
| 129 | u64 tx_overhead; | ||
| 130 | u64 tx_ntbs; | ||
| 131 | u64 rx_overhead; | ||
| 132 | u64 rx_ntbs; | ||
| 122 | }; | 133 | }; |
| 123 | 134 | ||
| 124 | u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf); | 135 | u8 cdc_ncm_select_altsetting(struct usb_interface *intf); |
| 125 | int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); | 136 | int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); |
| 126 | void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); | 137 | void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); |
| 127 | struct sk_buff *cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign); | 138 | struct sk_buff *cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign); |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index d3ca3b53837c..7373203140e7 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -57,6 +57,61 @@ | |||
| 57 | struct usb_configuration; | 57 | struct usb_configuration; |
| 58 | 58 | ||
| 59 | /** | 59 | /** |
| 60 | * struct usb_os_desc_ext_prop - describes one "Extended Property" | ||
| 61 | * @entry: used to keep a list of extended properties | ||
| 62 | * @type: Extended Property type | ||
| 63 | * @name_len: Extended Property unicode name length, including terminating '\0' | ||
| 64 | * @name: Extended Property name | ||
| 65 | * @data_len: Length of Extended Property blob (for unicode store double len) | ||
| 66 | * @data: Extended Property blob | ||
| 67 | * @item: Represents this Extended Property in configfs | ||
| 68 | */ | ||
| 69 | struct usb_os_desc_ext_prop { | ||
| 70 | struct list_head entry; | ||
| 71 | u8 type; | ||
| 72 | int name_len; | ||
| 73 | char *name; | ||
| 74 | int data_len; | ||
| 75 | char *data; | ||
| 76 | struct config_item item; | ||
| 77 | }; | ||
| 78 | |||
| 79 | /** | ||
| 80 | * struct usb_os_desc - describes OS descriptors associated with one interface | ||
| 81 | * @ext_compat_id: 16 bytes of "Compatible ID" and "Subcompatible ID" | ||
| 82 | * @ext_prop: Extended Properties list | ||
| 83 | * @ext_prop_len: Total length of Extended Properties blobs | ||
| 84 | * @ext_prop_count: Number of Extended Properties | ||
| 85 | * @opts_mutex: Optional mutex protecting config data of a usb_function_instance | ||
| 86 | * @group: Represents OS descriptors associated with an interface in configfs | ||
| 87 | * @owner: Module associated with this OS descriptor | ||
| 88 | */ | ||
| 89 | struct usb_os_desc { | ||
| 90 | char *ext_compat_id; | ||
| 91 | struct list_head ext_prop; | ||
| 92 | int ext_prop_len; | ||
| 93 | int ext_prop_count; | ||
| 94 | struct mutex *opts_mutex; | ||
| 95 | struct config_group group; | ||
| 96 | struct module *owner; | ||
| 97 | }; | ||
| 98 | |||
| 99 | /** | ||
| 100 | * struct usb_os_desc_table - describes OS descriptors associated with one | ||
| 101 | * interface of a usb_function | ||
| 102 | * @if_id: Interface id | ||
| 103 | * @os_desc: "Extended Compatibility ID" and "Extended Properties" of the | ||
| 104 | * interface | ||
| 105 | * | ||
| 106 | * Each interface can have at most one "Extended Compatibility ID" and a | ||
| 107 | * number of "Extended Properties". | ||
| 108 | */ | ||
| 109 | struct usb_os_desc_table { | ||
| 110 | int if_id; | ||
| 111 | struct usb_os_desc *os_desc; | ||
| 112 | }; | ||
| 113 | |||
| 114 | /** | ||
| 60 | * struct usb_function - describes one function of a configuration | 115 | * struct usb_function - describes one function of a configuration |
| 61 | * @name: For diagnostics, identifies the function. | 116 | * @name: For diagnostics, identifies the function. |
| 62 | * @strings: tables of strings, keyed by identifiers assigned during bind() | 117 | * @strings: tables of strings, keyed by identifiers assigned during bind() |
| @@ -73,6 +128,10 @@ struct usb_configuration; | |||
| 73 | * be available at super speed. | 128 | * be available at super speed. |
| 74 | * @config: assigned when @usb_add_function() is called; this is the | 129 | * @config: assigned when @usb_add_function() is called; this is the |
| 75 | * configuration with which this function is associated. | 130 | * configuration with which this function is associated. |
| 131 | * @os_desc_table: Table of (interface id, os descriptors) pairs. The function | ||
| 132 | * can expose more than one interface. If an interface is a member of | ||
| 133 | * an IAD, only the first interface of IAD has its entry in the table. | ||
| 134 | * @os_desc_n: Number of entries in os_desc_table | ||
| 76 | * @bind: Before the gadget can register, all of its functions bind() to the | 135 | * @bind: Before the gadget can register, all of its functions bind() to the |
| 77 | * available resources including string and interface identifiers used | 136 | * available resources including string and interface identifiers used |
| 78 | * in interface or class descriptors; endpoints; I/O buffers; and so on. | 137 | * in interface or class descriptors; endpoints; I/O buffers; and so on. |
| @@ -129,6 +188,9 @@ struct usb_function { | |||
| 129 | 188 | ||
| 130 | struct usb_configuration *config; | 189 | struct usb_configuration *config; |
| 131 | 190 | ||
| 191 | struct usb_os_desc_table *os_desc_table; | ||
| 192 | unsigned os_desc_n; | ||
| 193 | |||
| 132 | /* REVISIT: bind() functions can be marked __init, which | 194 | /* REVISIT: bind() functions can be marked __init, which |
| 133 | * makes trouble for section mismatch analysis. See if | 195 | * makes trouble for section mismatch analysis. See if |
| 134 | * we can't restructure things to avoid mismatching. | 196 | * we can't restructure things to avoid mismatching. |
| @@ -327,6 +389,8 @@ extern void usb_composite_unregister(struct usb_composite_driver *driver); | |||
| 327 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | 389 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); |
| 328 | extern int composite_dev_prepare(struct usb_composite_driver *composite, | 390 | extern int composite_dev_prepare(struct usb_composite_driver *composite, |
| 329 | struct usb_composite_dev *cdev); | 391 | struct usb_composite_dev *cdev); |
| 392 | extern int composite_os_desc_req_prepare(struct usb_composite_dev *cdev, | ||
| 393 | struct usb_ep *ep0); | ||
| 330 | void composite_dev_cleanup(struct usb_composite_dev *cdev); | 394 | void composite_dev_cleanup(struct usb_composite_dev *cdev); |
| 331 | 395 | ||
| 332 | static inline struct usb_composite_driver *to_cdriver( | 396 | static inline struct usb_composite_driver *to_cdriver( |
| @@ -335,11 +399,19 @@ static inline struct usb_composite_driver *to_cdriver( | |||
| 335 | return container_of(gdrv, struct usb_composite_driver, gadget_driver); | 399 | return container_of(gdrv, struct usb_composite_driver, gadget_driver); |
| 336 | } | 400 | } |
| 337 | 401 | ||
| 402 | #define OS_STRING_QW_SIGN_LEN 14 | ||
| 403 | #define OS_STRING_IDX 0xEE | ||
| 404 | |||
| 338 | /** | 405 | /** |
| 339 | * struct usb_composite_device - represents one composite usb gadget | 406 | * struct usb_composite_device - represents one composite usb gadget |
| 340 | * @gadget: read-only, abstracts the gadget's usb peripheral controller | 407 | * @gadget: read-only, abstracts the gadget's usb peripheral controller |
| 341 | * @req: used for control responses; buffer is pre-allocated | 408 | * @req: used for control responses; buffer is pre-allocated |
| 409 | * @os_desc_req: used for OS descriptors responses; buffer is pre-allocated | ||
| 342 | * @config: the currently active configuration | 410 | * @config: the currently active configuration |
| 411 | * @qw_sign: qwSignature part of the OS string | ||
| 412 | * @b_vendor_code: bMS_VendorCode part of the OS string | ||
| 413 | * @use_os_string: false by default, interested gadgets set it | ||
| 414 | * @os_desc_config: the configuration to be used with OS descriptors | ||
| 343 | * | 415 | * |
| 344 | * One of these devices is allocated and initialized before the | 416 | * One of these devices is allocated and initialized before the |
| 345 | * associated device driver's bind() is called. | 417 | * associated device driver's bind() is called. |
| @@ -369,9 +441,16 @@ static inline struct usb_composite_driver *to_cdriver( | |||
| 369 | struct usb_composite_dev { | 441 | struct usb_composite_dev { |
| 370 | struct usb_gadget *gadget; | 442 | struct usb_gadget *gadget; |
| 371 | struct usb_request *req; | 443 | struct usb_request *req; |
| 444 | struct usb_request *os_desc_req; | ||
| 372 | 445 | ||
| 373 | struct usb_configuration *config; | 446 | struct usb_configuration *config; |
| 374 | 447 | ||
| 448 | /* OS String is a custom (yet popular) extension to the USB standard. */ | ||
| 449 | u8 qw_sign[OS_STRING_QW_SIGN_LEN]; | ||
| 450 | u8 b_vendor_code; | ||
| 451 | struct usb_configuration *os_desc_config; | ||
| 452 | unsigned int use_os_string:1; | ||
| 453 | |||
| 375 | /* private: */ | 454 | /* private: */ |
| 376 | /* internals */ | 455 | /* internals */ |
| 377 | unsigned int suspended:1; | 456 | unsigned int suspended:1; |
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h index 32754835a39b..b0a39243295a 100644 --- a/include/linux/usb/msm_hsusb.h +++ b/include/linux/usb/msm_hsusb.h | |||
| @@ -23,21 +23,6 @@ | |||
| 23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * Supported USB modes | ||
| 27 | * | ||
| 28 | * USB_PERIPHERAL Only peripheral mode is supported. | ||
| 29 | * USB_HOST Only host mode is supported. | ||
| 30 | * USB_OTG OTG mode is supported. | ||
| 31 | * | ||
| 32 | */ | ||
| 33 | enum usb_mode_type { | ||
| 34 | USB_NONE = 0, | ||
| 35 | USB_PERIPHERAL, | ||
| 36 | USB_HOST, | ||
| 37 | USB_OTG, | ||
| 38 | }; | ||
| 39 | |||
| 40 | /** | ||
| 41 | * OTG control | 26 | * OTG control |
| 42 | * | 27 | * |
| 43 | * OTG_NO_CONTROL Id/VBUS notifications not required. Useful in host | 28 | * OTG_NO_CONTROL Id/VBUS notifications not required. Useful in host |
| @@ -115,27 +100,23 @@ enum usb_chg_type { | |||
| 115 | /** | 100 | /** |
| 116 | * struct msm_otg_platform_data - platform device data | 101 | * struct msm_otg_platform_data - platform device data |
| 117 | * for msm_otg driver. | 102 | * for msm_otg driver. |
| 118 | * @phy_init_seq: PHY configuration sequence. val, reg pairs | 103 | * @phy_init_seq: PHY configuration sequence values. Value of -1 is reserved as |
| 119 | * terminated by -1. | 104 | * "do not overwrite default vaule at this address". |
| 105 | * @phy_init_sz: PHY configuration sequence size. | ||
| 120 | * @vbus_power: VBUS power on/off routine. | 106 | * @vbus_power: VBUS power on/off routine. |
| 121 | * @power_budget: VBUS power budget in mA (0 will be treated as 500mA). | 107 | * @power_budget: VBUS power budget in mA (0 will be treated as 500mA). |
| 122 | * @mode: Supported mode (OTG/peripheral/host). | 108 | * @mode: Supported mode (OTG/peripheral/host). |
| 123 | * @otg_control: OTG switch controlled by user/Id pin | 109 | * @otg_control: OTG switch controlled by user/Id pin |
| 124 | * @default_mode: Default operational mode. Applicable only if | ||
| 125 | * OTG switch is controller by user. | ||
| 126 | * @pclk_src_name: pclk is derived from ebi1_usb_clk in case of 7x27 and 8k | ||
| 127 | * dfab_usb_hs_clk in case of 8660 and 8960. | ||
| 128 | */ | 110 | */ |
| 129 | struct msm_otg_platform_data { | 111 | struct msm_otg_platform_data { |
| 130 | int *phy_init_seq; | 112 | int *phy_init_seq; |
| 113 | int phy_init_sz; | ||
| 131 | void (*vbus_power)(bool on); | 114 | void (*vbus_power)(bool on); |
| 132 | unsigned power_budget; | 115 | unsigned power_budget; |
| 133 | enum usb_mode_type mode; | 116 | enum usb_dr_mode mode; |
| 134 | enum otg_control_type otg_control; | 117 | enum otg_control_type otg_control; |
| 135 | enum usb_mode_type default_mode; | ||
| 136 | enum msm_usb_phy_type phy_type; | 118 | enum msm_usb_phy_type phy_type; |
| 137 | void (*setup_gpio)(enum usb_otg_state state); | 119 | void (*setup_gpio)(enum usb_otg_state state); |
| 138 | char *pclk_src_name; | ||
| 139 | int (*link_clk_reset)(struct clk *link_clk, bool assert); | 120 | int (*link_clk_reset)(struct clk *link_clk, bool assert); |
| 140 | int (*phy_clk_reset)(struct clk *phy_clk); | 121 | int (*phy_clk_reset)(struct clk *phy_clk); |
| 141 | }; | 122 | }; |
| @@ -147,7 +128,6 @@ struct msm_otg_platform_data { | |||
| 147 | * @irq: IRQ number assigned for HSUSB controller. | 128 | * @irq: IRQ number assigned for HSUSB controller. |
| 148 | * @clk: clock struct of usb_hs_clk. | 129 | * @clk: clock struct of usb_hs_clk. |
| 149 | * @pclk: clock struct of usb_hs_pclk. | 130 | * @pclk: clock struct of usb_hs_pclk. |
| 150 | * @pclk_src: pclk source for voting. | ||
| 151 | * @phy_reset_clk: clock struct of usb_phy_clk. | 131 | * @phy_reset_clk: clock struct of usb_phy_clk. |
| 152 | * @core_clk: clock struct of usb_hs_core_clk. | 132 | * @core_clk: clock struct of usb_hs_core_clk. |
| 153 | * @regs: ioremapped register base address. | 133 | * @regs: ioremapped register base address. |
| @@ -168,7 +148,6 @@ struct msm_otg { | |||
| 168 | int irq; | 148 | int irq; |
| 169 | struct clk *clk; | 149 | struct clk *clk; |
| 170 | struct clk *pclk; | 150 | struct clk *pclk; |
| 171 | struct clk *pclk_src; | ||
| 172 | struct clk *phy_reset_clk; | 151 | struct clk *phy_reset_clk; |
| 173 | struct clk *core_clk; | 152 | struct clk *core_clk; |
| 174 | void __iomem *regs; | 153 | void __iomem *regs; |
| @@ -179,10 +158,18 @@ struct msm_otg { | |||
| 179 | atomic_t in_lpm; | 158 | atomic_t in_lpm; |
| 180 | int async_int; | 159 | int async_int; |
| 181 | unsigned cur_power; | 160 | unsigned cur_power; |
| 161 | int phy_number; | ||
| 182 | struct delayed_work chg_work; | 162 | struct delayed_work chg_work; |
| 183 | enum usb_chg_state chg_state; | 163 | enum usb_chg_state chg_state; |
| 184 | enum usb_chg_type chg_type; | 164 | enum usb_chg_type chg_type; |
| 185 | u8 dcd_retries; | 165 | u8 dcd_retries; |
| 166 | struct regulator *v3p3; | ||
| 167 | struct regulator *v1p8; | ||
| 168 | struct regulator *vddcx; | ||
| 169 | |||
| 170 | struct reset_control *phy_rst; | ||
| 171 | struct reset_control *link_rst; | ||
| 172 | int vdd_levels[3]; | ||
| 186 | }; | 173 | }; |
| 187 | 174 | ||
| 188 | #endif | 175 | #endif |
diff --git a/include/linux/usb/msm_hsusb_hw.h b/include/linux/usb/msm_hsusb_hw.h index 6e97a2d3d39f..a29f6030afb1 100644 --- a/include/linux/usb/msm_hsusb_hw.h +++ b/include/linux/usb/msm_hsusb_hw.h | |||
| @@ -16,6 +16,9 @@ | |||
| 16 | #ifndef __LINUX_USB_GADGET_MSM72K_UDC_H__ | 16 | #ifndef __LINUX_USB_GADGET_MSM72K_UDC_H__ |
| 17 | #define __LINUX_USB_GADGET_MSM72K_UDC_H__ | 17 | #define __LINUX_USB_GADGET_MSM72K_UDC_H__ |
| 18 | 18 | ||
| 19 | /* USB phy selector - in TCSR address range */ | ||
| 20 | #define USB2_PHY_SEL 0xfd4ab000 | ||
| 21 | |||
| 19 | #define USB_AHBBURST (MSM_USB_BASE + 0x0090) | 22 | #define USB_AHBBURST (MSM_USB_BASE + 0x0090) |
| 20 | #define USB_AHBMODE (MSM_USB_BASE + 0x0098) | 23 | #define USB_AHBMODE (MSM_USB_BASE + 0x0098) |
| 21 | #define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */ | 24 | #define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */ |
| @@ -25,13 +28,15 @@ | |||
| 25 | #define USB_OTGSC (MSM_USB_BASE + 0x01A4) | 28 | #define USB_OTGSC (MSM_USB_BASE + 0x01A4) |
| 26 | #define USB_USBMODE (MSM_USB_BASE + 0x01A8) | 29 | #define USB_USBMODE (MSM_USB_BASE + 0x01A8) |
| 27 | #define USB_PHY_CTRL (MSM_USB_BASE + 0x0240) | 30 | #define USB_PHY_CTRL (MSM_USB_BASE + 0x0240) |
| 31 | #define USB_PHY_CTRL2 (MSM_USB_BASE + 0x0278) | ||
| 28 | 32 | ||
| 29 | #define USBCMD_RESET 2 | 33 | #define USBCMD_RESET 2 |
| 30 | #define USB_USBINTR (MSM_USB_BASE + 0x0148) | 34 | #define USB_USBINTR (MSM_USB_BASE + 0x0148) |
| 31 | 35 | ||
| 32 | #define PORTSC_PHCD (1 << 23) /* phy suspend mode */ | 36 | #define PORTSC_PHCD (1 << 23) /* phy suspend mode */ |
| 33 | #define PORTSC_PTS_MASK (3 << 30) | 37 | #define PORTSC_PTS_MASK (3 << 30) |
| 34 | #define PORTSC_PTS_ULPI (3 << 30) | 38 | #define PORTSC_PTS_ULPI (2 << 30) |
| 39 | #define PORTSC_PTS_SERIAL (3 << 30) | ||
| 35 | 40 | ||
| 36 | #define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170) | 41 | #define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170) |
| 37 | #define ULPI_RUN (1 << 30) | 42 | #define ULPI_RUN (1 << 30) |
| @@ -41,9 +46,14 @@ | |||
| 41 | #define ULPI_DATA(n) ((n) & 255) | 46 | #define ULPI_DATA(n) ((n) & 255) |
| 42 | #define ULPI_DATA_READ(n) (((n) >> 8) & 255) | 47 | #define ULPI_DATA_READ(n) (((n) >> 8) & 255) |
| 43 | 48 | ||
| 49 | /* synopsys 28nm phy registers */ | ||
| 50 | #define ULPI_PWR_CLK_MNG_REG 0x88 | ||
| 51 | #define OTG_COMP_DISABLE BIT(0) | ||
| 52 | |||
| 44 | #define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */ | 53 | #define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */ |
| 45 | #define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */ | 54 | #define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */ |
| 46 | #define PHY_RETEN (1 << 1) /* PHY retention enable/disable */ | 55 | #define PHY_RETEN (1 << 1) /* PHY retention enable/disable */ |
| 56 | #define PHY_POR_ASSERT (1 << 0) /* USB2 28nm PHY POR ASSERT */ | ||
| 47 | 57 | ||
| 48 | /* OTG definitions */ | 58 | /* OTG definitions */ |
| 49 | #define OTGSC_INTSTS_MASK (0x7f << 16) | 59 | #define OTGSC_INTSTS_MASK (0x7f << 16) |
diff --git a/include/linux/usb/usb_phy_gen_xceiv.h b/include/linux/usb/usb_phy_generic.h index cc8d818a83be..68adae83affc 100644 --- a/include/linux/usb/usb_phy_gen_xceiv.h +++ b/include/linux/usb/usb_phy_generic.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/usb/otg.h> | 4 | #include <linux/usb/otg.h> |
| 5 | 5 | ||
| 6 | struct usb_phy_gen_xceiv_platform_data { | 6 | struct usb_phy_generic_platform_data { |
| 7 | enum usb_phy_type type; | 7 | enum usb_phy_type type; |
| 8 | unsigned long clk_rate; | 8 | unsigned long clk_rate; |
| 9 | 9 | ||
| @@ -13,16 +13,17 @@ struct usb_phy_gen_xceiv_platform_data { | |||
| 13 | int gpio_reset; | 13 | int gpio_reset; |
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) | 16 | #if IS_ENABLED(CONFIG_NOP_USB_XCEIV) |
| 17 | /* sometimes transceivers are accessed only through e.g. ULPI */ | 17 | /* sometimes transceivers are accessed only through e.g. ULPI */ |
| 18 | extern void usb_nop_xceiv_register(void); | 18 | extern struct platform_device *usb_phy_generic_register(void); |
| 19 | extern void usb_nop_xceiv_unregister(void); | 19 | extern void usb_phy_generic_unregister(struct platform_device *); |
| 20 | #else | 20 | #else |
| 21 | static inline void usb_nop_xceiv_register(void) | 21 | static inline struct platform_device *usb_phy_generic_register(void) |
| 22 | { | 22 | { |
| 23 | return NULL; | ||
| 23 | } | 24 | } |
| 24 | 25 | ||
| 25 | static inline void usb_nop_xceiv_unregister(void) | 26 | static inline void usb_phy_generic_unregister(struct platform_device *pdev) |
| 26 | { | 27 | { |
| 27 | } | 28 | } |
| 28 | #endif | 29 | #endif |
