aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 13:05:06 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 13:05:06 -0500
commit36facadd9ea98f8415d0dbb63e0763b7ee9d3911 (patch)
tree99dea00b332ed852f2b0a4923b581dd723f03634 /include/linux
parent2faa83e2a519abea1055d156ce1b42b8fa57e87b (diff)
parent0b83ae960cd7d4a5ee02786ecf41ab45688999bf (diff)
Merge branch 'usb-next' into musb-merge
* usb-next: (132 commits) USB: uas: Use GFP_NOIO instead of GFP_KERNEL in I/O submission path USB: uas: Ensure we only bind to a UAS interface USB: uas: Rename sense pipe and sense urb to status pipe and status urb USB: uas: Use kzalloc instead of kmalloc USB: uas: Fix up the Sense IU usb: musb: core: kill unneeded #include's DA8xx: assign name to MUSB IRQ resource usb: gadget: g_ncm added usb: gadget: f_ncm.c added usb: gadget: u_ether: prepare for NCM usb: pch_udc: Fix setup transfers with data out usb: pch_udc: Fix compile error, warnings and checkpatch warnings usb: add ab8500 usb transceiver driver USB: gadget: Implement runtime PM for MSM bus glue driver USB: gadget: Implement runtime PM for ci13xxx gadget USB: gadget: Add USB controller driver for MSM SoC USB: gadget: Introduce ci13xxx_udc_driver struct USB: gadget: Initialize ci13xxx gadget device's coherent DMA mask USB: gadget: Fix "scheduling while atomic" bugs in ci13xxx_udc USB: gadget: Separate out PCI bus code from ci13xxx_udc ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/i2c/twl.h7
-rw-r--r--include/linux/usb.h7
-rw-r--r--include/linux/usb/ch11.h47
-rw-r--r--include/linux/usb/ch9.h10
-rw-r--r--include/linux/usb/hcd.h4
-rw-r--r--include/linux/usb/msm_hsusb.h112
-rw-r--r--include/linux/usb/msm_hsusb_hw.h59
-rw-r--r--include/linux/usb/musb.h8
-rw-r--r--include/linux/usb/otg.h2
9 files changed, 246 insertions, 10 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index c760991b354a..61b9609e55f2 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -593,6 +593,13 @@ enum twl4030_usb_mode {
593 593
594struct twl4030_usb_data { 594struct twl4030_usb_data {
595 enum twl4030_usb_mode usb_mode; 595 enum twl4030_usb_mode usb_mode;
596
597 int (*phy_init)(struct device *dev);
598 int (*phy_exit)(struct device *dev);
599 /* Power on/off the PHY */
600 int (*phy_power)(struct device *dev, int iD, int on);
601 /* enable/disable phy clocks */
602 int (*phy_set_clock)(struct device *dev, int on);
596}; 603};
597 604
598struct twl4030_ins { 605struct twl4030_ins {
diff --git a/include/linux/usb.h b/include/linux/usb.h
index a28eb2592577..bd69b65f3356 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -20,6 +20,7 @@
20#include <linux/completion.h> /* for struct completion */ 20#include <linux/completion.h> /* for struct completion */
21#include <linux/sched.h> /* for current && schedule_timeout */ 21#include <linux/sched.h> /* for current && schedule_timeout */
22#include <linux/mutex.h> /* for struct mutex */ 22#include <linux/mutex.h> /* for struct mutex */
23#include <linux/pm_runtime.h> /* for runtime PM */
23 24
24struct usb_device; 25struct usb_device;
25struct usb_driver; 26struct usb_driver;
@@ -411,8 +412,6 @@ struct usb_tt;
411 * @quirks: quirks of the whole device 412 * @quirks: quirks of the whole device
412 * @urbnum: number of URBs submitted for the whole device 413 * @urbnum: number of URBs submitted for the whole device
413 * @active_duration: total time device is not suspended 414 * @active_duration: total time device is not suspended
414 * @last_busy: time of last use
415 * @autosuspend_delay: in jiffies
416 * @connect_time: time device was first connected 415 * @connect_time: time device was first connected
417 * @do_remote_wakeup: remote wakeup should be enabled 416 * @do_remote_wakeup: remote wakeup should be enabled
418 * @reset_resume: needs reset instead of resume 417 * @reset_resume: needs reset instead of resume
@@ -485,8 +484,6 @@ struct usb_device {
485 unsigned long active_duration; 484 unsigned long active_duration;
486 485
487#ifdef CONFIG_PM 486#ifdef CONFIG_PM
488 unsigned long last_busy;
489 int autosuspend_delay;
490 unsigned long connect_time; 487 unsigned long connect_time;
491 488
492 unsigned do_remote_wakeup:1; 489 unsigned do_remote_wakeup:1;
@@ -531,7 +528,7 @@ extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf);
531 528
532static inline void usb_mark_last_busy(struct usb_device *udev) 529static inline void usb_mark_last_busy(struct usb_device *udev)
533{ 530{
534 udev->last_busy = jiffies; 531 pm_runtime_mark_last_busy(&udev->dev);
535} 532}
536 533
537#else 534#else
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h
index 119194c85d10..10ec0699bea4 100644
--- a/include/linux/usb/ch11.h
+++ b/include/linux/usb/ch11.h
@@ -28,6 +28,13 @@
28#define HUB_STOP_TT 11 28#define HUB_STOP_TT 11
29 29
30/* 30/*
31 * Hub class additional requests defined by USB 3.0 spec
32 * See USB 3.0 spec Table 10-6
33 */
34#define HUB_SET_DEPTH 12
35#define HUB_GET_PORT_ERR_COUNT 13
36
37/*
31 * Hub Class feature numbers 38 * Hub Class feature numbers
32 * See USB 2.0 spec Table 11-17 39 * See USB 2.0 spec Table 11-17
33 */ 40 */
@@ -56,6 +63,20 @@
56#define USB_PORT_FEAT_C_PORT_L1 23 63#define USB_PORT_FEAT_C_PORT_L1 23
57 64
58/* 65/*
66 * Port feature selectors added by USB 3.0 spec.
67 * See USB 3.0 spec Table 10-7
68 */
69#define USB_PORT_FEAT_LINK_STATE 5
70#define USB_PORT_FEAT_U1_TIMEOUT 23
71#define USB_PORT_FEAT_U2_TIMEOUT 24
72#define USB_PORT_FEAT_C_LINK_STATE 25
73#define USB_PORT_FEAT_C_CONFIG_ERR 26
74#define USB_PORT_FEAT_REMOTE_WAKE_MASK 27
75#define USB_PORT_FEAT_BH_PORT_RESET 28
76#define USB_PORT_FEAT_C_BH_PORT_RESET 29
77#define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30
78
79/*
59 * Hub Status and Hub Change results 80 * Hub Status and Hub Change results
60 * See USB 2.0 spec Table 11-19 and Table 11-20 81 * See USB 2.0 spec Table 11-19 and Table 11-20
61 */ 82 */
@@ -84,6 +105,32 @@ struct usb_port_status {
84#define USB_PORT_STAT_SUPER_SPEED 0x8000 /* Linux-internal */ 105#define USB_PORT_STAT_SUPER_SPEED 0x8000 /* Linux-internal */
85 106
86/* 107/*
108 * Additions to wPortStatus bit field from USB 3.0
109 * See USB 3.0 spec Table 10-10
110 */
111#define USB_PORT_STAT_LINK_STATE 0x01e0
112#define USB_SS_PORT_STAT_POWER 0x0200
113#define USB_PORT_STAT_SPEED_5GBPS 0x0000
114/* Valid only if port is enabled */
115
116/*
117 * Definitions for PORT_LINK_STATE values
118 * (bits 5-8) in wPortStatus
119 */
120#define USB_SS_PORT_LS_U0 0x0000
121#define USB_SS_PORT_LS_U1 0x0020
122#define USB_SS_PORT_LS_U2 0x0040
123#define USB_SS_PORT_LS_U3 0x0060
124#define USB_SS_PORT_LS_SS_DISABLED 0x0080
125#define USB_SS_PORT_LS_RX_DETECT 0x00a0
126#define USB_SS_PORT_LS_SS_INACTIVE 0x00c0
127#define USB_SS_PORT_LS_POLLING 0x00e0
128#define USB_SS_PORT_LS_RECOVERY 0x0100
129#define USB_SS_PORT_LS_HOT_RESET 0x0120
130#define USB_SS_PORT_LS_COMP_MOD 0x0140
131#define USB_SS_PORT_LS_LOOPBACK 0x0160
132
133/*
87 * wPortChange bit field 134 * wPortChange bit field
88 * See USB 2.0 spec Table 11-22 135 * See USB 2.0 spec Table 11-22
89 * Bits 0 to 4 shown, bits 5 to 15 are reserved 136 * Bits 0 to 4 shown, bits 5 to 15 are reserved
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index f917bbbc8901..ab461948b579 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -124,6 +124,16 @@
124#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ 124#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */
125 125
126/* 126/*
127 * Test Mode Selectors
128 * See USB 2.0 spec Table 9-7
129 */
130#define TEST_J 1
131#define TEST_K 2
132#define TEST_SE0_NAK 3
133#define TEST_PACKET 4
134#define TEST_FORCE_EN 5
135
136/*
127 * New Feature Selectors as added by USB 3.0 137 * New Feature Selectors as added by USB 3.0
128 * See USB 3.0 spec Table 9-6 138 * See USB 3.0 spec Table 9-6
129 */ 139 */
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 0b6e751ea0b1..dd6ee49a0844 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -471,6 +471,10 @@ extern void usb_ep0_reinit(struct usb_device *);
471 471
472/*-------------------------------------------------------------------------*/ 472/*-------------------------------------------------------------------------*/
473 473
474/* class requests from USB 3.0 hub spec, table 10-5 */
475#define SetHubDepth (0x3000 | HUB_SET_DEPTH)
476#define GetPortErrorCount (0x8000 | HUB_GET_PORT_ERR_COUNT)
477
474/* 478/*
475 * Generic bandwidth allocation constants/support 479 * Generic bandwidth allocation constants/support
476 */ 480 */
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h
new file mode 100644
index 000000000000..3675e03b1539
--- /dev/null
+++ b/include/linux/usb/msm_hsusb.h
@@ -0,0 +1,112 @@
1/* linux/include/asm-arm/arch-msm/hsusb.h
2 *
3 * Copyright (C) 2008 Google, Inc.
4 * Author: Brian Swetland <swetland@google.com>
5 * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#ifndef __ASM_ARCH_MSM_HSUSB_H
19#define __ASM_ARCH_MSM_HSUSB_H
20
21#include <linux/types.h>
22#include <linux/usb/otg.h>
23
24/**
25 * Supported USB modes
26 *
27 * USB_PERIPHERAL Only peripheral mode is supported.
28 * USB_HOST Only host mode is supported.
29 * USB_OTG OTG mode is supported.
30 *
31 */
32enum usb_mode_type {
33 USB_NONE = 0,
34 USB_PERIPHERAL,
35 USB_HOST,
36 USB_OTG,
37};
38
39/**
40 * OTG control
41 *
42 * OTG_NO_CONTROL Id/VBUS notifications not required. Useful in host
43 * only configuration.
44 * OTG_PHY_CONTROL Id/VBUS notifications comes form USB PHY.
45 * OTG_PMIC_CONTROL Id/VBUS notifications comes from PMIC hardware.
46 * OTG_USER_CONTROL Id/VBUS notifcations comes from User via sysfs.
47 *
48 */
49enum otg_control_type {
50 OTG_NO_CONTROL = 0,
51 OTG_PHY_CONTROL,
52 OTG_PMIC_CONTROL,
53 OTG_USER_CONTROL,
54};
55
56/**
57 * struct msm_otg_platform_data - platform device data
58 * for msm72k_otg driver.
59 * @phy_init_seq: PHY configuration sequence. val, reg pairs
60 * terminated by -1.
61 * @vbus_power: VBUS power on/off routine.
62 * @power_budget: VBUS power budget in mA (0 will be treated as 500mA).
63 * @mode: Supported mode (OTG/peripheral/host).
64 * @otg_control: OTG switch controlled by user/Id pin
65 * @default_mode: Default operational mode. Applicable only if
66 * OTG switch is controller by user.
67 *
68 */
69struct msm_otg_platform_data {
70 int *phy_init_seq;
71 void (*vbus_power)(bool on);
72 unsigned power_budget;
73 enum usb_mode_type mode;
74 enum otg_control_type otg_control;
75 enum usb_mode_type default_mode;
76 void (*setup_gpio)(enum usb_otg_state state);
77};
78
79/**
80 * struct msm_otg: OTG driver data. Shared by HCD and DCD.
81 * @otg: USB OTG Transceiver structure.
82 * @pdata: otg device platform data.
83 * @irq: IRQ number assigned for HSUSB controller.
84 * @clk: clock struct of usb_hs_clk.
85 * @pclk: clock struct of usb_hs_pclk.
86 * @phy_reset_clk: clock struct of usb_phy_clk.
87 * @core_clk: clock struct of usb_hs_core_clk.
88 * @regs: ioremapped register base address.
89 * @inputs: OTG state machine inputs(Id, SessValid etc).
90 * @sm_work: OTG state machine work.
91 * @in_lpm: indicates low power mode (LPM) state.
92 * @async_int: Async interrupt arrived.
93 *
94 */
95struct msm_otg {
96 struct otg_transceiver otg;
97 struct msm_otg_platform_data *pdata;
98 int irq;
99 struct clk *clk;
100 struct clk *pclk;
101 struct clk *phy_reset_clk;
102 struct clk *core_clk;
103 void __iomem *regs;
104#define ID 0
105#define B_SESS_VLD 1
106 unsigned long inputs;
107 struct work_struct sm_work;
108 atomic_t in_lpm;
109 int async_int;
110};
111
112#endif
diff --git a/include/linux/usb/msm_hsusb_hw.h b/include/linux/usb/msm_hsusb_hw.h
new file mode 100644
index 000000000000..b92e17349c7b
--- /dev/null
+++ b/include/linux/usb/msm_hsusb_hw.h
@@ -0,0 +1,59 @@
1/*
2 * Copyright (C) 2007 Google, Inc.
3 * Author: Brian Swetland <swetland@google.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#ifndef __LINUX_USB_GADGET_MSM72K_UDC_H__
17#define __LINUX_USB_GADGET_MSM72K_UDC_H__
18
19#ifdef CONFIG_ARCH_MSM7X00A
20#define USB_SBUSCFG (MSM_USB_BASE + 0x0090)
21#else
22#define USB_AHBBURST (MSM_USB_BASE + 0x0090)
23#define USB_AHBMODE (MSM_USB_BASE + 0x0098)
24#endif
25#define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */
26
27#define USB_USBCMD (MSM_USB_BASE + 0x0140)
28#define USB_PORTSC (MSM_USB_BASE + 0x0184)
29#define USB_OTGSC (MSM_USB_BASE + 0x01A4)
30#define USB_USBMODE (MSM_USB_BASE + 0x01A8)
31
32#define USBCMD_RESET 2
33#define USB_USBINTR (MSM_USB_BASE + 0x0148)
34
35#define PORTSC_PHCD (1 << 23) /* phy suspend mode */
36#define PORTSC_PTS_MASK (3 << 30)
37#define PORTSC_PTS_ULPI (3 << 30)
38
39#define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170)
40#define ULPI_RUN (1 << 30)
41#define ULPI_WRITE (1 << 29)
42#define ULPI_READ (0 << 29)
43#define ULPI_ADDR(n) (((n) & 255) << 16)
44#define ULPI_DATA(n) ((n) & 255)
45#define ULPI_DATA_READ(n) (((n) >> 8) & 255)
46
47#define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */
48#define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */
49
50/* OTG definitions */
51#define OTGSC_INTSTS_MASK (0x7f << 16)
52#define OTGSC_ID (1 << 8)
53#define OTGSC_BSV (1 << 11)
54#define OTGSC_IDIS (1 << 16)
55#define OTGSC_BSVIS (1 << 19)
56#define OTGSC_IDIE (1 << 24)
57#define OTGSC_BSVIE (1 << 27)
58
59#endif /* __LINUX_USB_GADGET_MSM72K_UDC_H__ */
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index 2387f9fc8138..eb505250940a 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -3,7 +3,7 @@
3 * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC. 3 * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC.
4 * 4 *
5 * Board initialization should put one of these into dev->platform_data, 5 * Board initialization should put one of these into dev->platform_data,
6 * probably on some platform_device named "musb_hdrc". It encapsulates 6 * probably on some platform_device named "musb-hdrc". It encapsulates
7 * key configuration differences between boards. 7 * key configuration differences between boards.
8 */ 8 */
9 9
@@ -120,14 +120,14 @@ struct musb_hdrc_platform_data {
120 /* Power the device on or off */ 120 /* Power the device on or off */
121 int (*set_power)(int state); 121 int (*set_power)(int state);
122 122
123 /* Turn device clock on or off */
124 int (*set_clock)(struct clk *clock, int is_on);
125
126 /* MUSB configuration-specific details */ 123 /* MUSB configuration-specific details */
127 struct musb_hdrc_config *config; 124 struct musb_hdrc_config *config;
128 125
129 /* Architecture specific board data */ 126 /* Architecture specific board data */
130 void *board_data; 127 void *board_data;
128
129 /* Platform specific struct musb_ops pointer */
130 const void *platform_ops;
131}; 131};
132 132
133 133
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 0a5b3711e502..a1a1e7a73ec9 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -116,7 +116,7 @@ struct otg_transceiver {
116/* for board-specific init logic */ 116/* for board-specific init logic */
117extern int otg_set_transceiver(struct otg_transceiver *); 117extern int otg_set_transceiver(struct otg_transceiver *);
118 118
119#if defined(CONFIG_NOP_USB_XCEIV) || defined(CONFIG_NOP_USB_XCEIV_MODULE) 119#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
120/* sometimes transceivers are accessed only through e.g. ULPI */ 120/* sometimes transceivers are accessed only through e.g. ULPI */
121extern void usb_nop_xceiv_register(void); 121extern void usb_nop_xceiv_register(void);
122extern void usb_nop_xceiv_unregister(void); 122extern void usb_nop_xceiv_unregister(void);