aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-01 12:40:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-01 12:40:49 -0500
commite4ee8b85b7657d9c769b727038faabdc2e6a3412 (patch)
treee6b52a1e866ed77b09b267f60f8f1b5449228325 /include/linux
parent7109a04eae81c41ed529da9f3c48c3655ccea741 (diff)
parentd08dd3f3dd2ae351b793fc5b76abdbf0fd317b12 (diff)
Merge tag 'usb-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB/PHY updates from Greg KH: "Here is the big USB and PHY driver update for 4.16-rc1. Along with the normally expected XHCI, MUSB, and Gadget driver patches, there are some PHY driver fixes, license cleanups, sysfs attribute cleanups, usbip changes, and a raft of other smaller fixes and additions. Full details are in the shortlog. All of these have been in the linux-next tree for a long time with no reported issues" * tag 'usb-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (137 commits) USB: serial: pl2303: new device id for Chilitag USB: misc: fix up some remaining DEVICE_ATTR() usages USB: musb: fix up one odd DEVICE_ATTR() usage USB: atm: fix up some remaining DEVICE_ATTR() usage USB: move many drivers to use DEVICE_ATTR_WO USB: move many drivers to use DEVICE_ATTR_RO USB: move many drivers to use DEVICE_ATTR_RW USB: misc: chaoskey: Use true and false for boolean values USB: storage: remove old wording about how to submit a change USB: storage: remove invalid URL from drivers usb: ehci-omap: don't complain on -EPROBE_DEFER when no PHY found usbip: list: don't list devices attached to vhci_hcd usbip: prevent bind loops on devices attached to vhci_hcd USB: serial: remove redundant initializations of 'mos_parport' usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc() usb: gadget: compress return logic into one line usbip: vhci_hcd: update 'status' file header and format USB: serial: simple: add Motorola Tetra driver CDC-ACM: apply quirk for card reader usb: option: Add support for FS040U modem ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/usb.h7
-rw-r--r--include/linux/usb/gadget.h2
-rw-r--r--include/linux/usb/of.h21
-rw-r--r--include/linux/usb/pd.h2
-rw-r--r--include/linux/usb/pd_vdo.h2
-rw-r--r--include/linux/usb/renesas_usbhs.h9
-rw-r--r--include/linux/usb/tcpm.h16
7 files changed, 45 insertions, 14 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index fbbe974661f2..0173597e59aa 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -609,6 +609,10 @@ struct usb3_lpm_parameters {
609 * to keep track of the number of functions that require USB 3.0 Link Power 609 * to keep track of the number of functions that require USB 3.0 Link Power
610 * Management to be disabled for this usb_device. This count should only 610 * Management to be disabled for this usb_device. This count should only
611 * be manipulated by those functions, with the bandwidth_mutex is held. 611 * be manipulated by those functions, with the bandwidth_mutex is held.
612 * @hub_delay: cached value consisting of:
613 * parent->hub_delay + wHubDelay + tTPTransmissionDelay (40ns)
614 *
615 * Will be used as wValue for SetIsochDelay requests.
612 * 616 *
613 * Notes: 617 * Notes:
614 * Usbcore drivers should not set usbdev->state directly. Instead use 618 * Usbcore drivers should not set usbdev->state directly. Instead use
@@ -689,6 +693,8 @@ struct usb_device {
689 struct usb3_lpm_parameters u1_params; 693 struct usb3_lpm_parameters u1_params;
690 struct usb3_lpm_parameters u2_params; 694 struct usb3_lpm_parameters u2_params;
691 unsigned lpm_disable_count; 695 unsigned lpm_disable_count;
696
697 u16 hub_delay;
692}; 698};
693#define to_usb_device(d) container_of(d, struct usb_device, dev) 699#define to_usb_device(d) container_of(d, struct usb_device, dev)
694 700
@@ -1293,7 +1299,6 @@ extern int usb_disabled(void);
1293#define URB_ISO_ASAP 0x0002 /* iso-only; use the first unexpired 1299#define URB_ISO_ASAP 0x0002 /* iso-only; use the first unexpired
1294 * slot in the schedule */ 1300 * slot in the schedule */
1295#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ 1301#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */
1296#define URB_NO_FSBR 0x0020 /* UHCI-specific */
1297#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ 1302#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */
1298#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt 1303#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt
1299 * needed */ 1304 * needed */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 0142f3af0da6..66a5cff7ee14 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -330,6 +330,7 @@ struct usb_gadget_ops {
330 * @name: Identifies the controller hardware type. Used in diagnostics 330 * @name: Identifies the controller hardware type. Used in diagnostics
331 * and sometimes configuration. 331 * and sometimes configuration.
332 * @dev: Driver model state for this abstract device. 332 * @dev: Driver model state for this abstract device.
333 * @isoch_delay: value from Set Isoch Delay request. Only valid on SS/SSP
333 * @out_epnum: last used out ep number 334 * @out_epnum: last used out ep number
334 * @in_epnum: last used in ep number 335 * @in_epnum: last used in ep number
335 * @mA: last set mA value 336 * @mA: last set mA value
@@ -394,6 +395,7 @@ struct usb_gadget {
394 enum usb_device_state state; 395 enum usb_device_state state;
395 const char *name; 396 const char *name;
396 struct device dev; 397 struct device dev;
398 unsigned isoch_delay;
397 unsigned out_epnum; 399 unsigned out_epnum;
398 unsigned in_epnum; 400 unsigned in_epnum;
399 unsigned mA; 401 unsigned mA;
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h
index 6cbe7a5c2b57..dba55ccb9b53 100644
--- a/include/linux/usb/of.h
+++ b/include/linux/usb/of.h
@@ -12,13 +12,17 @@
12#include <linux/usb/otg.h> 12#include <linux/usb/otg.h>
13#include <linux/usb/phy.h> 13#include <linux/usb/phy.h>
14 14
15struct usb_device;
16
15#if IS_ENABLED(CONFIG_OF) 17#if IS_ENABLED(CONFIG_OF)
16enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0); 18enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0);
17bool of_usb_host_tpl_support(struct device_node *np); 19bool of_usb_host_tpl_support(struct device_node *np);
18int of_usb_update_otg_caps(struct device_node *np, 20int of_usb_update_otg_caps(struct device_node *np,
19 struct usb_otg_caps *otg_caps); 21 struct usb_otg_caps *otg_caps);
20struct device_node *usb_of_get_child_node(struct device_node *parent, 22struct device_node *usb_of_get_device_node(struct usb_device *hub, int port1);
21 int portnum); 23bool usb_of_has_combined_node(struct usb_device *udev);
24struct device_node *usb_of_get_interface_node(struct usb_device *udev,
25 u8 config, u8 ifnum);
22struct device *usb_of_get_companion_dev(struct device *dev); 26struct device *usb_of_get_companion_dev(struct device *dev);
23#else 27#else
24static inline enum usb_dr_mode 28static inline enum usb_dr_mode
@@ -35,8 +39,17 @@ static inline int of_usb_update_otg_caps(struct device_node *np,
35{ 39{
36 return 0; 40 return 0;
37} 41}
38static inline struct device_node *usb_of_get_child_node 42static inline struct device_node *
39 (struct device_node *parent, int portnum) 43usb_of_get_device_node(struct usb_device *hub, int port1)
44{
45 return NULL;
46}
47static inline bool usb_of_has_combined_node(struct usb_device *udev)
48{
49 return false;
50}
51static inline struct device_node *
52usb_of_get_interface_node(struct usb_device *udev, u8 config, u8 ifnum)
40{ 53{
41 return NULL; 54 return NULL;
42} 55}
diff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h
index e00051ced806..b3d41d7409b3 100644
--- a/include/linux/usb/pd.h
+++ b/include/linux/usb/pd.h
@@ -148,6 +148,8 @@ enum pd_pdo_type {
148 (PDO_TYPE(PDO_TYPE_FIXED) | (flags) | \ 148 (PDO_TYPE(PDO_TYPE_FIXED) | (flags) | \
149 PDO_FIXED_VOLT(mv) | PDO_FIXED_CURR(ma)) 149 PDO_FIXED_VOLT(mv) | PDO_FIXED_CURR(ma))
150 150
151#define VSAFE5V 5000 /* mv units */
152
151#define PDO_BATT_MAX_VOLT_SHIFT 20 /* 50mV units */ 153#define PDO_BATT_MAX_VOLT_SHIFT 20 /* 50mV units */
152#define PDO_BATT_MIN_VOLT_SHIFT 10 /* 50mV units */ 154#define PDO_BATT_MIN_VOLT_SHIFT 10 /* 50mV units */
153#define PDO_BATT_MAX_PWR_SHIFT 0 /* 250mW units */ 155#define PDO_BATT_MAX_PWR_SHIFT 0 /* 250mW units */
diff --git a/include/linux/usb/pd_vdo.h b/include/linux/usb/pd_vdo.h
index d92259f8de0a..2b64d23ace5c 100644
--- a/include/linux/usb/pd_vdo.h
+++ b/include/linux/usb/pd_vdo.h
@@ -65,7 +65,7 @@
65#define CMD_EXIT_MODE 5 65#define CMD_EXIT_MODE 5
66#define CMD_ATTENTION 6 66#define CMD_ATTENTION 6
67 67
68#define VDO_CMD_VENDOR(x) (((10 + (x)) & 0x1f)) 68#define VDO_CMD_VENDOR(x) (((0x10 + (x)) & 0x1f))
69 69
70/* ChromeOS specific commands */ 70/* ChromeOS specific commands */
71#define VDO_CMD_VERSION VDO_CMD_VENDOR(0) 71#define VDO_CMD_VERSION VDO_CMD_VENDOR(0)
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 67102f3d59d4..53924f8e840c 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -17,6 +17,7 @@
17 */ 17 */
18#ifndef RENESAS_USB_H 18#ifndef RENESAS_USB_H
19#define RENESAS_USB_H 19#define RENESAS_USB_H
20#include <linux/notifier.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/usb/ch9.h> 22#include <linux/usb/ch9.h>
22 23
@@ -98,6 +99,13 @@ struct renesas_usbhs_platform_callback {
98 * VBUS control is needed for Host 99 * VBUS control is needed for Host
99 */ 100 */
100 int (*set_vbus)(struct platform_device *pdev, int enable); 101 int (*set_vbus)(struct platform_device *pdev, int enable);
102
103 /*
104 * option:
105 * extcon notifier to set host/peripheral mode.
106 */
107 int (*notifier)(struct notifier_block *nb, unsigned long event,
108 void *data);
101}; 109};
102 110
103/* 111/*
@@ -187,6 +195,7 @@ struct renesas_usbhs_driver_param {
187#define USBHS_TYPE_RCAR_GEN2 1 195#define USBHS_TYPE_RCAR_GEN2 1
188#define USBHS_TYPE_RCAR_GEN3 2 196#define USBHS_TYPE_RCAR_GEN3 2
189#define USBHS_TYPE_RCAR_GEN3_WITH_PLL 3 197#define USBHS_TYPE_RCAR_GEN3_WITH_PLL 3
198#define USBHS_TYPE_RZA1 4
190 199
191/* 200/*
192 * option: 201 * option:
diff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h
index 073197f0d2bb..ca1c0b57f03f 100644
--- a/include/linux/usb/tcpm.h
+++ b/include/linux/usb/tcpm.h
@@ -183,14 +183,14 @@ struct tcpm_port;
183struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc); 183struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc);
184void tcpm_unregister_port(struct tcpm_port *port); 184void tcpm_unregister_port(struct tcpm_port *port);
185 185
186void tcpm_update_source_capabilities(struct tcpm_port *port, const u32 *pdo, 186int tcpm_update_source_capabilities(struct tcpm_port *port, const u32 *pdo,
187 unsigned int nr_pdo); 187 unsigned int nr_pdo);
188void tcpm_update_sink_capabilities(struct tcpm_port *port, const u32 *pdo, 188int tcpm_update_sink_capabilities(struct tcpm_port *port, const u32 *pdo,
189 unsigned int nr_pdo, 189 unsigned int nr_pdo,
190 unsigned int max_snk_mv, 190 unsigned int max_snk_mv,
191 unsigned int max_snk_ma, 191 unsigned int max_snk_ma,
192 unsigned int max_snk_mw, 192 unsigned int max_snk_mw,
193 unsigned int operating_snk_mw); 193 unsigned int operating_snk_mw);
194 194
195void tcpm_vbus_change(struct tcpm_port *port); 195void tcpm_vbus_change(struct tcpm_port *port);
196void tcpm_cc_change(struct tcpm_port *port); 196void tcpm_cc_change(struct tcpm_port *port);