summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle McMartin <kyle@mcmartin.ca>2010-10-26 13:05:04 -0400
committerKyle McMartin <kyle@mcmartin.ca>2010-10-26 13:05:04 -0400
commit3daa57b3d93c5d0a795e3446850c83483df37f2e (patch)
treeb7180846ac827be0456498f39eb2adf67c18ec39
parentc22cea221f8de78ab36ce0f183b73c99031cc7dc (diff)
downloadkernel-3daa57b3d93c5d0a795e3446850c83483df37f2e.tar.gz
kernel-3daa57b3d93c5d0a795e3446850c83483df37f2e.tar.xz
kernel-3daa57b3d93c5d0a795e3446850c83483df37f2e.zip
Linux 2.6.36-git8
-rw-r--r--.gitignore1
-rw-r--r--Makefile2
-rw-r--r--btusb-macbookpro-6-2.patch41
-rw-r--r--btusb-macbookpro-7-1.patch42
-rw-r--r--config-debug1
-rw-r--r--config-generic43
-rw-r--r--config-nodebug1
-rw-r--r--config-powerpc-generic2
-rw-r--r--config-x86-generic10
-rw-r--r--config-x86_64-generic9
-rw-r--r--kernel.spec39
-rw-r--r--linux-2.6-qcserial-autosuspend.patch23
-rw-r--r--linux-2.6-utrace.patch2
-rw-r--r--sources1
-rw-r--r--wacom-01-add-fuzz-parameters-to-features.patch69
-rw-r--r--wacom-02-parse-the-bamboo-device-family.patch122
-rw-r--r--wacom-03-collect-device-quirks-into-single-function.patch107
-rw-r--r--wacom-04-add-support-for-the-bamboo-touch-trackpad.patch172
-rw-r--r--wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch69
-rw-r--r--wacom-06-request-tablet-data-for-bamboo-pens.patch55
-rw-r--r--wacom-07-move-bamboo-touch-irq-to-its-own-function.patch52
-rw-r--r--wacom-08-add-support-for-bamboo-pen.patch130
-rw-r--r--wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch31
-rw-r--r--xhci_hcd-suspend-resume.patch1289
24 files changed, 72 insertions, 2241 deletions
diff --git a/.gitignore b/.gitignore
index c2fd41347..a955be81a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ patch-*.bz2
clog
*.rpm
kernel-2.6.*/
+/patch-2.6.36-git8.bz2
diff --git a/Makefile b/Makefile
index 2bba607ef..8e3e84130 100644
--- a/Makefile
+++ b/Makefile
@@ -77,6 +77,7 @@ debug:
@perl -pi -e 's/# CONFIG_DEBUG_CFQ_IOSCHED is not set/CONFIG_DEBUG_CFQ_IOSCHED=y/' config-nodebug
@perl -pi -e 's/# CONFIG_DRBD_FAULT_INJECTION is not set/CONFIG_DRBD_FAULT_INJECTION=y/' config-nodebug
@perl -pi -e 's/# CONFIG_ATH_DEBUG is not set/CONFIG_ATH_DEBUG=y/' config-nodebug
+ @perl -pi -e 's/# CONFIG_CARL9170_DEBUGFS is not set/CONFIG_CARL9170_DEBUGFS=y/' config-nodebug
@perl -pi -e 's/# CONFIG_IWLWIFI_DEVICE_TRACING is not set/CONFIG_IWLWIFI_DEVICE_TRACING=y/' config-nodebug
@perl -pi -e 's/# CONFIG_DEBUG_OBJECTS_WORK is not set/CONFIG_DEBUG_OBJECTS_WORK=y/' config-nodebug
@perl -pi -e 's/# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set/CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y/' config-nodebug
@@ -149,6 +150,7 @@ release:
@perl -pi -e 's/CONFIG_DEBUG_CFQ_IOSCHED=y/# CONFIG_DEBUG_CFQ_IOSCHED is not set/' config-nodebug
@perl -pi -e 's/CONFIG_DRBD_FAULT_INJECTION=y/# CONFIG_DRBD_FAULT_INJECTION is not set/' config-nodebug
@perl -pi -e 's/CONFIG_ATH_DEBUG=y/# CONFIG_ATH_DEBUG is not set/' config-nodebug
+ @perl -pi -e 's/CONFIG_CARL9170_DEBUGFS=y/# CONFIG_CARL9170_DEBUGFS is not set/' config-nodebug
@perl -pi -e 's/CONFIG_IWLWIFI_DEVICE_TRACING=y/# CONFIG_IWLWIFI_DEVICE_TRACING is not set/' config-nodebug
@perl -pi -e 's/CONFIG_DEBUG_OBJECTS_WORK=y/# CONFIG_DEBUG_OBJECTS_WORK is not set/' config-nodebug
@perl -pi -e 's/CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y/# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set/' config-nodebug
diff --git a/btusb-macbookpro-6-2.patch b/btusb-macbookpro-6-2.patch
deleted file mode 100644
index d65a30960..000000000
--- a/btusb-macbookpro-6-2.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From kernel-bounces@lists.fedoraproject.org Fri Sep 17 17:09:15 2010
-From: Will Woods <wwoods@redhat.com>
-To: Marcel Holtmann <marcel@holtmann.org>
-Subject: [PATCH 2/2] bluetooth: add support for controller in MacBookPro6,2
-Date: Fri, 17 Sep 2010 17:09:21 -0400
-
-Once again the device class is ff(vend.) instead of e0(wlcon).
-
-output from 'usb-devices':
-T: Bus=01 Lev=03 Prnt=03 Port=02 Cnt=03 Dev#= 8 Spd=12 MxCh= 0
-D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
-P: Vendor=05ac ProdID=8218 Rev=00.22
-S: Manufacturer=Apple Inc.
-S: Product=Bluetooth USB Host Controller
-C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
-I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
-I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
-I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
-I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
-
-Signed-off-by: Will Woods <wwoods@redhat.com>
----
- drivers/bluetooth/btusb.c | 3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-
-diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
-index eac44e4..320e798 100644
---- a/drivers/bluetooth/btusb.c
-+++ b/drivers/bluetooth/btusb.c
-@@ -65,6 +65,9 @@ static struct usb_device_id btusb_table[] = {
- /* Apple iMac11,1 */
- { USB_DEVICE(0x05ac, 0x8215) },
-
-+ /* Apple MacBookPro6,2 */
-+ { USB_DEVICE(0x05ac, 0x8218) },
-+
- /* AVM BlueFRITZ! USB v2.0 */
- { USB_DEVICE(0x057c, 0x3800) },
-
---
-1.7.2.3
diff --git a/btusb-macbookpro-7-1.patch b/btusb-macbookpro-7-1.patch
deleted file mode 100644
index 3e07dd583..000000000
--- a/btusb-macbookpro-7-1.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From kernel-bounces@lists.fedoraproject.org Fri Sep 17 17:09:18 2010
-From: Will Woods <wwoods@redhat.com>
-To: Marcel Holtmann <marcel@holtmann.org>
-Subject: [PATCH 1/2] bluetooth: add support for controller in MacBookPro7,1
-Date: Fri, 17 Sep 2010 17:09:20 -0400
-
-As with iMac11,1 the device class is ff(vend.) instead of e0(wlcon).
-
-output from 'usb-devices':
-T: Bus=04 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0
-D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
-P: Vendor=05ac ProdID=8213 Rev=01.86
-S: Manufacturer=Apple Inc.
-S: Product=Bluetooth USB Host Controller
-S: SerialNumber=58B0359C28ED
-C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
-I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
-I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
-I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
-I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)
-
-Signed-off-by: Will Woods <wwoods@redhat.com>
----
- drivers/bluetooth/btusb.c | 3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-
-diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
-index d22ce3c..eac44e4 100644
---- a/drivers/bluetooth/btusb.c
-+++ b/drivers/bluetooth/btusb.c
-@@ -59,6 +59,9 @@ static struct usb_device_id btusb_table[] = {
- /* Generic Bluetooth USB device */
- { USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
-
-+ /* Apple MacBookPro7,1 */
-+ { USB_DEVICE(0x05ac, 0x8213) },
-+
- /* Apple iMac11,1 */
- { USB_DEVICE(0x05ac, 0x8215) },
-
---
-1.7.2.3
diff --git a/config-debug b/config-debug
index 4e580e255..1675f5c0c 100644
--- a/config-debug
+++ b/config-debug
@@ -74,6 +74,7 @@ CONFIG_DEBUG_CFQ_IOSCHED=y
CONFIG_DRBD_FAULT_INJECTION=y
CONFIG_ATH_DEBUG=y
+CONFIG_CARL9170_DEBUGFS=y
CONFIG_IWLWIFI_DEVICE_TRACING=y
CONFIG_DEBUG_OBJECTS_WORK=y
diff --git a/config-generic b/config-generic
index b97545100..3c3e26060 100644
--- a/config-generic
+++ b/config-generic
@@ -154,6 +154,7 @@ CONFIG_INFINIBAND_AMSO1100=m
# CONFIG_INFINIBAND_AMSO1100_DEBUG is not set
CONFIG_INFINIBAND_CXGB3=m
CONFIG_INFINIBAND_CXGB4=m
+CONFIG_SCSI_CXGB4_ISCSI=m
# CONFIG_INFINIBAND_CXGB3_DEBUG is not set
CONFIG_MLX4_INFINIBAND=m
CONFIG_INFINIBAND_NES=m
@@ -365,6 +366,7 @@ CONFIG_BLK_DEV_DELKIN=m
CONFIG_LBDAF=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_INTEGRITY=y
+CONFIG_BLK_DEV_THROTTLING=y
#
@@ -759,6 +761,7 @@ CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_NF_SECURITY=m
# CONFIG_IP_PNP is not set
CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE_DEMUX=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE=y
@@ -797,6 +800,7 @@ CONFIG_IP_VS_SH=m
CONFIG_IP_VS_SED=m
CONFIG_IP_VS_NQ=m
CONFIG_IP_VS_FTP=m
+CONFIG_IP_VS_PE_SIP=m
CONFIG_IPV6=m
CONFIG_IPV6_PRIVACY=y
@@ -1100,6 +1104,7 @@ CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_SIMP=m
+CONFIG_NET_ACT_CSUM=m
CONFIG_DCB=y
@@ -1150,6 +1155,7 @@ CONFIG_ATM_FORE200E_TX_RETRY=16
CONFIG_ATM_FORE200E_DEBUG=0
CONFIG_ATM_HE=m
+CONFIG_PPTP=m
CONFIG_PPPOATM=m
CONFIG_PPPOL2TP=m
CONFIG_ATM_NICSTAR=m
@@ -1195,6 +1201,7 @@ CONFIG_FIXED_PHY=y
CONFIG_MDIO_BITBANG=m
CONFIG_NATIONAL_PHY=m
CONFIG_ICPLUS_PHY=m
+CONFIG_BCM63XX_PHY=m
CONFIG_LSI_ET1011C_PHY=m
CONFIG_LXT_PHY=m
CONFIG_MARVELL_PHY=m
@@ -1212,6 +1219,12 @@ CONFIG_NET_VENDOR_3COM=y
CONFIG_VORTEX=m
CONFIG_TYPHOON=m
CONFIG_DNET=m
+CONFIG_STMMAC_ETH=m
+# CONFIG_STMMAC_DA is not set
+# CONFIG_STMMAC_DUAL_MAC is not set
+# CONFIG_STMMAC_TIMER is not set
+
+# CONFIG_PCH_GBE is not set
#
# Tulip family network device support
@@ -1329,6 +1342,7 @@ CONFIG_MLX4_EN=m
# CONFIG_MLX4_DEBUG is not set
CONFIG_QLCNIC=m
CONFIG_QLGE=m
+CONFIG_BNA=m
CONFIG_SFC=m
CONFIG_SFC_MTD=y
CONFIG_BE2NET=m
@@ -1408,6 +1422,9 @@ CONFIG_ATH9K=m
CONFIG_ATH9K_DEBUGFS=y
CONFIG_ATH9K_HTC=m
# CONFIG_ATH9K_HTC_DEBUGFS is not set
+CONFIG_ATH9K_RATE_CONTROL=y
+CONFIG_CARL9170=m
+CONFIG_CARL9170_LEDS=y
CONFIG_AT76C50X_USB=m
CONFIG_AIRO=m
CONFIG_AIRO_CS=m
@@ -1462,6 +1479,7 @@ CONFIG_IWL4965=y
CONFIG_IWL5000=y
CONFIG_IWL3945=m
CONFIG_IWL3945_SPECTRUM_MEASUREMENT=y
+# CONFIG_IWLWIFI_DEBUG_EXPERIMENTAL_UCODE is not set
CONFIG_IWM=m
# CONFIG_IWM_DEBUG is not set
# CONFIG_IWM_TRACING is not set
@@ -1800,6 +1818,7 @@ CONFIG_INPUT_TABLET=y
CONFIG_TABLET_USB_ACECAD=m
CONFIG_TABLET_USB_AIPTEK=m
CONFIG_TABLET_USB_GTCO=m
+CONFIG_TABLET_USB_HANWANG=m
CONFIG_TABLET_USB_KBTAB=m
CONFIG_TABLET_USB_WACOM=m
@@ -1823,6 +1842,7 @@ CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=y
CONFIG_SERIO_RAW=m
CONFIG_SERIO_ALTERA_PS2=m
+# CONFIG_SERIO_PS2MULT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
@@ -1916,6 +1936,7 @@ CONFIG_TOUCHSCREEN_USB_E2I=y
CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
# CONFIG_TOUCHSCREEN_WM97XX is not set
CONFIG_TOUCHSCREEN_W90X900=m
+# CONFIG_TOUCHSCREEN_BU21013 is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_PCSPKR=m
@@ -2159,13 +2180,16 @@ CONFIG_SENSORS_ADT7411=m
CONFIG_SENSORS_ASC7621=m
CONFIG_SENSORS_EMC1403=m
CONFIG_SENSORS_TMP102=m
+CONFIG_SENSORS_LTC4261=m
# CONFIG_SENSORS_BH1780 is not set
# CONFIG_SENSORS_JC42 is not set
# CONFIG_SENSORS_SMM665 is not set
# CONFIG_SENSORS_EMC2103 is not set
+# CONFIG_SENSORS_GPIO_FAN is not set
# CONFIG_HMC6352 is not set
# CONFIG_BMP085 is not set
+# CONFIG_PCH_PHUB is not set
CONFIG_W1=m
CONFIG_W1_CON=y
@@ -2747,6 +2771,7 @@ CONFIG_SND_DYNAMIC_MINORS=y
# Generic devices
#
CONFIG_SND_DUMMY=m
+CONFIG_SND_ALOOP=m
CONFIG_SND_VIRMIDI=m
CONFIG_SND_MTPAV=m
CONFIG_SND_MTS64=m
@@ -2765,6 +2790,8 @@ CONFIG_SND_AD1889=m
# CONFIG_SND_WAVEFRONT is not set
# CONFIG_SND_MSND_PINNACLE is not set
# CONFIG_SND_MSND_CLASSIC is not set
+# CONFIG_SND_AZT1605 is not set
+# CONFIG_SND_AZT2316 is not set
#
# PCI devices
@@ -2819,6 +2846,7 @@ CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_INTELHDMI=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_CODEC_NVHDMI=y
+CONFIG_SND_HDA_CODEC_HDMI=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
@@ -2936,6 +2964,8 @@ CONFIG_USB_STORAGE_ONETOUCH=y
CONFIG_USB_STORAGE_ALAUDA=y
CONFIG_USB_STORAGE_KARMA=y
# CONFIG_USB_LIBUSUAL is not set
+CONFIG_USB_UAS=m
+
#
# USB Human Interface Devices (HID)
@@ -2949,6 +2979,7 @@ CONFIG_HID=m
CONFIG_HIDRAW=y
CONFIG_HID_PID=y
CONFIG_LOGITECH_FF=y
+CONFIG_LOGIWII_FF=y
CONFIG_LOGIRUMBLEPAD2_FF=y
CONFIG_PANTHERLORD_FF=y
CONFIG_THRUSTMASTER_FF=y
@@ -2990,7 +3021,9 @@ CONFIG_HID_ZEROPLUS=m
CONFIG_HID_ZYDACRON=m
CONFIG_HID_ACRUX_FF=m
CONFIG_HID_ELECOM=m
-
+CONFIG_HID_UCLOGIC=m
+CONFIG_HID_WALTOP=m
+CONFIG_HID_ROCCAT_PYRA=m
#
# USB Imaging devices
@@ -3091,6 +3124,7 @@ CONFIG_USB_NET_RNDIS_HOST=m
CONFIG_USB_NET_CDC_SUBSET=m
CONFIG_USB_NET_CDC_EEM=m
CONFIG_USB_NET_ZAURUS=m
+CONFIG_USB_NET_CX82310_ETH=m
CONFIG_USB_NET_INT51X1=m
CONFIG_USB_CDC_PHONET=m
CONFIG_USB_IPHETH=m
@@ -3183,6 +3217,7 @@ CONFIG_USB_SERIAL_QCAUX=m
CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m
CONFIG_USB_SERIAL_DEBUG=m
CONFIG_USB_SERIAL_SSU100=m
+CONFIG_USB_SERIAL_SAMBA=m
CONFIG_USB_EZUSB=y
CONFIG_USB_EMI62=m
@@ -3216,6 +3251,7 @@ CONFIG_USB_FILE_STORAGE=m
# CONFIG_USB_OXU210HP_HCD is not set
CONFIG_USB_IOWARRIOR=m
CONFIG_USB_ISIGHTFW=m
+CONFIG_USB_YUREX=m
CONFIG_USB_VST=m
CONFIG_USB_LCD=m
CONFIG_USB_LD=m
@@ -3445,6 +3481,7 @@ CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFS_FSCACHE=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
+# CONFIG_NFS_USE_NEW_IDMAPPER is not set
CONFIG_LOCKD=m
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=m
@@ -3747,6 +3784,7 @@ CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_SYSFS_DEPRECATED_V2 is not set
CONFIG_RELAY=y
@@ -4065,8 +4103,6 @@ CONFIG_RESOURCE_COUNTERS=y
#FIXME: x86 generic?
CONFIG_LEDS_CLEVO_MAIL=m
CONFIG_I8K=m
-CONFIG_EDAC_I3000=m
-CONFIG_EDAC_X38=m
CONFIG_INPUT_APANEL=m
# CONFIG_INTEL_MENLOW is not set
@@ -4117,6 +4153,7 @@ CONFIG_NET_SCH_MULTIQ=m
CONFIG_NET_ACT_SKBEDIT=m
CONFIG_PHONET=m
+# CONFIG_PHONET_PIPECTRLR is not set
CONFIG_ICS932S401=m
# CONFIG_C2PORT is not set
diff --git a/config-nodebug b/config-nodebug
index c70de44a8..4e5e220f9 100644
--- a/config-nodebug
+++ b/config-nodebug
@@ -74,6 +74,7 @@ CONFIG_DEBUG_CFQ_IOSCHED=y
CONFIG_DRBD_FAULT_INJECTION=y
CONFIG_ATH_DEBUG=y
+CONFIG_CARL9170_DEBUGFS=y
CONFIG_IWLWIFI_DEVICE_TRACING=y
CONFIG_DEBUG_OBJECTS_WORK=y
diff --git a/config-powerpc-generic b/config-powerpc-generic
index 0effe3d0d..1b05f4a90 100644
--- a/config-powerpc-generic
+++ b/config-powerpc-generic
@@ -334,3 +334,5 @@ CONFIG_SERIAL_GRLIB_GAISLER_APBUART=m
# CONFIG_GPIO_SCH is not set
# CONFIG_PPC_MPC512x is not set
+
+CONFIG_KVM_GUEST=y
diff --git a/config-x86-generic b/config-x86-generic
index 616fae957..8f19cd311 100644
--- a/config-x86-generic
+++ b/config-x86-generic
@@ -284,6 +284,9 @@ CONFIG_EDAC_R82600=m
CONFIG_EDAC_AMD8131=m
CONFIG_EDAC_AMD8111=m
CONFIG_EDAC_I7CORE=m
+CONFIG_EDAC_I3000=m
+CONFIG_EDAC_I7300=m
+CONFIG_EDAC_X38=m
CONFIG_SCHED_MC=y
@@ -309,6 +312,7 @@ CONFIG_EEEPC_LAPTOP=m
CONFIG_EEEPC_WMI=m
CONFIG_FUJITSU_LAPTOP=m
# CONFIG_FUJITSU_LAPTOP_DEBUG is not set
+CONFIG_IDEAPAD_LAPTOP=m
CONFIG_MSI_LAPTOP=m
CONFIG_SONY_LAPTOP=m
CONFIG_DELL_LAPTOP=m
@@ -352,6 +356,7 @@ CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_SPINLOCKS is not set
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
+CONFIG_KVM_MMU_AUDIT=y # default $x would be nice...
CONFIG_LGUEST_GUEST=y
CONFIG_VMI=y
@@ -506,9 +511,14 @@ CONFIG_XEN_PLATFORM_PCI=m
# CONFIG_ACPI_QUICKSTART is not set
CONFIG_IDEAPAD_ACPI=m
CONFIG_INTEL_IPS=m
+# CONFIG_IBM_RTL is not set
CONFIG_OLPC_XO1=m
+CONFIG_XO1_RFKILL=m
CONFIG_EDAC_MCE_INJ=m
CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_X86_RESERVE_LOW=64
+
+CONFIG_PCH_GBE=m
+CONFIG_PCH_PHUB=m
diff --git a/config-x86_64-generic b/config-x86_64-generic
index 069aaf56d..caad92abf 100644
--- a/config-x86_64-generic
+++ b/config-x86_64-generic
@@ -204,6 +204,9 @@ CONFIG_EDAC_AMD64=m
# CONFIG_EDAC_AMD64_ERROR_INJECTION is not set
CONFIG_EDAC_DECODE_MCE=m
CONFIG_EDAC_I7CORE=m
+CONFIG_EDAC_I3000=m
+CONFIG_EDAC_I7300=m
+CONFIG_EDAC_X38=m
CONFIG_SCHED_MC=y
@@ -284,6 +287,7 @@ CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_SPINLOCKS is not set
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
+CONFIG_KVM_MMU_AUDIT=y
CONFIG_XEN=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=32
@@ -419,7 +423,12 @@ CONFIG_XEN_PLATFORM_PCI=m
# CONFIG_ACPI_QUICKSTART is not set
CONFIG_IDEAPAD_ACPI=m
CONFIG_INTEL_IPS=m
+CONFIG_IDEAPAD_LAPTOP=m
+# CONFIG_IBM_RTL is not set
CONFIG_EDAC_MCE_INJ=m
CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_X86_RESERVE_LOW=64
+
+CONFIG_PCH_GBE=m
+CONFIG_PCH_PHUB=m
diff --git a/kernel.spec b/kernel.spec
index 758ae5248..e8a00a281 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -84,7 +84,7 @@ Summary: The Linux kernel
# The rc snapshot level
%define rcrev 0
# The git snapshot level
-%define gitrev 2
+%define gitrev 8
# Set rpm version accordingly
%define rpmversion 2.6.%{upstream_sublevel}
%endif
@@ -696,36 +696,19 @@ Patch12018: neuter_intel_microcode_load.patch
Patch12030: tpm-fix-stall-on-boot.patch
-# Wacom Bamboo
-Patch12100: wacom-01-add-fuzz-parameters-to-features.patch
-Patch12105: wacom-02-parse-the-bamboo-device-family.patch
-Patch12110: wacom-03-collect-device-quirks-into-single-function.patch
-Patch12115: wacom-04-add-support-for-the-bamboo-touch-trackpad.patch
-Patch12120: wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch
-Patch12125: wacom-06-request-tablet-data-for-bamboo-pens.patch
-Patch12130: wacom-07-move-bamboo-touch-irq-to-its-own-function.patch
-Patch12135: wacom-08-add-support-for-bamboo-pen.patch
-Patch12140: wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch
-
# Runtime power management
Patch12200: linux-2.6-bluetooth-autosuspend.patch
Patch12201: linux-2.6-uvc-autosuspend.patch
-Patch12202: linux-2.6-qcserial-autosuspend.patch
Patch12203: linux-2.6-usb-pci-autosuspend.patch
Patch12204: linux-2.6-enable-more-pci-autosuspend.patch
Patch12205: runtime_pm_fixups.patch
Patch12225: pci-crs-fixes.patch
-Patch12300: btusb-macbookpro-7-1.patch
-Patch12301: btusb-macbookpro-6-2.patch
-
Patch12302: pnpacpi-cope-with-invalid-device-ids.patch
Patch12303: dmar-disable-when-ricoh-multifunction.patch
-Patch12305: xhci_hcd-suspend-resume.patch
-
%endif
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1306,21 +1289,9 @@ ApplyPatch neuter_intel_microcode_load.patch
# try to fix stalls during boot (#530393)
ApplyPatch tpm-fix-stall-on-boot.patch
-# Wacom Bamboo
-ApplyPatch wacom-01-add-fuzz-parameters-to-features.patch
-ApplyPatch wacom-02-parse-the-bamboo-device-family.patch
-ApplyPatch wacom-03-collect-device-quirks-into-single-function.patch
-ApplyPatch wacom-04-add-support-for-the-bamboo-touch-trackpad.patch
-ApplyPatch wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch
-ApplyPatch wacom-06-request-tablet-data-for-bamboo-pens.patch
-ApplyPatch wacom-07-move-bamboo-touch-irq-to-its-own-function.patch
-ApplyPatch wacom-08-add-support-for-bamboo-pen.patch
-ApplyPatch wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch
-
# Runtime PM
ApplyPatch linux-2.6-bluetooth-autosuspend.patch
ApplyPatch linux-2.6-uvc-autosuspend.patch
-ApplyPatch linux-2.6-qcserial-autosuspend.patch
ApplyPatch linux-2.6-usb-pci-autosuspend.patch
ApplyPatch linux-2.6-enable-more-pci-autosuspend.patch
ApplyPatch runtime_pm_fixups.patch
@@ -1329,17 +1300,12 @@ ApplyPatch runtime_pm_fixups.patch
# ( from linux-pci list )
ApplyPatch pci-crs-fixes.patch
-ApplyPatch btusb-macbookpro-7-1.patch
-ApplyPatch btusb-macbookpro-6-2.patch
-
# rhbz#641468
ApplyPatch pnpacpi-cope-with-invalid-device-ids.patch
# rhbz#605888
ApplyPatch dmar-disable-when-ricoh-multifunction.patch
-ApplyPatch xhci_hcd-suspend-resume.patch
-
# END OF PATCH APPLICATIONS
%endif
@@ -1947,6 +1913,9 @@ fi
# || ||
%changelog
+* Tue Oct 26 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.1.rc0.git8
+- Linux 2.6.36-git8
+
* Fri Oct 22 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.1.rc0.git2
- Switch to tracking git snapshots of what will become 2.6.37.
- Fix context rejects in utrace and a few other patches.
diff --git a/linux-2.6-qcserial-autosuspend.patch b/linux-2.6-qcserial-autosuspend.patch
deleted file mode 100644
index 524898813..000000000
--- a/linux-2.6-qcserial-autosuspend.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-commit 0fe584342da141957c8642191b508ad39e9b19e6
-Author: Matthew Garrett <mjg@redhat.com>
-Date: Thu Sep 16 13:39:31 2010 -0400
-
- usbserial: Enable USB autosuspend by default on qcserial
-
- Seems to work fine in my testing.
-
- Signed-off-by: Matthew Garrett <mjg@redhat.com>
-
-diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
-index cde67ca..2846ad8 100644
---- a/drivers/usb/serial/qcserial.c
-+++ b/drivers/usb/serial/qcserial.c
-@@ -118,6 +118,8 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
-
- spin_lock_init(&data->susp_lock);
-
-+ usb_enable_autosuspend(serial->dev);
-+
- switch (nintf) {
- case 1:
- /* QDL mode */
diff --git a/linux-2.6-utrace.patch b/linux-2.6-utrace.patch
index d9f81cdf7..c50b83ea8 100644
--- a/linux-2.6-utrace.patch
+++ b/linux-2.6-utrace.patch
@@ -44,7 +44,7 @@ index 34929f2..884c36b 100644
+++ b/Documentation/DocBook/Makefile
@@ -14,7 +14,7 @@ DOCBOOKS := z8530book.xml mcabook.xml de
genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
- mac80211.xml debugobjects.xml sh.xml regulator.xml \
+ 80211.xml debugobjects.xml sh.xml regulator.xml \
alsa-driver-api.xml writing-an-alsa-driver.xml \
- tracepoint.xml media.xml drm.xml
+ tracepoint.xml utrace.xml media.xml drm.xml
diff --git a/sources b/sources
index a51803471..de3496585 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2
+1ae3ad96ed31fb8d40384add909bf994 patch-2.6.36-git8.bz2
diff --git a/wacom-01-add-fuzz-parameters-to-features.patch b/wacom-01-add-fuzz-parameters-to-features.patch
deleted file mode 100644
index 4162726d3..000000000
--- a/wacom-01-add-fuzz-parameters-to-features.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From: Henrik Rydberg <rydberg@euromail.se>
-Date: Sun, 5 Sep 2010 19:25:11 +0000 (-0700)
-Subject: Input: wacom - add fuzz parameters to features
-X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=fed87e655a2c20468d628b37424af58287803afe
-
-Input: wacom - add fuzz parameters to features
-
-The signal-to-noise ratio varies between devices, but currently all
-devices are treated the same way. Add fuzz parameters to the feature
-struct, allowing for tailored treatment of devices.
-
-Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-Acked-by: Ping Cheng <pingc@wacom.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
----
-
-diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
-index 42ba369..e510e4f 100644
---- a/drivers/input/tablet/wacom_sys.c
-+++ b/drivers/input/tablet/wacom_sys.c
-@@ -333,8 +333,12 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
- struct usb_host_interface *interface = intf->cur_altsetting;
- struct hid_descriptor *hid_desc;
-
-- /* default device to penabled */
-+ /* default features */
- features->device_type = BTN_TOOL_PEN;
-+ features->x_fuzz = 4;
-+ features->y_fuzz = 4;
-+ features->pressure_fuzz = 0;
-+ features->distance_fuzz = 0;
-
- /* only Tablet PCs need to retrieve the info */
- if ((features->type != TABLETPC) && (features->type != TABLETPC2FG))
-diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
-index 6e29bad..6d7e164 100644
---- a/drivers/input/tablet/wacom_wac.c
-+++ b/drivers/input/tablet/wacom_wac.c
-@@ -951,9 +951,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
-
- __set_bit(BTN_TOUCH, input_dev->keybit);
-
-- input_set_abs_params(input_dev, ABS_X, 0, features->x_max, 4, 0);
-- input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 4, 0);
-- input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 0, 0);
-+ input_set_abs_params(input_dev, ABS_X, 0, features->x_max,
-+ features->x_fuzz, 0);
-+ input_set_abs_params(input_dev, ABS_Y, 0, features->y_max,
-+ features->y_fuzz, 0);
-+ input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max,
-+ features->pressure_fuzz, 0);
-
- __set_bit(ABS_MISC, input_dev->absbit);
-
-diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
-index 99e1a54..d769e9a 100644
---- a/drivers/input/tablet/wacom_wac.h
-+++ b/drivers/input/tablet/wacom_wac.h
-@@ -73,6 +73,10 @@ struct wacom_features {
- int y_phy;
- unsigned char unit;
- unsigned char unitExpo;
-+ int x_fuzz;
-+ int y_fuzz;
-+ int pressure_fuzz;
-+ int distance_fuzz;
- };
-
- struct wacom_shared {
diff --git a/wacom-02-parse-the-bamboo-device-family.patch b/wacom-02-parse-the-bamboo-device-family.patch
deleted file mode 100644
index f24d04d01..000000000
--- a/wacom-02-parse-the-bamboo-device-family.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From: Ping Cheng <pinglinux@gmail.com>
-Date: Sun, 5 Sep 2010 19:25:40 +0000 (-0700)
-Subject: Input: wacom - parse the Bamboo device family
-X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=4a88081e739a41d6d70bace7e0a027f9054ab540
-
-Input: wacom - parse the Bamboo device family
-
-The Bamboo devices have multiple interfaces which need to be setup
-separately. Use the HID parsing mechanism to achieve that.
-
-Signed-off-by: Ping Cheng <pinglinux@gmail.com>
-Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
----
-
-diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
-index e510e4f..98cba08 100644
---- a/drivers/input/tablet/wacom_sys.c
-+++ b/drivers/input/tablet/wacom_sys.c
-@@ -195,17 +195,30 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
- features->pktlen = WACOM_PKGLEN_TPC2FG;
- features->device_type = BTN_TOOL_TRIPLETAP;
- }
-- features->x_max =
-- get_unaligned_le16(&report[i + 3]);
-- features->x_phy =
-- get_unaligned_le16(&report[i + 6]);
-- features->unit = report[i + 9];
-- features->unitExpo = report[i + 11];
-- i += 12;
-+ if (features->type == BAMBOO_PT) {
-+ /* need to reset back */
-+ features->pktlen = WACOM_PKGLEN_BBTOUCH;
-+ features->device_type = BTN_TOOL_TRIPLETAP;
-+ features->x_phy =
-+ get_unaligned_le16(&report[i + 5]);
-+ features->x_max =
-+ get_unaligned_le16(&report[i + 8]);
-+ i += 15;
-+ } else {
-+ features->x_max =
-+ get_unaligned_le16(&report[i + 3]);
-+ features->x_phy =
-+ get_unaligned_le16(&report[i + 6]);
-+ features->unit = report[i + 9];
-+ features->unitExpo = report[i + 11];
-+ i += 12;
-+ }
- } else if (pen) {
- /* penabled only accepts exact bytes of data */
- if (features->type == TABLETPC2FG)
- features->pktlen = WACOM_PKGLEN_GRAPHIRE;
-+ if (features->type == BAMBOO_PT)
-+ features->pktlen = WACOM_PKGLEN_BBFUN;
- features->device_type = BTN_TOOL_PEN;
- features->x_max =
- get_unaligned_le16(&report[i + 3]);
-@@ -234,6 +247,15 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
- features->y_phy =
- get_unaligned_le16(&report[i + 6]);
- i += 7;
-+ } else if (features->type == BAMBOO_PT) {
-+ /* need to reset back */
-+ features->pktlen = WACOM_PKGLEN_BBTOUCH;
-+ features->device_type = BTN_TOOL_TRIPLETAP;
-+ features->y_phy =
-+ get_unaligned_le16(&report[i + 3]);
-+ features->y_max =
-+ get_unaligned_le16(&report[i + 6]);
-+ i += 12;
- } else {
- features->y_max =
- features->x_max;
-@@ -245,6 +267,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
- /* penabled only accepts exact bytes of data */
- if (features->type == TABLETPC2FG)
- features->pktlen = WACOM_PKGLEN_GRAPHIRE;
-+ if (features->type == BAMBOO_PT)
-+ features->pktlen = WACOM_PKGLEN_BBFUN;
- features->device_type = BTN_TOOL_PEN;
- features->y_max =
- get_unaligned_le16(&report[i + 3]);
-@@ -341,7 +365,8 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
- features->distance_fuzz = 0;
-
- /* only Tablet PCs need to retrieve the info */
-- if ((features->type != TABLETPC) && (features->type != TABLETPC2FG))
-+ if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) &&
-+ (features->type != BAMBOO_PT))
- goto out;
-
- if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
-@@ -499,7 +524,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
-
- strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
-
-- if (features->type == TABLETPC || features->type == TABLETPC2FG) {
-+ if (features->type == TABLETPC || features->type == TABLETPC2FG ||
-+ features->type == BAMBOO_PT) {
- /* Append the device type to the name */
- strlcat(wacom_wac->name,
- features->device_type == BTN_TOOL_PEN ?
-diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
-index d769e9a..fb30895 100644
---- a/drivers/input/tablet/wacom_wac.h
-+++ b/drivers/input/tablet/wacom_wac.h
-@@ -21,6 +21,7 @@
- #define WACOM_PKGLEN_INTUOS 10
- #define WACOM_PKGLEN_TPC1FG 5
- #define WACOM_PKGLEN_TPC2FG 14
-+#define WACOM_PKGLEN_BBTOUCH 20
-
- /* device IDs */
- #define STYLUS_DEVICE_ID 0x02
-@@ -44,6 +45,7 @@ enum {
- PTU,
- PL,
- DTU,
-+ BAMBOO_PT,
- INTUOS,
- INTUOS3S,
- INTUOS3,
diff --git a/wacom-03-collect-device-quirks-into-single-function.patch b/wacom-03-collect-device-quirks-into-single-function.patch
deleted file mode 100644
index 7bf768770..000000000
--- a/wacom-03-collect-device-quirks-into-single-function.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From: Henrik Rydberg <rydberg@euromail.se>
-Date: Sun, 5 Sep 2010 19:26:16 +0000 (-0700)
-Subject: Input: wacom - collect device quirks into single function
-X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=bc73dd39e78dd6e5b34cd938b7f037a8bc041bdd
-
-Input: wacom - collect device quirks into single function
-
-Collect device-specific code into a single function, and use quirks to
-flag specific behavior instead.
-
-Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-Acked-by: Ping Cheng <pingc@wacom.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
----
-
-diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
-index 284dfaa..de5adb1 100644
---- a/drivers/input/tablet/wacom.h
-+++ b/drivers/input/tablet/wacom.h
-@@ -118,6 +118,7 @@ struct wacom {
- extern const struct usb_device_id wacom_ids[];
-
- void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len);
-+void wacom_setup_device_quirks(struct wacom_features *features);
- void wacom_setup_input_capabilities(struct input_dev *input_dev,
- struct wacom_wac *wacom_wac);
- #endif
-diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
-index 98cba08..fc6fd53 100644
---- a/drivers/input/tablet/wacom_sys.c
-+++ b/drivers/input/tablet/wacom_sys.c
-@@ -381,12 +381,6 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
- if (error)
- goto out;
-
-- /* touch device found but size is not defined. use default */
-- if (features->device_type == BTN_TOOL_DOUBLETAP && !features->x_max) {
-- features->x_max = 1023;
-- features->y_max = 1023;
-- }
--
- out:
- return error;
- }
-@@ -522,10 +516,11 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
- if (error)
- goto fail2;
-
-+ wacom_setup_device_quirks(features);
-+
- strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
-
-- if (features->type == TABLETPC || features->type == TABLETPC2FG ||
-- features->type == BAMBOO_PT) {
-+ if (features->quirks & WACOM_QUIRK_MULTI_INPUT) {
- /* Append the device type to the name */
- strlcat(wacom_wac->name,
- features->device_type == BTN_TOOL_PEN ?
-diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
-index 6d7e164..44b4a59 100644
---- a/drivers/input/tablet/wacom_wac.c
-+++ b/drivers/input/tablet/wacom_wac.c
-@@ -941,6 +941,22 @@ static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
- input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0);
- }
-
-+
-+void wacom_setup_device_quirks(struct wacom_features *features)
-+{
-+
-+ /* touch device found but size is not defined. use default */
-+ if (features->device_type == BTN_TOOL_DOUBLETAP && !features->x_max) {
-+ features->x_max = 1023;
-+ features->y_max = 1023;
-+ }
-+
-+ /* these device have multiple inputs */
-+ if (features->type == TABLETPC || features->type == TABLETPC2FG ||
-+ features->type == BAMBOO_PT)
-+ features->quirks |= WACOM_QUIRK_MULTI_INPUT;
-+}
-+
- void wacom_setup_input_capabilities(struct input_dev *input_dev,
- struct wacom_wac *wacom_wac)
- {
-diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
-index fb30895..6a1ff10 100644
---- a/drivers/input/tablet/wacom_wac.h
-+++ b/drivers/input/tablet/wacom_wac.h
-@@ -38,6 +38,9 @@
- #define WACOM_REPORT_TPC1FG 6
- #define WACOM_REPORT_TPC2FG 13
-
-+/* device quirks */
-+#define WACOM_QUIRK_MULTI_INPUT 0x0001
-+
- enum {
- PENPARTNER = 0,
- GRAPHIRE,
-@@ -79,6 +82,7 @@ struct wacom_features {
- int y_fuzz;
- int pressure_fuzz;
- int distance_fuzz;
-+ unsigned quirks;
- };
-
- struct wacom_shared {
diff --git a/wacom-04-add-support-for-the-bamboo-touch-trackpad.patch b/wacom-04-add-support-for-the-bamboo-touch-trackpad.patch
deleted file mode 100644
index f104b2ce3..000000000
--- a/wacom-04-add-support-for-the-bamboo-touch-trackpad.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-From: Henrik Rydberg <rydberg@euromail.se>
-Date: Sun, 5 Sep 2010 19:53:16 +0000 (-0700)
-Subject: Input: wacom - add support for the Bamboo Touch trackpad
-X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=cb734c03680eaaad64a20a666300eafd1ac260b2
-
-Input: wacom - add support for the Bamboo Touch trackpad
-
-Add support for the Bamboo Touch trackpad, and make it work with
-both the Synaptics X Driver and the Multitouch X Driver. The device
-uses MT slots internally, so the choice of protocol is a given.
-
-Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-Acked-by: Ping Cheng <pingc@wacom.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
----
-
-diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
-index 44b4a59..4e9b1dd 100644
---- a/drivers/input/tablet/wacom_wac.c
-+++ b/drivers/input/tablet/wacom_wac.c
-@@ -855,6 +855,53 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
- return retval;
- }
-
-+static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
-+{
-+ struct input_dev *input = wacom->input;
-+ unsigned char *data = wacom->data;
-+ int sp = 0, sx = 0, sy = 0, count = 0;
-+ int i;
-+
-+ if (len != WACOM_PKGLEN_BBTOUCH)
-+ return 0;
-+
-+ for (i = 0; i < 2; i++) {
-+ int p = data[9 * i + 2];
-+ input_mt_slot(input, i);
-+ if (p) {
-+ int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff;
-+ int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff;
-+ input_report_abs(input, ABS_MT_PRESSURE, p);
-+ input_report_abs(input, ABS_MT_POSITION_X, x);
-+ input_report_abs(input, ABS_MT_POSITION_Y, y);
-+ if (wacom->id[i] < 0)
-+ wacom->id[i] = wacom->trk_id++ & MAX_TRACKING_ID;
-+ if (!count++)
-+ sp = p, sx = x, sy = y;
-+ } else {
-+ wacom->id[i] = -1;
-+ }
-+ input_report_abs(input, ABS_MT_TRACKING_ID, wacom->id[i]);
-+ }
-+
-+ input_report_key(input, BTN_TOUCH, count > 0);
-+ input_report_key(input, BTN_TOOL_FINGER, count == 1);
-+ input_report_key(input, BTN_TOOL_DOUBLETAP, count == 2);
-+
-+ input_report_abs(input, ABS_PRESSURE, sp);
-+ input_report_abs(input, ABS_X, sx);
-+ input_report_abs(input, ABS_Y, sy);
-+
-+ input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
-+ input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
-+ input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
-+ input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
-+
-+ input_sync(input);
-+
-+ return 0;
-+}
-+
- void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
- {
- bool sync;
-@@ -900,6 +947,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
- sync = wacom_tpc_irq(wacom_wac, len);
- break;
-
-+ case BAMBOO_PT:
-+ sync = wacom_bpt_irq(wacom_wac, len);
-+ break;
-+
- default:
- sync = false;
- break;
-@@ -955,6 +1006,13 @@ void wacom_setup_device_quirks(struct wacom_features *features)
- if (features->type == TABLETPC || features->type == TABLETPC2FG ||
- features->type == BAMBOO_PT)
- features->quirks |= WACOM_QUIRK_MULTI_INPUT;
-+
-+ /* quirks for bamboo touch */
-+ if (features->type == BAMBOO_PT &&
-+ features->device_type == BTN_TOOL_TRIPLETAP) {
-+ features->pressure_max = 256;
-+ features->pressure_fuzz = 16;
-+ }
- }
-
- void wacom_setup_input_capabilities(struct input_dev *input_dev,
-@@ -1095,6 +1153,33 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
- case PENPARTNER:
- __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
- break;
-+
-+ case BAMBOO_PT:
-+ __clear_bit(ABS_MISC, input_dev->absbit);
-+
-+ if (features->device_type == BTN_TOOL_TRIPLETAP) {
-+ __set_bit(BTN_LEFT, input_dev->keybit);
-+ __set_bit(BTN_FORWARD, input_dev->keybit);
-+ __set_bit(BTN_BACK, input_dev->keybit);
-+ __set_bit(BTN_RIGHT, input_dev->keybit);
-+
-+ __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
-+ __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
-+
-+ input_mt_create_slots(input_dev, 2);
-+ input_set_abs_params(input_dev, ABS_MT_POSITION_X,
-+ 0, features->x_max,
-+ features->x_fuzz, 0);
-+ input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
-+ 0, features->y_max,
-+ features->y_fuzz, 0);
-+ input_set_abs_params(input_dev, ABS_MT_PRESSURE,
-+ 0, features->pressure_max,
-+ features->pressure_fuzz, 0);
-+ input_set_abs_params(input_dev, ABS_MT_TRACKING_ID, 0,
-+ MAX_TRACKING_ID, 0, 0);
-+ }
-+ break;
- }
- }
-
-@@ -1232,6 +1317,8 @@ static const struct wacom_features wacom_features_0xE3 =
- { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG };
- static const struct wacom_features wacom_features_0x47 =
- { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS };
-+static struct wacom_features wacom_features_0xD0 =
-+ { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT };
-
- #define USB_DEVICE_WACOM(prod) \
- USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
-@@ -1296,6 +1383,7 @@ const struct usb_device_id wacom_ids[] = {
- { USB_DEVICE_WACOM(0xC6) },
- { USB_DEVICE_WACOM(0xC7) },
- { USB_DEVICE_WACOM(0xCE) },
-+ { USB_DEVICE_WACOM(0xD0) },
- { USB_DEVICE_WACOM(0xF0) },
- { USB_DEVICE_WACOM(0xCC) },
- { USB_DEVICE_WACOM(0x90) },
-diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
-index 6a1ff10..a23d6a5 100644
---- a/drivers/input/tablet/wacom_wac.h
-+++ b/drivers/input/tablet/wacom_wac.h
-@@ -41,6 +41,9 @@
- /* device quirks */
- #define WACOM_QUIRK_MULTI_INPUT 0x0001
-
-+/* largest reported tracking id */
-+#define MAX_TRACKING_ID 0xfff
-+
- enum {
- PENPARTNER = 0,
- GRAPHIRE,
-@@ -96,6 +99,7 @@ struct wacom_wac {
- int id[3];
- __u32 serial[2];
- int last_finger;
-+ int trk_id;
- struct wacom_features features;
- struct wacom_shared *shared;
- struct input_dev *input;
diff --git a/wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch b/wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch
deleted file mode 100644
index 1809ec03e..000000000
--- a/wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From: Henrik Rydberg <rydberg@euromail.se>
-Date: Sun, 5 Sep 2010 19:57:13 +0000 (-0700)
-Subject: Input: wacom - add a quirk for low resolution Bamboo devices
-X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=f4ccbef2886968ed409939531f6dd0474d53a12a
-
-Input: wacom - add a quirk for low resolution Bamboo devices
-
-The Bamboo Touch reports a sub-screen resolution of 480x320. The
-signal-to-noise ratio is only about 100, so filtering is needed in
-order to reduce the jitter to a usable level. However, the low
-resolution leads to round-off errors in the EWMA filter, resulting in
-extremely jerky pointer motion. This patch explicitly sets a higher
-resolution for those devices, and tells this to the completion handler
-via a low-resolution quirk.
-
-Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-Acked-by: Ping Cheng <pingc@wacom.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
----
-
-diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
-index 4e9b1dd..2f4411a 100644
---- a/drivers/input/tablet/wacom_wac.c
-+++ b/drivers/input/tablet/wacom_wac.c
-@@ -857,6 +857,7 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
-
- static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
- {
-+ struct wacom_features *features = &wacom->features;
- struct input_dev *input = wacom->input;
- unsigned char *data = wacom->data;
- int sp = 0, sx = 0, sy = 0, count = 0;
-@@ -871,6 +872,10 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
- if (p) {
- int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff;
- int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff;
-+ if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {
-+ x <<= 5;
-+ y <<= 5;
-+ }
- input_report_abs(input, ABS_MT_PRESSURE, p);
- input_report_abs(input, ABS_MT_POSITION_X, x);
- input_report_abs(input, ABS_MT_POSITION_Y, y);
-@@ -1010,8 +1015,13 @@ void wacom_setup_device_quirks(struct wacom_features *features)
- /* quirks for bamboo touch */
- if (features->type == BAMBOO_PT &&
- features->device_type == BTN_TOOL_TRIPLETAP) {
-+ features->x_max <<= 5;
-+ features->y_max <<= 5;
-+ features->x_fuzz <<= 5;
-+ features->y_fuzz <<= 5;
- features->pressure_max = 256;
- features->pressure_fuzz = 16;
-+ features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES;
- }
- }
-
-diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
-index a23d6a5..00ca015 100644
---- a/drivers/input/tablet/wacom_wac.h
-+++ b/drivers/input/tablet/wacom_wac.h
-@@ -40,6 +40,7 @@
-
- /* device quirks */
- #define WACOM_QUIRK_MULTI_INPUT 0x0001
-+#define WACOM_QUIRK_BBTOUCH_LOWRES 0x0002
-
- /* largest reported tracking id */
- #define MAX_TRACKING_ID 0xfff
diff --git a/wacom-06-request-tablet-data-for-bamboo-pens.patch b/wacom-06-request-tablet-data-for-bamboo-pens.patch
deleted file mode 100644
index 8b31d4eab..000000000
--- a/wacom-06-request-tablet-data-for-bamboo-pens.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From: Chris Bagwell <chris@cnpbagwell.com>
-Date: Sun, 12 Sep 2010 07:08:40 +0000 (-0700)
-Subject: Input: wacom - request tablet data for Bamboo Pens
-X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=3dc9f40de4dddf9147b80cf15be633189a2b70f4
-
-Input: wacom - request tablet data for Bamboo Pens
-
-Bamboo P&T need to use second form of usb_set_report() to
-ask to report tablet data.
-
-With previous addition of Bamboo Touch, BTN_TOOL_TRIPLETAP is now used
-for both TABLETPC2FG and BAMBOO_PT types. So reduced check to
-match type=TABLETPC2FG.
-
-This change shows redundant check for !TABLETPC2FG in else statement.
-
-Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
-Acked-by: Ping Cheng <pingc@wacom.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
----
-
-diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
-index fc6fd53..1e3af29 100644
---- a/drivers/input/tablet/wacom_sys.c
-+++ b/drivers/input/tablet/wacom_sys.c
-@@ -319,8 +319,9 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
- if (!rep_data)
- return error;
-
-- /* ask to report tablet data if it is 2FGT or not a Tablet PC */
-- if (features->device_type == BTN_TOOL_TRIPLETAP) {
-+ /* ask to report tablet data if it is 2FGT Tablet PC or
-+ * not a Tablet PC */
-+ if (features->type == TABLETPC2FG) {
- do {
- rep_data[0] = 3;
- rep_data[1] = 4;
-@@ -332,7 +333,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
- WAC_HID_FEATURE_REPORT, report_id,
- rep_data, 3);
- } while ((error < 0 || rep_data[1] != 4) && limit++ < 5);
-- } else if (features->type != TABLETPC && features->type != TABLETPC2FG) {
-+ } else if (features->type != TABLETPC) {
- do {
- rep_data[0] = 2;
- rep_data[1] = 2;
-@@ -364,7 +365,7 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
- features->pressure_fuzz = 0;
- features->distance_fuzz = 0;
-
-- /* only Tablet PCs need to retrieve the info */
-+ /* only Tablet PCs and Bamboo P&T need to retrieve the info */
- if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) &&
- (features->type != BAMBOO_PT))
- goto out;
diff --git a/wacom-07-move-bamboo-touch-irq-to-its-own-function.patch b/wacom-07-move-bamboo-touch-irq-to-its-own-function.patch
deleted file mode 100644
index 7495ac390..000000000
--- a/wacom-07-move-bamboo-touch-irq-to-its-own-function.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From: Chris Bagwell <chris@cnpbagwell.com>
-Date: Sun, 12 Sep 2010 07:09:27 +0000 (-0700)
-Subject: Input: wacom - move Bamboo Touch irq to its own function
-X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=e1d38e49ad97eec5024342e1244279b645e36688
-
-Input: wacom - move Bamboo Touch irq to its own function
-
-This is in preparation of pen support in same irq handler.
-
-Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
-Acked-by: Ping Cheng <pingc@wacom.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
----
-
-diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
-index 2f4411a..2f7ed9a 100644
---- a/drivers/input/tablet/wacom_wac.c
-+++ b/drivers/input/tablet/wacom_wac.c
-@@ -855,7 +855,7 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
- return retval;
- }
-
--static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
-+static int wacom_bpt_touch(struct wacom_wac *wacom)
- {
- struct wacom_features *features = &wacom->features;
- struct input_dev *input = wacom->input;
-@@ -863,9 +863,6 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
- int sp = 0, sx = 0, sy = 0, count = 0;
- int i;
-
-- if (len != WACOM_PKGLEN_BBTOUCH)
-- return 0;
--
- for (i = 0; i < 2; i++) {
- int p = data[9 * i + 2];
- input_mt_slot(input, i);
-@@ -907,6 +904,14 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
- return 0;
- }
-
-+static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
-+{
-+ if (len == WACOM_PKGLEN_BBTOUCH)
-+ return wacom_bpt_touch(wacom);
-+
-+ return 0;
-+}
-+
- void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
- {
- bool sync;
diff --git a/wacom-08-add-support-for-bamboo-pen.patch b/wacom-08-add-support-for-bamboo-pen.patch
deleted file mode 100644
index 319bf6c53..000000000
--- a/wacom-08-add-support-for-bamboo-pen.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-From: Chris Bagwell <chris@cnpbagwell.com>
-Date: Sun, 12 Sep 2010 07:11:35 +0000 (-0700)
-Subject: Input: wacom - add support for Bamboo Pen
-X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=2aaacb153689dbe9064e4db7e9d00de0edfc1fa0
-
-Input: wacom - add support for Bamboo Pen
-
-This adds support for Pen on Bamboo Pen and Bamboo Pen&Touch devices.
-Touchpad is handled by previous Bamboo Touch logic.
-
-Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
-Acked-by: Ping Cheng <pingc@wacom.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
----
-
-diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
-index 2f7ed9a..536156b 100644
---- a/drivers/input/tablet/wacom_wac.c
-+++ b/drivers/input/tablet/wacom_wac.c
-@@ -904,10 +904,75 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
- return 0;
- }
-
-+static int wacom_bpt_pen(struct wacom_wac *wacom)
-+{
-+ struct input_dev *input = wacom->input;
-+ unsigned char *data = wacom->data;
-+ int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
-+
-+ /*
-+ * Similar to Graphire protocol, data[1] & 0x20 is proximity and
-+ * data[1] & 0x18 is tool ID. 0x30 is safety check to ignore
-+ * 2 unused tool ID's.
-+ */
-+ prox = (data[1] & 0x30) == 0x30;
-+
-+ /*
-+ * All reports shared between PEN and RUBBER tool must be
-+ * forced to a known starting value (zero) when transitioning to
-+ * out-of-prox.
-+ *
-+ * If not reset then, to userspace, it will look like lost events
-+ * if new tool comes in-prox with same values as previous tool sent.
-+ *
-+ * Hardware does report zero in most out-of-prox cases but not all.
-+ */
-+ if (prox) {
-+ if (!wacom->shared->stylus_in_proximity) {
-+ if (data[1] & 0x08) {
-+ wacom->tool[0] = BTN_TOOL_RUBBER;
-+ wacom->id[0] = ERASER_DEVICE_ID;
-+ } else {
-+ wacom->tool[0] = BTN_TOOL_PEN;
-+ wacom->id[0] = STYLUS_DEVICE_ID;
-+ }
-+ wacom->shared->stylus_in_proximity = true;
-+ }
-+ x = le16_to_cpup((__le16 *)&data[2]);
-+ y = le16_to_cpup((__le16 *)&data[4]);
-+ p = le16_to_cpup((__le16 *)&data[6]);
-+ d = data[8];
-+ pen = data[1] & 0x01;
-+ btn1 = data[1] & 0x02;
-+ btn2 = data[1] & 0x04;
-+ }
-+
-+ input_report_key(input, BTN_TOUCH, pen);
-+ input_report_key(input, BTN_STYLUS, btn1);
-+ input_report_key(input, BTN_STYLUS2, btn2);
-+
-+ input_report_abs(input, ABS_X, x);
-+ input_report_abs(input, ABS_Y, y);
-+ input_report_abs(input, ABS_PRESSURE, p);
-+ input_report_abs(input, ABS_DISTANCE, d);
-+
-+ if (!prox) {
-+ wacom->id[0] = 0;
-+ wacom->shared->stylus_in_proximity = false;
-+ }
-+
-+ input_report_key(input, wacom->tool[0], prox); /* PEN or RUBBER */
-+ input_report_abs(input, ABS_MISC, wacom->id[0]); /* TOOL ID */
-+
-+ return 1;
-+}
-+
- static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
- {
- if (len == WACOM_PKGLEN_BBTOUCH)
- return wacom_bpt_touch(wacom);
-+ else if (len == WACOM_PKGLEN_BBFUN)
-+ return wacom_bpt_pen(wacom);
-
- return 0;
- }
-@@ -1193,6 +1258,11 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
- features->pressure_fuzz, 0);
- input_set_abs_params(input_dev, ABS_MT_TRACKING_ID, 0,
- MAX_TRACKING_ID, 0, 0);
-+ } else if (features->device_type == BTN_TOOL_PEN) {
-+ __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
-+ __set_bit(BTN_TOOL_PEN, input_dev->keybit);
-+ __set_bit(BTN_STYLUS, input_dev->keybit);
-+ __set_bit(BTN_STYLUS2, input_dev->keybit);
- }
- break;
- }
-@@ -1334,6 +1404,12 @@ static const struct wacom_features wacom_features_0x47 =
- { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS };
- static struct wacom_features wacom_features_0xD0 =
- { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT };
-+static struct wacom_features wacom_features_0xD1 =
-+ { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT };
-+static struct wacom_features wacom_features_0xD2 =
-+ { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT };
-+static struct wacom_features wacom_features_0xD3 =
-+ { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT };
-
- #define USB_DEVICE_WACOM(prod) \
- USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
-@@ -1399,6 +1475,9 @@ const struct usb_device_id wacom_ids[] = {
- { USB_DEVICE_WACOM(0xC7) },
- { USB_DEVICE_WACOM(0xCE) },
- { USB_DEVICE_WACOM(0xD0) },
-+ { USB_DEVICE_WACOM(0xD1) },
-+ { USB_DEVICE_WACOM(0xD2) },
-+ { USB_DEVICE_WACOM(0xD3) },
- { USB_DEVICE_WACOM(0xF0) },
- { USB_DEVICE_WACOM(0xCC) },
- { USB_DEVICE_WACOM(0x90) },
diff --git a/wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch b/wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch
deleted file mode 100644
index e14954031..000000000
--- a/wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Chris Bagwell <chris@cnpbagwell.com>
-Date: Sun, 12 Sep 2010 07:12:28 +0000 (-0700)
-Subject: Input: wacom - disable Bamboo touchpad when pen is being used
-X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=33d5f713a19b0f5cb93e0594f7206d2730cf39da
-
-Input: wacom - disable Bamboo touchpad when pen is being used
-
-Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
-Acked-by: Ping Cheng <pingc@wacom.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
----
-
-diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
-index 536156b..e1b65ba 100644
---- a/drivers/input/tablet/wacom_wac.c
-+++ b/drivers/input/tablet/wacom_wac.c
-@@ -866,7 +866,13 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
- for (i = 0; i < 2; i++) {
- int p = data[9 * i + 2];
- input_mt_slot(input, i);
-- if (p) {
-+ /*
-+ * Touch events need to be disabled while stylus is
-+ * in proximity because user's hand is resting on touchpad
-+ * and sending unwanted events. User expects tablet buttons
-+ * to continue working though.
-+ */
-+ if (p && !wacom->shared->stylus_in_proximity) {
- int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff;
- int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff;
- if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {
diff --git a/xhci_hcd-suspend-resume.patch b/xhci_hcd-suspend-resume.patch
deleted file mode 100644
index ffbaeb421..000000000
--- a/xhci_hcd-suspend-resume.patch
+++ /dev/null
@@ -1,1289 +0,0 @@
-commit 5e5563661948c57f72cc16b3a0cc5dc205ed4900
-Author: Andiry Xu <andiry.xu@amd.com>
-Date: Thu Oct 14 07:23:06 2010 -0700
-
- USB: xHCI: PCI power management implementation
-
- This patch implements the PCI suspend/resume.
-
- Please refer to xHCI spec for doing the suspend/resume operation.
-
- For S3, CSS/SRS in USBCMD is used to save/restore the internal state.
- However, an error maybe occurs while restoring the internal state.
- In this case, it means that HC internal state is wrong and HC will be
- re-initialized.
-
- Signed-off-by: Libin Yang <libin.yang@amd.com>
- Signed-off-by: Dong Nguyen <dong.nguyen@amd.com>
- Signed-off-by: Andiry Xu <andiry.xu@amd.com>
- Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
- Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-commit 96520f33d383c9a3ba1ca571cac5fa75325728f5
-Author: Andiry Xu <andiry.xu@amd.com>
-Date: Thu Oct 14 07:23:03 2010 -0700
-
- USB: xHCI: bus power management implementation
-
- This patch implements xHCI bus suspend/resume function hook.
-
- In the patch it goes through all the ports and suspend/resume
- the ports if needed.
-
- If any port is in remote wakeup, abort bus suspend as what ehci/ohci do.
-
- Signed-off-by: Libin Yang <libin.yang@amd.com>
- Signed-off-by: Crane Cai <crane.cai@amd.com>
- Signed-off-by: Andiry Xu <andiry.xu@amd.com>
- Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
- Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-commit 7b29198e193ab6f5e8bfcd48c59340b8c7689f5c
-Author: Andiry Xu <andiry.xu@amd.com>
-Date: Thu Oct 14 07:23:00 2010 -0700
-
- USB: xHCI: port remote wakeup implementation
-
- This commit implements port remote wakeup.
-
- When a port is in U3 state and resume signaling is detected from a device,
- the port transitions to the Resume state, and the xHC generates a Port Status
- Change Event.
-
- For USB3 port, software write a '0' to the PLS field to complete the resume
- signaling. For USB2 port, the resume should be signaling for at least 20ms,
- irq handler set a timer for port remote wakeup, and then finishes process in
- hub_control GetPortStatus.
-
- Some codes are borrowed from EHCI code.
-
- Signed-off-by: Andiry Xu <andiry.xu@amd.com>
- Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
- Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
-commit 9ada0dec259dfe796a757ff2c9b63a05e6408e5f
-Author: Andiry Xu <andiry.xu@amd.com>
-Date: Thu Oct 14 07:22:57 2010 -0700
-
- USB: xHCI: port power management implementation
-
- Add software trigger USB device suspend resume function hook.
- Do port suspend & resume in terms of xHCI spec.
-
- Port Suspend:
- Stop all endpoints via Stop Endpoint Command with Suspend (SP) flag set.
- Place individual ports into suspend mode by writing '3' for Port Link State
- (PLS) field into PORTSC register. This can only be done when the port is in
- Enabled state. When writing, the Port Link State Write Strobe (LWS) bit shall
- be set to '1'.
- Allocate an xhci_command and stash it in xhci_virt_device to wait completion for
- the last Stop Endpoint Command. Use the Suspend bit in TRB to indicate the Stop
- Endpoint Command is for port suspend. Based on Sarah's suggestion.
-
- Port Resume:
- Write '0' in PLS field, device will transition to running state.
- Ring an endpoints' doorbell to restart it.
-
- Ref: USB device remote wake need another patch to implement. For details of
- how USB subsystem do power management, please see:
- Documentation/usb/power-management.txt
-
- Signed-off-by: Crane Cai <crane.cai@amd.com>
- Signed-off-by: Libin Yang <libin.yang@amd.com>
- Signed-off-by: Andiry Xu <andiry.xu@amd.com>
- Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
- Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
- drivers/usb/host/xhci-hub.c | 424 +++++++++++++++++++++++++++++++++++++++++-
- drivers/usb/host/xhci-mem.c | 4 +
- drivers/usb/host/xhci-pci.c | 36 ++++-
- drivers/usb/host/xhci-ring.c | 101 +++++++++-
- drivers/usb/host/xhci.c | 212 +++++++++++++++++++++-
- drivers/usb/host/xhci.h | 46 +++++-
- 6 files changed, 805 insertions(+), 18 deletions(-)
-
-diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
-index a1a7a97..7f2f63c 100644
---- a/drivers/usb/host/xhci-hub.c
-+++ b/drivers/usb/host/xhci-hub.c
-@@ -24,6 +24,10 @@
-
- #include "xhci.h"
-
-+#define PORT_WAKE_BITS (PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E)
-+#define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \
-+ PORT_RC | PORT_PLC | PORT_PE)
-+
- static void xhci_hub_descriptor(struct xhci_hcd *xhci,
- struct usb_hub_descriptor *desc)
- {
-@@ -123,12 +127,105 @@ static unsigned int xhci_port_speed(unsigned int port_status)
- * writing a 0 clears the bit and writing a 1 sets the bit (RWS).
- * For all other types (RW1S, RW1CS, RW, and RZ), writing a '0' has no effect.
- */
--static u32 xhci_port_state_to_neutral(u32 state)
-+u32 xhci_port_state_to_neutral(u32 state)
- {
- /* Save read-only status and port state */
- return (state & XHCI_PORT_RO) | (state & XHCI_PORT_RWS);
- }
-
-+/*
-+ * find slot id based on port number.
-+ */
-+int xhci_find_slot_id_by_port(struct xhci_hcd *xhci, u16 port)
-+{
-+ int slot_id;
-+ int i;
-+
-+ slot_id = 0;
-+ for (i = 0; i < MAX_HC_SLOTS; i++) {
-+ if (!xhci->devs[i])
-+ continue;
-+ if (xhci->devs[i]->port == port) {
-+ slot_id = i;
-+ break;
-+ }
-+ }
-+
-+ return slot_id;
-+}
-+
-+/*
-+ * Stop device
-+ * It issues stop endpoint command for EP 0 to 30. And wait the last command
-+ * to complete.
-+ * suspend will set to 1, if suspend bit need to set in command.
-+ */
-+static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
-+{
-+ struct xhci_virt_device *virt_dev;
-+ struct xhci_command *cmd;
-+ unsigned long flags;
-+ int timeleft;
-+ int ret;
-+ int i;
-+
-+ ret = 0;
-+ virt_dev = xhci->devs[slot_id];
-+ cmd = xhci_alloc_command(xhci, false, true, GFP_NOIO);
-+ if (!cmd) {
-+ xhci_dbg(xhci, "Couldn't allocate command structure.\n");
-+ return -ENOMEM;
-+ }
-+
-+ spin_lock_irqsave(&xhci->lock, flags);
-+ for (i = LAST_EP_INDEX; i > 0; i--) {
-+ if (virt_dev->eps[i].ring && virt_dev->eps[i].ring->dequeue)
-+ xhci_queue_stop_endpoint(xhci, slot_id, i, suspend);
-+ }
-+ cmd->command_trb = xhci->cmd_ring->enqueue;
-+ list_add_tail(&cmd->cmd_list, &virt_dev->cmd_list);
-+ xhci_queue_stop_endpoint(xhci, slot_id, 0, suspend);
-+ xhci_ring_cmd_db(xhci);
-+ spin_unlock_irqrestore(&xhci->lock, flags);
-+
-+ /* Wait for last stop endpoint command to finish */
-+ timeleft = wait_for_completion_interruptible_timeout(
-+ cmd->completion,
-+ USB_CTRL_SET_TIMEOUT);
-+ if (timeleft <= 0) {
-+ xhci_warn(xhci, "%s while waiting for stop endpoint command\n",
-+ timeleft == 0 ? "Timeout" : "Signal");
-+ spin_lock_irqsave(&xhci->lock, flags);
-+ /* The timeout might have raced with the event ring handler, so
-+ * only delete from the list if the item isn't poisoned.
-+ */
-+ if (cmd->cmd_list.next != LIST_POISON1)
-+ list_del(&cmd->cmd_list);
-+ spin_unlock_irqrestore(&xhci->lock, flags);
-+ ret = -ETIME;
-+ goto command_cleanup;
-+ }
-+
-+command_cleanup:
-+ xhci_free_command(xhci, cmd);
-+ return ret;
-+}
-+
-+/*
-+ * Ring device, it rings the all doorbells unconditionally.
-+ */
-+void xhci_ring_device(struct xhci_hcd *xhci, int slot_id)
-+{
-+ int i;
-+
-+ for (i = 0; i < LAST_EP_INDEX + 1; i++)
-+ if (xhci->devs[slot_id]->eps[i].ring &&
-+ xhci->devs[slot_id]->eps[i].ring->dequeue)
-+ xhci_ring_ep_doorbell(xhci, slot_id, i, 0);
-+
-+ return;
-+}
-+
- static void xhci_disable_port(struct xhci_hcd *xhci, u16 wIndex,
- u32 __iomem *addr, u32 port_status)
- {
-@@ -162,6 +259,10 @@ static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue,
- status = PORT_PEC;
- port_change_bit = "enable/disable";
- break;
-+ case USB_PORT_FEAT_C_SUSPEND:
-+ status = PORT_PLC;
-+ port_change_bit = "suspend/resume";
-+ break;
- default:
- /* Should never happen */
- return;
-@@ -179,9 +280,10 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
- struct xhci_hcd *xhci = hcd_to_xhci(hcd);
- int ports;
- unsigned long flags;
-- u32 temp, status;
-+ u32 temp, temp1, status;
- int retval = 0;
- u32 __iomem *addr;
-+ int slot_id;
-
- ports = HCS_MAX_PORTS(xhci->hcs_params1);
-
-@@ -211,9 +313,49 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
- if ((temp & PORT_OCC))
- status |= USB_PORT_STAT_C_OVERCURRENT << 16;
- /*
-- * FIXME ignoring suspend, reset, and USB 2.1/3.0 specific
-+ * FIXME ignoring reset and USB 2.1/3.0 specific
- * changes
- */
-+ if ((temp & PORT_PLS_MASK) == XDEV_U3
-+ && (temp & PORT_POWER))
-+ status |= 1 << USB_PORT_FEAT_SUSPEND;
-+ if ((temp & PORT_PLS_MASK) == XDEV_RESUME) {
-+ if ((temp & PORT_RESET) || !(temp & PORT_PE))
-+ goto error;
-+ if (!DEV_SUPERSPEED(temp) && time_after_eq(jiffies,
-+ xhci->resume_done[wIndex])) {
-+ xhci_dbg(xhci, "Resume USB2 port %d\n",
-+ wIndex + 1);
-+ xhci->resume_done[wIndex] = 0;
-+ temp1 = xhci_port_state_to_neutral(temp);
-+ temp1 &= ~PORT_PLS_MASK;
-+ temp1 |= PORT_LINK_STROBE | XDEV_U0;
-+ xhci_writel(xhci, temp1, addr);
-+
-+ xhci_dbg(xhci, "set port %d resume\n",
-+ wIndex + 1);
-+ slot_id = xhci_find_slot_id_by_port(xhci,
-+ wIndex + 1);
-+ if (!slot_id) {
-+ xhci_dbg(xhci, "slot_id is zero\n");
-+ goto error;
-+ }
-+ xhci_ring_device(xhci, slot_id);
-+ xhci->port_c_suspend[wIndex >> 5] |=
-+ 1 << (wIndex & 31);
-+ xhci->suspended_ports[wIndex >> 5] &=
-+ ~(1 << (wIndex & 31));
-+ }
-+ }
-+ if ((temp & PORT_PLS_MASK) == XDEV_U0
-+ && (temp & PORT_POWER)
-+ && (xhci->suspended_ports[wIndex >> 5] &
-+ (1 << (wIndex & 31)))) {
-+ xhci->suspended_ports[wIndex >> 5] &=
-+ ~(1 << (wIndex & 31));
-+ xhci->port_c_suspend[wIndex >> 5] |=
-+ 1 << (wIndex & 31);
-+ }
- if (temp & PORT_CONNECT) {
- status |= USB_PORT_STAT_CONNECTION;
- status |= xhci_port_speed(temp);
-@@ -226,6 +368,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
- status |= USB_PORT_STAT_RESET;
- if (temp & PORT_POWER)
- status |= USB_PORT_STAT_POWER;
-+ if (xhci->port_c_suspend[wIndex >> 5] & (1 << (wIndex & 31)))
-+ status |= 1 << USB_PORT_FEAT_C_SUSPEND;
- xhci_dbg(xhci, "Get port status returned 0x%x\n", status);
- put_unaligned(cpu_to_le32(status), (__le32 *) buf);
- break;
-@@ -238,6 +382,42 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
- temp = xhci_readl(xhci, addr);
- temp = xhci_port_state_to_neutral(temp);
- switch (wValue) {
-+ case USB_PORT_FEAT_SUSPEND:
-+ temp = xhci_readl(xhci, addr);
-+ /* In spec software should not attempt to suspend
-+ * a port unless the port reports that it is in the
-+ * enabled (PED = ‘1’,PLS < ‘3’) state.
-+ */
-+ if ((temp & PORT_PE) == 0 || (temp & PORT_RESET)
-+ || (temp & PORT_PLS_MASK) >= XDEV_U3) {
-+ xhci_warn(xhci, "USB core suspending device "
-+ "not in U0/U1/U2.\n");
-+ goto error;
-+ }
-+
-+ slot_id = xhci_find_slot_id_by_port(xhci, wIndex + 1);
-+ if (!slot_id) {
-+ xhci_warn(xhci, "slot_id is zero\n");
-+ goto error;
-+ }
-+ /* unlock to execute stop endpoint commands */
-+ spin_unlock_irqrestore(&xhci->lock, flags);
-+ xhci_stop_device(xhci, slot_id, 1);
-+ spin_lock_irqsave(&xhci->lock, flags);
-+
-+ temp = xhci_port_state_to_neutral(temp);
-+ temp &= ~PORT_PLS_MASK;
-+ temp |= PORT_LINK_STROBE | XDEV_U3;
-+ xhci_writel(xhci, temp, addr);
-+
-+ spin_unlock_irqrestore(&xhci->lock, flags);
-+ msleep(10); /* wait device to enter */
-+ spin_lock_irqsave(&xhci->lock, flags);
-+
-+ temp = xhci_readl(xhci, addr);
-+ xhci->suspended_ports[wIndex >> 5] |=
-+ 1 << (wIndex & (31));
-+ break;
- case USB_PORT_FEAT_POWER:
- /*
- * Turn on ports, even if there isn't per-port switching.
-@@ -271,6 +451,52 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
- temp = xhci_readl(xhci, addr);
- temp = xhci_port_state_to_neutral(temp);
- switch (wValue) {
-+ case USB_PORT_FEAT_SUSPEND:
-+ temp = xhci_readl(xhci, addr);
-+ xhci_dbg(xhci, "clear USB_PORT_FEAT_SUSPEND\n");
-+ xhci_dbg(xhci, "PORTSC %04x\n", temp);
-+ if (temp & PORT_RESET)
-+ goto error;
-+ if (temp & XDEV_U3) {
-+ if ((temp & PORT_PE) == 0)
-+ goto error;
-+ if (DEV_SUPERSPEED(temp)) {
-+ temp = xhci_port_state_to_neutral(temp);
-+ temp &= ~PORT_PLS_MASK;
-+ temp |= PORT_LINK_STROBE | XDEV_U0;
-+ xhci_writel(xhci, temp, addr);
-+ xhci_readl(xhci, addr);
-+ } else {
-+ temp = xhci_port_state_to_neutral(temp);
-+ temp &= ~PORT_PLS_MASK;
-+ temp |= PORT_LINK_STROBE | XDEV_RESUME;
-+ xhci_writel(xhci, temp, addr);
-+
-+ spin_unlock_irqrestore(&xhci->lock,
-+ flags);
-+ msleep(20);
-+ spin_lock_irqsave(&xhci->lock, flags);
-+
-+ temp = xhci_readl(xhci, addr);
-+ temp = xhci_port_state_to_neutral(temp);
-+ temp &= ~PORT_PLS_MASK;
-+ temp |= PORT_LINK_STROBE | XDEV_U0;
-+ xhci_writel(xhci, temp, addr);
-+ }
-+ xhci->port_c_suspend[wIndex >> 5] |=
-+ 1 << (wIndex & 31);
-+ }
-+
-+ slot_id = xhci_find_slot_id_by_port(xhci, wIndex + 1);
-+ if (!slot_id) {
-+ xhci_dbg(xhci, "slot_id is zero\n");
-+ goto error;
-+ }
-+ xhci_ring_device(xhci, slot_id);
-+ break;
-+ case USB_PORT_FEAT_C_SUSPEND:
-+ xhci->port_c_suspend[wIndex >> 5] &=
-+ ~(1 << (wIndex & 31));
- case USB_PORT_FEAT_C_RESET:
- case USB_PORT_FEAT_C_CONNECTION:
- case USB_PORT_FEAT_C_OVER_CURRENT:
-@@ -306,6 +532,7 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
- {
- unsigned long flags;
- u32 temp, status;
-+ u32 mask;
- int i, retval;
- struct xhci_hcd *xhci = hcd_to_xhci(hcd);
- int ports;
-@@ -318,13 +545,18 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
- memset(buf, 0, retval);
- status = 0;
-
-+ mask = PORT_CSC | PORT_PEC | PORT_OCC;
-+
- spin_lock_irqsave(&xhci->lock, flags);
- /* For each port, did anything change? If so, set that bit in buf. */
- for (i = 0; i < ports; i++) {
- addr = &xhci->op_regs->port_status_base +
- NUM_PORT_REGS*i;
- temp = xhci_readl(xhci, addr);
-- if (temp & (PORT_CSC | PORT_PEC | PORT_OCC)) {
-+ if ((temp & mask) != 0 ||
-+ (xhci->port_c_suspend[i >> 5] & 1 << (i & 31)) ||
-+ (xhci->resume_done[i] && time_after_eq(
-+ jiffies, xhci->resume_done[i]))) {
- buf[(i + 1) / 8] |= 1 << (i + 1) % 8;
- status = 1;
- }
-@@ -332,3 +564,187 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
- spin_unlock_irqrestore(&xhci->lock, flags);
- return status ? retval : 0;
- }
-+
-+#ifdef CONFIG_PM
-+
-+int xhci_bus_suspend(struct usb_hcd *hcd)
-+{
-+ struct xhci_hcd *xhci = hcd_to_xhci(hcd);
-+ int port;
-+ unsigned long flags;
-+
-+ xhci_dbg(xhci, "suspend root hub\n");
-+
-+ spin_lock_irqsave(&xhci->lock, flags);
-+
-+ if (hcd->self.root_hub->do_remote_wakeup) {
-+ port = HCS_MAX_PORTS(xhci->hcs_params1);
-+ while (port--) {
-+ if (xhci->resume_done[port] != 0) {
-+ spin_unlock_irqrestore(&xhci->lock, flags);
-+ xhci_dbg(xhci, "suspend failed because "
-+ "port %d is resuming\n",
-+ port + 1);
-+ return -EBUSY;
-+ }
-+ }
-+ }
-+
-+ port = HCS_MAX_PORTS(xhci->hcs_params1);
-+ xhci->bus_suspended = 0;
-+ while (port--) {
-+ /* suspend the port if the port is not suspended */
-+ u32 __iomem *addr;
-+ u32 t1, t2;
-+ int slot_id;
-+
-+ addr = &xhci->op_regs->port_status_base +
-+ NUM_PORT_REGS * (port & 0xff);
-+ t1 = xhci_readl(xhci, addr);
-+ t2 = xhci_port_state_to_neutral(t1);
-+
-+ if ((t1 & PORT_PE) && !(t1 & PORT_PLS_MASK)) {
-+ xhci_dbg(xhci, "port %d not suspended\n", port);
-+ slot_id = xhci_find_slot_id_by_port(xhci, port + 1);
-+ if (slot_id) {
-+ spin_unlock_irqrestore(&xhci->lock, flags);
-+ xhci_stop_device(xhci, slot_id, 1);
-+ spin_lock_irqsave(&xhci->lock, flags);
-+ }
-+ t2 &= ~PORT_PLS_MASK;
-+ t2 |= PORT_LINK_STROBE | XDEV_U3;
-+ set_bit(port, &xhci->bus_suspended);
-+ }
-+ if (hcd->self.root_hub->do_remote_wakeup) {
-+ if (t1 & PORT_CONNECT) {
-+ t2 |= PORT_WKOC_E | PORT_WKDISC_E;
-+ t2 &= ~PORT_WKCONN_E;
-+ } else {
-+ t2 |= PORT_WKOC_E | PORT_WKCONN_E;
-+ t2 &= ~PORT_WKDISC_E;
-+ }
-+ } else
-+ t2 &= ~PORT_WAKE_BITS;
-+
-+ t1 = xhci_port_state_to_neutral(t1);
-+ if (t1 != t2)
-+ xhci_writel(xhci, t2, addr);
-+
-+ if (DEV_HIGHSPEED(t1)) {
-+ /* enable remote wake up for USB 2.0 */
-+ u32 __iomem *addr;
-+ u32 tmp;
-+
-+ addr = &xhci->op_regs->port_power_base +
-+ NUM_PORT_REGS * (port & 0xff);
-+ tmp = xhci_readl(xhci, addr);
-+ tmp |= PORT_RWE;
-+ xhci_writel(xhci, tmp, addr);
-+ }
-+ }
-+ hcd->state = HC_STATE_SUSPENDED;
-+ xhci->next_statechange = jiffies + msecs_to_jiffies(10);
-+ spin_unlock_irqrestore(&xhci->lock, flags);
-+ return 0;
-+}
-+
-+int xhci_bus_resume(struct usb_hcd *hcd)
-+{
-+ struct xhci_hcd *xhci = hcd_to_xhci(hcd);
-+ int port;
-+ u32 temp;
-+ unsigned long flags;
-+
-+ xhci_dbg(xhci, "resume root hub\n");
-+
-+ if (time_before(jiffies, xhci->next_statechange))
-+ msleep(5);
-+
-+ spin_lock_irqsave(&xhci->lock, flags);
-+ if (!HCD_HW_ACCESSIBLE(hcd)) {
-+ spin_unlock_irqrestore(&xhci->lock, flags);
-+ return -ESHUTDOWN;
-+ }
-+
-+ /* delay the irqs */
-+ temp = xhci_readl(xhci, &xhci->op_regs->command);
-+ temp &= ~CMD_EIE;
-+ xhci_writel(xhci, temp, &xhci->op_regs->command);
-+
-+ port = HCS_MAX_PORTS(xhci->hcs_params1);
-+ while (port--) {
-+ /* Check whether need resume ports. If needed
-+ resume port and disable remote wakeup */
-+ u32 __iomem *addr;
-+ u32 temp;
-+ int slot_id;
-+
-+ addr = &xhci->op_regs->port_status_base +
-+ NUM_PORT_REGS * (port & 0xff);
-+ temp = xhci_readl(xhci, addr);
-+ if (DEV_SUPERSPEED(temp))
-+ temp &= ~(PORT_RWC_BITS | PORT_CEC | PORT_WAKE_BITS);
-+ else
-+ temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
-+ if (test_bit(port, &xhci->bus_suspended) &&
-+ (temp & PORT_PLS_MASK)) {
-+ if (DEV_SUPERSPEED(temp)) {
-+ temp = xhci_port_state_to_neutral(temp);
-+ temp &= ~PORT_PLS_MASK;
-+ temp |= PORT_LINK_STROBE | XDEV_U0;
-+ xhci_writel(xhci, temp, addr);
-+ } else {
-+ temp = xhci_port_state_to_neutral(temp);
-+ temp &= ~PORT_PLS_MASK;
-+ temp |= PORT_LINK_STROBE | XDEV_RESUME;
-+ xhci_writel(xhci, temp, addr);
-+
-+ spin_unlock_irqrestore(&xhci->lock, flags);
-+ msleep(20);
-+ spin_lock_irqsave(&xhci->lock, flags);
-+
-+ temp = xhci_readl(xhci, addr);
-+ temp = xhci_port_state_to_neutral(temp);
-+ temp &= ~PORT_PLS_MASK;
-+ temp |= PORT_LINK_STROBE | XDEV_U0;
-+ xhci_writel(xhci, temp, addr);
-+ }
-+ slot_id = xhci_find_slot_id_by_port(xhci, port + 1);
-+ if (slot_id)
-+ xhci_ring_device(xhci, slot_id);
-+ } else
-+ xhci_writel(xhci, temp, addr);
-+
-+ if (DEV_HIGHSPEED(temp)) {
-+ /* disable remote wake up for USB 2.0 */
-+ u32 __iomem *addr;
-+ u32 tmp;
-+
-+ addr = &xhci->op_regs->port_power_base +
-+ NUM_PORT_REGS * (port & 0xff);
-+ tmp = xhci_readl(xhci, addr);
-+ tmp &= ~PORT_RWE;
-+ xhci_writel(xhci, tmp, addr);
-+ }
-+ }
-+
-+ (void) xhci_readl(xhci, &xhci->op_regs->command);
-+
-+ xhci->next_statechange = jiffies + msecs_to_jiffies(5);
-+ hcd->state = HC_STATE_RUNNING;
-+ /* re-enable irqs */
-+ temp = xhci_readl(xhci, &xhci->op_regs->command);
-+ temp |= CMD_EIE;
-+ xhci_writel(xhci, temp, &xhci->op_regs->command);
-+ temp = xhci_readl(xhci, &xhci->op_regs->command);
-+
-+ spin_unlock_irqrestore(&xhci->lock, flags);
-+ return 0;
-+}
-+
-+#else
-+
-+#define xhci_bus_suspend NULL
-+#define xhci_bus_resume NULL
-+
-+#endif
-diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
-index 4e51343..cef8d81 100644
---- a/drivers/usb/host/xhci-mem.c
-+++ b/drivers/usb/host/xhci-mem.c
-@@ -866,6 +866,7 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
- top_dev = top_dev->parent)
- /* Found device below root hub */;
- slot_ctx->dev_info2 |= (u32) ROOT_HUB_PORT(top_dev->portnum);
-+ dev->port = top_dev->portnum;
- xhci_dbg(xhci, "Set root hub portnum to %d\n", top_dev->portnum);
-
- /* Is this a LS/FS device under a HS hub? */
-@@ -1443,6 +1444,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
- scratchpad_free(xhci);
- xhci->page_size = 0;
- xhci->page_shift = 0;
-+ xhci->bus_suspended = 0;
- }
-
- static int xhci_test_trb_in_td(struct xhci_hcd *xhci,
-@@ -1801,6 +1803,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
- init_completion(&xhci->addr_dev);
- for (i = 0; i < MAX_HC_SLOTS; ++i)
- xhci->devs[i] = NULL;
-+ for (i = 0; i < MAX_HC_PORTS; ++i)
-+ xhci->resume_done[i] = 0;
-
- if (scratchpad_alloc(xhci, flags))
- goto fail;
-diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
-index f7efe02..e3a5924 100644
---- a/drivers/usb/host/xhci-pci.c
-+++ b/drivers/usb/host/xhci-pci.c
-@@ -116,6 +116,30 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
- return xhci_pci_reinit(xhci, pdev);
- }
-
-+#ifdef CONFIG_PM
-+static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
-+{
-+ struct xhci_hcd *xhci = hcd_to_xhci(hcd);
-+ int retval = 0;
-+
-+ if (hcd->state != HC_STATE_SUSPENDED)
-+ return -EINVAL;
-+
-+ retval = xhci_suspend(xhci);
-+
-+ return retval;
-+}
-+
-+static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
-+{
-+ struct xhci_hcd *xhci = hcd_to_xhci(hcd);
-+ int retval = 0;
-+
-+ retval = xhci_resume(xhci, hibernated);
-+ return retval;
-+}
-+#endif /* CONFIG_PM */
-+
- static const struct hc_driver xhci_pci_hc_driver = {
- .description = hcd_name,
- .product_desc = "xHCI Host Controller",
-@@ -132,7 +156,10 @@ static const struct hc_driver xhci_pci_hc_driver = {
- */
- .reset = xhci_pci_setup,
- .start = xhci_run,
-- /* suspend and resume implemented later */
-+#ifdef CONFIG_PM
-+ .pci_suspend = xhci_pci_suspend,
-+ .pci_resume = xhci_pci_resume,
-+#endif
- .stop = xhci_stop,
- .shutdown = xhci_shutdown,
-
-@@ -162,6 +189,8 @@ static const struct hc_driver xhci_pci_hc_driver = {
- /* Root hub support */
- .hub_control = xhci_hub_control,
- .hub_status_data = xhci_hub_status_data,
-+ .bus_suspend = xhci_bus_suspend,
-+ .bus_resume = xhci_bus_resume,
- };
-
- /*-------------------------------------------------------------------------*/
-@@ -186,6 +215,11 @@ static struct pci_driver xhci_pci_driver = {
- /* suspend and resume implemented later */
-
- .shutdown = usb_hcd_pci_shutdown,
-+#ifdef CONFIG_PM_SLEEP
-+ .driver = {
-+ .pm = &usb_hcd_pci_pm_ops
-+ },
-+#endif
- };
-
- int xhci_register_pci(void)
-diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
-index 48e60d1..9f3115e 100644
---- a/drivers/usb/host/xhci-ring.c
-+++ b/drivers/usb/host/xhci-ring.c
-@@ -68,6 +68,10 @@
- #include <linux/slab.h>
- #include "xhci.h"
-
-+static int handle_cmd_in_cmd_wait_list(struct xhci_hcd *xhci,
-+ struct xhci_virt_device *virt_dev,
-+ struct xhci_event_cmd *event);
-+
- /*
- * Returns zero if the TRB isn't in this segment, otherwise it returns the DMA
- * address of the TRB.
-@@ -313,7 +317,7 @@ void xhci_ring_cmd_db(struct xhci_hcd *xhci)
- xhci_readl(xhci, &xhci->dba->doorbell[0]);
- }
-
--static void ring_ep_doorbell(struct xhci_hcd *xhci,
-+void xhci_ring_ep_doorbell(struct xhci_hcd *xhci,
- unsigned int slot_id,
- unsigned int ep_index,
- unsigned int stream_id)
-@@ -353,7 +357,7 @@ static void ring_doorbell_for_active_rings(struct xhci_hcd *xhci,
- /* A ring has pending URBs if its TD list is not empty */
- if (!(ep->ep_state & EP_HAS_STREAMS)) {
- if (!(list_empty(&ep->ring->td_list)))
-- ring_ep_doorbell(xhci, slot_id, ep_index, 0);
-+ xhci_ring_ep_doorbell(xhci, slot_id, ep_index, 0);
- return;
- }
-
-@@ -361,7 +365,8 @@ static void ring_doorbell_for_active_rings(struct xhci_hcd *xhci,
- stream_id++) {
- struct xhci_stream_info *stream_info = ep->stream_info;
- if (!list_empty(&stream_info->stream_rings[stream_id]->td_list))
-- ring_ep_doorbell(xhci, slot_id, ep_index, stream_id);
-+ xhci_ring_ep_doorbell(xhci, slot_id, ep_index,
-+ stream_id);
- }
- }
-
-@@ -626,10 +631,11 @@ static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci,
- * bit cleared) so that the HW will skip over them.
- */
- static void handle_stopped_endpoint(struct xhci_hcd *xhci,
-- union xhci_trb *trb)
-+ union xhci_trb *trb, struct xhci_event_cmd *event)
- {
- unsigned int slot_id;
- unsigned int ep_index;
-+ struct xhci_virt_device *virt_dev;
- struct xhci_ring *ep_ring;
- struct xhci_virt_ep *ep;
- struct list_head *entry;
-@@ -638,6 +644,21 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
-
- struct xhci_dequeue_state deq_state;
-
-+ if (unlikely(TRB_TO_SUSPEND_PORT(
-+ xhci->cmd_ring->dequeue->generic.field[3]))) {
-+ slot_id = TRB_TO_SLOT_ID(
-+ xhci->cmd_ring->dequeue->generic.field[3]);
-+ virt_dev = xhci->devs[slot_id];
-+ if (virt_dev)
-+ handle_cmd_in_cmd_wait_list(xhci, virt_dev,
-+ event);
-+ else
-+ xhci_warn(xhci, "Stop endpoint command "
-+ "completion for disabled slot %u\n",
-+ slot_id);
-+ return;
-+ }
-+
- memset(&deq_state, 0, sizeof(deq_state));
- slot_id = TRB_TO_SLOT_ID(trb->generic.field[3]);
- ep_index = TRB_TO_EP_INDEX(trb->generic.field[3]);
-@@ -1091,7 +1112,7 @@ bandwidth_change:
- complete(&xhci->addr_dev);
- break;
- case TRB_TYPE(TRB_STOP_RING):
-- handle_stopped_endpoint(xhci, xhci->cmd_ring->dequeue);
-+ handle_stopped_endpoint(xhci, xhci->cmd_ring->dequeue, event);
- break;
- case TRB_TYPE(TRB_SET_DEQ):
- handle_set_deq_completion(xhci, event, xhci->cmd_ring->dequeue);
-@@ -1144,17 +1165,72 @@ static void handle_vendor_event(struct xhci_hcd *xhci,
- static void handle_port_status(struct xhci_hcd *xhci,
- union xhci_trb *event)
- {
-+ struct usb_hcd *hcd = xhci_to_hcd(xhci);
- u32 port_id;
-+ u32 temp, temp1;
-+ u32 __iomem *addr;
-+ int ports;
-+ int slot_id;
-
- /* Port status change events always have a successful completion code */
- if (GET_COMP_CODE(event->generic.field[2]) != COMP_SUCCESS) {
- xhci_warn(xhci, "WARN: xHC returned failed port status event\n");
- xhci->error_bitmask |= 1 << 8;
- }
-- /* FIXME: core doesn't care about all port link state changes yet */
- port_id = GET_PORT_ID(event->generic.field[0]);
- xhci_dbg(xhci, "Port Status Change Event for port %d\n", port_id);
-
-+ ports = HCS_MAX_PORTS(xhci->hcs_params1);
-+ if ((port_id <= 0) || (port_id > ports)) {
-+ xhci_warn(xhci, "Invalid port id %d\n", port_id);
-+ goto cleanup;
-+ }
-+
-+ addr = &xhci->op_regs->port_status_base + NUM_PORT_REGS * (port_id - 1);
-+ temp = xhci_readl(xhci, addr);
-+ if ((temp & PORT_CONNECT) && (hcd->state == HC_STATE_SUSPENDED)) {
-+ xhci_dbg(xhci, "resume root hub\n");
-+ usb_hcd_resume_root_hub(hcd);
-+ }
-+
-+ if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_RESUME) {
-+ xhci_dbg(xhci, "port resume event for port %d\n", port_id);
-+
-+ temp1 = xhci_readl(xhci, &xhci->op_regs->command);
-+ if (!(temp1 & CMD_RUN)) {
-+ xhci_warn(xhci, "xHC is not running.\n");
-+ goto cleanup;
-+ }
-+
-+ if (DEV_SUPERSPEED(temp)) {
-+ xhci_dbg(xhci, "resume SS port %d\n", port_id);
-+ temp = xhci_port_state_to_neutral(temp);
-+ temp &= ~PORT_PLS_MASK;
-+ temp |= PORT_LINK_STROBE | XDEV_U0;
-+ xhci_writel(xhci, temp, addr);
-+ slot_id = xhci_find_slot_id_by_port(xhci, port_id);
-+ if (!slot_id) {
-+ xhci_dbg(xhci, "slot_id is zero\n");
-+ goto cleanup;
-+ }
-+ xhci_ring_device(xhci, slot_id);
-+ xhci_dbg(xhci, "resume SS port %d finished\n", port_id);
-+ /* Clear PORT_PLC */
-+ temp = xhci_readl(xhci, addr);
-+ temp = xhci_port_state_to_neutral(temp);
-+ temp |= PORT_PLC;
-+ xhci_writel(xhci, temp, addr);
-+ } else {
-+ xhci_dbg(xhci, "resume HS port %d\n", port_id);
-+ xhci->resume_done[port_id - 1] = jiffies +
-+ msecs_to_jiffies(20);
-+ mod_timer(&hcd->rh_timer,
-+ xhci->resume_done[port_id - 1]);
-+ /* Do the rest in GetPortStatus */
-+ }
-+ }
-+
-+cleanup:
- /* Update event ring dequeue pointer before dropping the lock */
- inc_deq(xhci, xhci->event_ring, true);
-
-@@ -2347,7 +2423,7 @@ static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id,
- */
- wmb();
- start_trb->field[3] |= start_cycle;
-- ring_ep_doorbell(xhci, slot_id, ep_index, stream_id);
-+ xhci_ring_ep_doorbell(xhci, slot_id, ep_index, stream_id);
- }
-
- /*
-@@ -2931,7 +3007,7 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
- wmb();
- start_trb->field[3] |= start_cycle;
-
-- ring_ep_doorbell(xhci, slot_id, ep_index, urb->stream_id);
-+ xhci_ring_ep_doorbell(xhci, slot_id, ep_index, urb->stream_id);
- return 0;
- }
-
-@@ -3108,15 +3184,20 @@ int xhci_queue_evaluate_context(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
- false);
- }
-
-+/*
-+ * Suspend is set to indicate "Stop Endpoint Command" is being issued to stop
-+ * activity on an endpoint that is about to be suspended.
-+ */
- int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id,
-- unsigned int ep_index)
-+ unsigned int ep_index, int suspend)
- {
- u32 trb_slot_id = SLOT_ID_FOR_TRB(slot_id);
- u32 trb_ep_index = EP_ID_FOR_TRB(ep_index);
- u32 type = TRB_TYPE(TRB_STOP_RING);
-+ u32 trb_suspend = SUSPEND_PORT_FOR_TRB(suspend);
-
- return queue_command(xhci, 0, 0, 0,
-- trb_slot_id | trb_ep_index | type, false);
-+ trb_slot_id | trb_ep_index | type | trb_suspend, false);
- }
-
- /* Set Transfer Ring Dequeue Pointer command.
-diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
-index d5c550e..34f1b3b 100644
---- a/drivers/usb/host/xhci.c
-+++ b/drivers/usb/host/xhci.c
-@@ -551,6 +551,216 @@ void xhci_shutdown(struct usb_hcd *hcd)
- xhci_readl(xhci, &xhci->op_regs->status));
- }
-
-+static void xhci_save_registers(struct xhci_hcd *xhci)
-+{
-+ xhci->s3.command = xhci_readl(xhci, &xhci->op_regs->command);
-+ xhci->s3.dev_nt = xhci_readl(xhci, &xhci->op_regs->dev_notification);
-+ xhci->s3.dcbaa_ptr = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr);
-+ xhci->s3.config_reg = xhci_readl(xhci, &xhci->op_regs->config_reg);
-+ xhci->s3.irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);
-+ xhci->s3.irq_control = xhci_readl(xhci, &xhci->ir_set->irq_control);
-+ xhci->s3.erst_size = xhci_readl(xhci, &xhci->ir_set->erst_size);
-+ xhci->s3.erst_base = xhci_read_64(xhci, &xhci->ir_set->erst_base);
-+ xhci->s3.erst_dequeue = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
-+}
-+
-+static void xhci_restore_registers(struct xhci_hcd *xhci)
-+{
-+ xhci_writel(xhci, xhci->s3.command, &xhci->op_regs->command);
-+ xhci_writel(xhci, xhci->s3.dev_nt, &xhci->op_regs->dev_notification);
-+ xhci_write_64(xhci, xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr);
-+ xhci_writel(xhci, xhci->s3.config_reg, &xhci->op_regs->config_reg);
-+ xhci_writel(xhci, xhci->s3.irq_pending, &xhci->ir_set->irq_pending);
-+ xhci_writel(xhci, xhci->s3.irq_control, &xhci->ir_set->irq_control);
-+ xhci_writel(xhci, xhci->s3.erst_size, &xhci->ir_set->erst_size);
-+ xhci_write_64(xhci, xhci->s3.erst_base, &xhci->ir_set->erst_base);
-+}
-+
-+/*
-+ * Stop HC (not bus-specific)
-+ *
-+ * This is called when the machine transition into S3/S4 mode.
-+ *
-+ */
-+int xhci_suspend(struct xhci_hcd *xhci)
-+{
-+ int rc = 0;
-+ struct usb_hcd *hcd = xhci_to_hcd(xhci);
-+ u32 command;
-+
-+ spin_lock_irq(&xhci->lock);
-+ clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
-+ /* step 1: stop endpoint */
-+ /* skipped assuming that port suspend has done */
-+
-+ /* step 2: clear Run/Stop bit */
-+ command = xhci_readl(xhci, &xhci->op_regs->command);
-+ command &= ~CMD_RUN;
-+ xhci_writel(xhci, command, &xhci->op_regs->command);
-+ if (handshake(xhci, &xhci->op_regs->status,
-+ STS_HALT, STS_HALT, 100*100)) {
-+ xhci_warn(xhci, "WARN: xHC CMD_RUN timeout\n");
-+ spin_unlock_irq(&xhci->lock);
-+ return -ETIMEDOUT;
-+ }
-+
-+ /* step 3: save registers */
-+ xhci_save_registers(xhci);
-+
-+ /* step 4: set CSS flag */
-+ command = xhci_readl(xhci, &xhci->op_regs->command);
-+ command |= CMD_CSS;
-+ xhci_writel(xhci, command, &xhci->op_regs->command);
-+ if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10*100)) {
-+ xhci_warn(xhci, "WARN: xHC CMD_CSS timeout\n");
-+ spin_unlock_irq(&xhci->lock);
-+ return -ETIMEDOUT;
-+ }
-+ /* step 5: remove core well power */
-+ xhci_cleanup_msix(xhci);
-+ spin_unlock_irq(&xhci->lock);
-+
-+ return rc;
-+}
-+
-+/*
-+ * start xHC (not bus-specific)
-+ *
-+ * This is called when the machine transition from S3/S4 mode.
-+ *
-+ */
-+int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
-+{
-+ u32 command, temp = 0;
-+ struct usb_hcd *hcd = xhci_to_hcd(xhci);
-+ struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
-+ u64 val_64;
-+ int old_state, retval;
-+
-+ old_state = hcd->state;
-+ if (time_before(jiffies, xhci->next_statechange))
-+ msleep(100);
-+
-+ spin_lock_irq(&xhci->lock);
-+
-+ if (!hibernated) {
-+ /* step 1: restore register */
-+ xhci_restore_registers(xhci);
-+ /* step 2: initialize command ring buffer */
-+ val_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);
-+ val_64 = (val_64 & (u64) CMD_RING_RSVD_BITS) |
-+ (xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg,
-+ xhci->cmd_ring->dequeue) &
-+ (u64) ~CMD_RING_RSVD_BITS) |
-+ xhci->cmd_ring->cycle_state;
-+ xhci_dbg(xhci, "// Setting command ring address to 0x%llx\n",
-+ (long unsigned long) val_64);
-+ xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring);
-+ /* step 3: restore state and start state*/
-+ /* step 3: set CRS flag */
-+ command = xhci_readl(xhci, &xhci->op_regs->command);
-+ command |= CMD_CRS;
-+ xhci_writel(xhci, command, &xhci->op_regs->command);
-+ if (handshake(xhci, &xhci->op_regs->status,
-+ STS_RESTORE, 0, 10*100)) {
-+ xhci_dbg(xhci, "WARN: xHC CMD_CSS timeout\n");
-+ spin_unlock_irq(&xhci->lock);
-+ return -ETIMEDOUT;
-+ }
-+ temp = xhci_readl(xhci, &xhci->op_regs->status);
-+ }
-+
-+ /* If restore operation fails, re-initialize the HC during resume */
-+ if ((temp & STS_SRE) || hibernated) {
-+ usb_root_hub_lost_power(hcd->self.root_hub);
-+
-+ xhci_dbg(xhci, "Stop HCD\n");
-+ xhci_halt(xhci);
-+ xhci_reset(xhci);
-+ if (hibernated)
-+ xhci_cleanup_msix(xhci);
-+ spin_unlock_irq(&xhci->lock);
-+
-+#ifdef CONFIG_USB_XHCI_HCD_DEBUGGING
-+ /* Tell the event ring poll function not to reschedule */
-+ xhci->zombie = 1;
-+ del_timer_sync(&xhci->event_ring_timer);
-+#endif
-+
-+ xhci_dbg(xhci, "// Disabling event ring interrupts\n");
-+ temp = xhci_readl(xhci, &xhci->op_regs->status);
-+ xhci_writel(xhci, temp & ~STS_EINT, &xhci->op_regs->status);
-+ temp = xhci_readl(xhci, &xhci->ir_set->irq_pending);
-+ xhci_writel(xhci, ER_IRQ_DISABLE(temp),
-+ &xhci->ir_set->irq_pending);
-+ xhci_print_ir_set(xhci, xhci->ir_set, 0);
-+
-+ xhci_dbg(xhci, "cleaning up memory\n");
-+ xhci_mem_cleanup(xhci);
-+ xhci_dbg(xhci, "xhci_stop completed - status = %x\n",
-+ xhci_readl(xhci, &xhci->op_regs->status));
-+
-+ xhci_dbg(xhci, "Initialize the HCD\n");
-+ retval = xhci_init(hcd);
-+ if (retval)
-+ return retval;
-+
-+ xhci_dbg(xhci, "Start the HCD\n");
-+ retval = xhci_run(hcd);
-+ if (!retval)
-+ set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
-+ hcd->state = HC_STATE_SUSPENDED;
-+ return retval;
-+ }
-+
-+ /* Re-setup MSI-X */
-+ if (hcd->irq)
-+ free_irq(hcd->irq, hcd);
-+ hcd->irq = -1;
-+
-+ retval = xhci_setup_msix(xhci);
-+ if (retval)
-+ /* fall back to msi*/
-+ retval = xhci_setup_msi(xhci);
-+
-+ if (retval) {
-+ /* fall back to legacy interrupt*/
-+ retval = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED,
-+ hcd->irq_descr, hcd);
-+ if (retval) {
-+ xhci_err(xhci, "request interrupt %d failed\n",
-+ pdev->irq);
-+ return retval;
-+ }
-+ hcd->irq = pdev->irq;
-+ }
-+
-+ /* step 4: set Run/Stop bit */
-+ command = xhci_readl(xhci, &xhci->op_regs->command);
-+ command |= CMD_RUN;
-+ xhci_writel(xhci, command, &xhci->op_regs->command);
-+ handshake(xhci, &xhci->op_regs->status, STS_HALT,
-+ 0, 250 * 1000);
-+
-+ /* step 5: walk topology and initialize portsc,
-+ * portpmsc and portli
-+ */
-+ /* this is done in bus_resume */
-+
-+ /* step 6: restart each of the previously
-+ * Running endpoints by ringing their doorbells
-+ */
-+
-+ set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
-+ if (!hibernated)
-+ hcd->state = old_state;
-+ else
-+ hcd->state = HC_STATE_SUSPENDED;
-+
-+ spin_unlock_irq(&xhci->lock);
-+ return 0;
-+}
-+
- /*-------------------------------------------------------------------------*/
-
- /**
-@@ -956,7 +1166,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
- ep->stop_cmd_timer.expires = jiffies +
- XHCI_STOP_EP_CMD_TIMEOUT * HZ;
- add_timer(&ep->stop_cmd_timer);
-- xhci_queue_stop_endpoint(xhci, urb->dev->slot_id, ep_index);
-+ xhci_queue_stop_endpoint(xhci, urb->dev->slot_id, ep_index, 0);
- xhci_ring_cmd_db(xhci);
- }
- done:
-diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
-index 34a60d9..b6d8033 100644
---- a/drivers/usb/host/xhci.h
-+++ b/drivers/usb/host/xhci.h
-@@ -191,7 +191,7 @@ struct xhci_op_regs {
- /* bits 4:6 are reserved (and should be preserved on writes). */
- /* light reset (port status stays unchanged) - reset completed when this is 0 */
- #define CMD_LRESET (1 << 7)
--/* FIXME: ignoring host controller save/restore state for now. */
-+/* host controller save/restore state. */
- #define CMD_CSS (1 << 8)
- #define CMD_CRS (1 << 9)
- /* Enable Wrap Event - '1' means xHC generates an event when MFINDEX wraps. */
-@@ -269,6 +269,10 @@ struct xhci_op_regs {
- * A read gives the current link PM state of the port,
- * a write with Link State Write Strobe set sets the link state.
- */
-+#define PORT_PLS_MASK (0xf << 5)
-+#define XDEV_U0 (0x0 << 5)
-+#define XDEV_U3 (0x3 << 5)
-+#define XDEV_RESUME (0xf << 5)
- /* true: port has power (see HCC_PPC) */
- #define PORT_POWER (1 << 9)
- /* bits 10:13 indicate device speed:
-@@ -353,6 +357,8 @@ struct xhci_op_regs {
- #define PORT_U2_TIMEOUT(p) (((p) & 0xff) << 8)
- /* Bits 24:31 for port testing */
-
-+/* USB2 Protocol PORTSPMSC */
-+#define PORT_RWE (1 << 0x3)
-
- /**
- * struct xhci_intr_reg - Interrupt Register Set
-@@ -510,6 +516,7 @@ struct xhci_slot_ctx {
- #define MAX_EXIT (0xffff)
- /* Root hub port number that is needed to access the USB device */
- #define ROOT_HUB_PORT(p) (((p) & 0xff) << 16)
-+#define DEVINFO_TO_ROOT_HUB_PORT(p) (((p) >> 16) & 0xff)
- /* Maximum number of ports under a hub device */
- #define XHCI_MAX_PORTS(p) (((p) & 0xff) << 24)
-
-@@ -751,6 +758,7 @@ struct xhci_virt_device {
- /* Status of the last command issued for this device */
- u32 cmd_status;
- struct list_head cmd_list;
-+ u8 port;
- };
-
-
-@@ -881,6 +889,10 @@ struct xhci_event_cmd {
- #define TRB_TO_EP_INDEX(p) ((((p) & (0x1f << 16)) >> 16) - 1)
- #define EP_ID_FOR_TRB(p) ((((p) + 1) & 0x1f) << 16)
-
-+#define SUSPEND_PORT_FOR_TRB(p) (((p) & 1) << 23)
-+#define TRB_TO_SUSPEND_PORT(p) (((p) & (1 << 23)) >> 23)
-+#define LAST_EP_INDEX 30
-+
- /* Set TR Dequeue Pointer command TRB fields */
- #define TRB_TO_STREAM_ID(p) ((((p) & (0xffff << 16)) >> 16))
- #define STREAM_ID_FOR_TRB(p) ((((p)) & 0xffff) << 16)
-@@ -1115,6 +1127,17 @@ struct urb_priv {
- #define XHCI_STOP_EP_CMD_TIMEOUT 5
- /* XXX: Make these module parameters */
-
-+struct s3_save {
-+ u32 command;
-+ u32 dev_nt;
-+ u64 dcbaa_ptr;
-+ u32 config_reg;
-+ u32 irq_pending;
-+ u32 irq_control;
-+ u32 erst_size;
-+ u64 erst_base;
-+ u64 erst_dequeue;
-+};
-
- /* There is one ehci_hci structure per controller */
- struct xhci_hcd {
-@@ -1178,6 +1201,12 @@ struct xhci_hcd {
- #endif
- /* Host controller watchdog timer structures */
- unsigned int xhc_state;
-+
-+ unsigned long bus_suspended;
-+ unsigned long next_statechange;
-+
-+ u32 command;
-+ struct s3_save s3;
- /* Host controller is dying - not responding to commands. "I'm not dead yet!"
- *
- * xHC interrupts have been disabled and a watchdog timer will (or has already)
-@@ -1199,6 +1228,10 @@ struct xhci_hcd {
- #define XHCI_LINK_TRB_QUIRK (1 << 0)
- #define XHCI_RESET_EP_QUIRK (1 << 1)
- #define XHCI_NEC_HOST (1 << 2)
-+ u32 port_c_suspend[8]; /* port suspend change*/
-+ u32 suspended_ports[8]; /* which ports are
-+ suspended */
-+ unsigned long resume_done[MAX_HC_PORTS];
- };
-
- /* For testing purposes */
-@@ -1369,6 +1402,8 @@ int xhci_init(struct usb_hcd *hcd);
- int xhci_run(struct usb_hcd *hcd);
- void xhci_stop(struct usb_hcd *hcd);
- void xhci_shutdown(struct usb_hcd *hcd);
-+int xhci_suspend(struct xhci_hcd *xhci);
-+int xhci_resume(struct xhci_hcd *xhci, bool hibernated);
- int xhci_get_frame(struct usb_hcd *hcd);
- irqreturn_t xhci_irq(struct usb_hcd *hcd);
- irqreturn_t xhci_msi_irq(int irq, struct usb_hcd *hcd);
-@@ -1406,7 +1441,7 @@ int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
- int xhci_queue_vendor_command(struct xhci_hcd *xhci,
- u32 field1, u32 field2, u32 field3, u32 field4);
- int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id,
-- unsigned int ep_index);
-+ unsigned int ep_index, int suspend);
- int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
- int slot_id, unsigned int ep_index);
- int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
-@@ -1436,11 +1471,18 @@ void xhci_queue_config_ep_quirk(struct xhci_hcd *xhci,
- unsigned int slot_id, unsigned int ep_index,
- struct xhci_dequeue_state *deq_state);
- void xhci_stop_endpoint_command_watchdog(unsigned long arg);
-+void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, unsigned int slot_id,
-+ unsigned int ep_index, unsigned int stream_id);
-
- /* xHCI roothub code */
- int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
- char *buf, u16 wLength);
- int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
-+int xhci_bus_suspend(struct usb_hcd *hcd);
-+int xhci_bus_resume(struct usb_hcd *hcd);
-+u32 xhci_port_state_to_neutral(u32 state);
-+int xhci_find_slot_id_by_port(struct xhci_hcd *xhci, u16 port);
-+void xhci_ring_device(struct xhci_hcd *xhci, int slot_id);
-
- /* xHCI contexts */
- struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx);