USB 3.5-rc1 pull request

Here is the big USB 3.5-rc1 pull request for the 3.5-rc1 merge window.
 
 It's touches a lot of different parts of the kernel, all USB drivers,
 due to some API cleanups (getting rid of the ancient err() macro) and
 some changes that are needed for USB 3.0 power management updates.
 
 There are also lots of new drivers, pimarily gadget, but others as well.
 We deleted a staging driver, which was nice, and finally dropped the
 obsolete usbfs code, which will make Al happy to never have to touch
 that again.
 
 There were some build errors in the tree that linux-next found a few
 days ago, but those were fixed by the most recent changes (all were due
 to us not building with CONFIG_PM disabled.)
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iEYEABECAAYFAk+7qs0ACgkQMUfUDdst+ymjOgCfeoWqWk1bsKKt6SZULvQois5i
 3csAn1Uapcm8Uswwpnj2v1/2Zh4rBHLA
 =4jM1
 -----END PGP SIGNATURE-----

Merge tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB 3.5-rc1 changes from Greg Kroah-Hartman:
 "Here is the big USB 3.5-rc1 pull request for the 3.5-rc1 merge window.

  It's touches a lot of different parts of the kernel, all USB drivers,
  due to some API cleanups (getting rid of the ancient err() macro) and
  some changes that are needed for USB 3.0 power management updates.

  There are also lots of new drivers, pimarily gadget, but others as
  well.  We deleted a staging driver, which was nice, and finally
  dropped the obsolete usbfs code, which will make Al happy to never
  have to touch that again.

  There were some build errors in the tree that linux-next found a few
  days ago, but those were fixed by the most recent changes (all were
  due to us not building with CONFIG_PM disabled.)

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (477 commits)
  xhci: Fix DIV_ROUND_UP compile error.
  xhci: Fix compile with CONFIG_USB_SUSPEND=n
  USB: Fix core compile with CONFIG_USB_SUSPEND=n
  brcm80211: Fix compile error for .disable_hub_initiated_lpm.
  Revert "USB: EHCI: work around bug in the Philips ISP1562 controller"
  MAINTAINERS: Add myself as maintainer to the USB PHY Layer
  USB: EHCI: fix command register configuration lost problem
  USB: Remove races in devio.c
  USB: ehci-platform: remove update_device
  USB: Disable hub-initiated LPM for comms devices.
  xhci: Add Intel U1/U2 timeout policy.
  xhci: Add infrastructure for host-specific LPM policies.
  USB: Add macros for interrupt endpoint types.
  xhci: Reserve one command for USB3 LPM disable.
  xhci: Some Evaluate Context commands must succeed.
  USB: Disable USB 3.0 LPM in critical sections.
  USB: Add support to enable/disable USB3 link states.
  USB: Allow drivers to disable hub-initiated LPM.
  USB: Calculate USB 3.0 exit latencies for LPM.
  USB: Refactor code to set LPM support flag.
  ...

Conflicts:
	arch/arm/mach-exynos/mach-nuri.c
	arch/arm/mach-exynos/mach-universal_c210.c
	drivers/net/wireless/ath/ath6kl/usb.c
This commit is contained in:
Linus Torvalds 2012-05-22 15:50:46 -07:00
commit a481991467
395 changed files with 19465 additions and 16233 deletions

View File

@ -135,6 +135,17 @@ Description:
for the device and attempt to bind to it. For example: for the device and attempt to bind to it. For example:
# echo "8086 10f5" > /sys/bus/usb/drivers/foo/new_id # echo "8086 10f5" > /sys/bus/usb/drivers/foo/new_id
Reading from this file will list all dynamically added
device IDs in the same format, with one entry per
line. For example:
# cat /sys/bus/usb/drivers/foo/new_id
8086 10f5
dead beef 06
f00d cafe
The list will be truncated at PAGE_SIZE bytes due to
sysfs restrictions.
What: /sys/bus/usb-serial/drivers/.../new_id What: /sys/bus/usb-serial/drivers/.../new_id
Date: October 2011 Date: October 2011
Contact: linux-usb@vger.kernel.org Contact: linux-usb@vger.kernel.org
@ -157,6 +168,10 @@ Description:
match the driver to the device. For example: match the driver to the device. For example:
# echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id # echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id
Reading from this file will list the dynamically added
device IDs, exactly like reading from the entry
"/sys/bus/usb/drivers/.../new_id"
What: /sys/bus/usb/device/.../avoid_reset_quirk What: /sys/bus/usb/device/.../avoid_reset_quirk
Date: December 2009 Date: December 2009
Contact: Oliver Neukum <oliver@neukum.org> Contact: Oliver Neukum <oliver@neukum.org>

View File

@ -0,0 +1,25 @@
* NXP ISP1301 USB transceiver
Required properties:
- compatible: must be "nxp,isp1301"
- reg: I2C address of the ISP1301 device
Optional properties of devices using ISP1301:
- transceiver: phandle of isp1301 - this helps the ISP1301 driver to find the
ISP1301 instance associated with the respective USB driver
Example:
isp1301: usb-transceiver@2c {
compatible = "nxp,isp1301";
reg = <0x2c>;
};
usbd@31020000 {
compatible = "nxp,lpc3220-udc";
reg = <0x31020000 0x300>;
interrupt-parent = <&mic>;
interrupts = <0x3d 0>, <0x3e 0>, <0x3c 0>, <0x3a 0>;
transceiver = <&isp1301>;
status = "okay";
};

View File

@ -0,0 +1,28 @@
* NXP LPC32xx SoC USB Device Controller (UDC)
Required properties:
- compatible: Must be "nxp,lpc3220-udc"
- reg: Physical base address of the controller and length of memory mapped
region.
- interrupts: The USB interrupts:
* USB Device Low Priority Interrupt
* USB Device High Priority Interrupt
* USB Device DMA Interrupt
* External USB Transceiver Interrupt (OTG ATX)
- transceiver: phandle of the associated ISP1301 device - this is necessary for
the UDC controller for connecting to the USB physical layer
Example:
isp1301: usb-transceiver@2c {
compatible = "nxp,isp1301";
reg = <0x2c>;
};
usbd@31020000 {
compatible = "nxp,lpc3220-udc";
reg = <0x31020000 0x300>;
interrupt-parent = <&mic>;
interrupts = <0x3d 0>, <0x3e 0>, <0x3c 0>, <0x3a 0>;
transceiver = <&isp1301>;
};

View File

@ -0,0 +1,24 @@
* OHCI controller, NXP ohci-nxp variant
Required properties:
- compatible: must be "nxp,ohci-nxp"
- reg: physical base address of the controller and length of memory mapped
region.
- interrupts: The OHCI interrupt
- transceiver: phandle of the associated ISP1301 device - this is necessary for
the UDC controller for connecting to the USB physical layer
Example (LPC32xx):
isp1301: usb-transceiver@2c {
compatible = "nxp,isp1301";
reg = <0x2c>;
};
ohci@31020000 {
compatible = "nxp,ohci-nxp";
reg = <0x31020000 0x300>;
interrupt-parent = <&mic>;
interrupts = <0x3b 0>;
transceiver = <&isp1301>;
};

View File

@ -0,0 +1,39 @@
ST SPEAr SoC USB controllers:
-----------------------------
EHCI:
-----
Required properties:
- compatible: "st,spear600-ehci"
- interrupt-parent: Should be the phandle for the interrupt controller
that services interrupts for this device
- interrupts: Should contain the EHCI interrupt
Example:
ehci@e1800000 {
compatible = "st,spear600-ehci", "usb-ehci";
reg = <0xe1800000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <27>;
};
OHCI:
-----
Required properties:
- compatible: "st,spear600-ohci"
- interrupt-parent: Should be the phandle for the interrupt controller
that services interrupts for this device
- interrupts: Should contain the OHCI interrupt
Example:
ohci@e1900000 {
compatible = "st,spear600-ohci", "usb-ohci";
reg = <0xe1800000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <26>;
};

View File

@ -0,0 +1,67 @@
*How FunctionFS works*
From kernel point of view it is just a composite function with some
unique behaviour. It may be added to an USB configuration only after
the user space driver has registered by writing descriptors and
strings (the user space program has to provide the same information
that kernel level composite functions provide when they are added to
the configuration).
This in particular means that the composite initialisation functions
may not be in init section (ie. may not use the __init tag).
From user space point of view it is a file system which when
mounted provides an "ep0" file. User space driver need to
write descriptors and strings to that file. It does not need
to worry about endpoints, interfaces or strings numbers but
simply provide descriptors such as if the function was the
only one (endpoints and strings numbers starting from one and
interface numbers starting from zero). The FunctionFS changes
them as needed also handling situation when numbers differ in
different configurations.
When descriptors and strings are written "ep#" files appear
(one for each declared endpoint) which handle communication on
a single endpoint. Again, FunctionFS takes care of the real
numbers and changing of the configuration (which means that
"ep1" file may be really mapped to (say) endpoint 3 (and when
configuration changes to (say) endpoint 2)). "ep0" is used
for receiving events and handling setup requests.
When all files are closed the function disables itself.
What I also want to mention is that the FunctionFS is designed in such
a way that it is possible to mount it several times so in the end
a gadget could use several FunctionFS functions. The idea is that
each FunctionFS instance is identified by the device name used
when mounting.
One can imagine a gadget that has an Ethernet, MTP and HID interfaces
where the last two are implemented via FunctionFS. On user space
level it would look like this:
$ insmod g_ffs.ko idVendor=<ID> iSerialNumber=<string> functions=mtp,hid
$ mkdir /dev/ffs-mtp && mount -t functionfs mtp /dev/ffs-mtp
$ ( cd /dev/ffs-mtp && mtp-daemon ) &
$ mkdir /dev/ffs-hid && mount -t functionfs hid /dev/ffs-hid
$ ( cd /dev/ffs-hid && hid-daemon ) &
On kernel level the gadget checks ffs_data->dev_name to identify
whether it's FunctionFS designed for MTP ("mtp") or HID ("hid").
If no "functions" module parameters is supplied, the driver accepts
just one function with any name.
When "functions" module parameter is supplied, only functions
with listed names are accepted. In particular, if the "functions"
parameter's value is just a one-element list, then the behaviour
is similar to when there is no "functions" at all; however,
only a function with the specified name is accepted.
The gadget is registered only after all the declared function
filesystems have been mounted and USB descriptors of all functions
have been written to their ep0's.
Conversely, the gadget is unregistered after the first USB function
closes its endpoints.

View File

@ -1826,6 +1826,12 @@ L: linux-kernel@zh-kernel.org (moderated for non-subscribers)
S: Maintained S: Maintained
F: Documentation/zh_CN/ F: Documentation/zh_CN/
CHIPIDEA USB HIGH SPEED DUAL ROLE CONTROLLER
M: Alexander Shishkin <alexander.shishkin@linux.intel.com>
L: linux-usb@vger.kernel.org
S: Maintained
F: drivers/usb/chipidea/
CISCO VIC ETHERNET NIC DRIVER CISCO VIC ETHERNET NIC DRIVER
M: Christian Benvenuti <benve@cisco.com> M: Christian Benvenuti <benve@cisco.com>
M: Roopa Prabhu <roprabhu@cisco.com> M: Roopa Prabhu <roprabhu@cisco.com>
@ -7053,6 +7059,14 @@ W: http://pegasus2.sourceforge.net/
S: Maintained S: Maintained
F: drivers/net/usb/pegasus.* F: drivers/net/usb/pegasus.*
USB PHY LAYER
M: Felipe Balbi <balbi@ti.com>
L: linux-usb@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
S: Maintained
F: drivers/usb/phy/
F: drivers/usb/otg/
USB PRINTER DRIVER (usblp) USB PRINTER DRIVER (usblp)
M: Pete Zaitcev <zaitcev@redhat.com> M: Pete Zaitcev <zaitcev@redhat.com>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org

View File

@ -251,6 +251,7 @@ config MACH_UNIVERSAL_C210
select S3C_DEV_I2C1 select S3C_DEV_I2C1
select S3C_DEV_I2C3 select S3C_DEV_I2C3
select S3C_DEV_I2C5 select S3C_DEV_I2C5
select S3C_DEV_USB_HSOTG
select S5P_DEV_I2C_HDMIPHY select S5P_DEV_I2C_HDMIPHY
select S5P_DEV_MFC select S5P_DEV_MFC
select S5P_DEV_ONENAND select S5P_DEV_ONENAND
@ -264,6 +265,7 @@ config MACH_UNIVERSAL_C210
select EXYNOS4_SETUP_SDHCI select EXYNOS4_SETUP_SDHCI
select EXYNOS4_SETUP_FIMC select EXYNOS4_SETUP_FIMC
select S5P_SETUP_MIPIPHY select S5P_SETUP_MIPIPHY
select EXYNOS4_SETUP_USB_PHY
help help
Machine support for Samsung Mobile Universal S5PC210 Reference Machine support for Samsung Mobile Universal S5PC210 Reference
Board. Board.
@ -282,6 +284,7 @@ config MACH_NURI
select S3C_DEV_I2C3 select S3C_DEV_I2C3
select S3C_DEV_I2C5 select S3C_DEV_I2C5
select S3C_DEV_I2C6 select S3C_DEV_I2C6
select S3C_DEV_USB_HSOTG
select S5P_DEV_CSIS0 select S5P_DEV_CSIS0
select S5P_DEV_JPEG select S5P_DEV_JPEG
select S5P_DEV_FIMC0 select S5P_DEV_FIMC0

View File

@ -189,6 +189,7 @@
#define IRQ_IIC7 EXYNOS4_IRQ_IIC7 #define IRQ_IIC7 EXYNOS4_IRQ_IIC7
#define IRQ_USB_HOST EXYNOS4_IRQ_USB_HOST #define IRQ_USB_HOST EXYNOS4_IRQ_USB_HOST
#define IRQ_OTG EXYNOS4_IRQ_USB_HSOTG
#define IRQ_HSMMC0 EXYNOS4_IRQ_HSMMC0 #define IRQ_HSMMC0 EXYNOS4_IRQ_HSMMC0
#define IRQ_HSMMC1 EXYNOS4_IRQ_HSMMC1 #define IRQ_HSMMC1 EXYNOS4_IRQ_HSMMC1

View File

@ -130,6 +130,9 @@
#define EXYNOS4_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000)) #define EXYNOS4_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000))
#define EXYNOS4_PA_DWMCI 0x12550000 #define EXYNOS4_PA_DWMCI 0x12550000
#define EXYNOS4_PA_HSOTG 0x12480000
#define EXYNOS4_PA_USB_HSPHY 0x125B0000
#define EXYNOS4_PA_SATA 0x12560000 #define EXYNOS4_PA_SATA 0x12560000
#define EXYNOS4_PA_SATAPHY 0x125D0000 #define EXYNOS4_PA_SATAPHY 0x125D0000
#define EXYNOS4_PA_SATAPHY_CTRL 0x126B0000 #define EXYNOS4_PA_SATAPHY_CTRL 0x126B0000
@ -186,6 +189,7 @@
#define S3C_PA_SPI0 EXYNOS4_PA_SPI0 #define S3C_PA_SPI0 EXYNOS4_PA_SPI0
#define S3C_PA_SPI1 EXYNOS4_PA_SPI1 #define S3C_PA_SPI1 EXYNOS4_PA_SPI1
#define S3C_PA_SPI2 EXYNOS4_PA_SPI2 #define S3C_PA_SPI2 EXYNOS4_PA_SPI2
#define S3C_PA_USB_HSOTG EXYNOS4_PA_HSOTG
#define S5P_PA_EHCI EXYNOS4_PA_EHCI #define S5P_PA_EHCI EXYNOS4_PA_EHCI
#define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0 #define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0

View File

@ -163,6 +163,9 @@
#define S5P_CHECK_SLEEP 0x00000BAD #define S5P_CHECK_SLEEP 0x00000BAD
/* Only for EXYNOS4210 */ /* Only for EXYNOS4210 */
#define S5P_USBDEVICE_PHY_CONTROL S5P_PMUREG(0x0704)
#define S5P_USBDEVICE_PHY_ENABLE (1 << 0)
#define S5P_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708) #define S5P_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708)
#define S5P_USBHOST_PHY_ENABLE (1 << 0) #define S5P_USBHOST_PHY_ENABLE (1 << 0)

View File

@ -25,6 +25,7 @@
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/pwm_backlight.h> #include <linux/pwm_backlight.h>
#include <linux/platform_data/s3c-hsotg.h>
#include <drm/exynos_drm.h> #include <drm/exynos_drm.h>
#include <video/platform_lcd.h> #include <video/platform_lcd.h>
@ -373,6 +374,7 @@ static struct regulator_consumer_supply __initdata max8997_ldo1_[] = {
REGULATOR_SUPPLY("vdd", "s5p-adc"), /* Used by CPU's ADC drv */ REGULATOR_SUPPLY("vdd", "s5p-adc"), /* Used by CPU's ADC drv */
}; };
static struct regulator_consumer_supply __initdata max8997_ldo3_[] = { static struct regulator_consumer_supply __initdata max8997_ldo3_[] = {
REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"), /* USB */
REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */ REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */
}; };
static struct regulator_consumer_supply __initdata max8997_ldo4_[] = { static struct regulator_consumer_supply __initdata max8997_ldo4_[] = {
@ -388,7 +390,7 @@ static struct regulator_consumer_supply __initdata max8997_ldo7_[] = {
REGULATOR_SUPPLY("dig_18", "0-001f"), /* HCD803 */ REGULATOR_SUPPLY("dig_18", "0-001f"), /* HCD803 */
}; };
static struct regulator_consumer_supply __initdata max8997_ldo8_[] = { static struct regulator_consumer_supply __initdata max8997_ldo8_[] = {
REGULATOR_SUPPLY("vusb_d", NULL), /* Used by CPU */ REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"), /* USB */
REGULATOR_SUPPLY("vdac", NULL), /* Used by CPU */ REGULATOR_SUPPLY("vdac", NULL), /* Used by CPU */
}; };
static struct regulator_consumer_supply __initdata max8997_ldo11_[] = { static struct regulator_consumer_supply __initdata max8997_ldo11_[] = {
@ -844,6 +846,7 @@ static struct regulator_init_data __initdata max8997_esafeout1_data = {
.constraints = { .constraints = {
.name = "SAFEOUT1", .name = "SAFEOUT1",
.valid_ops_mask = REGULATOR_CHANGE_STATUS, .valid_ops_mask = REGULATOR_CHANGE_STATUS,
.always_on = 1,
.state_mem = { .state_mem = {
.disabled = 1, .disabled = 1,
}, },
@ -1101,6 +1104,9 @@ static void __init nuri_ehci_init(void)
s5p_ehci_set_platdata(pdata); s5p_ehci_set_platdata(pdata);
} }
/* USB OTG */
static struct s3c_hsotg_plat nuri_hsotg_pdata;
/* CAMERA */ /* CAMERA */
static struct regulator_consumer_supply cam_vt_cam15_supply = static struct regulator_consumer_supply cam_vt_cam15_supply =
REGULATOR_SUPPLY("vdd_core", "6-003c"); REGULATOR_SUPPLY("vdd_core", "6-003c");
@ -1313,6 +1319,7 @@ static struct platform_device *nuri_devices[] __initdata = {
&s5p_device_mfc_l, &s5p_device_mfc_l,
&s5p_device_mfc_r, &s5p_device_mfc_r,
&s5p_device_fimc_md, &s5p_device_fimc_md,
&s3c_device_usb_hsotg,
/* NURI Devices */ /* NURI Devices */
&nuri_gpio_keys, &nuri_gpio_keys,
@ -1369,6 +1376,7 @@ static void __init nuri_machine_init(void)
nuri_camera_init(); nuri_camera_init();
nuri_ehci_init(); nuri_ehci_init();
s3c_hsotg_set_platdata(&nuri_hsotg_pdata);
/* Last */ /* Last */
platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices));

View File

@ -23,6 +23,7 @@
#include <linux/i2c-gpio.h> #include <linux/i2c-gpio.h>
#include <linux/i2c/mcs.h> #include <linux/i2c/mcs.h>
#include <linux/i2c/atmel_mxt_ts.h> #include <linux/i2c/atmel_mxt_ts.h>
#include <linux/platform_data/s3c-hsotg.h>
#include <drm/exynos_drm.h> #include <drm/exynos_drm.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
@ -206,6 +207,7 @@ static struct regulator_init_data lp3974_ldo2_data = {
}; };
static struct regulator_consumer_supply lp3974_ldo3_consumer[] = { static struct regulator_consumer_supply lp3974_ldo3_consumer[] = {
REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"),
REGULATOR_SUPPLY("vdd", "exynos4-hdmi"), REGULATOR_SUPPLY("vdd", "exynos4-hdmi"),
REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"), REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"),
REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"),
@ -291,6 +293,7 @@ static struct regulator_init_data lp3974_ldo7_data = {
}; };
static struct regulator_consumer_supply lp3974_ldo8_consumer[] = { static struct regulator_consumer_supply lp3974_ldo8_consumer[] = {
REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"),
REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"), REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"),
}; };
@ -487,7 +490,10 @@ static struct regulator_init_data lp3974_vichg_data = {
static struct regulator_init_data lp3974_esafeout1_data = { static struct regulator_init_data lp3974_esafeout1_data = {
.constraints = { .constraints = {
.name = "SAFEOUT1", .name = "SAFEOUT1",
.min_uV = 4800000,
.max_uV = 4800000,
.valid_ops_mask = REGULATOR_CHANGE_STATUS, .valid_ops_mask = REGULATOR_CHANGE_STATUS,
.always_on = 1,
.state_mem = { .state_mem = {
.enabled = 1, .enabled = 1,
}, },
@ -1017,6 +1023,9 @@ static struct gpio universal_camera_gpios[] = {
{ GPIO_CAM_VGA_NSTBY, GPIOF_OUT_INIT_LOW, "CAM_VGA_NSTBY" }, { GPIO_CAM_VGA_NSTBY, GPIOF_OUT_INIT_LOW, "CAM_VGA_NSTBY" },
}; };
/* USB OTG */
static struct s3c_hsotg_plat universal_hsotg_pdata;
static void __init universal_camera_init(void) static void __init universal_camera_init(void)
{ {
s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata), s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata),
@ -1075,6 +1084,7 @@ static struct platform_device *universal_devices[] __initdata = {
#ifdef CONFIG_DRM_EXYNOS #ifdef CONFIG_DRM_EXYNOS
&exynos_device_drm, &exynos_device_drm,
#endif #endif
&s3c_device_usb_hsotg,
&s5p_device_mfc, &s5p_device_mfc,
&s5p_device_mfc_l, &s5p_device_mfc_l,
&s5p_device_mfc_r, &s5p_device_mfc_r,
@ -1133,6 +1143,7 @@ static void __init universal_machine_init(void)
i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs, i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs,
ARRAY_SIZE(i2c_gpio12_devs)); ARRAY_SIZE(i2c_gpio12_devs));
s3c_hsotg_set_platdata(&universal_hsotg_pdata);
universal_camera_init(); universal_camera_init();
/* Last */ /* Last */

View File

@ -26,11 +26,71 @@ static int exynos4_usb_host_phy_is_on(void)
return (readl(EXYNOS4_PHYPWR) & PHY1_STD_ANALOG_POWERDOWN) ? 0 : 1; return (readl(EXYNOS4_PHYPWR) & PHY1_STD_ANALOG_POWERDOWN) ? 0 : 1;
} }
static int exynos4_usb_phy1_init(struct platform_device *pdev) static void exynos4210_usb_phy_clkset(struct platform_device *pdev)
{ {
struct clk *otg_clk;
struct clk *xusbxti_clk; struct clk *xusbxti_clk;
u32 phyclk; u32 phyclk;
/* set clock frequency for PLL */
phyclk = readl(EXYNOS4_PHYCLK) & ~CLKSEL_MASK;
xusbxti_clk = clk_get(&pdev->dev, "xusbxti");
if (xusbxti_clk && !IS_ERR(xusbxti_clk)) {
switch (clk_get_rate(xusbxti_clk)) {
case 12 * MHZ:
phyclk |= CLKSEL_12M;
break;
case 24 * MHZ:
phyclk |= CLKSEL_24M;
break;
default:
case 48 * MHZ:
/* default reference clock */
break;
}
clk_put(xusbxti_clk);
}
writel(phyclk, EXYNOS4_PHYCLK);
}
static int exynos4210_usb_phy0_init(struct platform_device *pdev)
{
u32 rstcon;
writel(readl(S5P_USBDEVICE_PHY_CONTROL) | S5P_USBDEVICE_PHY_ENABLE,
S5P_USBDEVICE_PHY_CONTROL);
exynos4210_usb_phy_clkset(pdev);
/* set to normal PHY0 */
writel((readl(EXYNOS4_PHYPWR) & ~PHY0_NORMAL_MASK), EXYNOS4_PHYPWR);
/* reset PHY0 and Link */
rstcon = readl(EXYNOS4_RSTCON) | PHY0_SWRST_MASK;
writel(rstcon, EXYNOS4_RSTCON);
udelay(10);
rstcon &= ~PHY0_SWRST_MASK;
writel(rstcon, EXYNOS4_RSTCON);
return 0;
}
static int exynos4210_usb_phy0_exit(struct platform_device *pdev)
{
writel((readl(EXYNOS4_PHYPWR) | PHY0_ANALOG_POWERDOWN |
PHY0_OTG_DISABLE), EXYNOS4_PHYPWR);
writel(readl(S5P_USBDEVICE_PHY_CONTROL) & ~S5P_USBDEVICE_PHY_ENABLE,
S5P_USBDEVICE_PHY_CONTROL);
return 0;
}
static int exynos4210_usb_phy1_init(struct platform_device *pdev)
{
struct clk *otg_clk;
u32 rstcon; u32 rstcon;
int err; int err;
@ -54,27 +114,7 @@ static int exynos4_usb_phy1_init(struct platform_device *pdev)
writel(readl(S5P_USBHOST_PHY_CONTROL) | S5P_USBHOST_PHY_ENABLE, writel(readl(S5P_USBHOST_PHY_CONTROL) | S5P_USBHOST_PHY_ENABLE,
S5P_USBHOST_PHY_CONTROL); S5P_USBHOST_PHY_CONTROL);
/* set clock frequency for PLL */ exynos4210_usb_phy_clkset(pdev);
phyclk = readl(EXYNOS4_PHYCLK) & ~CLKSEL_MASK;
xusbxti_clk = clk_get(&pdev->dev, "xusbxti");
if (xusbxti_clk && !IS_ERR(xusbxti_clk)) {
switch (clk_get_rate(xusbxti_clk)) {
case 12 * MHZ:
phyclk |= CLKSEL_12M;
break;
case 24 * MHZ:
phyclk |= CLKSEL_24M;
break;
default:
case 48 * MHZ:
/* default reference clock */
break;
}
clk_put(xusbxti_clk);
}
writel(phyclk, EXYNOS4_PHYCLK);
/* floating prevention logic: disable */ /* floating prevention logic: disable */
writel((readl(EXYNOS4_PHY1CON) | FPENABLEN), EXYNOS4_PHY1CON); writel((readl(EXYNOS4_PHY1CON) | FPENABLEN), EXYNOS4_PHY1CON);
@ -102,7 +142,7 @@ static int exynos4_usb_phy1_init(struct platform_device *pdev)
return 0; return 0;
} }
static int exynos4_usb_phy1_exit(struct platform_device *pdev) static int exynos4210_usb_phy1_exit(struct platform_device *pdev)
{ {
struct clk *otg_clk; struct clk *otg_clk;
int err; int err;
@ -136,16 +176,20 @@ static int exynos4_usb_phy1_exit(struct platform_device *pdev)
int s5p_usb_phy_init(struct platform_device *pdev, int type) int s5p_usb_phy_init(struct platform_device *pdev, int type)
{ {
if (type == S5P_USB_PHY_HOST) if (type == S5P_USB_PHY_DEVICE)
return exynos4_usb_phy1_init(pdev); return exynos4210_usb_phy0_init(pdev);
else if (type == S5P_USB_PHY_HOST)
return exynos4210_usb_phy1_init(pdev);
return -EINVAL; return -EINVAL;
} }
int s5p_usb_phy_exit(struct platform_device *pdev, int type) int s5p_usb_phy_exit(struct platform_device *pdev, int type)
{ {
if (type == S5P_USB_PHY_HOST) if (type == S5P_USB_PHY_DEVICE)
return exynos4_usb_phy1_exit(pdev); return exynos4210_usb_phy0_exit(pdev);
else if (type == S5P_USB_PHY_HOST)
return exynos4210_usb_phy1_exit(pdev);
return -EINVAL; return -EINVAL;
} }

View File

@ -31,6 +31,7 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/i2c/pca953x.h> #include <linux/i2c/pca953x.h>
#include <linux/platform_data/s3c-hsotg.h>
#include <video/platform_lcd.h> #include <video/platform_lcd.h>
@ -61,7 +62,6 @@
#include <plat/sdhci.h> #include <plat/sdhci.h>
#include <plat/gpio-cfg.h> #include <plat/gpio-cfg.h>
#include <plat/s3c64xx-spi.h> #include <plat/s3c64xx-spi.h>
#include <plat/udc-hs.h>
#include <plat/keypad.h> #include <plat/keypad.h>
#include <plat/clock.h> #include <plat/clock.h>

View File

@ -18,6 +18,7 @@
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/spi/spi_gpio.h> #include <linux/spi/spi_gpio.h>
#include <linux/usb/gpio_vbus.h> #include <linux/usb/gpio_vbus.h>
#include <linux/platform_data/s3c-hsotg.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
@ -33,7 +34,6 @@
#include <plat/gpio-cfg.h> #include <plat/gpio-cfg.h>
#include <plat/hwmon.h> #include <plat/hwmon.h>
#include <plat/regs-serial.h> #include <plat/regs-serial.h>
#include <plat/udc-hs.h>
#include <plat/usb-control.h> #include <plat/usb-control.h>
#include <plat/sdhci.h> #include <plat/sdhci.h>
#include <plat/ts.h> #include <plat/ts.h>

View File

@ -30,6 +30,7 @@
#include <linux/regulator/fixed.h> #include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/pwm_backlight.h> #include <linux/pwm_backlight.h>
#include <linux/platform_data/s3c-hsotg.h>
#ifdef CONFIG_SMDK6410_WM1190_EV1 #ifdef CONFIG_SMDK6410_WM1190_EV1
#include <linux/mfd/wm8350/core.h> #include <linux/mfd/wm8350/core.h>
@ -72,7 +73,6 @@
#include <plat/keypad.h> #include <plat/keypad.h>
#include <plat/backlight.h> #include <plat/backlight.h>
#include <plat/regs-fb-v4.h> #include <plat/regs-fb-v4.h>
#include <plat/udc-hs.h>
#include "common.h" #include "common.h"

View File

@ -85,6 +85,7 @@ config MACH_AQUILA
select S5P_DEV_ONENAND select S5P_DEV_ONENAND
select S5PV210_SETUP_FB_24BPP select S5PV210_SETUP_FB_24BPP
select S5PV210_SETUP_SDHCI select S5PV210_SETUP_SDHCI
select S5PV210_SETUP_USB_PHY
help help
Machine support for the Samsung Aquila target based on S5PC110 SoC Machine support for the Samsung Aquila target based on S5PC110 SoC

View File

@ -27,6 +27,7 @@
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/platform_data/s3c-hsotg.h>
#include <asm/hardware/vic.h> #include <asm/hardware/vic.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
@ -278,6 +279,9 @@ static void __init goni_tsp_init(void)
i2c2_devs[0].irq = gpio_to_irq(gpio); i2c2_devs[0].irq = gpio_to_irq(gpio);
} }
/* USB OTG */
static struct s3c_hsotg_plat goni_hsotg_pdata;
static void goni_camera_init(void) static void goni_camera_init(void)
{ {
s5pv210_fimc_setup_gpio(S5P_CAMPORT_A); s5pv210_fimc_setup_gpio(S5P_CAMPORT_A);
@ -941,6 +945,8 @@ static void __init goni_machine_init(void)
s3c_set_platdata(&goni_fimc_md_platdata, sizeof(goni_fimc_md_platdata), s3c_set_platdata(&goni_fimc_md_platdata, sizeof(goni_fimc_md_platdata),
&s5p_device_fimc_md); &s5p_device_fimc_md);
s3c_hsotg_set_platdata(&goni_hsotg_pdata);
goni_camera_init(); goni_camera_init();
/* SPI */ /* SPI */

View File

@ -30,6 +30,7 @@
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/platform_data/s3c-hsudc.h> #include <linux/platform_data/s3c-hsudc.h>
#include <linux/platform_data/s3c-hsotg.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/pmu.h> #include <asm/pmu.h>
@ -57,7 +58,6 @@
#include <plat/sdhci.h> #include <plat/sdhci.h>
#include <plat/ts.h> #include <plat/ts.h>
#include <plat/udc.h> #include <plat/udc.h>
#include <plat/udc-hs.h>
#include <plat/usb-control.h> #include <plat/usb-control.h>
#include <plat/usb-phy.h> #include <plat/usb-phy.h>
#include <plat/regs-iic.h> #include <plat/regs-iic.h>

View File

@ -1,379 +0,0 @@
/* arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h
*
* Copyright 2008 Openmoko, Inc.
* Copyright 2008 Simtec Electronics
* http://armlinux.simtec.co.uk/
* Ben Dooks <ben@simtec.co.uk>
*
* S3C - USB2.0 Highspeed/OtG device block registers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_H
#define __PLAT_S3C64XX_REGS_USB_HSOTG_H __FILE__
#define S3C_HSOTG_REG(x) (x)
#define S3C_GOTGCTL S3C_HSOTG_REG(0x000)
#define S3C_GOTGCTL_BSESVLD (1 << 19)
#define S3C_GOTGCTL_ASESVLD (1 << 18)
#define S3C_GOTGCTL_DBNC_SHORT (1 << 17)
#define S3C_GOTGCTL_CONID_B (1 << 16)
#define S3C_GOTGCTL_DEVHNPEN (1 << 11)
#define S3C_GOTGCTL_HSSETHNPEN (1 << 10)
#define S3C_GOTGCTL_HNPREQ (1 << 9)
#define S3C_GOTGCTL_HSTNEGSCS (1 << 8)
#define S3C_GOTGCTL_SESREQ (1 << 1)
#define S3C_GOTGCTL_SESREQSCS (1 << 0)
#define S3C_GOTGINT S3C_HSOTG_REG(0x004)
#define S3C_GOTGINT_DbnceDone (1 << 19)
#define S3C_GOTGINT_ADevTOUTChg (1 << 18)
#define S3C_GOTGINT_HstNegDet (1 << 17)
#define S3C_GOTGINT_HstnegSucStsChng (1 << 9)
#define S3C_GOTGINT_SesReqSucStsChng (1 << 8)
#define S3C_GOTGINT_SesEndDet (1 << 2)
#define S3C_GAHBCFG S3C_HSOTG_REG(0x008)
#define S3C_GAHBCFG_PTxFEmpLvl (1 << 8)
#define S3C_GAHBCFG_NPTxFEmpLvl (1 << 7)
#define S3C_GAHBCFG_DMAEn (1 << 5)
#define S3C_GAHBCFG_HBstLen_MASK (0xf << 1)
#define S3C_GAHBCFG_HBstLen_SHIFT (1)
#define S3C_GAHBCFG_HBstLen_Single (0x0 << 1)
#define S3C_GAHBCFG_HBstLen_Incr (0x1 << 1)
#define S3C_GAHBCFG_HBstLen_Incr4 (0x3 << 1)
#define S3C_GAHBCFG_HBstLen_Incr8 (0x5 << 1)
#define S3C_GAHBCFG_HBstLen_Incr16 (0x7 << 1)
#define S3C_GAHBCFG_GlblIntrEn (1 << 0)
#define S3C_GUSBCFG S3C_HSOTG_REG(0x00C)
#define S3C_GUSBCFG_PHYLPClkSel (1 << 15)
#define S3C_GUSBCFG_HNPCap (1 << 9)
#define S3C_GUSBCFG_SRPCap (1 << 8)
#define S3C_GUSBCFG_PHYIf16 (1 << 3)
#define S3C_GUSBCFG_TOutCal_MASK (0x7 << 0)
#define S3C_GUSBCFG_TOutCal_SHIFT (0)
#define S3C_GUSBCFG_TOutCal_LIMIT (0x7)
#define S3C_GUSBCFG_TOutCal(_x) ((_x) << 0)
#define S3C_GRSTCTL S3C_HSOTG_REG(0x010)
#define S3C_GRSTCTL_AHBIdle (1 << 31)
#define S3C_GRSTCTL_DMAReq (1 << 30)
#define S3C_GRSTCTL_TxFNum_MASK (0x1f << 6)
#define S3C_GRSTCTL_TxFNum_SHIFT (6)
#define S3C_GRSTCTL_TxFNum_LIMIT (0x1f)
#define S3C_GRSTCTL_TxFNum(_x) ((_x) << 6)
#define S3C_GRSTCTL_TxFFlsh (1 << 5)
#define S3C_GRSTCTL_RxFFlsh (1 << 4)
#define S3C_GRSTCTL_INTknQFlsh (1 << 3)
#define S3C_GRSTCTL_FrmCntrRst (1 << 2)
#define S3C_GRSTCTL_HSftRst (1 << 1)
#define S3C_GRSTCTL_CSftRst (1 << 0)
#define S3C_GINTSTS S3C_HSOTG_REG(0x014)
#define S3C_GINTMSK S3C_HSOTG_REG(0x018)
#define S3C_GINTSTS_WkUpInt (1 << 31)
#define S3C_GINTSTS_SessReqInt (1 << 30)
#define S3C_GINTSTS_DisconnInt (1 << 29)
#define S3C_GINTSTS_ConIDStsChng (1 << 28)
#define S3C_GINTSTS_PTxFEmp (1 << 26)
#define S3C_GINTSTS_HChInt (1 << 25)
#define S3C_GINTSTS_PrtInt (1 << 24)
#define S3C_GINTSTS_FetSusp (1 << 22)
#define S3C_GINTSTS_incompIP (1 << 21)
#define S3C_GINTSTS_IncomplSOIN (1 << 20)
#define S3C_GINTSTS_OEPInt (1 << 19)
#define S3C_GINTSTS_IEPInt (1 << 18)
#define S3C_GINTSTS_EPMis (1 << 17)
#define S3C_GINTSTS_EOPF (1 << 15)
#define S3C_GINTSTS_ISOutDrop (1 << 14)
#define S3C_GINTSTS_EnumDone (1 << 13)
#define S3C_GINTSTS_USBRst (1 << 12)
#define S3C_GINTSTS_USBSusp (1 << 11)
#define S3C_GINTSTS_ErlySusp (1 << 10)
#define S3C_GINTSTS_GOUTNakEff (1 << 7)
#define S3C_GINTSTS_GINNakEff (1 << 6)
#define S3C_GINTSTS_NPTxFEmp (1 << 5)
#define S3C_GINTSTS_RxFLvl (1 << 4)
#define S3C_GINTSTS_SOF (1 << 3)
#define S3C_GINTSTS_OTGInt (1 << 2)
#define S3C_GINTSTS_ModeMis (1 << 1)
#define S3C_GINTSTS_CurMod_Host (1 << 0)
#define S3C_GRXSTSR S3C_HSOTG_REG(0x01C)
#define S3C_GRXSTSP S3C_HSOTG_REG(0x020)
#define S3C_GRXSTS_FN_MASK (0x7f << 25)
#define S3C_GRXSTS_FN_SHIFT (25)
#define S3C_GRXSTS_PktSts_MASK (0xf << 17)
#define S3C_GRXSTS_PktSts_SHIFT (17)
#define S3C_GRXSTS_PktSts_GlobalOutNAK (0x1 << 17)
#define S3C_GRXSTS_PktSts_OutRX (0x2 << 17)
#define S3C_GRXSTS_PktSts_OutDone (0x3 << 17)
#define S3C_GRXSTS_PktSts_SetupDone (0x4 << 17)
#define S3C_GRXSTS_PktSts_SetupRX (0x6 << 17)
#define S3C_GRXSTS_DPID_MASK (0x3 << 15)
#define S3C_GRXSTS_DPID_SHIFT (15)
#define S3C_GRXSTS_ByteCnt_MASK (0x7ff << 4)
#define S3C_GRXSTS_ByteCnt_SHIFT (4)
#define S3C_GRXSTS_EPNum_MASK (0xf << 0)
#define S3C_GRXSTS_EPNum_SHIFT (0)
#define S3C_GRXFSIZ S3C_HSOTG_REG(0x024)
#define S3C_GNPTXFSIZ S3C_HSOTG_REG(0x028)
#define S3C_GNPTXFSIZ_NPTxFDep_MASK (0xffff << 16)
#define S3C_GNPTXFSIZ_NPTxFDep_SHIFT (16)
#define S3C_GNPTXFSIZ_NPTxFDep_LIMIT (0xffff)
#define S3C_GNPTXFSIZ_NPTxFDep(_x) ((_x) << 16)
#define S3C_GNPTXFSIZ_NPTxFStAddr_MASK (0xffff << 0)
#define S3C_GNPTXFSIZ_NPTxFStAddr_SHIFT (0)
#define S3C_GNPTXFSIZ_NPTxFStAddr_LIMIT (0xffff)
#define S3C_GNPTXFSIZ_NPTxFStAddr(_x) ((_x) << 0)
#define S3C_GNPTXSTS S3C_HSOTG_REG(0x02C)
#define S3C_GNPTXSTS_NPtxQTop_MASK (0x7f << 24)
#define S3C_GNPTXSTS_NPtxQTop_SHIFT (24)
#define S3C_GNPTXSTS_NPTxQSpcAvail_MASK (0xff << 16)
#define S3C_GNPTXSTS_NPTxQSpcAvail_SHIFT (16)
#define S3C_GNPTXSTS_NPTxQSpcAvail_GET(_v) (((_v) >> 16) & 0xff)
#define S3C_GNPTXSTS_NPTxFSpcAvail_MASK (0xffff << 0)
#define S3C_GNPTXSTS_NPTxFSpcAvail_SHIFT (0)
#define S3C_GNPTXSTS_NPTxFSpcAvail_GET(_v) (((_v) >> 0) & 0xffff)
#define S3C_HPTXFSIZ S3C_HSOTG_REG(0x100)
#define S3C_DPTXFSIZn(_a) S3C_HSOTG_REG(0x104 + (((_a) - 1) * 4))
#define S3C_DPTXFSIZn_DPTxFSize_MASK (0xffff << 16)
#define S3C_DPTXFSIZn_DPTxFSize_SHIFT (16)
#define S3C_DPTXFSIZn_DPTxFSize_GET(_v) (((_v) >> 16) & 0xffff)
#define S3C_DPTXFSIZn_DPTxFSize_LIMIT (0xffff)
#define S3C_DPTXFSIZn_DPTxFSize(_x) ((_x) << 16)
#define S3C_DPTXFSIZn_DPTxFStAddr_MASK (0xffff << 0)
#define S3C_DPTXFSIZn_DPTxFStAddr_SHIFT (0)
/* Device mode registers */
#define S3C_DCFG S3C_HSOTG_REG(0x800)
#define S3C_DCFG_EPMisCnt_MASK (0x1f << 18)
#define S3C_DCFG_EPMisCnt_SHIFT (18)
#define S3C_DCFG_EPMisCnt_LIMIT (0x1f)
#define S3C_DCFG_EPMisCnt(_x) ((_x) << 18)
#define S3C_DCFG_PerFrInt_MASK (0x3 << 11)
#define S3C_DCFG_PerFrInt_SHIFT (11)
#define S3C_DCFG_PerFrInt_LIMIT (0x3)
#define S3C_DCFG_PerFrInt(_x) ((_x) << 11)
#define S3C_DCFG_DevAddr_MASK (0x7f << 4)
#define S3C_DCFG_DevAddr_SHIFT (4)
#define S3C_DCFG_DevAddr_LIMIT (0x7f)
#define S3C_DCFG_DevAddr(_x) ((_x) << 4)
#define S3C_DCFG_NZStsOUTHShk (1 << 2)
#define S3C_DCFG_DevSpd_MASK (0x3 << 0)
#define S3C_DCFG_DevSpd_SHIFT (0)
#define S3C_DCFG_DevSpd_HS (0x0 << 0)
#define S3C_DCFG_DevSpd_FS (0x1 << 0)
#define S3C_DCFG_DevSpd_LS (0x2 << 0)
#define S3C_DCFG_DevSpd_FS48 (0x3 << 0)
#define S3C_DCTL S3C_HSOTG_REG(0x804)
#define S3C_DCTL_PWROnPrgDone (1 << 11)
#define S3C_DCTL_CGOUTNak (1 << 10)
#define S3C_DCTL_SGOUTNak (1 << 9)
#define S3C_DCTL_CGNPInNAK (1 << 8)
#define S3C_DCTL_SGNPInNAK (1 << 7)
#define S3C_DCTL_TstCtl_MASK (0x7 << 4)
#define S3C_DCTL_TstCtl_SHIFT (4)
#define S3C_DCTL_GOUTNakSts (1 << 3)
#define S3C_DCTL_GNPINNakSts (1 << 2)
#define S3C_DCTL_SftDiscon (1 << 1)
#define S3C_DCTL_RmtWkUpSig (1 << 0)
#define S3C_DSTS S3C_HSOTG_REG(0x808)
#define S3C_DSTS_SOFFN_MASK (0x3fff << 8)
#define S3C_DSTS_SOFFN_SHIFT (8)
#define S3C_DSTS_SOFFN_LIMIT (0x3fff)
#define S3C_DSTS_SOFFN(_x) ((_x) << 8)
#define S3C_DSTS_ErraticErr (1 << 3)
#define S3C_DSTS_EnumSpd_MASK (0x3 << 1)
#define S3C_DSTS_EnumSpd_SHIFT (1)
#define S3C_DSTS_EnumSpd_HS (0x0 << 1)
#define S3C_DSTS_EnumSpd_FS (0x1 << 1)
#define S3C_DSTS_EnumSpd_LS (0x2 << 1)
#define S3C_DSTS_EnumSpd_FS48 (0x3 << 1)
#define S3C_DSTS_SuspSts (1 << 0)
#define S3C_DIEPMSK S3C_HSOTG_REG(0x810)
#define S3C_DIEPMSK_TxFIFOEmpty (1 << 7)
#define S3C_DIEPMSK_INEPNakEffMsk (1 << 6)
#define S3C_DIEPMSK_INTknEPMisMsk (1 << 5)
#define S3C_DIEPMSK_INTknTXFEmpMsk (1 << 4)
#define S3C_DIEPMSK_TimeOUTMsk (1 << 3)
#define S3C_DIEPMSK_AHBErrMsk (1 << 2)
#define S3C_DIEPMSK_EPDisbldMsk (1 << 1)
#define S3C_DIEPMSK_XferComplMsk (1 << 0)
#define S3C_DOEPMSK S3C_HSOTG_REG(0x814)
#define S3C_DOEPMSK_Back2BackSetup (1 << 6)
#define S3C_DOEPMSK_OUTTknEPdisMsk (1 << 4)
#define S3C_DOEPMSK_SetupMsk (1 << 3)
#define S3C_DOEPMSK_AHBErrMsk (1 << 2)
#define S3C_DOEPMSK_EPDisbldMsk (1 << 1)
#define S3C_DOEPMSK_XferComplMsk (1 << 0)
#define S3C_DAINT S3C_HSOTG_REG(0x818)
#define S3C_DAINTMSK S3C_HSOTG_REG(0x81C)
#define S3C_DAINT_OutEP_SHIFT (16)
#define S3C_DAINT_OutEP(x) (1 << ((x) + 16))
#define S3C_DAINT_InEP(x) (1 << (x))
#define S3C_DTKNQR1 S3C_HSOTG_REG(0x820)
#define S3C_DTKNQR2 S3C_HSOTG_REG(0x824)
#define S3C_DTKNQR3 S3C_HSOTG_REG(0x830)
#define S3C_DTKNQR4 S3C_HSOTG_REG(0x834)
#define S3C_DVBUSDIS S3C_HSOTG_REG(0x828)
#define S3C_DVBUSPULSE S3C_HSOTG_REG(0x82C)
#define S3C_DIEPCTL0 S3C_HSOTG_REG(0x900)
#define S3C_DOEPCTL0 S3C_HSOTG_REG(0xB00)
#define S3C_DIEPCTL(_a) S3C_HSOTG_REG(0x900 + ((_a) * 0x20))
#define S3C_DOEPCTL(_a) S3C_HSOTG_REG(0xB00 + ((_a) * 0x20))
/* EP0 specialness:
* bits[29..28] - reserved (no SetD0PID, SetD1PID)
* bits[25..22] - should always be zero, this isn't a periodic endpoint
* bits[10..0] - MPS setting differenct for EP0
*/
#define S3C_D0EPCTL_MPS_MASK (0x3 << 0)
#define S3C_D0EPCTL_MPS_SHIFT (0)
#define S3C_D0EPCTL_MPS_64 (0x0 << 0)
#define S3C_D0EPCTL_MPS_32 (0x1 << 0)
#define S3C_D0EPCTL_MPS_16 (0x2 << 0)
#define S3C_D0EPCTL_MPS_8 (0x3 << 0)
#define S3C_DxEPCTL_EPEna (1 << 31)
#define S3C_DxEPCTL_EPDis (1 << 30)
#define S3C_DxEPCTL_SetD1PID (1 << 29)
#define S3C_DxEPCTL_SetOddFr (1 << 29)
#define S3C_DxEPCTL_SetD0PID (1 << 28)
#define S3C_DxEPCTL_SetEvenFr (1 << 28)
#define S3C_DxEPCTL_SNAK (1 << 27)
#define S3C_DxEPCTL_CNAK (1 << 26)
#define S3C_DxEPCTL_TxFNum_MASK (0xf << 22)
#define S3C_DxEPCTL_TxFNum_SHIFT (22)
#define S3C_DxEPCTL_TxFNum_LIMIT (0xf)
#define S3C_DxEPCTL_TxFNum(_x) ((_x) << 22)
#define S3C_DxEPCTL_Stall (1 << 21)
#define S3C_DxEPCTL_Snp (1 << 20)
#define S3C_DxEPCTL_EPType_MASK (0x3 << 18)
#define S3C_DxEPCTL_EPType_SHIFT (18)
#define S3C_DxEPCTL_EPType_Control (0x0 << 18)
#define S3C_DxEPCTL_EPType_Iso (0x1 << 18)
#define S3C_DxEPCTL_EPType_Bulk (0x2 << 18)
#define S3C_DxEPCTL_EPType_Intterupt (0x3 << 18)
#define S3C_DxEPCTL_NAKsts (1 << 17)
#define S3C_DxEPCTL_DPID (1 << 16)
#define S3C_DxEPCTL_EOFrNum (1 << 16)
#define S3C_DxEPCTL_USBActEp (1 << 15)
#define S3C_DxEPCTL_NextEp_MASK (0xf << 11)
#define S3C_DxEPCTL_NextEp_SHIFT (11)
#define S3C_DxEPCTL_NextEp_LIMIT (0xf)
#define S3C_DxEPCTL_NextEp(_x) ((_x) << 11)
#define S3C_DxEPCTL_MPS_MASK (0x7ff << 0)
#define S3C_DxEPCTL_MPS_SHIFT (0)
#define S3C_DxEPCTL_MPS_LIMIT (0x7ff)
#define S3C_DxEPCTL_MPS(_x) ((_x) << 0)
#define S3C_DIEPINT(_a) S3C_HSOTG_REG(0x908 + ((_a) * 0x20))
#define S3C_DOEPINT(_a) S3C_HSOTG_REG(0xB08 + ((_a) * 0x20))
#define S3C_DxEPINT_INEPNakEff (1 << 6)
#define S3C_DxEPINT_Back2BackSetup (1 << 6)
#define S3C_DxEPINT_INTknEPMis (1 << 5)
#define S3C_DxEPINT_INTknTXFEmp (1 << 4)
#define S3C_DxEPINT_OUTTknEPdis (1 << 4)
#define S3C_DxEPINT_Timeout (1 << 3)
#define S3C_DxEPINT_Setup (1 << 3)
#define S3C_DxEPINT_AHBErr (1 << 2)
#define S3C_DxEPINT_EPDisbld (1 << 1)
#define S3C_DxEPINT_XferCompl (1 << 0)
#define S3C_DIEPTSIZ0 S3C_HSOTG_REG(0x910)
#define S3C_DIEPTSIZ0_PktCnt_MASK (0x3 << 19)
#define S3C_DIEPTSIZ0_PktCnt_SHIFT (19)
#define S3C_DIEPTSIZ0_PktCnt_LIMIT (0x3)
#define S3C_DIEPTSIZ0_PktCnt(_x) ((_x) << 19)
#define S3C_DIEPTSIZ0_XferSize_MASK (0x7f << 0)
#define S3C_DIEPTSIZ0_XferSize_SHIFT (0)
#define S3C_DIEPTSIZ0_XferSize_LIMIT (0x7f)
#define S3C_DIEPTSIZ0_XferSize(_x) ((_x) << 0)
#define DOEPTSIZ0 S3C_HSOTG_REG(0xB10)
#define S3C_DOEPTSIZ0_SUPCnt_MASK (0x3 << 29)
#define S3C_DOEPTSIZ0_SUPCnt_SHIFT (29)
#define S3C_DOEPTSIZ0_SUPCnt_LIMIT (0x3)
#define S3C_DOEPTSIZ0_SUPCnt(_x) ((_x) << 29)
#define S3C_DOEPTSIZ0_PktCnt (1 << 19)
#define S3C_DOEPTSIZ0_XferSize_MASK (0x7f << 0)
#define S3C_DOEPTSIZ0_XferSize_SHIFT (0)
#define S3C_DIEPTSIZ(_a) S3C_HSOTG_REG(0x910 + ((_a) * 0x20))
#define S3C_DOEPTSIZ(_a) S3C_HSOTG_REG(0xB10 + ((_a) * 0x20))
#define S3C_DxEPTSIZ_MC_MASK (0x3 << 29)
#define S3C_DxEPTSIZ_MC_SHIFT (29)
#define S3C_DxEPTSIZ_MC_LIMIT (0x3)
#define S3C_DxEPTSIZ_MC(_x) ((_x) << 29)
#define S3C_DxEPTSIZ_PktCnt_MASK (0x3ff << 19)
#define S3C_DxEPTSIZ_PktCnt_SHIFT (19)
#define S3C_DxEPTSIZ_PktCnt_GET(_v) (((_v) >> 19) & 0x3ff)
#define S3C_DxEPTSIZ_PktCnt_LIMIT (0x3ff)
#define S3C_DxEPTSIZ_PktCnt(_x) ((_x) << 19)
#define S3C_DxEPTSIZ_XferSize_MASK (0x7ffff << 0)
#define S3C_DxEPTSIZ_XferSize_SHIFT (0)
#define S3C_DxEPTSIZ_XferSize_GET(_v) (((_v) >> 0) & 0x7ffff)
#define S3C_DxEPTSIZ_XferSize_LIMIT (0x7ffff)
#define S3C_DxEPTSIZ_XferSize(_x) ((_x) << 0)
#define S3C_DIEPDMA(_a) S3C_HSOTG_REG(0x914 + ((_a) * 0x20))
#define S3C_DOEPDMA(_a) S3C_HSOTG_REG(0xB14 + ((_a) * 0x20))
#define S3C_DTXFSTS(_a) S3C_HSOTG_REG(0x918 + ((_a) * 0x20))
#define S3C_EPFIFO(_a) S3C_HSOTG_REG(0x1000 + ((_a) * 0x1000))
#endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_H */

View File

@ -69,6 +69,7 @@ static struct acpi_bus_type *acpi_get_bus_type(struct bus_type *type)
up_read(&bus_type_sem); up_read(&bus_type_sem);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(register_acpi_bus_type);
static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle) static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle)
{ {
@ -85,6 +86,7 @@ static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle)
up_read(&bus_type_sem); up_read(&bus_type_sem);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(unregister_acpi_bus_type);
/* Get device's handler per its address under its parent */ /* Get device's handler per its address under its parent */
struct acpi_find_child { struct acpi_find_child {

View File

@ -382,3 +382,33 @@ acpi_evaluate_reference(acpi_handle handle,
} }
EXPORT_SYMBOL(acpi_evaluate_reference); EXPORT_SYMBOL(acpi_evaluate_reference);
acpi_status
acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld *pld)
{
acpi_status status;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *output;
status = acpi_evaluate_object(handle, "_PLD", NULL, &buffer);
if (ACPI_FAILURE(status))
return status;
output = buffer.pointer;
if (!output || output->type != ACPI_TYPE_PACKAGE
|| !output->package.count
|| output->package.elements[0].type != ACPI_TYPE_BUFFER
|| output->package.elements[0].buffer.length > sizeof(*pld)) {
status = AE_TYPE;
goto out;
}
memcpy(pld, output->package.elements[0].buffer.pointer,
output->package.elements[0].buffer.length);
out:
kfree(buffer.pointer);
return status;
}
EXPORT_SYMBOL(acpi_get_physical_device_location);

View File

@ -297,6 +297,23 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
return -EILSEQ; return -EILSEQ;
} }
/* First Slave Address Descriptor should be port 0:
* the main register space for the core
*/
tmp = bcma_erom_get_addr_desc(bus, eromptr, SCAN_ADDR_TYPE_SLAVE, 0);
if (tmp <= 0) {
/* Try again to see if it is a bridge */
tmp = bcma_erom_get_addr_desc(bus, eromptr,
SCAN_ADDR_TYPE_BRIDGE, 0);
if (tmp <= 0) {
return -EILSEQ;
} else {
pr_info("Bridge found\n");
return -ENXIO;
}
}
core->addr = tmp;
/* get & parse slave ports */ /* get & parse slave ports */
for (i = 0; i < ports[1]; i++) { for (i = 0; i < ports[1]; i++) {
for (j = 0; ; j++) { for (j = 0; ; j++) {
@ -309,7 +326,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
break; break;
} else { } else {
if (i == 0 && j == 0) if (i == 0 && j == 0)
core->addr = tmp; core->addr1 = tmp;
} }
} }
} }

View File

@ -439,6 +439,7 @@ static struct usb_driver ath3k_driver = {
.probe = ath3k_probe, .probe = ath3k_probe,
.disconnect = ath3k_disconnect, .disconnect = ath3k_disconnect,
.id_table = ath3k_table, .id_table = ath3k_table,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(ath3k_driver); module_usb_driver(ath3k_driver);

View File

@ -279,6 +279,7 @@ static struct usb_driver bcm203x_driver = {
.probe = bcm203x_probe, .probe = bcm203x_probe,
.disconnect = bcm203x_disconnect, .disconnect = bcm203x_disconnect,
.id_table = bcm203x_table, .id_table = bcm203x_table,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(bcm203x_driver); module_usb_driver(bcm203x_driver);

View File

@ -749,6 +749,7 @@ static struct usb_driver bfusb_driver = {
.probe = bfusb_probe, .probe = bfusb_probe,
.disconnect = bfusb_disconnect, .disconnect = bfusb_disconnect,
.id_table = bfusb_table, .id_table = bfusb_table,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(bfusb_driver); module_usb_driver(bfusb_driver);

View File

@ -508,6 +508,7 @@ static struct usb_driver bpa10x_driver = {
.probe = bpa10x_probe, .probe = bpa10x_probe,
.disconnect = bpa10x_disconnect, .disconnect = bpa10x_disconnect,
.id_table = bpa10x_table, .id_table = bpa10x_table,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(bpa10x_driver); module_usb_driver(bpa10x_driver);

View File

@ -1218,6 +1218,7 @@ static struct usb_driver btusb_driver = {
#endif #endif
.id_table = btusb_table, .id_table = btusb_table,
.supports_autosuspend = 1, .supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(btusb_driver); module_usb_driver(btusb_driver);

View File

@ -203,7 +203,7 @@ static int usbhid_restart_out_queue(struct usbhid_device *usbhid)
return 0; return 0;
if ((kicked = (usbhid->outhead != usbhid->outtail))) { if ((kicked = (usbhid->outhead != usbhid->outtail))) {
dbg("Kicking head %d tail %d", usbhid->outhead, usbhid->outtail); hid_dbg(hid, "Kicking head %d tail %d", usbhid->outhead, usbhid->outtail);
r = usb_autopm_get_interface_async(usbhid->intf); r = usb_autopm_get_interface_async(usbhid->intf);
if (r < 0) if (r < 0)
@ -230,7 +230,7 @@ static int usbhid_restart_ctrl_queue(struct usbhid_device *usbhid)
return 0; return 0;
if ((kicked = (usbhid->ctrlhead != usbhid->ctrltail))) { if ((kicked = (usbhid->ctrlhead != usbhid->ctrltail))) {
dbg("Kicking head %d tail %d", usbhid->ctrlhead, usbhid->ctrltail); hid_dbg(hid, "Kicking head %d tail %d", usbhid->ctrlhead, usbhid->ctrltail);
r = usb_autopm_get_interface_async(usbhid->intf); r = usb_autopm_get_interface_async(usbhid->intf);
if (r < 0) if (r < 0)
@ -399,6 +399,16 @@ static int hid_submit_ctrl(struct hid_device *hid)
* Output interrupt completion handler. * Output interrupt completion handler.
*/ */
static int irq_out_pump_restart(struct hid_device *hid)
{
struct usbhid_device *usbhid = hid->driver_data;
if (usbhid->outhead != usbhid->outtail)
return hid_submit_out(hid);
else
return -1;
}
static void hid_irq_out(struct urb *urb) static void hid_irq_out(struct urb *urb)
{ {
struct hid_device *hid = urb->context; struct hid_device *hid = urb->context;
@ -428,7 +438,7 @@ static void hid_irq_out(struct urb *urb)
else else
usbhid->outtail = (usbhid->outtail + 1) & (HID_OUTPUT_FIFO_SIZE - 1); usbhid->outtail = (usbhid->outtail + 1) & (HID_OUTPUT_FIFO_SIZE - 1);
if (usbhid->outhead != usbhid->outtail && !hid_submit_out(hid)) { if (!irq_out_pump_restart(hid)) {
/* Successfully submitted next urb in queue */ /* Successfully submitted next urb in queue */
spin_unlock_irqrestore(&usbhid->lock, flags); spin_unlock_irqrestore(&usbhid->lock, flags);
return; return;
@ -443,6 +453,15 @@ static void hid_irq_out(struct urb *urb)
/* /*
* Control pipe completion handler. * Control pipe completion handler.
*/ */
static int ctrl_pump_restart(struct hid_device *hid)
{
struct usbhid_device *usbhid = hid->driver_data;
if (usbhid->ctrlhead != usbhid->ctrltail)
return hid_submit_ctrl(hid);
else
return -1;
}
static void hid_ctrl(struct urb *urb) static void hid_ctrl(struct urb *urb)
{ {
@ -476,7 +495,7 @@ static void hid_ctrl(struct urb *urb)
else else
usbhid->ctrltail = (usbhid->ctrltail + 1) & (HID_CONTROL_FIFO_SIZE - 1); usbhid->ctrltail = (usbhid->ctrltail + 1) & (HID_CONTROL_FIFO_SIZE - 1);
if (usbhid->ctrlhead != usbhid->ctrltail && !hid_submit_ctrl(hid)) { if (!ctrl_pump_restart(hid)) {
/* Successfully submitted next urb in queue */ /* Successfully submitted next urb in queue */
spin_unlock(&usbhid->lock); spin_unlock(&usbhid->lock);
return; return;
@ -535,11 +554,27 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
* the queue is known to run * the queue is known to run
* but an earlier request may be stuck * but an earlier request may be stuck
* we may need to time out * we may need to time out
* no race because this is called under * no race because the URB is blocked under
* spinlock * spinlock
*/ */
if (time_after(jiffies, usbhid->last_out + HZ * 5)) if (time_after(jiffies, usbhid->last_out + HZ * 5)) {
usb_block_urb(usbhid->urbout);
/* drop lock to not deadlock if the callback is called */
spin_unlock(&usbhid->lock);
usb_unlink_urb(usbhid->urbout); usb_unlink_urb(usbhid->urbout);
spin_lock(&usbhid->lock);
usb_unblock_urb(usbhid->urbout);
/*
* if the unlinking has already completed
* the pump will have been stopped
* it must be restarted now
*/
if (!test_bit(HID_OUT_RUNNING, &usbhid->iofl))
if (!irq_out_pump_restart(hid))
set_bit(HID_OUT_RUNNING, &usbhid->iofl);
}
} }
return; return;
} }
@ -583,11 +618,25 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
* the queue is known to run * the queue is known to run
* but an earlier request may be stuck * but an earlier request may be stuck
* we may need to time out * we may need to time out
* no race because this is called under * no race because the URB is blocked under
* spinlock * spinlock
*/ */
if (time_after(jiffies, usbhid->last_ctrl + HZ * 5)) if (time_after(jiffies, usbhid->last_ctrl + HZ * 5)) {
usb_block_urb(usbhid->urbctrl);
/* drop lock to not deadlock if the callback is called */
spin_unlock(&usbhid->lock);
usb_unlink_urb(usbhid->urbctrl); usb_unlink_urb(usbhid->urbctrl);
spin_lock(&usbhid->lock);
usb_unblock_urb(usbhid->urbctrl);
/*
* if the unlinking has already completed
* the pump will have been stopped
* it must be restarted now
*/
if (!test_bit(HID_CTRL_RUNNING, &usbhid->iofl))
if (!ctrl_pump_restart(hid))
set_bit(HID_CTRL_RUNNING, &usbhid->iofl);
}
} }
} }

View File

@ -92,9 +92,10 @@ static void usb_mouse_irq(struct urb *urb)
resubmit: resubmit:
status = usb_submit_urb (urb, GFP_ATOMIC); status = usb_submit_urb (urb, GFP_ATOMIC);
if (status) if (status)
err ("can't resubmit intr, %s-%s/input0, status %d", dev_err(&mouse->usbdev->dev,
mouse->usbdev->bus->bus_name, "can't resubmit intr, %s-%s/input0, status %d\n",
mouse->usbdev->devpath, status); mouse->usbdev->bus->bus_name,
mouse->usbdev->devpath, status);
} }
static int usb_mouse_open(struct input_dev *dev) static int usb_mouse_open(struct input_dev *dev)

View File

@ -317,7 +317,8 @@ int iforce_init_device(struct iforce *iforce)
break; break;
if (i == 20) { /* 5 seconds */ if (i == 20) { /* 5 seconds */
err("Timeout waiting for response from device."); dev_err(&input_dev->dev,
"Timeout waiting for response from device.\n");
error = -ENODEV; error = -ENODEV;
goto fail; goto fail;
} }

View File

@ -257,7 +257,8 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
status = usb_submit_urb(iforce->ctrl, GFP_ATOMIC); status = usb_submit_urb(iforce->ctrl, GFP_ATOMIC);
if (status) { if (status) {
err("usb_submit_urb failed %d", status); dev_err(&iforce->intf->dev,
"usb_submit_urb failed %d\n", status);
return -1; return -1;
} }
@ -265,12 +266,14 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
iforce->ctrl->status != -EINPROGRESS, HZ); iforce->ctrl->status != -EINPROGRESS, HZ);
if (iforce->ctrl->status) { if (iforce->ctrl->status) {
dbg("iforce->ctrl->status = %d", iforce->ctrl->status); dev_dbg(&iforce->intf->dev,
"iforce->ctrl->status = %d\n",
iforce->ctrl->status);
usb_unlink_urb(iforce->ctrl); usb_unlink_urb(iforce->ctrl);
return -1; return -1;
} }
#else #else
dbg("iforce_get_id_packet: iforce->bus = USB!"); printk(KERN_DEBUG "iforce_get_id_packet: iforce->bus = USB!\n");
#endif #endif
} }
break; break;
@ -289,12 +292,15 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
return -1; return -1;
} }
#else #else
err("iforce_get_id_packet: iforce->bus = SERIO!"); dev_err(&iforce->dev->dev,
"iforce_get_id_packet: iforce->bus = SERIO!\n");
#endif #endif
break; break;
default: default:
err("iforce_get_id_packet: iforce->bus = %d", iforce->bus); dev_err(&iforce->dev->dev,
"iforce_get_id_packet: iforce->bus = %d\n",
iforce->bus);
break; break;
} }

View File

@ -64,7 +64,7 @@ void iforce_usb_xmit(struct iforce *iforce)
if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) { if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) {
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags); clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
dev_warn(&iforce->dev->dev, "usb_submit_urb failed %d\n", n); dev_warn(&iforce->intf->dev, "usb_submit_urb failed %d\n", n);
} }
/* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended. /* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended.
@ -76,6 +76,7 @@ void iforce_usb_xmit(struct iforce *iforce)
static void iforce_usb_irq(struct urb *urb) static void iforce_usb_irq(struct urb *urb)
{ {
struct iforce *iforce = urb->context; struct iforce *iforce = urb->context;
struct device *dev = &iforce->intf->dev;
int status; int status;
switch (urb->status) { switch (urb->status) {
@ -86,11 +87,12 @@ static void iforce_usb_irq(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", dev_dbg(dev, "%s - urb shutting down with status: %d\n",
__func__, urb->status); __func__, urb->status);
return; return;
default: default:
dbg("%s - urb has status of: %d", __func__, urb->status); dev_dbg(dev, "%s - urb has status of: %d\n",
__func__, urb->status);
goto exit; goto exit;
} }
@ -100,8 +102,8 @@ static void iforce_usb_irq(struct urb *urb)
exit: exit:
status = usb_submit_urb (urb, GFP_ATOMIC); status = usb_submit_urb (urb, GFP_ATOMIC);
if (status) if (status)
err ("%s - usb_submit_urb failed with result %d", dev_err(dev, "%s - usb_submit_urb failed with result %d\n",
__func__, status); __func__, status);
} }
static void iforce_usb_out(struct urb *urb) static void iforce_usb_out(struct urb *urb)
@ -110,7 +112,8 @@ static void iforce_usb_out(struct urb *urb)
if (urb->status) { if (urb->status) {
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags); clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
dbg("urb->status %d, exiting", urb->status); dev_dbg(&iforce->intf->dev, "urb->status %d, exiting\n",
urb->status);
return; return;
} }
@ -155,6 +158,7 @@ static int iforce_usb_probe(struct usb_interface *intf,
iforce->bus = IFORCE_USB; iforce->bus = IFORCE_USB;
iforce->usbdev = dev; iforce->usbdev = dev;
iforce->intf = intf;
iforce->cr.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_INTERFACE; iforce->cr.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_INTERFACE;
iforce->cr.wIndex = 0; iforce->cr.wIndex = 0;

View File

@ -115,6 +115,7 @@ struct iforce {
#endif #endif
#ifdef CONFIG_JOYSTICK_IFORCE_USB #ifdef CONFIG_JOYSTICK_IFORCE_USB
struct usb_device *usbdev; /* USB transfer */ struct usb_device *usbdev; /* USB transfer */
struct usb_interface *intf;
struct urb *irq, *out, *ctrl; struct urb *irq, *out, *ctrl;
struct usb_ctrlrequest cr; struct usb_ctrlrequest cr;
#endif #endif

View File

@ -252,6 +252,7 @@ MODULE_DEVICE_TABLE (usb, xpad_table);
struct usb_xpad { struct usb_xpad {
struct input_dev *dev; /* input device interface */ struct input_dev *dev; /* input device interface */
struct usb_device *udev; /* usb device */ struct usb_device *udev; /* usb device */
struct usb_interface *intf; /* usb interface */
int pad_present; int pad_present;
@ -457,6 +458,7 @@ static void xpad360w_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned cha
static void xpad_irq_in(struct urb *urb) static void xpad_irq_in(struct urb *urb)
{ {
struct usb_xpad *xpad = urb->context; struct usb_xpad *xpad = urb->context;
struct device *dev = &xpad->intf->dev;
int retval, status; int retval, status;
status = urb->status; status = urb->status;
@ -469,11 +471,11 @@ static void xpad_irq_in(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", dev_dbg(dev, "%s - urb shutting down with status: %d\n",
__func__, status); __func__, status);
return; return;
default: default:
dbg("%s - nonzero urb status received: %d", dev_dbg(dev, "%s - nonzero urb status received: %d\n",
__func__, status); __func__, status);
goto exit; goto exit;
} }
@ -492,12 +494,15 @@ static void xpad_irq_in(struct urb *urb)
exit: exit:
retval = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval) if (retval)
err ("%s - usb_submit_urb failed with result %d", dev_err(dev, "%s - usb_submit_urb failed with result %d\n",
__func__, retval); __func__, retval);
} }
static void xpad_bulk_out(struct urb *urb) static void xpad_bulk_out(struct urb *urb)
{ {
struct usb_xpad *xpad = urb->context;
struct device *dev = &xpad->intf->dev;
switch (urb->status) { switch (urb->status) {
case 0: case 0:
/* success */ /* success */
@ -506,16 +511,20 @@ static void xpad_bulk_out(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __func__, urb->status); dev_dbg(dev, "%s - urb shutting down with status: %d\n",
__func__, urb->status);
break; break;
default: default:
dbg("%s - nonzero urb status received: %d", __func__, urb->status); dev_dbg(dev, "%s - nonzero urb status received: %d\n",
__func__, urb->status);
} }
} }
#if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS) #if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS)
static void xpad_irq_out(struct urb *urb) static void xpad_irq_out(struct urb *urb)
{ {
struct usb_xpad *xpad = urb->context;
struct device *dev = &xpad->intf->dev;
int retval, status; int retval, status;
status = urb->status; status = urb->status;
@ -529,19 +538,21 @@ static void xpad_irq_out(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __func__, status); dev_dbg(dev, "%s - urb shutting down with status: %d\n",
__func__, status);
return; return;
default: default:
dbg("%s - nonzero urb status received: %d", __func__, status); dev_dbg(dev, "%s - nonzero urb status received: %d\n",
__func__, status);
goto exit; goto exit;
} }
exit: exit:
retval = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval) if (retval)
err("%s - usb_submit_urb failed with result %d", dev_err(dev, "%s - usb_submit_urb failed with result %d\n",
__func__, retval); __func__, retval);
} }
static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad) static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
@ -654,7 +665,8 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect
return usb_submit_urb(xpad->irq_out, GFP_ATOMIC); return usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
default: default:
dbg("%s - rumble command sent to unsupported xpad type: %d", dev_dbg(&xpad->dev->dev,
"%s - rumble command sent to unsupported xpad type: %d\n",
__func__, xpad->xtype); __func__, xpad->xtype);
return -1; return -1;
} }
@ -844,6 +856,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
} }
xpad->udev = udev; xpad->udev = udev;
xpad->intf = intf;
xpad->mapping = xpad_device[i].mapping; xpad->mapping = xpad_device[i].mapping;
xpad->xtype = xpad_device[i].xtype; xpad->xtype = xpad_device[i].xtype;

View File

@ -327,7 +327,9 @@ static void cm109_submit_buzz_toggle(struct cm109_dev *dev)
error = usb_submit_urb(dev->urb_ctl, GFP_ATOMIC); error = usb_submit_urb(dev->urb_ctl, GFP_ATOMIC);
if (error) if (error)
err("%s: usb_submit_urb (urb_ctl) failed %d", __func__, error); dev_err(&dev->intf->dev,
"%s: usb_submit_urb (urb_ctl) failed %d\n",
__func__, error);
} }
/* /*
@ -339,7 +341,7 @@ static void cm109_urb_irq_callback(struct urb *urb)
const int status = urb->status; const int status = urb->status;
int error; int error;
dev_dbg(&urb->dev->dev, "### URB IRQ: [0x%02x 0x%02x 0x%02x 0x%02x] keybit=0x%02x\n", dev_dbg(&dev->intf->dev, "### URB IRQ: [0x%02x 0x%02x 0x%02x 0x%02x] keybit=0x%02x\n",
dev->irq_data->byte[0], dev->irq_data->byte[0],
dev->irq_data->byte[1], dev->irq_data->byte[1],
dev->irq_data->byte[2], dev->irq_data->byte[2],
@ -349,7 +351,7 @@ static void cm109_urb_irq_callback(struct urb *urb)
if (status) { if (status) {
if (status == -ESHUTDOWN) if (status == -ESHUTDOWN)
return; return;
err("%s: urb status %d", __func__, status); dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status);
} }
/* Special keys */ /* Special keys */
@ -396,7 +398,8 @@ static void cm109_urb_irq_callback(struct urb *urb)
error = usb_submit_urb(dev->urb_ctl, GFP_ATOMIC); error = usb_submit_urb(dev->urb_ctl, GFP_ATOMIC);
if (error) if (error)
err("%s: usb_submit_urb (urb_ctl) failed %d", dev_err(&dev->intf->dev,
"%s: usb_submit_urb (urb_ctl) failed %d\n",
__func__, error); __func__, error);
} }
@ -409,14 +412,14 @@ static void cm109_urb_ctl_callback(struct urb *urb)
const int status = urb->status; const int status = urb->status;
int error; int error;
dev_dbg(&urb->dev->dev, "### URB CTL: [0x%02x 0x%02x 0x%02x 0x%02x]\n", dev_dbg(&dev->intf->dev, "### URB CTL: [0x%02x 0x%02x 0x%02x 0x%02x]\n",
dev->ctl_data->byte[0], dev->ctl_data->byte[0],
dev->ctl_data->byte[1], dev->ctl_data->byte[1],
dev->ctl_data->byte[2], dev->ctl_data->byte[2],
dev->ctl_data->byte[3]); dev->ctl_data->byte[3]);
if (status) if (status)
err("%s: urb status %d", __func__, status); dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status);
spin_lock(&dev->ctl_submit_lock); spin_lock(&dev->ctl_submit_lock);
@ -433,7 +436,8 @@ static void cm109_urb_ctl_callback(struct urb *urb)
dev->irq_urb_pending = 1; dev->irq_urb_pending = 1;
error = usb_submit_urb(dev->urb_irq, GFP_ATOMIC); error = usb_submit_urb(dev->urb_irq, GFP_ATOMIC);
if (error) if (error)
err("%s: usb_submit_urb (urb_irq) failed %d", dev_err(&dev->intf->dev,
"%s: usb_submit_urb (urb_irq) failed %d\n",
__func__, error); __func__, error);
} }
} }
@ -476,7 +480,8 @@ static void cm109_toggle_buzzer_sync(struct cm109_dev *dev, int on)
dev->ctl_data, dev->ctl_data,
USB_PKT_LEN, USB_CTRL_SET_TIMEOUT); USB_PKT_LEN, USB_CTRL_SET_TIMEOUT);
if (error < 0 && error != -EINTR) if (error < 0 && error != -EINTR)
err("%s: usb_control_msg() failed %d", __func__, error); dev_err(&dev->intf->dev, "%s: usb_control_msg() failed %d\n",
__func__, error);
} }
static void cm109_stop_traffic(struct cm109_dev *dev) static void cm109_stop_traffic(struct cm109_dev *dev)
@ -518,8 +523,8 @@ static int cm109_input_open(struct input_dev *idev)
error = usb_autopm_get_interface(dev->intf); error = usb_autopm_get_interface(dev->intf);
if (error < 0) { if (error < 0) {
err("%s - cannot autoresume, result %d", dev_err(&idev->dev, "%s - cannot autoresume, result %d\n",
__func__, error); __func__, error);
return error; return error;
} }
@ -537,7 +542,8 @@ static int cm109_input_open(struct input_dev *idev)
error = usb_submit_urb(dev->urb_ctl, GFP_KERNEL); error = usb_submit_urb(dev->urb_ctl, GFP_KERNEL);
if (error) if (error)
err("%s: usb_submit_urb (urb_ctl) failed %d", __func__, error); dev_err(&dev->intf->dev, "%s: usb_submit_urb (urb_ctl) failed %d\n",
__func__, error);
else else
dev->open = 1; dev->open = 1;
@ -573,7 +579,7 @@ static int cm109_input_ev(struct input_dev *idev, unsigned int type,
{ {
struct cm109_dev *dev = input_get_drvdata(idev); struct cm109_dev *dev = input_get_drvdata(idev);
dev_dbg(&dev->udev->dev, dev_dbg(&dev->intf->dev,
"input_ev: type=%u code=%u value=%d\n", type, code, value); "input_ev: type=%u code=%u value=%d\n", type, code, value);
if (type != EV_SND) if (type != EV_SND)
@ -710,7 +716,8 @@ static int cm109_usb_probe(struct usb_interface *intf,
pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress); pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
if (ret != USB_PKT_LEN) if (ret != USB_PKT_LEN)
err("invalid payload size %d, expected %d", ret, USB_PKT_LEN); dev_err(&intf->dev, "invalid payload size %d, expected %d\n",
ret, USB_PKT_LEN);
/* initialise irq urb */ /* initialise irq urb */
usb_fill_int_urb(dev->urb_irq, udev, pipe, dev->irq_data, usb_fill_int_urb(dev->urb_irq, udev, pipe, dev->irq_data,

View File

@ -157,7 +157,7 @@ static int keyspan_load_tester(struct usb_keyspan* dev, int bits_needed)
* though so it's not too big a deal * though so it's not too big a deal
*/ */
if (dev->data.pos >= dev->data.len) { if (dev->data.pos >= dev->data.len) {
dev_dbg(&dev->udev->dev, dev_dbg(&dev->interface->dev,
"%s - Error ran out of data. pos: %d, len: %d\n", "%s - Error ran out of data. pos: %d, len: %d\n",
__func__, dev->data.pos, dev->data.len); __func__, dev->data.pos, dev->data.len);
return -1; return -1;
@ -267,7 +267,9 @@ static void keyspan_check_data(struct usb_keyspan *remote)
remote->data.tester = remote->data.tester >> 6; remote->data.tester = remote->data.tester >> 6;
remote->data.bits_left -= 6; remote->data.bits_left -= 6;
} else { } else {
err("%s - Unknown sequence found in system data.\n", __func__); dev_err(&remote->interface->dev,
"%s - Unknown sequence found in system data.\n",
__func__);
remote->stage = 0; remote->stage = 0;
return; return;
} }
@ -286,7 +288,9 @@ static void keyspan_check_data(struct usb_keyspan *remote)
remote->data.tester = remote->data.tester >> 6; remote->data.tester = remote->data.tester >> 6;
remote->data.bits_left -= 6; remote->data.bits_left -= 6;
} else { } else {
err("%s - Unknown sequence found in button data.\n", __func__); dev_err(&remote->interface->dev,
"%s - Unknown sequence found in button data.\n",
__func__);
remote->stage = 0; remote->stage = 0;
return; return;
} }
@ -302,7 +306,9 @@ static void keyspan_check_data(struct usb_keyspan *remote)
remote->data.tester = remote->data.tester >> 6; remote->data.tester = remote->data.tester >> 6;
remote->data.bits_left -= 6; remote->data.bits_left -= 6;
} else { } else {
err("%s - Error in message, invalid toggle.\n", __func__); dev_err(&remote->interface->dev,
"%s - Error in message, invalid toggle.\n",
__func__);
remote->stage = 0; remote->stage = 0;
return; return;
} }
@ -312,10 +318,11 @@ static void keyspan_check_data(struct usb_keyspan *remote)
remote->data.tester = remote->data.tester >> 5; remote->data.tester = remote->data.tester >> 5;
remote->data.bits_left -= 5; remote->data.bits_left -= 5;
} else { } else {
err("Bad message received, no stop bit found.\n"); dev_err(&remote->interface->dev,
"Bad message received, no stop bit found.\n");
} }
dev_dbg(&remote->udev->dev, dev_dbg(&remote->interface->dev,
"%s found valid message: system: %d, button: %d, toggle: %d\n", "%s found valid message: system: %d, button: %d, toggle: %d\n",
__func__, message.system, message.button, message.toggle); __func__, message.system, message.button, message.toggle);
@ -397,7 +404,9 @@ static void keyspan_irq_recv(struct urb *urb)
resubmit: resubmit:
retval = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval) if (retval)
err ("%s - usb_submit_urb failed with result: %d", __func__, retval); dev_err(&dev->interface->dev,
"%s - usb_submit_urb failed with result: %d\n",
__func__, retval);
} }
static int keyspan_open(struct input_dev *dev) static int keyspan_open(struct input_dev *dev)

View File

@ -65,6 +65,7 @@ struct powermate_device {
struct urb *irq, *config; struct urb *irq, *config;
struct usb_ctrlrequest *configcr; struct usb_ctrlrequest *configcr;
struct usb_device *udev; struct usb_device *udev;
struct usb_interface *intf;
struct input_dev *input; struct input_dev *input;
spinlock_t lock; spinlock_t lock;
int static_brightness; int static_brightness;
@ -85,6 +86,7 @@ static void powermate_config_complete(struct urb *urb);
static void powermate_irq(struct urb *urb) static void powermate_irq(struct urb *urb)
{ {
struct powermate_device *pm = urb->context; struct powermate_device *pm = urb->context;
struct device *dev = &pm->intf->dev;
int retval; int retval;
switch (urb->status) { switch (urb->status) {
@ -95,10 +97,12 @@ static void powermate_irq(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __func__, urb->status); dev_dbg(dev, "%s - urb shutting down with status: %d\n",
__func__, urb->status);
return; return;
default: default:
dbg("%s - nonzero urb status received: %d", __func__, urb->status); dev_dbg(dev, "%s - nonzero urb status received: %d\n",
__func__, urb->status);
goto exit; goto exit;
} }
@ -110,8 +114,8 @@ static void powermate_irq(struct urb *urb)
exit: exit:
retval = usb_submit_urb (urb, GFP_ATOMIC); retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval) if (retval)
err ("%s - usb_submit_urb failed with result %d", dev_err(dev, "%s - usb_submit_urb failed with result: %d\n",
__func__, retval); __func__, retval);
} }
/* Decide if we need to issue a control message and do so. Must be called with pm->lock taken */ /* Decide if we need to issue a control message and do so. Must be called with pm->lock taken */
@ -330,6 +334,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
goto fail3; goto fail3;
pm->udev = udev; pm->udev = udev;
pm->intf = intf;
pm->input = input_dev; pm->input = input_dev;
usb_make_path(udev, pm->phys, sizeof(pm->phys)); usb_make_path(udev, pm->phys, sizeof(pm->phys));

View File

@ -101,6 +101,7 @@ static const struct lcd_segment_map {
struct yealink_dev { struct yealink_dev {
struct input_dev *idev; /* input device */ struct input_dev *idev; /* input device */
struct usb_device *udev; /* usb device */ struct usb_device *udev; /* usb device */
struct usb_interface *intf; /* usb interface */
/* irq input channel */ /* irq input channel */
struct yld_ctl_packet *irq_data; struct yld_ctl_packet *irq_data;
@ -428,7 +429,8 @@ static void urb_irq_callback(struct urb *urb)
int ret, status = urb->status; int ret, status = urb->status;
if (status) if (status)
err("%s - urb status %d", __func__, status); dev_err(&yld->intf->dev, "%s - urb status %d\n",
__func__, status);
switch (yld->irq_data->cmd) { switch (yld->irq_data->cmd) {
case CMD_KEYPRESS: case CMD_KEYPRESS:
@ -437,13 +439,15 @@ static void urb_irq_callback(struct urb *urb)
break; break;
case CMD_SCANCODE: case CMD_SCANCODE:
dbg("get scancode %x", yld->irq_data->data[0]); dev_dbg(&yld->intf->dev, "get scancode %x\n",
yld->irq_data->data[0]);
report_key(yld, map_p1k_to_key(yld->irq_data->data[0])); report_key(yld, map_p1k_to_key(yld->irq_data->data[0]));
break; break;
default: default:
err("unexpected response %x", yld->irq_data->cmd); dev_err(&yld->intf->dev, "unexpected response %x\n",
yld->irq_data->cmd);
} }
yealink_do_idle_tasks(yld); yealink_do_idle_tasks(yld);
@ -451,7 +455,9 @@ static void urb_irq_callback(struct urb *urb)
if (!yld->shutdown) { if (!yld->shutdown) {
ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC); ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC);
if (ret && ret != -EPERM) if (ret && ret != -EPERM)
err("%s - usb_submit_urb failed %d", __func__, ret); dev_err(&yld->intf->dev,
"%s - usb_submit_urb failed %d\n",
__func__, ret);
} }
} }
@ -461,7 +467,8 @@ static void urb_ctl_callback(struct urb *urb)
int ret = 0, status = urb->status; int ret = 0, status = urb->status;
if (status) if (status)
err("%s - urb status %d", __func__, status); dev_err(&yld->intf->dev, "%s - urb status %d\n",
__func__, status);
switch (yld->ctl_data->cmd) { switch (yld->ctl_data->cmd) {
case CMD_KEYPRESS: case CMD_KEYPRESS:
@ -479,7 +486,8 @@ static void urb_ctl_callback(struct urb *urb)
} }
if (ret && ret != -EPERM) if (ret && ret != -EPERM)
err("%s - usb_submit_urb failed %d", __func__, ret); dev_err(&yld->intf->dev, "%s - usb_submit_urb failed %d\n",
__func__, ret);
} }
/******************************************************************************* /*******************************************************************************
@ -511,7 +519,7 @@ static int input_open(struct input_dev *dev)
struct yealink_dev *yld = input_get_drvdata(dev); struct yealink_dev *yld = input_get_drvdata(dev);
int i, ret; int i, ret;
dbg("%s", __func__); dev_dbg(&yld->intf->dev, "%s\n", __func__);
/* force updates to device */ /* force updates to device */
for (i = 0; i<sizeof(yld->master); i++) for (i = 0; i<sizeof(yld->master); i++)
@ -526,8 +534,9 @@ static int input_open(struct input_dev *dev)
yld->ctl_data->size = 10; yld->ctl_data->size = 10;
yld->ctl_data->sum = 0x100-CMD_INIT-10; yld->ctl_data->sum = 0x100-CMD_INIT-10;
if ((ret = usb_submit_urb(yld->urb_ctl, GFP_KERNEL)) != 0) { if ((ret = usb_submit_urb(yld->urb_ctl, GFP_KERNEL)) != 0) {
dbg("%s - usb_submit_urb failed with result %d", dev_dbg(&yld->intf->dev,
__func__, ret); "%s - usb_submit_urb failed with result %d\n",
__func__, ret);
return ret; return ret;
} }
return 0; return 0;
@ -876,6 +885,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
return -ENOMEM; return -ENOMEM;
yld->udev = udev; yld->udev = udev;
yld->intf = intf;
yld->idev = input_dev = input_allocate_device(); yld->idev = input_dev = input_allocate_device();
if (!input_dev) if (!input_dev)
@ -909,7 +919,8 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress); pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
if (ret != USB_PKT_LEN) if (ret != USB_PKT_LEN)
err("invalid payload size %d, expected %zd", ret, USB_PKT_LEN); dev_err(&intf->dev, "invalid payload size %d, expected %zd\n",
ret, USB_PKT_LEN);
/* initialise irq urb */ /* initialise irq urb */
usb_fill_int_urb(yld->urb_irq, udev, pipe, yld->irq_data, usb_fill_int_urb(yld->urb_irq, udev, pipe, yld->irq_data,

View File

@ -195,6 +195,7 @@ enum atp_status_bits {
struct atp { struct atp {
char phys[64]; char phys[64];
struct usb_device *udev; /* usb device */ struct usb_device *udev; /* usb device */
struct usb_interface *intf; /* usb interface */
struct urb *urb; /* usb request block */ struct urb *urb; /* usb request block */
u8 *data; /* transferred data */ u8 *data; /* transferred data */
struct input_dev *input; /* input dev */ struct input_dev *input; /* input dev */
@ -253,8 +254,9 @@ MODULE_PARM_DESC(debug, "Activate debugging output");
* packets (Report ID 2). This code changes device mode, so it * packets (Report ID 2). This code changes device mode, so it
* sends raw sensor reports (Report ID 5). * sends raw sensor reports (Report ID 5).
*/ */
static int atp_geyser_init(struct usb_device *udev) static int atp_geyser_init(struct atp *dev)
{ {
struct usb_device *udev = dev->udev;
char *data; char *data;
int size; int size;
int i; int i;
@ -262,7 +264,7 @@ static int atp_geyser_init(struct usb_device *udev)
data = kmalloc(8, GFP_KERNEL); data = kmalloc(8, GFP_KERNEL);
if (!data) { if (!data) {
err("Out of memory"); dev_err(&dev->intf->dev, "Out of memory\n");
return -ENOMEM; return -ENOMEM;
} }
@ -277,7 +279,7 @@ static int atp_geyser_init(struct usb_device *udev)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[i]); dprintk("appletouch[%d]: %d\n", i, data[i]);
err("Failed to read mode from device."); dev_err(&dev->intf->dev, "Failed to read mode from device.\n");
ret = -EIO; ret = -EIO;
goto out_free; goto out_free;
} }
@ -296,7 +298,7 @@ static int atp_geyser_init(struct usb_device *udev)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[i]); dprintk("appletouch[%d]: %d\n", i, data[i]);
err("Failed to request geyser raw mode"); dev_err(&dev->intf->dev, "Failed to request geyser raw mode\n");
ret = -EIO; ret = -EIO;
goto out_free; goto out_free;
} }
@ -313,16 +315,16 @@ out_free:
static void atp_reinit(struct work_struct *work) static void atp_reinit(struct work_struct *work)
{ {
struct atp *dev = container_of(work, struct atp, work); struct atp *dev = container_of(work, struct atp, work);
struct usb_device *udev = dev->udev;
int retval; int retval;
dprintk("appletouch: putting appletouch to sleep (reinit)\n"); dprintk("appletouch: putting appletouch to sleep (reinit)\n");
atp_geyser_init(udev); atp_geyser_init(dev);
retval = usb_submit_urb(dev->urb, GFP_ATOMIC); retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval) if (retval)
err("atp_reinit: usb_submit_urb failed with error %d", dev_err(&dev->intf->dev,
retval); "atp_reinit: usb_submit_urb failed with error %d\n",
retval);
} }
static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact, static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact,
@ -400,6 +402,7 @@ static inline void atp_report_fingers(struct input_dev *input, int fingers)
static int atp_status_check(struct urb *urb) static int atp_status_check(struct urb *urb)
{ {
struct atp *dev = urb->context; struct atp *dev = urb->context;
struct usb_interface *intf = dev->intf;
switch (urb->status) { switch (urb->status) {
case 0: case 0:
@ -407,8 +410,8 @@ static int atp_status_check(struct urb *urb)
break; break;
case -EOVERFLOW: case -EOVERFLOW:
if (!dev->overflow_warned) { if (!dev->overflow_warned) {
printk(KERN_WARNING "appletouch: OVERFLOW with data " dev_warn(&intf->dev,
"length %d, actual length is %d\n", "appletouch: OVERFLOW with data length %d, actual length is %d\n",
dev->info->datalen, dev->urb->actual_length); dev->info->datalen, dev->urb->actual_length);
dev->overflow_warned = true; dev->overflow_warned = true;
} }
@ -416,13 +419,15 @@ static int atp_status_check(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* This urb is terminated, clean up */ /* This urb is terminated, clean up */
dbg("atp_complete: urb shutting down with status: %d", dev_dbg(&intf->dev,
urb->status); "atp_complete: urb shutting down with status: %d\n",
urb->status);
return ATP_URB_STATUS_ERROR_FATAL; return ATP_URB_STATUS_ERROR_FATAL;
default: default:
dbg("atp_complete: nonzero urb status received: %d", dev_dbg(&intf->dev,
urb->status); "atp_complete: nonzero urb status received: %d\n",
urb->status);
return ATP_URB_STATUS_ERROR; return ATP_URB_STATUS_ERROR;
} }
@ -445,7 +450,8 @@ static void atp_detect_size(struct atp *dev)
for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) { for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) {
if (dev->xy_cur[i]) { if (dev->xy_cur[i]) {
printk(KERN_INFO "appletouch: 17\" model detected.\n"); dev_info(&dev->intf->dev,
"appletouch: 17\" model detected.\n");
input_set_abs_params(dev->input, ABS_X, 0, input_set_abs_params(dev->input, ABS_X, 0,
(dev->info->xsensors_17 - 1) * (dev->info->xsensors_17 - 1) *
@ -588,8 +594,9 @@ static void atp_complete_geyser_1_2(struct urb *urb)
exit: exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC); retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval) if (retval)
err("atp_complete: usb_submit_urb failed with result %d", dev_err(&dev->intf->dev,
retval); "atp_complete: usb_submit_urb failed with result %d\n",
retval);
} }
/* Interrupt function for older touchpads: GEYSER3/GEYSER4 */ /* Interrupt function for older touchpads: GEYSER3/GEYSER4 */
@ -722,8 +729,9 @@ static void atp_complete_geyser_3_4(struct urb *urb)
exit: exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC); retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval) if (retval)
err("atp_complete: usb_submit_urb failed with result %d", dev_err(&dev->intf->dev,
retval); "atp_complete: usb_submit_urb failed with result %d\n",
retval);
} }
static int atp_open(struct input_dev *input) static int atp_open(struct input_dev *input)
@ -748,14 +756,12 @@ static void atp_close(struct input_dev *input)
static int atp_handle_geyser(struct atp *dev) static int atp_handle_geyser(struct atp *dev)
{ {
struct usb_device *udev = dev->udev;
if (dev->info != &fountain_info) { if (dev->info != &fountain_info) {
/* switch to raw sensor mode */ /* switch to raw sensor mode */
if (atp_geyser_init(udev)) if (atp_geyser_init(dev))
return -EIO; return -EIO;
printk(KERN_INFO "appletouch: Geyser mode initialized.\n"); dev_info(&dev->intf->dev, "Geyser mode initialized.\n");
} }
return 0; return 0;
@ -785,7 +791,7 @@ static int atp_probe(struct usb_interface *iface,
} }
} }
if (!int_in_endpointAddr) { if (!int_in_endpointAddr) {
err("Could not find int-in endpoint"); dev_err(&iface->dev, "Could not find int-in endpoint\n");
return -EIO; return -EIO;
} }
@ -793,11 +799,12 @@ static int atp_probe(struct usb_interface *iface,
dev = kzalloc(sizeof(struct atp), GFP_KERNEL); dev = kzalloc(sizeof(struct atp), GFP_KERNEL);
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (!dev || !input_dev) { if (!dev || !input_dev) {
err("Out of memory"); dev_err(&iface->dev, "Out of memory\n");
goto err_free_devs; goto err_free_devs;
} }
dev->udev = udev; dev->udev = udev;
dev->intf = iface;
dev->input = input_dev; dev->input = input_dev;
dev->info = info; dev->info = info;
dev->overflow_warned = false; dev->overflow_warned = false;
@ -886,7 +893,7 @@ static void atp_disconnect(struct usb_interface *iface)
usb_free_urb(dev->urb); usb_free_urb(dev->urb);
kfree(dev); kfree(dev);
} }
printk(KERN_INFO "input: appletouch disconnected\n"); dev_info(&iface->dev, "input: appletouch disconnected\n");
} }
static int atp_recover(struct atp *dev) static int atp_recover(struct atp *dev)

View File

@ -584,7 +584,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
int retval = 0, size; int retval = 0, size;
if (!data) { if (!data) {
err("bcm5974: out of memory"); dev_err(&dev->intf->dev, "out of memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto out; goto out;
} }
@ -597,7 +597,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000); BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000);
if (size != 8) { if (size != 8) {
err("bcm5974: could not read from device"); dev_err(&dev->intf->dev, "could not read from device\n");
retval = -EIO; retval = -EIO;
goto out; goto out;
} }
@ -615,7 +615,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000); BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000);
if (size != 8) { if (size != 8) {
err("bcm5974: could not write to device"); dev_err(&dev->intf->dev, "could not write to device\n");
retval = -EIO; retval = -EIO;
goto out; goto out;
} }
@ -631,6 +631,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
static void bcm5974_irq_button(struct urb *urb) static void bcm5974_irq_button(struct urb *urb)
{ {
struct bcm5974 *dev = urb->context; struct bcm5974 *dev = urb->context;
struct usb_interface *intf = dev->intf;
int error; int error;
switch (urb->status) { switch (urb->status) {
@ -640,10 +641,11 @@ static void bcm5974_irq_button(struct urb *urb)
case -ECONNRESET: case -ECONNRESET:
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
dbg("bcm5974: button urb shutting down: %d", urb->status); dev_dbg(&intf->dev, "button urb shutting down: %d\n",
urb->status);
return; return;
default: default:
dbg("bcm5974: button urb status: %d", urb->status); dev_dbg(&intf->dev, "button urb status: %d\n", urb->status);
goto exit; goto exit;
} }
@ -654,12 +656,13 @@ static void bcm5974_irq_button(struct urb *urb)
exit: exit:
error = usb_submit_urb(dev->bt_urb, GFP_ATOMIC); error = usb_submit_urb(dev->bt_urb, GFP_ATOMIC);
if (error) if (error)
err("bcm5974: button urb failed: %d", error); dev_err(&intf->dev, "button urb failed: %d\n", error);
} }
static void bcm5974_irq_trackpad(struct urb *urb) static void bcm5974_irq_trackpad(struct urb *urb)
{ {
struct bcm5974 *dev = urb->context; struct bcm5974 *dev = urb->context;
struct usb_interface *intf = dev->intf;
int error; int error;
switch (urb->status) { switch (urb->status) {
@ -669,10 +672,11 @@ static void bcm5974_irq_trackpad(struct urb *urb)
case -ECONNRESET: case -ECONNRESET:
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
dbg("bcm5974: trackpad urb shutting down: %d", urb->status); dev_dbg(&intf->dev, "trackpad urb shutting down: %d\n",
urb->status);
return; return;
default: default:
dbg("bcm5974: trackpad urb status: %d", urb->status); dev_dbg(&intf->dev, "trackpad urb status: %d\n", urb->status);
goto exit; goto exit;
} }
@ -687,7 +691,7 @@ static void bcm5974_irq_trackpad(struct urb *urb)
exit: exit:
error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC); error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC);
if (error) if (error)
err("bcm5974: trackpad urb failed: %d", error); dev_err(&intf->dev, "trackpad urb failed: %d\n", error);
} }
/* /*
@ -833,7 +837,7 @@ static int bcm5974_probe(struct usb_interface *iface,
dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL); dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL);
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (!dev || !input_dev) { if (!dev || !input_dev) {
err("bcm5974: out of memory"); dev_err(&iface->dev, "out of memory\n");
goto err_free_devs; goto err_free_devs;
} }

View File

@ -51,6 +51,7 @@ struct usb_acecad {
char name[128]; char name[128];
char phys[64]; char phys[64];
struct usb_device *usbdev; struct usb_device *usbdev;
struct usb_interface *intf;
struct input_dev *input; struct input_dev *input;
struct urb *irq; struct urb *irq;
@ -63,6 +64,7 @@ static void usb_acecad_irq(struct urb *urb)
struct usb_acecad *acecad = urb->context; struct usb_acecad *acecad = urb->context;
unsigned char *data = acecad->data; unsigned char *data = acecad->data;
struct input_dev *dev = acecad->input; struct input_dev *dev = acecad->input;
struct usb_interface *intf = acecad->intf;
int prox, status; int prox, status;
switch (urb->status) { switch (urb->status) {
@ -73,10 +75,12 @@ static void usb_acecad_irq(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __func__, urb->status); dev_dbg(&intf->dev, "%s - urb shutting down with status: %d\n",
__func__, urb->status);
return; return;
default: default:
dbg("%s - nonzero urb status received: %d", __func__, urb->status); dev_dbg(&intf->dev, "%s - nonzero urb status received: %d\n",
__func__, urb->status);
goto resubmit; goto resubmit;
} }
@ -105,8 +109,10 @@ static void usb_acecad_irq(struct urb *urb)
resubmit: resubmit:
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
if (status) if (status)
err("can't resubmit intr, %s-%s/input0, status %d", dev_err(&intf->dev,
acecad->usbdev->bus->bus_name, acecad->usbdev->devpath, status); "can't resubmit intr, %s-%s/input0, status %d\n",
acecad->usbdev->bus->bus_name,
acecad->usbdev->devpath, status);
} }
static int usb_acecad_open(struct input_dev *dev) static int usb_acecad_open(struct input_dev *dev)
@ -168,6 +174,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
} }
acecad->usbdev = dev; acecad->usbdev = dev;
acecad->intf = intf;
acecad->input = input_dev; acecad->input = input_dev;
if (dev->manufacturer) if (dev->manufacturer)

View File

@ -309,6 +309,7 @@ struct aiptek_settings {
struct aiptek { struct aiptek {
struct input_dev *inputdev; /* input device struct */ struct input_dev *inputdev; /* input device struct */
struct usb_device *usbdev; /* usb device struct */ struct usb_device *usbdev; /* usb device struct */
struct usb_interface *intf; /* usb interface struct */
struct urb *urb; /* urb for incoming reports */ struct urb *urb; /* urb for incoming reports */
dma_addr_t data_dma; /* our dma stuffage */ dma_addr_t data_dma; /* our dma stuffage */
struct aiptek_features features; /* tablet's array of features */ struct aiptek_features features; /* tablet's array of features */
@ -435,6 +436,7 @@ static void aiptek_irq(struct urb *urb)
struct aiptek *aiptek = urb->context; struct aiptek *aiptek = urb->context;
unsigned char *data = aiptek->data; unsigned char *data = aiptek->data;
struct input_dev *inputdev = aiptek->inputdev; struct input_dev *inputdev = aiptek->inputdev;
struct usb_interface *intf = aiptek->intf;
int jitterable = 0; int jitterable = 0;
int retval, macro, x, y, z, left, right, middle, p, dv, tip, bs, pck; int retval, macro, x, y, z, left, right, middle, p, dv, tip, bs, pck;
@ -447,13 +449,13 @@ static void aiptek_irq(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* This urb is terminated, clean up */ /* This urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", dev_dbg(&intf->dev, "%s - urb shutting down with status: %d\n",
__func__, urb->status); __func__, urb->status);
return; return;
default: default:
dbg("%s - nonzero urb status received: %d", dev_dbg(&intf->dev, "%s - nonzero urb status received: %d\n",
__func__, urb->status); __func__, urb->status);
goto exit; goto exit;
} }
@ -785,7 +787,7 @@ static void aiptek_irq(struct urb *urb)
1 | AIPTEK_REPORT_TOOL_UNKNOWN); 1 | AIPTEK_REPORT_TOOL_UNKNOWN);
input_sync(inputdev); input_sync(inputdev);
} else { } else {
dbg("Unknown report %d", data[0]); dev_dbg(&intf->dev, "Unknown report %d\n", data[0]);
} }
/* Jitter may occur when the user presses a button on the stlyus /* Jitter may occur when the user presses a button on the stlyus
@ -811,8 +813,9 @@ static void aiptek_irq(struct urb *urb)
exit: exit:
retval = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval != 0) { if (retval != 0) {
err("%s - usb_submit_urb failed with result %d", dev_err(&intf->dev,
__func__, retval); "%s - usb_submit_urb failed with result %d\n",
__func__, retval);
} }
} }
@ -912,8 +915,9 @@ aiptek_command(struct aiptek *aiptek, unsigned char command, unsigned char data)
if ((ret = if ((ret =
aiptek_set_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) { aiptek_set_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) {
dbg("aiptek_program: failed, tried to send: 0x%02x 0x%02x", dev_dbg(&aiptek->intf->dev,
command, data); "aiptek_program: failed, tried to send: 0x%02x 0x%02x\n",
command, data);
} }
kfree(buf); kfree(buf);
return ret < 0 ? ret : 0; return ret < 0 ? ret : 0;
@ -947,8 +951,9 @@ aiptek_query(struct aiptek *aiptek, unsigned char command, unsigned char data)
if ((ret = if ((ret =
aiptek_get_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) { aiptek_get_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) {
dbg("aiptek_query failed: returned 0x%02x 0x%02x 0x%02x", dev_dbg(&aiptek->intf->dev,
buf[0], buf[1], buf[2]); "aiptek_query failed: returned 0x%02x 0x%02x 0x%02x\n",
buf[0], buf[1], buf[2]);
ret = -EIO; ret = -EIO;
} else { } else {
ret = get_unaligned_le16(buf + 1); ret = get_unaligned_le16(buf + 1);
@ -1726,6 +1731,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
aiptek->inputdev = inputdev; aiptek->inputdev = inputdev;
aiptek->usbdev = usbdev; aiptek->usbdev = usbdev;
aiptek->intf = intf;
aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber; aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber;
aiptek->inDelay = 0; aiptek->inDelay = 0;
aiptek->endDelay = 0; aiptek->endDelay = 0;

View File

@ -2,8 +2,6 @@
GTCO digitizer USB driver GTCO digitizer USB driver
Use the err() and dbg() macros from usb.h for system logging
TO CHECK: Is pressure done right on report 5? TO CHECK: Is pressure done right on report 5?
Copyright (C) 2006 GTCO CalComp Copyright (C) 2006 GTCO CalComp
@ -108,6 +106,7 @@ struct gtco {
struct input_dev *inputdevice; /* input device struct pointer */ struct input_dev *inputdevice; /* input device struct pointer */
struct usb_device *usbdev; /* the usb device for this device */ struct usb_device *usbdev; /* the usb device for this device */
struct usb_interface *intf; /* the usb interface for this device */
struct urb *urbinfo; /* urb for incoming reports */ struct urb *urbinfo; /* urb for incoming reports */
dma_addr_t buf_dma; /* dma addr of the data buffer*/ dma_addr_t buf_dma; /* dma addr of the data buffer*/
unsigned char * buffer; /* databuffer for reports */ unsigned char * buffer; /* databuffer for reports */
@ -202,6 +201,7 @@ struct hid_descriptor
static void parse_hid_report_descriptor(struct gtco *device, char * report, static void parse_hid_report_descriptor(struct gtco *device, char * report,
int length) int length)
{ {
struct device *ddev = &device->intf->dev;
int x, i = 0; int x, i = 0;
/* Tag primitive vars */ /* Tag primitive vars */
@ -228,7 +228,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
char indentstr[10] = ""; char indentstr[10] = "";
dbg("======>>>>>>PARSE<<<<<<======"); dev_dbg(ddev, "======>>>>>>PARSE<<<<<<======\n");
/* Walk this report and pull out the info we need */ /* Walk this report and pull out the info we need */
while (i < length) { while (i < length) {
@ -277,11 +277,11 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
else if (data == 3) else if (data == 3)
strcpy(globtype, "Var|Const"); strcpy(globtype, "Var|Const");
dbg("::::: Saving Report: %d input #%d Max: 0x%X(%d) Min:0x%X(%d) of %d bits", dev_dbg(ddev, "::::: Saving Report: %d input #%d Max: 0x%X(%d) Min:0x%X(%d) of %d bits\n",
globalval[TAG_GLOB_REPORT_ID], inputnum, globalval[TAG_GLOB_REPORT_ID], inputnum,
globalval[TAG_GLOB_LOG_MAX], globalval[TAG_GLOB_LOG_MAX], globalval[TAG_GLOB_LOG_MAX], globalval[TAG_GLOB_LOG_MAX],
globalval[TAG_GLOB_LOG_MIN], globalval[TAG_GLOB_LOG_MIN], globalval[TAG_GLOB_LOG_MIN], globalval[TAG_GLOB_LOG_MIN],
globalval[TAG_GLOB_REPORT_SZ] * globalval[TAG_GLOB_REPORT_CNT]); globalval[TAG_GLOB_REPORT_SZ] * globalval[TAG_GLOB_REPORT_CNT]);
/* /*
@ -292,7 +292,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
*/ */
switch (inputnum) { switch (inputnum) {
case 0: /* X coord */ case 0: /* X coord */
dbg("GER: X Usage: 0x%x", usage); dev_dbg(ddev, "GER: X Usage: 0x%x\n", usage);
if (device->max_X == 0) { if (device->max_X == 0) {
device->max_X = globalval[TAG_GLOB_LOG_MAX]; device->max_X = globalval[TAG_GLOB_LOG_MAX];
device->min_X = globalval[TAG_GLOB_LOG_MIN]; device->min_X = globalval[TAG_GLOB_LOG_MIN];
@ -300,7 +300,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
break; break;
case 1: /* Y coord */ case 1: /* Y coord */
dbg("GER: Y Usage: 0x%x", usage); dev_dbg(ddev, "GER: Y Usage: 0x%x\n", usage);
if (device->max_Y == 0) { if (device->max_Y == 0) {
device->max_Y = globalval[TAG_GLOB_LOG_MAX]; device->max_Y = globalval[TAG_GLOB_LOG_MAX];
device->min_Y = globalval[TAG_GLOB_LOG_MIN]; device->min_Y = globalval[TAG_GLOB_LOG_MIN];
@ -350,10 +350,10 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
maintype = 'S'; maintype = 'S';
if (data == 0) { if (data == 0) {
dbg("======>>>>>> Physical"); dev_dbg(ddev, "======>>>>>> Physical\n");
strcpy(globtype, "Physical"); strcpy(globtype, "Physical");
} else } else
dbg("======>>>>>>"); dev_dbg(ddev, "======>>>>>>\n");
/* Indent the debug output */ /* Indent the debug output */
indent++; indent++;
@ -368,7 +368,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
break; break;
case TAG_MAIN_COL_END: case TAG_MAIN_COL_END:
dbg("<<<<<<======"); dev_dbg(ddev, "<<<<<<======\n");
maintype = 'E'; maintype = 'E';
indent--; indent--;
for (x = 0; x < indent; x++) for (x = 0; x < indent; x++)
@ -384,18 +384,18 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
switch (size) { switch (size) {
case 1: case 1:
dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
indentstr, tag, maintype, size, globtype, data); indentstr, tag, maintype, size, globtype, data);
break; break;
case 2: case 2:
dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
indentstr, tag, maintype, size, globtype, data16); indentstr, tag, maintype, size, globtype, data16);
break; break;
case 4: case 4:
dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
indentstr, tag, maintype, size, globtype, data32); indentstr, tag, maintype, size, globtype, data32);
break; break;
} }
break; break;
@ -465,26 +465,26 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
if (tag < TAG_GLOB_MAX) { if (tag < TAG_GLOB_MAX) {
switch (size) { switch (size) {
case 1: case 1:
dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
indentstr, globtype, tag, size, data); indentstr, globtype, tag, size, data);
globalval[tag] = data; globalval[tag] = data;
break; break;
case 2: case 2:
dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
indentstr, globtype, tag, size, data16); indentstr, globtype, tag, size, data16);
globalval[tag] = data16; globalval[tag] = data16;
break; break;
case 4: case 4:
dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
indentstr, globtype, tag, size, data32); indentstr, globtype, tag, size, data32);
globalval[tag] = data32; globalval[tag] = data32;
break; break;
} }
} else { } else {
dbg("%sGLOBALTAG: ILLEGAL TAG:%d SIZE: %d ", dev_dbg(ddev, "%sGLOBALTAG: ILLEGAL TAG:%d SIZE: %d\n",
indentstr, tag, size); indentstr, tag, size);
} }
break; break;
@ -511,18 +511,18 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
switch (size) { switch (size) {
case 1: case 1:
dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
indentstr, tag, globtype, size, data); indentstr, tag, globtype, size, data);
break; break;
case 2: case 2:
dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
indentstr, tag, globtype, size, data16); indentstr, tag, globtype, size, data16);
break; break;
case 4: case 4:
dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
indentstr, tag, globtype, size, data32); indentstr, tag, globtype, size, data32);
break; break;
} }
@ -714,8 +714,9 @@ static void gtco_urb_callback(struct urb *urbinfo)
* the rest as 0 * the rest as 0
*/ */
val = device->buffer[5] & MASK_BUTTON; val = device->buffer[5] & MASK_BUTTON;
dbg("======>>>>>>REPORT 1: val 0x%X(%d)", dev_dbg(&device->intf->dev,
val, val); "======>>>>>>REPORT 1: val 0x%X(%d)\n",
val, val);
/* /*
* We don't apply any meaning to the button * We don't apply any meaning to the button
@ -808,7 +809,8 @@ static void gtco_urb_callback(struct urb *urbinfo)
resubmit: resubmit:
rc = usb_submit_urb(urbinfo, GFP_ATOMIC); rc = usb_submit_urb(urbinfo, GFP_ATOMIC);
if (rc != 0) if (rc != 0)
err("usb_submit_urb failed rc=0x%x", rc); dev_err(&device->intf->dev,
"usb_submit_urb failed rc=0x%x\n", rc);
} }
/* /*
@ -838,7 +840,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
gtco = kzalloc(sizeof(struct gtco), GFP_KERNEL); gtco = kzalloc(sizeof(struct gtco), GFP_KERNEL);
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (!gtco || !input_dev) { if (!gtco || !input_dev) {
err("No more memory"); dev_err(&usbinterface->dev, "No more memory\n");
error = -ENOMEM; error = -ENOMEM;
goto err_free_devs; goto err_free_devs;
} }
@ -848,12 +850,13 @@ static int gtco_probe(struct usb_interface *usbinterface,
/* Save interface information */ /* Save interface information */
gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface)); gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface));
gtco->intf = usbinterface;
/* Allocate some data for incoming reports */ /* Allocate some data for incoming reports */
gtco->buffer = usb_alloc_coherent(gtco->usbdev, REPORT_MAX_SIZE, gtco->buffer = usb_alloc_coherent(gtco->usbdev, REPORT_MAX_SIZE,
GFP_KERNEL, &gtco->buf_dma); GFP_KERNEL, &gtco->buf_dma);
if (!gtco->buffer) { if (!gtco->buffer) {
err("No more memory for us buffers"); dev_err(&usbinterface->dev, "No more memory for us buffers\n");
error = -ENOMEM; error = -ENOMEM;
goto err_free_devs; goto err_free_devs;
} }
@ -861,7 +864,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
/* Allocate URB for reports */ /* Allocate URB for reports */
gtco->urbinfo = usb_alloc_urb(0, GFP_KERNEL); gtco->urbinfo = usb_alloc_urb(0, GFP_KERNEL);
if (!gtco->urbinfo) { if (!gtco->urbinfo) {
err("Failed to allocate URB"); dev_err(&usbinterface->dev, "Failed to allocate URB\n");
error = -ENOMEM; error = -ENOMEM;
goto err_free_buf; goto err_free_buf;
} }
@ -873,14 +876,14 @@ static int gtco_probe(struct usb_interface *usbinterface,
endpoint = &usbinterface->altsetting[0].endpoint[0].desc; endpoint = &usbinterface->altsetting[0].endpoint[0].desc;
/* Some debug */ /* Some debug */
dbg("gtco # interfaces: %d", usbinterface->num_altsetting); dev_dbg(&usbinterface->dev, "gtco # interfaces: %d\n", usbinterface->num_altsetting);
dbg("num endpoints: %d", usbinterface->cur_altsetting->desc.bNumEndpoints); dev_dbg(&usbinterface->dev, "num endpoints: %d\n", usbinterface->cur_altsetting->desc.bNumEndpoints);
dbg("interface class: %d", usbinterface->cur_altsetting->desc.bInterfaceClass); dev_dbg(&usbinterface->dev, "interface class: %d\n", usbinterface->cur_altsetting->desc.bInterfaceClass);
dbg("endpoint: attribute:0x%x type:0x%x", endpoint->bmAttributes, endpoint->bDescriptorType); dev_dbg(&usbinterface->dev, "endpoint: attribute:0x%x type:0x%x\n", endpoint->bmAttributes, endpoint->bDescriptorType);
if (usb_endpoint_xfer_int(endpoint)) if (usb_endpoint_xfer_int(endpoint))
dbg("endpoint: we have interrupt endpoint\n"); dev_dbg(&usbinterface->dev, "endpoint: we have interrupt endpoint\n");
dbg("endpoint extra len:%d ", usbinterface->altsetting[0].extralen); dev_dbg(&usbinterface->dev, "endpoint extra len:%d\n", usbinterface->altsetting[0].extralen);
/* /*
* Find the HID descriptor so we can find out the size of the * Find the HID descriptor so we can find out the size of the
@ -888,17 +891,19 @@ static int gtco_probe(struct usb_interface *usbinterface,
*/ */
if (usb_get_extra_descriptor(usbinterface->cur_altsetting, if (usb_get_extra_descriptor(usbinterface->cur_altsetting,
HID_DEVICE_TYPE, &hid_desc) != 0){ HID_DEVICE_TYPE, &hid_desc) != 0){
err("Can't retrieve exta USB descriptor to get hid report descriptor length"); dev_err(&usbinterface->dev,
"Can't retrieve exta USB descriptor to get hid report descriptor length\n");
error = -EIO; error = -EIO;
goto err_free_urb; goto err_free_urb;
} }
dbg("Extra descriptor success: type:%d len:%d", dev_dbg(&usbinterface->dev,
hid_desc->bDescriptorType, hid_desc->wDescriptorLength); "Extra descriptor success: type:%d len:%d\n",
hid_desc->bDescriptorType, hid_desc->wDescriptorLength);
report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL); report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL);
if (!report) { if (!report) {
err("No more memory for report"); dev_err(&usbinterface->dev, "No more memory for report\n");
error = -ENOMEM; error = -ENOMEM;
goto err_free_urb; goto err_free_urb;
} }
@ -915,7 +920,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
le16_to_cpu(hid_desc->wDescriptorLength), le16_to_cpu(hid_desc->wDescriptorLength),
5000); /* 5 secs */ 5000); /* 5 secs */
dbg("usb_control_msg result: %d", result); dev_dbg(&usbinterface->dev, "usb_control_msg result: %d\n", result);
if (result == le16_to_cpu(hid_desc->wDescriptorLength)) { if (result == le16_to_cpu(hid_desc->wDescriptorLength)) {
parse_hid_report_descriptor(gtco, report, result); parse_hid_report_descriptor(gtco, report, result);
break; break;
@ -926,8 +931,9 @@ static int gtco_probe(struct usb_interface *usbinterface,
/* If we didn't get the report, fail */ /* If we didn't get the report, fail */
if (result != le16_to_cpu(hid_desc->wDescriptorLength)) { if (result != le16_to_cpu(hid_desc->wDescriptorLength)) {
err("Failed to get HID Report Descriptor of size: %d", dev_err(&usbinterface->dev,
hid_desc->wDescriptorLength); "Failed to get HID Report Descriptor of size: %d\n",
hid_desc->wDescriptorLength);
error = -EIO; error = -EIO;
goto err_free_urb; goto err_free_urb;
} }

View File

@ -33,6 +33,7 @@ struct kbtab {
dma_addr_t data_dma; dma_addr_t data_dma;
struct input_dev *dev; struct input_dev *dev;
struct usb_device *usbdev; struct usb_device *usbdev;
struct usb_interface *intf;
struct urb *irq; struct urb *irq;
char phys[32]; char phys[32];
}; };
@ -53,10 +54,14 @@ static void kbtab_irq(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __func__, urb->status); dev_dbg(&kbtab->intf->dev,
"%s - urb shutting down with status: %d\n",
__func__, urb->status);
return; return;
default: default:
dbg("%s - nonzero urb status received: %d", __func__, urb->status); dev_dbg(&kbtab->intf->dev,
"%s - nonzero urb status received: %d\n",
__func__, urb->status);
goto exit; goto exit;
} }
@ -80,8 +85,9 @@ static void kbtab_irq(struct urb *urb)
exit: exit:
retval = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval) if (retval)
err("%s - usb_submit_urb failed with result %d", dev_err(&kbtab->intf->dev,
__func__, retval); "%s - usb_submit_urb failed with result %d\n",
__func__, retval);
} }
static struct usb_device_id kbtab_ids[] = { static struct usb_device_id kbtab_ids[] = {
@ -131,6 +137,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
goto fail2; goto fail2;
kbtab->usbdev = dev; kbtab->usbdev = dev;
kbtab->intf = intf;
kbtab->dev = input_dev; kbtab->dev = input_dev;
usb_make_path(dev, kbtab->phys, sizeof(kbtab->phys)); usb_make_path(dev, kbtab->phys, sizeof(kbtab->phys));

View File

@ -99,6 +99,7 @@ static int wacom_set_report(struct usb_interface *intf, u8 type, u8 id,
static void wacom_sys_irq(struct urb *urb) static void wacom_sys_irq(struct urb *urb)
{ {
struct wacom *wacom = urb->context; struct wacom *wacom = urb->context;
struct device *dev = &wacom->intf->dev;
int retval; int retval;
switch (urb->status) { switch (urb->status) {
@ -109,10 +110,12 @@ static void wacom_sys_irq(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __func__, urb->status); dev_dbg(dev, "%s - urb shutting down with status: %d\n",
__func__, urb->status);
return; return;
default: default:
dbg("%s - nonzero urb status received: %d", __func__, urb->status); dev_dbg(dev, "%s - nonzero urb status received: %d\n",
__func__, urb->status);
goto exit; goto exit;
} }
@ -122,8 +125,8 @@ static void wacom_sys_irq(struct urb *urb)
usb_mark_last_busy(wacom->usbdev); usb_mark_last_busy(wacom->usbdev);
retval = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval) if (retval)
err ("%s - usb_submit_urb failed with result %d", dev_err(dev, "%s - usb_submit_urb failed with result %d\n",
__func__, retval); __func__, retval);
} }
static int wacom_open(struct input_dev *dev) static int wacom_open(struct input_dev *dev)

View File

@ -76,7 +76,8 @@ static int wacom_pl_irq(struct wacom_wac *wacom)
int prox, pressure; int prox, pressure;
if (data[0] != WACOM_REPORT_PENABLED) { if (data[0] != WACOM_REPORT_PENABLED) {
dbg("wacom_pl_irq: received unknown report #%d", data[0]); dev_dbg(&input->dev,
"wacom_pl_irq: received unknown report #%d\n", data[0]);
return 0; return 0;
} }
@ -175,7 +176,7 @@ static int wacom_dtu_irq(struct wacom_wac *wacom)
struct input_dev *input = wacom->input; struct input_dev *input = wacom->input;
int prox = data[1] & 0x20, pressure; int prox = data[1] & 0x20, pressure;
dbg("wacom_dtu_irq: received report #%d", data[0]); dev_dbg(&input->dev, "wacom_dtu_irq: received report #%d\n", data[0]);
if (prox) { if (prox) {
/* Going into proximity select tool */ /* Going into proximity select tool */
@ -211,7 +212,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
int retval = 0; int retval = 0;
if (data[0] != WACOM_REPORT_PENABLED) { if (data[0] != WACOM_REPORT_PENABLED) {
dbg("wacom_graphire_irq: received unknown report #%d", data[0]); dev_dbg(&input->dev,
"wacom_graphire_irq: received unknown report #%d\n",
data[0]);
goto exit; goto exit;
} }
@ -484,7 +487,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD
&& data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD) { && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD) {
dbg("wacom_intuos_irq: received unknown report #%d", data[0]); dev_dbg(&input->dev,
"wacom_intuos_irq: received unknown report #%d\n",
data[0]);
return 0; return 0;
} }
@ -830,7 +835,8 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
{ {
char *data = wacom->data; char *data = wacom->data;
dbg("wacom_tpc_irq: received report #%d", data[0]); dev_dbg(&wacom->input->dev, "wacom_tpc_irq: received report #%d\n",
data[0]);
switch (len) { switch (len) {
case WACOM_PKGLEN_TPC1FG: case WACOM_PKGLEN_TPC1FG:

View File

@ -269,8 +269,9 @@ static int e2i_init(struct usbtouch_usb *usbtouch)
0x01, 0x02, 0x0000, 0x0081, 0x01, 0x02, 0x0000, 0x0081,
NULL, 0, USB_CTRL_SET_TIMEOUT); NULL, 0, USB_CTRL_SET_TIMEOUT);
dbg("%s - usb_control_msg - E2I_RESET - bytes|err: %d", dev_dbg(&usbtouch->interface->dev,
__func__, ret); "%s - usb_control_msg - E2I_RESET - bytes|err: %d\n",
__func__, ret);
return ret; return ret;
} }
@ -425,8 +426,9 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
MTOUCHUSB_RESET, MTOUCHUSB_RESET,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d", dev_dbg(&usbtouch->interface->dev,
__func__, ret); "%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d\n",
__func__, ret);
if (ret < 0) if (ret < 0)
return ret; return ret;
msleep(150); msleep(150);
@ -436,8 +438,9 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
MTOUCHUSB_ASYNC_REPORT, MTOUCHUSB_ASYNC_REPORT,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT); 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT);
dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d", dev_dbg(&usbtouch->interface->dev,
__func__, ret); "%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d\n",
__func__, ret);
if (ret >= 0) if (ret >= 0)
break; break;
if (ret != -EPIPE) if (ret != -EPIPE)
@ -737,27 +740,29 @@ static int jastec_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
#ifdef CONFIG_TOUCHSCREEN_USB_ZYTRONIC #ifdef CONFIG_TOUCHSCREEN_USB_ZYTRONIC
static int zytronic_read_data(struct usbtouch_usb *dev, unsigned char *pkt) static int zytronic_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
{ {
struct usb_interface *intf = dev->interface;
switch (pkt[0]) { switch (pkt[0]) {
case 0x3A: /* command response */ case 0x3A: /* command response */
dbg("%s: Command response %d", __func__, pkt[1]); dev_dbg(&intf->dev, "%s: Command response %d\n", __func__, pkt[1]);
break; break;
case 0xC0: /* down */ case 0xC0: /* down */
dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7);
dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7);
dev->touch = 1; dev->touch = 1;
dbg("%s: down %d,%d", __func__, dev->x, dev->y); dev_dbg(&intf->dev, "%s: down %d,%d\n", __func__, dev->x, dev->y);
return 1; return 1;
case 0x80: /* up */ case 0x80: /* up */
dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7); dev->x = (pkt[1] & 0x7f) | ((pkt[2] & 0x07) << 7);
dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7); dev->y = (pkt[3] & 0x7f) | ((pkt[4] & 0x07) << 7);
dev->touch = 0; dev->touch = 0;
dbg("%s: up %d,%d", __func__, dev->x, dev->y); dev_dbg(&intf->dev, "%s: up %d,%d\n", __func__, dev->x, dev->y);
return 1; return 1;
default: default:
dbg("%s: Unknown return %d", __func__, pkt[0]); dev_dbg(&intf->dev, "%s: Unknown return %d\n", __func__, pkt[0]);
break; break;
} }
@ -812,7 +817,8 @@ static int nexio_alloc(struct usbtouch_usb *usbtouch)
priv->ack = usb_alloc_urb(0, GFP_KERNEL); priv->ack = usb_alloc_urb(0, GFP_KERNEL);
if (!priv->ack) { if (!priv->ack) {
dbg("%s - usb_alloc_urb failed: usbtouch->ack", __func__); dev_dbg(&usbtouch->interface->dev,
"%s - usb_alloc_urb failed: usbtouch->ack\n", __func__);
goto err_ack_buf; goto err_ack_buf;
} }
@ -1349,6 +1355,7 @@ out_flush_buf:
static void usbtouch_irq(struct urb *urb) static void usbtouch_irq(struct urb *urb)
{ {
struct usbtouch_usb *usbtouch = urb->context; struct usbtouch_usb *usbtouch = urb->context;
struct device *dev = &usbtouch->interface->dev;
int retval; int retval;
switch (urb->status) { switch (urb->status) {
@ -1357,20 +1364,21 @@ static void usbtouch_irq(struct urb *urb)
break; break;
case -ETIME: case -ETIME:
/* this urb is timing out */ /* this urb is timing out */
dbg("%s - urb timed out - was the device unplugged?", dev_dbg(dev,
__func__); "%s - urb timed out - was the device unplugged?\n",
__func__);
return; return;
case -ECONNRESET: case -ECONNRESET:
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
case -EPIPE: case -EPIPE:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", dev_dbg(dev, "%s - urb shutting down with status: %d\n",
__func__, urb->status); __func__, urb->status);
return; return;
default: default:
dbg("%s - nonzero urb status received: %d", dev_dbg(dev, "%s - nonzero urb status received: %d\n",
__func__, urb->status); __func__, urb->status);
goto exit; goto exit;
} }
@ -1380,8 +1388,8 @@ exit:
usb_mark_last_busy(interface_to_usbdev(usbtouch->interface)); usb_mark_last_busy(interface_to_usbdev(usbtouch->interface));
retval = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval) if (retval)
err("%s - usb_submit_urb failed with result: %d", dev_err(dev, "%s - usb_submit_urb failed with result: %d\n",
__func__, retval); __func__, retval);
} }
static int usbtouch_open(struct input_dev *input) static int usbtouch_open(struct input_dev *input)
@ -1456,8 +1464,9 @@ static int usbtouch_reset_resume(struct usb_interface *intf)
if (usbtouch->type->init) { if (usbtouch->type->init) {
err = usbtouch->type->init(usbtouch); err = usbtouch->type->init(usbtouch);
if (err) { if (err) {
dbg("%s - type->init() failed, err: %d", dev_dbg(&intf->dev,
__func__, err); "%s - type->init() failed, err: %d\n",
__func__, err);
return err; return err;
} }
} }
@ -1532,7 +1541,8 @@ static int usbtouch_probe(struct usb_interface *intf,
usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL); usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL);
if (!usbtouch->irq) { if (!usbtouch->irq) {
dbg("%s - usb_alloc_urb failed: usbtouch->irq", __func__); dev_dbg(&intf->dev,
"%s - usb_alloc_urb failed: usbtouch->irq\n", __func__);
goto out_free_buffers; goto out_free_buffers;
} }
@ -1594,7 +1604,9 @@ static int usbtouch_probe(struct usb_interface *intf,
if (type->alloc) { if (type->alloc) {
err = type->alloc(usbtouch); err = type->alloc(usbtouch);
if (err) { if (err) {
dbg("%s - type->alloc() failed, err: %d", __func__, err); dev_dbg(&intf->dev,
"%s - type->alloc() failed, err: %d\n",
__func__, err);
goto out_free_urb; goto out_free_urb;
} }
} }
@ -1603,14 +1615,18 @@ static int usbtouch_probe(struct usb_interface *intf,
if (type->init) { if (type->init) {
err = type->init(usbtouch); err = type->init(usbtouch);
if (err) { if (err) {
dbg("%s - type->init() failed, err: %d", __func__, err); dev_dbg(&intf->dev,
"%s - type->init() failed, err: %d\n",
__func__, err);
goto out_do_exit; goto out_do_exit;
} }
} }
err = input_register_device(usbtouch->input); err = input_register_device(usbtouch->input);
if (err) { if (err) {
dbg("%s - input_register_device failed, err: %d", __func__, err); dev_dbg(&intf->dev,
"%s - input_register_device failed, err: %d\n",
__func__, err);
goto out_do_exit; goto out_do_exit;
} }
@ -1622,8 +1638,9 @@ static int usbtouch_probe(struct usb_interface *intf,
err = usb_submit_urb(usbtouch->irq, GFP_KERNEL); err = usb_submit_urb(usbtouch->irq, GFP_KERNEL);
if (err) { if (err) {
usb_autopm_put_interface(intf); usb_autopm_put_interface(intf);
err("%s - usb_submit_urb failed with result: %d", dev_err(&intf->dev,
__func__, err); "%s - usb_submit_urb failed with result: %d\n",
__func__, err);
goto out_unregister_input; goto out_unregister_input;
} }
} }
@ -1650,12 +1667,12 @@ static void usbtouch_disconnect(struct usb_interface *intf)
{ {
struct usbtouch_usb *usbtouch = usb_get_intfdata(intf); struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
dbg("%s - called", __func__);
if (!usbtouch) if (!usbtouch)
return; return;
dbg("%s - usbtouch is initialized, cleaning up", __func__); dev_dbg(&intf->dev,
"%s - usbtouch is initialized, cleaning up\n", __func__);
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
/* this will stop IO via close */ /* this will stop IO via close */
input_unregister_device(usbtouch->input); input_unregister_device(usbtouch->input);

View File

@ -148,6 +148,7 @@ static struct usb_driver gigaset_usb_driver = {
.reset_resume = gigaset_post_reset, .reset_resume = gigaset_post_reset,
.pre_reset = gigaset_pre_reset, .pre_reset = gigaset_pre_reset,
.post_reset = gigaset_post_reset, .post_reset = gigaset_post_reset,
.disable_hub_initiated_lpm = 1,
}; };
/* get message text for usb_submit_urb return code /* get message text for usb_submit_urb return code

View File

@ -124,6 +124,7 @@ static struct usb_driver gigaset_usb_driver = {
.reset_resume = gigaset_resume, .reset_resume = gigaset_resume,
.pre_reset = gigaset_pre_reset, .pre_reset = gigaset_pre_reset,
.post_reset = gigaset_resume, .post_reset = gigaset_resume,
.disable_hub_initiated_lpm = 1,
}; };
struct usb_cardstate { struct usb_cardstate {

View File

@ -2126,6 +2126,7 @@ static struct usb_driver hfcsusb_drv = {
.id_table = hfcsusb_idtab, .id_table = hfcsusb_idtab,
.probe = hfcsusb_probe, .probe = hfcsusb_probe,
.disconnect = hfcsusb_disconnect, .disconnect = hfcsusb_disconnect,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(hfcsusb_drv); module_usb_driver(hfcsusb_drv);

View File

@ -1568,6 +1568,7 @@ static struct usb_driver hfc_drv = {
.id_table = hfcusb_idtab, .id_table = hfcusb_idtab,
.probe = hfc_usb_probe, .probe = hfc_usb_probe,
.disconnect = hfc_usb_disconnect, .disconnect = hfc_usb_disconnect,
.disable_hub_initiated_lpm = 1,
}; };
static void __exit static void __exit

View File

@ -182,6 +182,7 @@ static struct usb_driver st5481_usb_driver = {
.probe = probe_st5481, .probe = probe_st5481,
.disconnect = disconnect_st5481, .disconnect = disconnect_st5481,
.id_table = st5481_ids, .id_table = st5481_ids,
.disable_hub_initiated_lpm = 1,
}; };
static int __init st5481_usb_init(void) static int __init st5481_usb_init(void)

View File

@ -1376,7 +1376,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
ARRAY_SIZE(ov562x_init_2)); ARRAY_SIZE(ov562x_init_2));
reg_w(gspca_dev, 0xe0, 0x00); reg_w(gspca_dev, 0xe0, 0x00);
} else { } else {
err("Unknown sensor %04x", sensor_id); pr_err("Unknown sensor %04x", sensor_id);
return -EINVAL; return -EINVAL;
} }

View File

@ -303,7 +303,7 @@ static int hdpvr_probe(struct usb_interface *interface,
/* allocate memory for our device state and initialize it */ /* allocate memory for our device state and initialize it */
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) { if (!dev) {
err("Out of memory"); dev_err(&interface->dev, "Out of memory\n");
goto error; goto error;
} }
@ -311,7 +311,7 @@ static int hdpvr_probe(struct usb_interface *interface,
/* register v4l2_device early so it can be used for printks */ /* register v4l2_device early so it can be used for printks */
if (v4l2_device_register(&interface->dev, &dev->v4l2_dev)) { if (v4l2_device_register(&interface->dev, &dev->v4l2_dev)) {
err("v4l2_device_register failed"); dev_err(&interface->dev, "v4l2_device_register failed\n");
goto error; goto error;
} }

View File

@ -1671,7 +1671,7 @@ static int irda_usb_probe(struct usb_interface *intf,
/* Is this really necessary? (no, except maybe for broken devices) */ /* Is this really necessary? (no, except maybe for broken devices) */
if (usb_reset_configuration (dev) < 0) { if (usb_reset_configuration (dev) < 0) {
err("reset_configuration failed"); dev_err(&intf->dev, "reset_configuration failed\n");
ret = -EIO; ret = -EIO;
goto err_out_3; goto err_out_3;
} }

View File

@ -134,14 +134,16 @@ static void kingsun_send_irq(struct urb *urb)
/* in process of stopping, just drop data */ /* in process of stopping, just drop data */
if (!netif_running(kingsun->netdev)) { if (!netif_running(kingsun->netdev)) {
err("kingsun_send_irq: Network not running!"); dev_err(&kingsun->usbdev->dev,
"kingsun_send_irq: Network not running!\n");
return; return;
} }
/* unlink, shutdown, unplug, other nasties */ /* unlink, shutdown, unplug, other nasties */
if (urb->status != 0) { if (urb->status != 0) {
err("kingsun_send_irq: urb asynchronously failed - %d", dev_err(&kingsun->usbdev->dev,
urb->status); "kingsun_send_irq: urb asynchronously failed - %d\n",
urb->status);
} }
netif_wake_queue(netdev); netif_wake_queue(netdev);
} }
@ -177,7 +179,8 @@ static netdev_tx_t kingsun_hard_xmit(struct sk_buff *skb,
kingsun, 1); kingsun, 1);
if ((ret = usb_submit_urb(kingsun->tx_urb, GFP_ATOMIC))) { if ((ret = usb_submit_urb(kingsun->tx_urb, GFP_ATOMIC))) {
err("kingsun_hard_xmit: failed tx_urb submit: %d", ret); dev_err(&kingsun->usbdev->dev,
"kingsun_hard_xmit: failed tx_urb submit: %d\n", ret);
switch (ret) { switch (ret) {
case -ENODEV: case -ENODEV:
case -EPIPE: case -EPIPE:
@ -211,8 +214,9 @@ static void kingsun_rcv_irq(struct urb *urb)
/* unlink, shutdown, unplug, other nasties */ /* unlink, shutdown, unplug, other nasties */
if (urb->status != 0) { if (urb->status != 0) {
err("kingsun_rcv_irq: urb asynchronously failed - %d", dev_err(&kingsun->usbdev->dev,
urb->status); "kingsun_rcv_irq: urb asynchronously failed - %d\n",
urb->status);
kingsun->receiving = 0; kingsun->receiving = 0;
return; return;
} }
@ -238,8 +242,9 @@ static void kingsun_rcv_irq(struct urb *urb)
? 1 : 0; ? 1 : 0;
} }
} else if (urb->actual_length > 0) { } else if (urb->actual_length > 0) {
err("%s(): Unexpected response length, expected %d got %d", dev_err(&kingsun->usbdev->dev,
__func__, kingsun->max_rx, urb->actual_length); "%s(): Unexpected response length, expected %d got %d\n",
__func__, kingsun->max_rx, urb->actual_length);
} }
/* This urb has already been filled in kingsun_net_open */ /* This urb has already been filled in kingsun_net_open */
ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC);
@ -286,7 +291,7 @@ static int kingsun_net_open(struct net_device *netdev)
sprintf(hwname, "usb#%d", kingsun->usbdev->devnum); sprintf(hwname, "usb#%d", kingsun->usbdev->devnum);
kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname); kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname);
if (!kingsun->irlap) { if (!kingsun->irlap) {
err("kingsun-sir: irlap_open failed"); dev_err(&kingsun->usbdev->dev, "irlap_open failed\n");
goto free_mem; goto free_mem;
} }
@ -298,7 +303,8 @@ static int kingsun_net_open(struct net_device *netdev)
kingsun->rx_urb->status = 0; kingsun->rx_urb->status = 0;
err = usb_submit_urb(kingsun->rx_urb, GFP_KERNEL); err = usb_submit_urb(kingsun->rx_urb, GFP_KERNEL);
if (err) { if (err) {
err("kingsun-sir: first urb-submit failed: %d", err); dev_err(&kingsun->usbdev->dev,
"first urb-submit failed: %d\n", err);
goto close_irlap; goto close_irlap;
} }
@ -446,13 +452,15 @@ static int kingsun_probe(struct usb_interface *intf,
*/ */
interface = intf->cur_altsetting; interface = intf->cur_altsetting;
if (interface->desc.bNumEndpoints != 2) { if (interface->desc.bNumEndpoints != 2) {
err("kingsun-sir: expected 2 endpoints, found %d", dev_err(&intf->dev,
interface->desc.bNumEndpoints); "kingsun-sir: expected 2 endpoints, found %d\n",
interface->desc.bNumEndpoints);
return -ENODEV; return -ENODEV;
} }
endpoint = &interface->endpoint[KINGSUN_EP_IN].desc; endpoint = &interface->endpoint[KINGSUN_EP_IN].desc;
if (!usb_endpoint_is_int_in(endpoint)) { if (!usb_endpoint_is_int_in(endpoint)) {
err("kingsun-sir: endpoint 0 is not interrupt IN"); dev_err(&intf->dev,
"kingsun-sir: endpoint 0 is not interrupt IN\n");
return -ENODEV; return -ENODEV;
} }
@ -460,14 +468,16 @@ static int kingsun_probe(struct usb_interface *intf,
pipe = usb_rcvintpipe(dev, ep_in); pipe = usb_rcvintpipe(dev, ep_in);
maxp_in = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); maxp_in = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
if (maxp_in > 255 || maxp_in <= 1) { if (maxp_in > 255 || maxp_in <= 1) {
err("%s: endpoint 0 has max packet size %d not in range", dev_err(&intf->dev,
__FILE__, maxp_in); "endpoint 0 has max packet size %d not in range\n",
maxp_in);
return -ENODEV; return -ENODEV;
} }
endpoint = &interface->endpoint[KINGSUN_EP_OUT].desc; endpoint = &interface->endpoint[KINGSUN_EP_OUT].desc;
if (!usb_endpoint_is_int_out(endpoint)) { if (!usb_endpoint_is_int_out(endpoint)) {
err("kingsun-sir: endpoint 1 is not interrupt OUT"); dev_err(&intf->dev,
"kingsun-sir: endpoint 1 is not interrupt OUT\n");
return -ENODEV; return -ENODEV;
} }

View File

@ -247,8 +247,9 @@ static void ks959_speed_irq(struct urb *urb)
{ {
/* unlink, shutdown, unplug, other nasties */ /* unlink, shutdown, unplug, other nasties */
if (urb->status != 0) { if (urb->status != 0) {
err("ks959_speed_irq: urb asynchronously failed - %d", dev_err(&urb->dev->dev,
urb->status); "ks959_speed_irq: urb asynchronously failed - %d\n",
urb->status);
} }
} }
@ -332,14 +333,16 @@ static void ks959_send_irq(struct urb *urb)
/* in process of stopping, just drop data */ /* in process of stopping, just drop data */
if (!netif_running(kingsun->netdev)) { if (!netif_running(kingsun->netdev)) {
err("ks959_send_irq: Network not running!"); dev_err(&kingsun->usbdev->dev,
"ks959_send_irq: Network not running!\n");
return; return;
} }
/* unlink, shutdown, unplug, other nasties */ /* unlink, shutdown, unplug, other nasties */
if (urb->status != 0) { if (urb->status != 0) {
err("ks959_send_irq: urb asynchronously failed - %d", dev_err(&kingsun->usbdev->dev,
urb->status); "ks959_send_irq: urb asynchronously failed - %d\n",
urb->status);
return; return;
} }
@ -358,8 +361,9 @@ static void ks959_send_irq(struct urb *urb)
if (kingsun->tx_buf_clear_used > 0) { if (kingsun->tx_buf_clear_used > 0) {
/* There is more data to be sent */ /* There is more data to be sent */
if ((ret = ks959_submit_tx_fragment(kingsun)) != 0) { if ((ret = ks959_submit_tx_fragment(kingsun)) != 0) {
err("ks959_send_irq: failed tx_urb submit: %d", dev_err(&kingsun->usbdev->dev,
ret); "ks959_send_irq: failed tx_urb submit: %d\n",
ret);
switch (ret) { switch (ret) {
case -ENODEV: case -ENODEV:
case -EPIPE: case -EPIPE:
@ -407,7 +411,8 @@ static netdev_tx_t ks959_hard_xmit(struct sk_buff *skb,
kingsun->tx_buf_clear_used = wraplen; kingsun->tx_buf_clear_used = wraplen;
if ((ret = ks959_submit_tx_fragment(kingsun)) != 0) { if ((ret = ks959_submit_tx_fragment(kingsun)) != 0) {
err("ks959_hard_xmit: failed tx_urb submit: %d", ret); dev_err(&kingsun->usbdev->dev,
"ks959_hard_xmit: failed tx_urb submit: %d\n", ret);
switch (ret) { switch (ret) {
case -ENODEV: case -ENODEV:
case -EPIPE: case -EPIPE:
@ -442,8 +447,9 @@ static void ks959_rcv_irq(struct urb *urb)
/* unlink, shutdown, unplug, other nasties */ /* unlink, shutdown, unplug, other nasties */
if (urb->status != 0) { if (urb->status != 0) {
err("kingsun_rcv_irq: urb asynchronously failed - %d", dev_err(&kingsun->usbdev->dev,
urb->status); "kingsun_rcv_irq: urb asynchronously failed - %d\n",
urb->status);
kingsun->receiving = 0; kingsun->receiving = 0;
return; return;
} }
@ -536,7 +542,7 @@ static int ks959_net_open(struct net_device *netdev)
sprintf(hwname, "usb#%d", kingsun->usbdev->devnum); sprintf(hwname, "usb#%d", kingsun->usbdev->devnum);
kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname); kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname);
if (!kingsun->irlap) { if (!kingsun->irlap) {
err("ks959-sir: irlap_open failed"); dev_err(&kingsun->usbdev->dev, "irlap_open failed\n");
goto free_mem; goto free_mem;
} }
@ -549,7 +555,8 @@ static int ks959_net_open(struct net_device *netdev)
kingsun->rx_urb->status = 0; kingsun->rx_urb->status = 0;
err = usb_submit_urb(kingsun->rx_urb, GFP_KERNEL); err = usb_submit_urb(kingsun->rx_urb, GFP_KERNEL);
if (err) { if (err) {
err("ks959-sir: first urb-submit failed: %d", err); dev_err(&kingsun->usbdev->dev,
"first urb-submit failed: %d\n", err);
goto close_irlap; goto close_irlap;
} }

View File

@ -168,10 +168,10 @@ struct ksdazzle_cb {
static void ksdazzle_speed_irq(struct urb *urb) static void ksdazzle_speed_irq(struct urb *urb)
{ {
/* unlink, shutdown, unplug, other nasties */ /* unlink, shutdown, unplug, other nasties */
if (urb->status != 0) { if (urb->status != 0)
err("ksdazzle_speed_irq: urb asynchronously failed - %d", dev_err(&urb->dev->dev,
urb->status); "ksdazzle_speed_irq: urb asynchronously failed - %d\n",
} urb->status);
} }
/* Send a control request to change speed of the dongle */ /* Send a control request to change speed of the dongle */
@ -245,14 +245,16 @@ static void ksdazzle_send_irq(struct urb *urb)
/* in process of stopping, just drop data */ /* in process of stopping, just drop data */
if (!netif_running(kingsun->netdev)) { if (!netif_running(kingsun->netdev)) {
err("ksdazzle_send_irq: Network not running!"); dev_err(&kingsun->usbdev->dev,
"ksdazzle_send_irq: Network not running!\n");
return; return;
} }
/* unlink, shutdown, unplug, other nasties */ /* unlink, shutdown, unplug, other nasties */
if (urb->status != 0) { if (urb->status != 0) {
err("ksdazzle_send_irq: urb asynchronously failed - %d", dev_err(&kingsun->usbdev->dev,
urb->status); "ksdazzle_send_irq: urb asynchronously failed - %d\n",
urb->status);
return; return;
} }
@ -271,7 +273,9 @@ static void ksdazzle_send_irq(struct urb *urb)
if (kingsun->tx_buf_clear_used > 0) { if (kingsun->tx_buf_clear_used > 0) {
/* There is more data to be sent */ /* There is more data to be sent */
if ((ret = ksdazzle_submit_tx_fragment(kingsun)) != 0) { if ((ret = ksdazzle_submit_tx_fragment(kingsun)) != 0) {
err("ksdazzle_send_irq: failed tx_urb submit: %d", ret); dev_err(&kingsun->usbdev->dev,
"ksdazzle_send_irq: failed tx_urb submit: %d\n",
ret);
switch (ret) { switch (ret) {
case -ENODEV: case -ENODEV:
case -EPIPE: case -EPIPE:
@ -320,7 +324,8 @@ static netdev_tx_t ksdazzle_hard_xmit(struct sk_buff *skb,
kingsun->tx_buf_clear_used = wraplen; kingsun->tx_buf_clear_used = wraplen;
if ((ret = ksdazzle_submit_tx_fragment(kingsun)) != 0) { if ((ret = ksdazzle_submit_tx_fragment(kingsun)) != 0) {
err("ksdazzle_hard_xmit: failed tx_urb submit: %d", ret); dev_err(&kingsun->usbdev->dev,
"ksdazzle_hard_xmit: failed tx_urb submit: %d\n", ret);
switch (ret) { switch (ret) {
case -ENODEV: case -ENODEV:
case -EPIPE: case -EPIPE:
@ -355,8 +360,9 @@ static void ksdazzle_rcv_irq(struct urb *urb)
/* unlink, shutdown, unplug, other nasties */ /* unlink, shutdown, unplug, other nasties */
if (urb->status != 0) { if (urb->status != 0) {
err("ksdazzle_rcv_irq: urb asynchronously failed - %d", dev_err(&kingsun->usbdev->dev,
urb->status); "ksdazzle_rcv_irq: urb asynchronously failed - %d\n",
urb->status);
kingsun->receiving = 0; kingsun->receiving = 0;
return; return;
} }
@ -430,7 +436,7 @@ static int ksdazzle_net_open(struct net_device *netdev)
sprintf(hwname, "usb#%d", kingsun->usbdev->devnum); sprintf(hwname, "usb#%d", kingsun->usbdev->devnum);
kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname); kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname);
if (!kingsun->irlap) { if (!kingsun->irlap) {
err("ksdazzle-sir: irlap_open failed"); dev_err(&kingsun->usbdev->dev, "irlap_open failed\n");
goto free_mem; goto free_mem;
} }
@ -442,7 +448,7 @@ static int ksdazzle_net_open(struct net_device *netdev)
kingsun->rx_urb->status = 0; kingsun->rx_urb->status = 0;
err = usb_submit_urb(kingsun->rx_urb, GFP_KERNEL); err = usb_submit_urb(kingsun->rx_urb, GFP_KERNEL);
if (err) { if (err) {
err("ksdazzle-sir: first urb-submit failed: %d", err); dev_err(&kingsun->usbdev->dev, "first urb-submit failed: %d\n", err);
goto close_irlap; goto close_irlap;
} }
@ -590,13 +596,14 @@ static int ksdazzle_probe(struct usb_interface *intf,
*/ */
interface = intf->cur_altsetting; interface = intf->cur_altsetting;
if (interface->desc.bNumEndpoints != 2) { if (interface->desc.bNumEndpoints != 2) {
err("ksdazzle: expected 2 endpoints, found %d", dev_err(&intf->dev, "ksdazzle: expected 2 endpoints, found %d\n",
interface->desc.bNumEndpoints); interface->desc.bNumEndpoints);
return -ENODEV; return -ENODEV;
} }
endpoint = &interface->endpoint[KINGSUN_EP_IN].desc; endpoint = &interface->endpoint[KINGSUN_EP_IN].desc;
if (!usb_endpoint_is_int_in(endpoint)) { if (!usb_endpoint_is_int_in(endpoint)) {
err("ksdazzle: endpoint 0 is not interrupt IN"); dev_err(&intf->dev,
"ksdazzle: endpoint 0 is not interrupt IN\n");
return -ENODEV; return -ENODEV;
} }
@ -604,13 +611,16 @@ static int ksdazzle_probe(struct usb_interface *intf,
pipe = usb_rcvintpipe(dev, ep_in); pipe = usb_rcvintpipe(dev, ep_in);
maxp_in = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); maxp_in = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
if (maxp_in > 255 || maxp_in <= 1) { if (maxp_in > 255 || maxp_in <= 1) {
err("ksdazzle: endpoint 0 has max packet size %d not in range [2..255]", maxp_in); dev_err(&intf->dev,
"ksdazzle: endpoint 0 has max packet size %d not in range [2..255]\n",
maxp_in);
return -ENODEV; return -ENODEV;
} }
endpoint = &interface->endpoint[KINGSUN_EP_OUT].desc; endpoint = &interface->endpoint[KINGSUN_EP_OUT].desc;
if (!usb_endpoint_is_int_out(endpoint)) { if (!usb_endpoint_is_int_out(endpoint)) {
err("ksdazzle: endpoint 1 is not interrupt OUT"); dev_err(&intf->dev,
"ksdazzle: endpoint 1 is not interrupt OUT\n");
return -ENODEV; return -ENODEV;
} }

View File

@ -904,7 +904,7 @@ static int stir_net_open(struct net_device *netdev)
sprintf(hwname, "usb#%d", stir->usbdev->devnum); sprintf(hwname, "usb#%d", stir->usbdev->devnum);
stir->irlap = irlap_open(netdev, &stir->qos, hwname); stir->irlap = irlap_open(netdev, &stir->qos, hwname);
if (!stir->irlap) { if (!stir->irlap) {
err("stir4200: irlap_open failed"); dev_err(&stir->usbdev->dev, "irlap_open failed\n");
goto err_out5; goto err_out5;
} }
@ -913,7 +913,7 @@ static int stir_net_open(struct net_device *netdev)
"%s", stir->netdev->name); "%s", stir->netdev->name);
if (IS_ERR(stir->thread)) { if (IS_ERR(stir->thread)) {
err = PTR_ERR(stir->thread); err = PTR_ERR(stir->thread);
err("stir4200: unable to start kernel thread"); dev_err(&stir->usbdev->dev, "unable to start kernel thread\n");
goto err_out6; goto err_out6;
} }
@ -1042,7 +1042,7 @@ static int stir_probe(struct usb_interface *intf,
ret = usb_reset_configuration(dev); ret = usb_reset_configuration(dev);
if (ret != 0) { if (ret != 0) {
err("stir4200: usb reset configuration failed"); dev_err(&intf->dev, "usb reset configuration failed\n");
goto err_out2; goto err_out2;
} }

View File

@ -1647,6 +1647,7 @@ static struct usb_driver asix_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.supports_autosuspend = 1, .supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(asix_driver); module_usb_driver(asix_driver);

View File

@ -338,16 +338,18 @@ static void catc_irq_done(struct urb *urb)
} else { } else {
catc->rx_urb->dev = catc->usbdev; catc->rx_urb->dev = catc->usbdev;
if ((res = usb_submit_urb(catc->rx_urb, GFP_ATOMIC)) < 0) { if ((res = usb_submit_urb(catc->rx_urb, GFP_ATOMIC)) < 0) {
err("submit(rx_urb) status %d", res); dev_err(&catc->usbdev->dev,
"submit(rx_urb) status %d\n", res);
} }
} }
} }
resubmit: resubmit:
res = usb_submit_urb (urb, GFP_ATOMIC); res = usb_submit_urb (urb, GFP_ATOMIC);
if (res) if (res)
err ("can't resubmit intr, %s-%s, status %d", dev_err(&catc->usbdev->dev,
catc->usbdev->bus->bus_name, "can't resubmit intr, %s-%s, status %d\n",
catc->usbdev->devpath, res); catc->usbdev->bus->bus_name,
catc->usbdev->devpath, res);
} }
/* /*
@ -366,7 +368,8 @@ static int catc_tx_run(struct catc *catc)
catc->tx_urb->dev = catc->usbdev; catc->tx_urb->dev = catc->usbdev;
if ((status = usb_submit_urb(catc->tx_urb, GFP_ATOMIC)) < 0) if ((status = usb_submit_urb(catc->tx_urb, GFP_ATOMIC)) < 0)
err("submit(tx_urb), status %d", status); dev_err(&catc->usbdev->dev, "submit(tx_urb), status %d\n",
status);
catc->tx_idx = !catc->tx_idx; catc->tx_idx = !catc->tx_idx;
catc->tx_ptr = 0; catc->tx_ptr = 0;
@ -496,7 +499,8 @@ static void catc_ctrl_run(struct catc *catc)
memcpy(catc->ctrl_buf, q->buf, q->len); memcpy(catc->ctrl_buf, q->buf, q->len);
if ((status = usb_submit_urb(catc->ctrl_urb, GFP_ATOMIC))) if ((status = usb_submit_urb(catc->ctrl_urb, GFP_ATOMIC)))
err("submit(ctrl_urb) status %d", status); dev_err(&catc->usbdev->dev, "submit(ctrl_urb) status %d\n",
status);
} }
static void catc_ctrl_done(struct urb *urb) static void catc_ctrl_done(struct urb *urb)
@ -555,7 +559,7 @@ static int catc_ctrl_async(struct catc *catc, u8 dir, u8 request, u16 value,
catc->ctrl_head = (catc->ctrl_head + 1) & (CTRL_QUEUE - 1); catc->ctrl_head = (catc->ctrl_head + 1) & (CTRL_QUEUE - 1);
if (catc->ctrl_head == catc->ctrl_tail) { if (catc->ctrl_head == catc->ctrl_tail) {
err("ctrl queue full"); dev_err(&catc->usbdev->dev, "ctrl queue full\n");
catc->ctrl_tail = (catc->ctrl_tail + 1) & (CTRL_QUEUE - 1); catc->ctrl_tail = (catc->ctrl_tail + 1) & (CTRL_QUEUE - 1);
retval = -1; retval = -1;
} }
@ -714,7 +718,8 @@ static int catc_open(struct net_device *netdev)
catc->irq_urb->dev = catc->usbdev; catc->irq_urb->dev = catc->usbdev;
if ((status = usb_submit_urb(catc->irq_urb, GFP_KERNEL)) < 0) { if ((status = usb_submit_urb(catc->irq_urb, GFP_KERNEL)) < 0) {
err("submit(irq_urb) status %d", status); dev_err(&catc->usbdev->dev, "submit(irq_urb) status %d\n",
status);
return -1; return -1;
} }
@ -769,7 +774,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
if (usb_set_interface(usbdev, if (usb_set_interface(usbdev,
intf->altsetting->desc.bInterfaceNumber, 1)) { intf->altsetting->desc.bInterfaceNumber, 1)) {
err("Can't set altsetting 1."); dev_err(&intf->dev, "Can't set altsetting 1.\n");
return -EIO; return -EIO;
} }
@ -799,7 +804,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
catc->irq_urb = usb_alloc_urb(0, GFP_KERNEL); catc->irq_urb = usb_alloc_urb(0, GFP_KERNEL);
if ((!catc->ctrl_urb) || (!catc->tx_urb) || if ((!catc->ctrl_urb) || (!catc->tx_urb) ||
(!catc->rx_urb) || (!catc->irq_urb)) { (!catc->rx_urb) || (!catc->irq_urb)) {
err("No free urbs available."); dev_err(&intf->dev, "No free urbs available.\n");
usb_free_urb(catc->ctrl_urb); usb_free_urb(catc->ctrl_urb);
usb_free_urb(catc->tx_urb); usb_free_urb(catc->tx_urb);
usb_free_urb(catc->rx_urb); usb_free_urb(catc->rx_urb);
@ -947,6 +952,7 @@ static struct usb_driver catc_driver = {
.probe = catc_probe, .probe = catc_probe,
.disconnect = catc_disconnect, .disconnect = catc_disconnect,
.id_table = catc_id_table, .id_table = catc_id_table,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(catc_driver); module_usb_driver(catc_driver);

View File

@ -457,6 +457,7 @@ static struct usb_driver usbpn_driver = {
.probe = usbpn_probe, .probe = usbpn_probe,
.disconnect = usbpn_disconnect, .disconnect = usbpn_disconnect,
.id_table = usbpn_ids, .id_table = usbpn_ids,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(usbpn_driver); module_usb_driver(usbpn_driver);

View File

@ -368,6 +368,7 @@ static struct usb_driver eem_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(eem_driver); module_usb_driver(eem_driver);

View File

@ -705,6 +705,7 @@ static struct usb_driver cdc_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
.reset_resume = usbnet_resume, .reset_resume = usbnet_resume,
.supports_autosuspend = 1, .supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(cdc_driver); module_usb_driver(cdc_driver);

View File

@ -1212,6 +1212,7 @@ static struct usb_driver cdc_ncm_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
.reset_resume = usbnet_resume, .reset_resume = usbnet_resume,
.supports_autosuspend = 1, .supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
}; };
static const struct ethtool_ops cdc_ncm_ethtool_ops = { static const struct ethtool_ops cdc_ncm_ethtool_ops = {

View File

@ -336,6 +336,7 @@ static struct usb_driver cdc_subset_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.id_table = products, .id_table = products,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(cdc_subset_driver); module_usb_driver(cdc_subset_driver);

View File

@ -327,6 +327,7 @@ static struct usb_driver cx82310_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(cx82310_driver); module_usb_driver(cx82310_driver);

View File

@ -670,6 +670,7 @@ static struct usb_driver dm9601_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(dm9601_driver); module_usb_driver(dm9601_driver);

View File

@ -225,6 +225,7 @@ static struct usb_driver gl620a_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(gl620a_driver); module_usb_driver(gl620a_driver);

View File

@ -3291,6 +3291,7 @@ static struct usb_driver hso_driver = {
.resume = hso_resume, .resume = hso_resume,
.reset_resume = hso_resume, .reset_resume = hso_resume,
.supports_autosuspend = 1, .supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
}; };
static int __init hso_init(void) static int __init hso_init(void)

View File

@ -236,6 +236,7 @@ static struct usb_driver int51x1_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(int51x1_driver); module_usb_driver(int51x1_driver);

View File

@ -209,7 +209,8 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
case 0: case 0:
break; break;
default: default:
err("%s: urb status: %d", __func__, status); dev_err(&dev->intf->dev, "%s: urb status: %d\n",
__func__, status);
return; return;
} }
@ -222,7 +223,8 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
skb = dev_alloc_skb(len); skb = dev_alloc_skb(len);
if (!skb) { if (!skb) {
err("%s: dev_alloc_skb: -ENOMEM", __func__); dev_err(&dev->intf->dev, "%s: dev_alloc_skb: -ENOMEM\n",
__func__);
dev->net->stats.rx_dropped++; dev->net->stats.rx_dropped++;
return; return;
} }
@ -251,7 +253,8 @@ static void ipheth_sndbulk_callback(struct urb *urb)
status != -ENOENT && status != -ENOENT &&
status != -ECONNRESET && status != -ECONNRESET &&
status != -ESHUTDOWN) status != -ESHUTDOWN)
err("%s: urb status: %d", __func__, status); dev_err(&dev->intf->dev, "%s: urb status: %d\n",
__func__, status);
dev_kfree_skb_irq(dev->tx_skb); dev_kfree_skb_irq(dev->tx_skb);
netif_wake_queue(dev->net); netif_wake_queue(dev->net);
@ -271,7 +274,8 @@ static int ipheth_carrier_set(struct ipheth_device *dev)
dev->ctrl_buf, IPHETH_CTRL_BUF_SIZE, dev->ctrl_buf, IPHETH_CTRL_BUF_SIZE,
IPHETH_CTRL_TIMEOUT); IPHETH_CTRL_TIMEOUT);
if (retval < 0) { if (retval < 0) {
err("%s: usb_control_msg: %d", __func__, retval); dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n",
__func__, retval);
return retval; return retval;
} }
@ -308,9 +312,11 @@ static int ipheth_get_macaddr(struct ipheth_device *dev)
IPHETH_CTRL_BUF_SIZE, IPHETH_CTRL_BUF_SIZE,
IPHETH_CTRL_TIMEOUT); IPHETH_CTRL_TIMEOUT);
if (retval < 0) { if (retval < 0) {
err("%s: usb_control_msg: %d", __func__, retval); dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n",
__func__, retval);
} else if (retval < ETH_ALEN) { } else if (retval < ETH_ALEN) {
err("%s: usb_control_msg: short packet: %d bytes", dev_err(&dev->intf->dev,
"%s: usb_control_msg: short packet: %d bytes\n",
__func__, retval); __func__, retval);
retval = -EINVAL; retval = -EINVAL;
} else { } else {
@ -335,7 +341,8 @@ static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags)
retval = usb_submit_urb(dev->rx_urb, mem_flags); retval = usb_submit_urb(dev->rx_urb, mem_flags);
if (retval) if (retval)
err("%s: usb_submit_urb: %d", __func__, retval); dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n",
__func__, retval);
return retval; return retval;
} }
@ -396,7 +403,8 @@ static int ipheth_tx(struct sk_buff *skb, struct net_device *net)
retval = usb_submit_urb(dev->tx_urb, GFP_ATOMIC); retval = usb_submit_urb(dev->tx_urb, GFP_ATOMIC);
if (retval) { if (retval) {
err("%s: usb_submit_urb: %d", __func__, retval); dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n",
__func__, retval);
dev->net->stats.tx_errors++; dev->net->stats.tx_errors++;
dev_kfree_skb_irq(skb); dev_kfree_skb_irq(skb);
} else { } else {
@ -414,7 +422,7 @@ static void ipheth_tx_timeout(struct net_device *net)
{ {
struct ipheth_device *dev = netdev_priv(net); struct ipheth_device *dev = netdev_priv(net);
err("%s: TX timeout", __func__); dev_err(&dev->intf->dev, "%s: TX timeout\n", __func__);
dev->net->stats.tx_errors++; dev->net->stats.tx_errors++;
usb_unlink_urb(dev->tx_urb); usb_unlink_urb(dev->tx_urb);
} }
@ -464,7 +472,7 @@ static int ipheth_probe(struct usb_interface *intf,
hintf = usb_altnum_to_altsetting(intf, IPHETH_ALT_INTFNUM); hintf = usb_altnum_to_altsetting(intf, IPHETH_ALT_INTFNUM);
if (hintf == NULL) { if (hintf == NULL) {
retval = -ENODEV; retval = -ENODEV;
err("Unable to find alternate settings interface"); dev_err(&intf->dev, "Unable to find alternate settings interface\n");
goto err_endpoints; goto err_endpoints;
} }
@ -477,7 +485,7 @@ static int ipheth_probe(struct usb_interface *intf,
} }
if (!(dev->bulk_in && dev->bulk_out)) { if (!(dev->bulk_in && dev->bulk_out)) {
retval = -ENODEV; retval = -ENODEV;
err("Unable to find endpoints"); dev_err(&intf->dev, "Unable to find endpoints\n");
goto err_endpoints; goto err_endpoints;
} }
@ -495,7 +503,7 @@ static int ipheth_probe(struct usb_interface *intf,
retval = ipheth_alloc_urbs(dev); retval = ipheth_alloc_urbs(dev);
if (retval) { if (retval) {
err("error allocating urbs: %d", retval); dev_err(&intf->dev, "error allocating urbs: %d\n", retval);
goto err_alloc_urbs; goto err_alloc_urbs;
} }
@ -506,7 +514,7 @@ static int ipheth_probe(struct usb_interface *intf,
retval = register_netdev(netdev); retval = register_netdev(netdev);
if (retval) { if (retval) {
err("error registering netdev: %d", retval); dev_err(&intf->dev, "error registering netdev: %d\n", retval);
retval = -EIO; retval = -EIO;
goto err_register_netdev; goto err_register_netdev;
} }
@ -546,6 +554,7 @@ static struct usb_driver ipheth_driver = {
.probe = ipheth_probe, .probe = ipheth_probe,
.disconnect = ipheth_disconnect, .disconnect = ipheth_disconnect,
.id_table = ipheth_table, .id_table = ipheth_table,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(ipheth_driver); module_usb_driver(ipheth_driver);

View File

@ -372,7 +372,8 @@ static struct usb_driver kalmia_driver = {
.probe = usbnet_probe, .probe = usbnet_probe,
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(kalmia_driver); module_usb_driver(kalmia_driver);

View File

@ -179,6 +179,7 @@ static struct usb_driver kaweth_driver = {
.resume = kaweth_resume, .resume = kaweth_resume,
.id_table = usb_klsi_table, .id_table = usb_klsi_table,
.supports_autosuspend = 1, .supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
}; };
typedef __u8 eth_addr_t[6]; typedef __u8 eth_addr_t[6];
@ -400,12 +401,13 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth,
ret = request_firmware(&fw, fwname, &kaweth->dev->dev); ret = request_firmware(&fw, fwname, &kaweth->dev->dev);
if (ret) { if (ret) {
err("Firmware request failed\n"); dev_err(&kaweth->intf->dev, "Firmware request failed\n");
return ret; return ret;
} }
if (fw->size > KAWETH_FIRMWARE_BUF_SIZE) { if (fw->size > KAWETH_FIRMWARE_BUF_SIZE) {
err("Firmware too big: %zu", fw->size); dev_err(&kaweth->intf->dev, "Firmware too big: %zu\n",
fw->size);
release_firmware(fw); release_firmware(fw);
return -ENOSPC; return -ENOSPC;
} }
@ -501,9 +503,10 @@ static void kaweth_resubmit_int_urb(struct kaweth_device *kaweth, gfp_t mf)
} }
if (status) if (status)
err ("can't resubmit intr, %s-%s, status %d", dev_err(&kaweth->intf->dev,
kaweth->dev->bus->bus_name, "can't resubmit intr, %s-%s, status %d\n",
kaweth->dev->devpath, status); kaweth->dev->bus->bus_name,
kaweth->dev->devpath, status);
} }
static void int_callback(struct urb *u) static void int_callback(struct urb *u)
@ -576,7 +579,8 @@ static int kaweth_resubmit_rx_urb(struct kaweth_device *kaweth,
kaweth->suspend_lowmem_rx = 1; kaweth->suspend_lowmem_rx = 1;
schedule_delayed_work(&kaweth->lowmem_work, HZ/4); schedule_delayed_work(&kaweth->lowmem_work, HZ/4);
} }
err("resubmitting rx_urb %d failed", result); dev_err(&kaweth->intf->dev, "resubmitting rx_urb %d failed\n",
result);
} else { } else {
kaweth->suspend_lowmem_rx = 0; kaweth->suspend_lowmem_rx = 0;
} }
@ -634,20 +638,21 @@ static void kaweth_usb_receive(struct urb *urb)
spin_unlock(&kaweth->device_lock); spin_unlock(&kaweth->device_lock);
if(status && status != -EREMOTEIO && count != 1) { if(status && status != -EREMOTEIO && count != 1) {
err("%s RX status: %d count: %d packet_len: %d", dev_err(&kaweth->intf->dev,
net->name, "%s RX status: %d count: %d packet_len: %d\n",
status, net->name, status, count, (int)pkt_len);
count,
(int)pkt_len);
kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
return; return;
} }
if(kaweth->net && (count > 2)) { if(kaweth->net && (count > 2)) {
if(pkt_len > (count - 2)) { if(pkt_len > (count - 2)) {
err("Packet length too long for USB frame (pkt_len: %x, count: %x)",pkt_len, count); dev_err(&kaweth->intf->dev,
err("Packet len & 2047: %x", pkt_len & 2047); "Packet length too long for USB frame (pkt_len: %x, count: %x)\n",
err("Count 2: %x", count2); pkt_len, count);
dev_err(&kaweth->intf->dev, "Packet len & 2047: %x\n",
pkt_len & 2047);
dev_err(&kaweth->intf->dev, "Count 2: %x\n", count2);
kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC);
return; return;
} }
@ -686,7 +691,7 @@ static int kaweth_open(struct net_device *net)
res = usb_autopm_get_interface(kaweth->intf); res = usb_autopm_get_interface(kaweth->intf);
if (res) { if (res) {
err("Interface cannot be resumed."); dev_err(&kaweth->intf->dev, "Interface cannot be resumed.\n");
return -EIO; return -EIO;
} }
res = kaweth_resubmit_rx_urb(kaweth, GFP_KERNEL); res = kaweth_resubmit_rx_urb(kaweth, GFP_KERNEL);
@ -907,7 +912,8 @@ static void kaweth_async_set_rx_mode(struct kaweth_device *kaweth)
KAWETH_CONTROL_TIMEOUT); KAWETH_CONTROL_TIMEOUT);
if(result < 0) { if(result < 0) {
err("Failed to set Rx mode: %d", result); dev_err(&kaweth->intf->dev, "Failed to set Rx mode: %d\n",
result);
} }
else { else {
dbg("Set Rx mode to %d", packet_filter_bitmap); dbg("Set Rx mode to %d", packet_filter_bitmap);
@ -1045,7 +1051,8 @@ static int kaweth_probe(
"kaweth/new_code.bin", "kaweth/new_code.bin",
100, 100,
2)) < 0) { 2)) < 0) {
err("Error downloading firmware (%d)", result); dev_err(&intf->dev, "Error downloading firmware (%d)\n",
result);
goto err_fw; goto err_fw;
} }
@ -1053,7 +1060,9 @@ static int kaweth_probe(
"kaweth/new_code_fix.bin", "kaweth/new_code_fix.bin",
100, 100,
3)) < 0) { 3)) < 0) {
err("Error downloading firmware fix (%d)", result); dev_err(&intf->dev,
"Error downloading firmware fix (%d)\n",
result);
goto err_fw; goto err_fw;
} }
@ -1061,7 +1070,9 @@ static int kaweth_probe(
"kaweth/trigger_code.bin", "kaweth/trigger_code.bin",
126, 126,
2)) < 0) { 2)) < 0) {
err("Error downloading trigger code (%d)", result); dev_err(&intf->dev,
"Error downloading trigger code (%d)\n",
result);
goto err_fw; goto err_fw;
} }
@ -1070,13 +1081,14 @@ static int kaweth_probe(
"kaweth/trigger_code_fix.bin", "kaweth/trigger_code_fix.bin",
126, 126,
3)) < 0) { 3)) < 0) {
err("Error downloading trigger code fix (%d)", result); dev_err(&intf->dev, "Error downloading trigger code fix (%d)\n", result);
goto err_fw; goto err_fw;
} }
if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) { if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) {
err("Error triggering firmware (%d)", result); dev_err(&intf->dev, "Error triggering firmware (%d)\n",
result);
goto err_fw; goto err_fw;
} }
@ -1091,7 +1103,7 @@ err_fw:
result = kaweth_read_configuration(kaweth); result = kaweth_read_configuration(kaweth);
if(result < 0) { if(result < 0) {
err("Error reading configuration (%d), no net device created", result); dev_err(&intf->dev, "Error reading configuration (%d), no net device created\n", result);
goto err_free_netdev; goto err_free_netdev;
} }
@ -1103,7 +1115,7 @@ err_fw:
if(!memcmp(&kaweth->configuration.hw_addr, if(!memcmp(&kaweth->configuration.hw_addr,
&bcast_addr, &bcast_addr,
sizeof(bcast_addr))) { sizeof(bcast_addr))) {
err("Firmware not functioning properly, no net device created"); dev_err(&intf->dev, "Firmware not functioning properly, no net device created\n");
goto err_free_netdev; goto err_free_netdev;
} }
@ -1113,7 +1125,7 @@ err_fw:
} }
if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) { if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) {
err("Error setting SOFS wait"); dev_err(&intf->dev, "Error setting SOFS wait\n");
goto err_free_netdev; goto err_free_netdev;
} }
@ -1123,7 +1135,7 @@ err_fw:
KAWETH_PACKET_FILTER_MULTICAST); KAWETH_PACKET_FILTER_MULTICAST);
if(result < 0) { if(result < 0) {
err("Error setting receive filter"); dev_err(&intf->dev, "Error setting receive filter\n");
goto err_free_netdev; goto err_free_netdev;
} }
@ -1175,7 +1187,7 @@ err_fw:
SET_NETDEV_DEV(netdev, &intf->dev); SET_NETDEV_DEV(netdev, &intf->dev);
if (register_netdev(netdev) != 0) { if (register_netdev(netdev) != 0) {
err("Error registering netdev."); dev_err(&intf->dev, "Error registering netdev.\n");
goto err_intfdata; goto err_intfdata;
} }

View File

@ -344,6 +344,7 @@ static struct usb_driver lg_vl600_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(lg_vl600_driver); module_usb_driver(lg_vl600_driver);

View File

@ -690,6 +690,7 @@ static struct usb_driver mcs7830_driver = {
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.reset_resume = mcs7830_reset_resume, .reset_resume = mcs7830_reset_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(mcs7830_driver); module_usb_driver(mcs7830_driver);

View File

@ -587,6 +587,7 @@ static struct usb_driver net1080_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(net1080_driver); module_usb_driver(net1080_driver);

View File

@ -1489,6 +1489,7 @@ static struct usb_driver pegasus_driver = {
.id_table = pegasus_ids, .id_table = pegasus_ids,
.suspend = pegasus_suspend, .suspend = pegasus_suspend,
.resume = pegasus_resume, .resume = pegasus_resume,
.disable_hub_initiated_lpm = 1,
}; };
static void __init parse_id(char *id) static void __init parse_id(char *id)

View File

@ -152,6 +152,7 @@ static struct usb_driver plusb_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(plusb_driver); module_usb_driver(plusb_driver);

View File

@ -560,6 +560,7 @@ static struct usb_driver qmi_wwan_driver = {
.resume = qmi_wwan_resume, .resume = qmi_wwan_resume,
.reset_resume = qmi_wwan_resume, .reset_resume = qmi_wwan_resume,
.supports_autosuspend = 1, .supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
}; };
static int __init qmi_wwan_init(void) static int __init qmi_wwan_init(void)

View File

@ -638,6 +638,7 @@ static struct usb_driver rndis_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(rndis_driver); module_usb_driver(rndis_driver);

View File

@ -203,7 +203,8 @@ static int async_set_registers(rtl8150_t * dev, u16 indx, u16 size)
if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) { if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) {
if (ret == -ENODEV) if (ret == -ENODEV)
netif_device_detach(dev->netdev); netif_device_detach(dev->netdev);
err("control request submission failed: %d", ret); dev_err(&dev->udev->dev,
"control request submission failed: %d\n", ret);
} else } else
set_bit(RX_REG_SET, &dev->flags); set_bit(RX_REG_SET, &dev->flags);
@ -516,9 +517,9 @@ resubmit:
if (res == -ENODEV) if (res == -ENODEV)
netif_device_detach(dev->netdev); netif_device_detach(dev->netdev);
else if (res) else if (res)
err ("can't resubmit intr, %s-%s/input0, status %d", dev_err(&dev->udev->dev,
dev->udev->bus->bus_name, "can't resubmit intr, %s-%s/input0, status %d\n",
dev->udev->devpath, res); dev->udev->bus->bus_name, dev->udev->devpath, res);
} }
static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message) static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message)
@ -890,11 +891,11 @@ static int rtl8150_probe(struct usb_interface *intf,
dev->intr_interval = 100; /* 100ms */ dev->intr_interval = 100; /* 100ms */
if (!alloc_all_urbs(dev)) { if (!alloc_all_urbs(dev)) {
err("out of memory"); dev_err(&intf->dev, "out of memory\n");
goto out; goto out;
} }
if (!rtl8150_reset(dev)) { if (!rtl8150_reset(dev)) {
err("couldn't reset the device"); dev_err(&intf->dev, "couldn't reset the device\n");
goto out1; goto out1;
} }
fill_skb_pool(dev); fill_skb_pool(dev);
@ -903,7 +904,7 @@ static int rtl8150_probe(struct usb_interface *intf,
usb_set_intfdata(intf, dev); usb_set_intfdata(intf, dev);
SET_NETDEV_DEV(netdev, &intf->dev); SET_NETDEV_DEV(netdev, &intf->dev);
if (register_netdev(netdev) != 0) { if (register_netdev(netdev) != 0) {
err("couldn't register the device"); dev_err(&intf->dev, "couldn't register the device\n");
goto out2; goto out2;
} }
@ -947,7 +948,8 @@ static struct usb_driver rtl8150_driver = {
.disconnect = rtl8150_disconnect, .disconnect = rtl8150_disconnect,
.id_table = rtl8150_table, .id_table = rtl8150_table,
.suspend = rtl8150_suspend, .suspend = rtl8150_suspend,
.resume = rtl8150_resume .resume = rtl8150_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(rtl8150_driver); module_usb_driver(rtl8150_driver);

View File

@ -982,6 +982,7 @@ static struct usb_driver sierra_net_driver = {
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.no_dynamic_id = 1, .no_dynamic_id = 1,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(sierra_net_driver); module_usb_driver(sierra_net_driver);

View File

@ -1254,6 +1254,7 @@ static struct usb_driver smsc75xx_driver = {
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(smsc75xx_driver); module_usb_driver(smsc75xx_driver);

View File

@ -1297,6 +1297,7 @@ static struct usb_driver smsc95xx_driver = {
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(smsc95xx_driver); module_usb_driver(smsc95xx_driver);

View File

@ -377,6 +377,7 @@ static struct usb_driver zaurus_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(zaurus_driver); module_usb_driver(zaurus_driver);

View File

@ -1955,7 +1955,7 @@ static int at76_hw_scan(struct ieee80211_hw *hw,
ret = at76_set_card_command(priv->udev, CMD_SCAN, &scan, sizeof(scan)); ret = at76_set_card_command(priv->udev, CMD_SCAN, &scan, sizeof(scan));
if (ret < 0) { if (ret < 0) {
err("CMD_SCAN failed: %d", ret); wiphy_err(priv->hw->wiphy, "CMD_SCAN failed: %d\n", ret);
goto exit; goto exit;
} }
@ -2486,6 +2486,7 @@ static struct usb_driver at76_driver = {
.probe = at76_probe, .probe = at76_probe,
.disconnect = at76_disconnect, .disconnect = at76_disconnect,
.id_table = dev_table, .id_table = dev_table,
.disable_hub_initiated_lpm = 1,
}; };
static int __init at76_mod_init(void) static int __init at76_mod_init(void)

View File

@ -1182,6 +1182,7 @@ static struct usb_driver ath6kl_usb_driver = {
.disconnect = ath6kl_usb_remove, .disconnect = ath6kl_usb_remove,
.id_table = ath6kl_usb_ids, .id_table = ath6kl_usb_ids,
.supports_autosuspend = true, .supports_autosuspend = true,
.disable_hub_initiated_lpm = 1,
}; };
static int ath6kl_usb_init(void) static int ath6kl_usb_init(void)

View File

@ -1358,6 +1358,7 @@ static struct usb_driver ath9k_hif_usb_driver = {
#endif #endif
.id_table = ath9k_hif_usb_ids, .id_table = ath9k_hif_usb_ids,
.soft_unbind = 1, .soft_unbind = 1,
.disable_hub_initiated_lpm = 1,
}; };
int ath9k_hif_usb_init(void) int ath9k_hif_usb_init(void)

View File

@ -1159,6 +1159,7 @@ static struct usb_driver carl9170_driver = {
.resume = carl9170_usb_resume, .resume = carl9170_usb_resume,
.reset_resume = carl9170_usb_resume, .reset_resume = carl9170_usb_resume,
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(carl9170_driver); module_usb_driver(carl9170_driver);

View File

@ -1596,7 +1596,8 @@ static struct usb_driver brcmf_usbdrvr = {
.id_table = brcmf_usb_devid_table, .id_table = brcmf_usb_devid_table,
.suspend = brcmf_usb_suspend, .suspend = brcmf_usb_suspend,
.resume = brcmf_usb_resume, .resume = brcmf_usb_resume,
.supports_autosuspend = 1 .supports_autosuspend = 1,
.disable_hub_initiated_lpm = 1,
}; };
void brcmf_usb_exit(void) void brcmf_usb_exit(void)

View File

@ -1011,6 +1011,7 @@ static struct usb_driver if_usb_driver = {
.suspend = if_usb_suspend, .suspend = if_usb_suspend,
.resume = if_usb_resume, .resume = if_usb_resume,
.reset_resume = if_usb_resume, .reset_resume = if_usb_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(if_usb_driver); module_usb_driver(if_usb_driver);

View File

@ -920,6 +920,7 @@ static struct usb_driver if_usb_driver = {
.id_table = if_usb_table, .id_table = if_usb_table,
.suspend = if_usb_suspend, .suspend = if_usb_suspend,
.resume = if_usb_resume, .resume = if_usb_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(if_usb_driver); module_usb_driver(if_usb_driver);

View File

@ -1752,6 +1752,7 @@ static struct usb_driver orinoco_driver = {
.probe = ezusb_probe, .probe = ezusb_probe,
.disconnect = ezusb_disconnect, .disconnect = ezusb_disconnect,
.id_table = ezusb_table, .id_table = ezusb_table,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(orinoco_driver); module_usb_driver(orinoco_driver);

View File

@ -1140,6 +1140,7 @@ static struct usb_driver p54u_driver = {
.reset_resume = p54u_resume, .reset_resume = p54u_resume,
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
.soft_unbind = 1, .soft_unbind = 1,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(p54u_driver); module_usb_driver(p54u_driver);

View File

@ -3765,6 +3765,7 @@ static struct usb_driver rndis_wlan_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
.suspend = usbnet_suspend, .suspend = usbnet_suspend,
.resume = usbnet_resume, .resume = usbnet_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(rndis_wlan_driver); module_usb_driver(rndis_wlan_driver);

View File

@ -1980,6 +1980,7 @@ static struct usb_driver rt2500usb_driver = {
.disconnect = rt2x00usb_disconnect, .disconnect = rt2x00usb_disconnect,
.suspend = rt2x00usb_suspend, .suspend = rt2x00usb_suspend,
.resume = rt2x00usb_resume, .resume = rt2x00usb_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(rt2500usb_driver); module_usb_driver(rt2500usb_driver);

View File

@ -1302,6 +1302,7 @@ static struct usb_driver rt2800usb_driver = {
.disconnect = rt2x00usb_disconnect, .disconnect = rt2x00usb_disconnect,
.suspend = rt2x00usb_suspend, .suspend = rt2x00usb_suspend,
.resume = rt2x00usb_resume, .resume = rt2x00usb_resume,
.disable_hub_initiated_lpm = 1,
}; };
module_usb_driver(rt2800usb_driver); module_usb_driver(rt2800usb_driver);

Some files were not shown because too many files have changed in this diff Show More