sfrench/cifs-2.6.git
13 years agoUSB: musb: make DBG() calls actually depend on CONFIG_USB_MUSB_DEBUG
Sergei Shtylyov [Fri, 24 Sep 2010 10:44:02 +0000 (13:44 +0300)]
USB: musb: make DBG() calls actually depend on CONFIG_USB_MUSB_DEBUG

Enabling CONFIG_USB_MUSB_DEBUG option causes -DDEBUG to be added to gcc's
command line, however the DBG() macro doesn't depend on DEBUG, so that the
debugging messages get printed regardless of the option, and I don't think
that this was intended. Get rid of otherwise unused xprintk() macro and make
DBG() macro directly call pr_debug() which only results in the actual code
generated if DEBUG is defined.

This change makes musb_hdrc.o ~30% less in size with CONFIG_USB_MUSB_DEBUG
disabled (in host mode).

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: yurex: fix memory leak and corrupted messages
Tomoki Sekiyama [Sat, 2 Oct 2010 21:59:06 +0000 (06:59 +0900)]
USB: yurex: fix memory leak and corrupted messages

This fixes the memory leak on disconnecting the device.
In addition, it fixes some messages corrupted by incorrect encoding.

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: yurex: assign a real minor number to the driver
Greg Kroah-Hartman [Thu, 30 Sep 2010 12:01:22 +0000 (05:01 -0700)]
USB: yurex: assign a real minor number to the driver

This assigns the minor number 192 to the yurex driver.

We also fix up the previous usb minor number entry, it was wrong.

Cc: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: add driver for Meywa-Denki & Kayac YUREX
Tomoki Sekiyama [Wed, 29 Sep 2010 03:16:50 +0000 (12:16 +0900)]
USB: add driver for Meywa-Denki & Kayac YUREX

Meywa-Denki/Kayac YUREX is a leg-shakes sensor device.
See http://bbu.kayac.com/en/about/ for further information.
This driver support read/write the leg-shakes counter in the device
via a device file /dev/yurex[0-9]*.

[minor coding style cleanups fixed by gregkh]

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: file_storage: reuse definitions from a header file
Michal Nazarewicz [Thu, 7 Oct 2010 11:05:24 +0000 (13:05 +0200)]
USB: gadget: file_storage: reuse definitions from a header file

This commit changes storage_common.c and file_storage.c to
reuse definitions from linux/usb/storage.h header file.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Add UAS driver
Matthew Wilcox [Thu, 7 Oct 2010 11:05:23 +0000 (13:05 +0200)]
USB: Add UAS driver

USB Attached SCSI is a new protocol specified jointly by the SCSI T10
committee and the USB Implementors Forum.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
[mina86@mina86.com: updated to use new USB_ prefix]
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Move USB Storage definitions to their own header file
Matthew Wilcox [Thu, 7 Oct 2010 11:05:22 +0000 (13:05 +0200)]
USB: Move USB Storage definitions to their own header file

The libusual header file is hard to use from code that isn't part
of libusual.  As the comment suggests, these definitions are moved to
their own header file, paralleling other USB classes.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
[mina86@mina86.com: updated to use USB_ prefix and added #include guard]
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
index 0000000..d7fc910

13 years agoUSB: storage: Use USB_ prefix instead of US_ prefix
Michal Nazarewicz [Thu, 7 Oct 2010 11:05:21 +0000 (13:05 +0200)]
USB: storage: Use USB_ prefix instead of US_ prefix

This commit changes prefix for some of the USB mass storage
class related macros (ie. USB_SC_ for subclass and USB_PR_
for class).

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: qcserial: Enable Diagnostics Monitor and GPS ports on Gobi 2000
Matthias G. Eckermann [Fri, 24 Sep 2010 16:12:01 +0000 (18:12 +0200)]
USB: qcserial: Enable Diagnostics Monitor and GPS ports on Gobi 2000

this patch to qcserial.c enables the Diagnostics Monitor
and NMEA GPS ports on Qualcomm Gobi 2000 devices.

A Gobi 2000 device will provide 3 serial ports:
        # /dev/ttyUSB0 -> Diagnostics
        # /dev/ttyUSB1 -> 3G Modem
        # /dev/ttyUSB2 -> NMEA GPS port

* The Diagnostics Monitor uses Qualcomm's DM protocol; I used
  libqcdm (ModemManager) to talk to it, found it working, but at
  least DM commands 12 and 64 are not implemented on my device
  (Gobi 2000 built into Thinkpad x100e).

* Functionality of the 3G Modem port remains unchanged.

* The GPS port and how to enable it has been confirmed now in the
  Gobi 3000 source code at:
https://www.codeaurora.org/patches/quic/gobi/
  Enable/disable GPS via:
        echo "\$GPS_START" > /dev/ttyUSB2
        # use GPS
        echo "\$GPS_STOP"  > /dev/ttyUSB2

Signed-off-by: Matthias G. Eckermann <mge@arcor.de>
13 years agoUSB: cdc.h: ncm: fix one more typo
Yauheni Kaliuta [Fri, 24 Sep 2010 06:43:27 +0000 (09:43 +0300)]
USB: cdc.h: ncm: fix one more typo

In usb_cdc_ncm_dpe32 the fields are 32 bit long and according
to usb style (hungarian notation) should be called dwDatagramIndex
and dwDatagramLength (see CDC NCM subclass spec, 3.3.2). Actually,
they were called wDatagramIndex, wDatagramLength.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ftdi_sio: revert "USB: ftdi_sio: fix DTR/RTS line modes"
Johan Hovold [Sun, 12 Sep 2010 14:31:45 +0000 (16:31 +0200)]
USB: ftdi_sio: revert "USB: ftdi_sio: fix DTR/RTS line modes"

This reverts commit 6a1a82df91fa0eb1cc76069a9efe5714d087eccd.

RTS and DTR should not be modified based on CRTSCTS when calling
set_termios.

Modem control lines are raised at port open by the tty layer and should stay
raised regardless of whether hardware flow control is enabled or not.

This is in conformance with the way serial ports work today and many
applications depend on this behaviour to be able to talk to hardware
implementing hardware flow control (without the applications actually using
it).

Hardware which expects different behaviour on these lines can always
use TIOCMSET/TIOCMBI[SC] after port open to change them.

Reported-by: Daniel Mack <daniel@caiaq.de>
Reported-by: Dave Mielke <dave@mielke.cc>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial: Enable USB autosuspend by default on qcserial
Matthew Garrett [Thu, 16 Sep 2010 18:00:51 +0000 (14:00 -0400)]
USB: serial: Enable USB autosuspend by default on qcserial

Seems to work fine in my testing.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled
Jean-Christophe PLAGNIOL-VILLARD [Mon, 20 Sep 2010 16:31:07 +0000 (18:31 +0200)]
USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled

to ensure gpio_is_valid return false

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc.h: ncm: add missed constants and structures
Yauheni Kaliuta [Mon, 20 Sep 2010 12:40:28 +0000 (15:40 +0300)]
USB: cdc.h: ncm: add missed constants and structures

Make a dedicated structure for datagram pointer entry. There is no
explicit declaration in the spec, but it's used by the host
implementation and makes the structure more clear.

Add some missed constants from the spec

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoRevert "USB: ncm: added ncm.h with auxiliary definitions"
Yauheni Kaliuta [Mon, 20 Sep 2010 12:40:27 +0000 (15:40 +0300)]
Revert "USB: ncm: added ncm.h with auxiliary definitions"

This reverts commit 65e0b499105ec8ff3bc4ab7680873dec20127f9d.

Since the host and gadget implementations are different, there is
no common code for the file, remove for now.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cdc.h: ncm: typo and style fixes
Yauheni Kaliuta [Mon, 20 Sep 2010 12:40:26 +0000 (15:40 +0300)]
USB: cdc.h: ncm: typo and style fixes

Some typos were in the initial commit, make the spelling
according to the spec.

Add some more comments.

Also change constant names according to the style of the rest
of the file

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: option: Add new ONDA vendor id and product id for ONDA MT825UP
Enrico Mioso [Fri, 17 Sep 2010 08:54:23 +0000 (10:54 +0200)]
USB: option: Add new ONDA vendor id and product id for ONDA MT825UP

This patch, adds to the option driver the Onda Communication
(http://www.ondacommunication.com) vendor id, and the MT825UP modem
device id.

Note that many variants of this same device are being release here in
Italy (at least one or two per telephony operator).

These devices are perfectly equivalent except for some predefined
settings (which can be changed of course).

It should be noted that most ONDA devices are allready supported (they
used other vendor's ids in the past). The patch seems working fine here,
and the rest of the driver seems uninfluenced.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: cp210x: Add Renesas RX-Stick device ID
DJ Delorie [Fri, 17 Sep 2010 15:09:06 +0000 (11:09 -0400)]
USB: cp210x: Add Renesas RX-Stick device ID

RX610 development board by Renesas

Bus 001 Device 024: ID 045b:0053 Hitachi, Ltd
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x045b Hitachi, Ltd
  idProduct          0x0053
  bcdDevice            1.00
  iManufacturer           1 Silicon Labs
  iProduct                2 RX-Stick
  iSerial                 3 0001
  . . .

http://am.renesas.com/rx610stick

Signed-off-by: DJ Delorie <dj@delorie.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: omap: ohci: Missing driver unregister in module exit
Keshava Munegowda [Mon, 13 Sep 2010 23:10:01 +0000 (04:40 +0530)]
usb: omap: ohci: Missing driver unregister in module exit

The un-registration of OHCI driver was not done in the ohci_hcd_mod_exit
function. This was affecting rmmod command not to work for OMAP3
platforms.  The platform driver un-registration for OMAP3 platforms is
perfomed while removing the OHCI module from kernel.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-of-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ftdi_sio: Add PID for accesio products
Rich Mattes [Tue, 14 Sep 2010 04:35:40 +0000 (00:35 -0400)]
USB: ftdi_sio: Add PID for accesio products

Adds support for Accesio USB to Serial adapters, which are built around
FTDI FT232 UARTs.  Tested with the Accesio USB-COM-4SM.

Signed-off-by: Rich Mattes <richmattes@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: host: oxu210hp-hcd: Use static const char * const where possible
Joe Perches [Tue, 14 Sep 2010 04:23:58 +0000 (21:23 -0700)]
usb: host: oxu210hp-hcd: Use static const char * const where possible

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: teach "devices" file about Wireless and SuperSpeed USB
Alan Stern [Mon, 13 Sep 2010 14:43:25 +0000 (10:43 -0400)]
USB: teach "devices" file about Wireless and SuperSpeed USB

The /sys/kernel/debug/usb/devices file doesn't know about Wireless or
SuperSpeed USB.  This patch (as1416b) teaches it, and updates the
Documentation/usb/proc_sub_info.txt file accordingly.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Vrabel <david.vrabel@csr.com>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agouwb: use '%pM' format to print MAC address
Andy Shevchenko [Mon, 13 Sep 2010 08:24:52 +0000 (11:24 +0300)]
uwb: use '%pM' format to print MAC address

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: option: Add more ZTE modem USB id's
Mauro Carvalho Chehab [Sun, 12 Sep 2010 14:41:50 +0000 (11:41 -0300)]
USB: option: Add more ZTE modem USB id's

There are lots of ZTE USB id's currently not covered by usb/serial. Adds them,
to allow those devices to work properly on Linux.

While here, put the USB ID's for 0x2002/0x2003 at the sorted order.

This patch is based on zte.c file found on MF645.

PS.: The ZTE driver is commenting the USB ID for 0x0053. It also adds, commented,
an USB ID for 0x0026.

Not sure why, but I think that 0053 is used by their devices in storage mode only.
So, I opted to keep the comment on this patch.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Remove pr_<level> uses of KERN_<level>
Joe Perches [Sun, 12 Sep 2010 05:10:58 +0000 (22:10 -0700)]
USB: gadget: Remove pr_<level> uses of KERN_<level>

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: isp1362-hcd: Removes CONFIG_USB_OTG dependent code, fix build breakage
Javier Martinez Canillas [Thu, 9 Sep 2010 21:31:29 +0000 (17:31 -0400)]
USB: isp1362-hcd: Removes CONFIG_USB_OTG dependent code, fix build breakage

In today linux-next I got a compile error on usb/host/isp1362-hcd:

drivers/usb/host/isp1362-hcd.c: In function ‘isp1362_hub_control’:
drivers/usb/host/isp1362-hcd.c:1680: error: ‘ohci’ undeclared (first use in this function)

The problem is when the CONFIG_USB_OTG option is enabled.

ohci variable is never declared and there isn't any CONFIG_USB_OTG dependent code
besides the portion defined in isp1362_hub_control.

So I think that maybe USB OTG support is not needed/supported.

This patch removes the CONFIG_USB_OTG dependent block so the driver can compile cleanly.

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Lothar Wassmann <LW@KARO-electronics.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb gadget: composite: prevent OOPS for non-standard control request
Roger Quadros [Wed, 8 Sep 2010 10:48:44 +0000 (13:48 +0300)]
usb gadget: composite: prevent OOPS for non-standard control request

The composite gadget will OOPS if the host sends a control request
targetted to an interface of an un-configured composite device. This patch
prevents this.

The OOPS was observed during WHQL USB CV tests. With this patch, the device
STALLs as per requirement.

Failing test case: From host do the following. I used libusb-1.0

1) Set configuration to zero.
libusb_control_transfer(device_handle,
0, /* standard OUT */
0x9, /* setConfiguration */
0, 0, NULL, 0, 0);

2) Query current configuratioan.
libusb_control_transfer(device_handle,
0x80, /* standard IN*/
0x8, /* getConfiguration */
0, 0, data, 1, 0);

3) Send the non-standard ctrl transfer targetted to interface
libusb_control_transfer(device_handle,
0x81, /* standard IN to interface*/
0x6, /* getDescriptor */
0x2300, 0, data, 0x12, 0);

Signed-off-by: Roger Quadros <roger.quadros@nokia.com>
Cc: stable <stable@kernel.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Robert Lukassen <robert.lukassen@tomtom.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoOHCI: work around for nVidia shutdown problem
Alan Stern [Fri, 10 Sep 2010 20:37:05 +0000 (16:37 -0400)]
OHCI: work around for nVidia shutdown problem

This patch (as1417) fixes a problem affecting some (or all) nVidia
chipsets.  When the computer is shut down, the OHCI controllers
continue to power the USB buses and evidently they drive a Reset
signal out all their ports.  This prevents attached devices from going
to low power.  Mouse LEDs stay on, for example, which is disconcerting
for users and a drain on laptop batteries.

The fix involves leaving each OHCI controller in the OPERATIONAL state
during system shutdown rather than putting it in the RESET state.
Although this nominally means the controller is running, in fact it's
not doing very much since all the schedules are all disabled.  However
there is ongoing DMA to the Host Controller Communications Area, so
the patch also disables the bus-master capability of all PCI USB
controllers after the shutdown routine runs.

The fix is applied only to nVidia-based PCI OHCI controllers, so it
shouldn't cause problems on systems using other hardware.  As an added
safety measure, in case the kernel encounters one of these running
controllers during boot, the patch changes quirk_usb_handoff_ohci()
(which runs early on during PCI discovery) to reset the controller
before anything bad can happen.

Reported-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
CC: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ohci-sm501: add iounmap on error path
Dan Carpenter [Fri, 10 Sep 2010 19:35:15 +0000 (21:35 +0200)]
USB: ohci-sm501: add iounmap on error path

This ioremap() was leaked on an error path.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Change acm_iad_descriptor bFunctionProtocol to USB_CDC_ACM_PROTO_AT_V25TER
Praveena Nadahally [Fri, 10 Sep 2010 17:35:03 +0000 (23:05 +0530)]
USB: Change acm_iad_descriptor bFunctionProtocol to USB_CDC_ACM_PROTO_AT_V25TER

The protocol code is set 00 in IAD and it's set to 01 in ACM control
interface descriptor in f_acm.c file. Due to this, windows is unable to
install the modem(ACM) driver based on class-subclass-protocol matching.

This patch corrects the protocol code in ACM IAD to the same as in
acm_control_interface_desc protocol code.

Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Praveena Nadahally <praveen.nadahally@stericsson.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: r8a66597-udc: Initialize uninitialized variable, fix compile warning
Javier Martinez Canillas [Fri, 10 Sep 2010 12:42:08 +0000 (08:42 -0400)]
USB: r8a66597-udc: Initialize uninitialized variable, fix compile warning

In today linux-next I got a compile warning due a possible uninitialized variable

This patch solves the issue initializing the variable

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Magnus Damm <damm@opensource.se>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB OTG Langwell: Update OTG Kconfig and driver version.
Hao Wu [Thu, 9 Sep 2010 21:35:54 +0000 (22:35 +0100)]
USB OTG Langwell: Update OTG Kconfig and driver version.

This patch updated Kconfig for langwell otg transceiver driver.
Add ipc driver(INTEL_SCU_IPC) as a dependency. Driver version is
updated too.

Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB OTG: Add common data structure for Intel MID Platform (Langwell/Penwell)
Hao Wu [Thu, 9 Sep 2010 21:35:39 +0000 (22:35 +0100)]
USB OTG: Add common data structure for Intel MID Platform (Langwell/Penwell)

This patch adds one new header file for the common data structure used in
Intel Penwell/Langwell MID Platform OTG Transceiver drivers. After switched
to the common data structure, Langwell/Penwell OTG Transceiver driver will
provide an unified interface to host/client driver.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: ftdi-elan: Convert "mutex" to semaphore
Thomas Gleixner [Tue, 7 Sep 2010 14:32:43 +0000 (14:32 +0000)]
usb: ftdi-elan: Convert "mutex" to semaphore

The "mutex" ftdi->sw_lock is used as a lock and a completion. Convert
it to a real semaphore which allows both.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: rndis: fix up coding style issues in the file
Mihai Donțu [Tue, 7 Sep 2010 23:54:02 +0000 (02:54 +0300)]
USB: gadget: rndis: fix up coding style issues in the file

Corrected the coding style.

Signed-off-by: Mihai Dontu <mihai.dontu@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ehci tdi : let's tdi_reset set host mode
Matthieu CASTET [Mon, 6 Sep 2010 16:26:56 +0000 (18:26 +0200)]
USB: ehci tdi : let's tdi_reset set host mode

tdi_reset is already taking care of setting host mode for tdi devices.
Don't duplicate code in platform driver.

Make ehci_halt a nop if the controller is not in host mode (otherwise it
will fail), and let's ehci_reset do the tdi_reset.
We need to move hcd->has_tt flags before ehci_halt, in order ehci_halt
knows we are a tdi device.

Before the setup routine was doing :
- put controller in host mode
- ehci_halt
- ehci_init
- hcd->has_tt = 1;
- ehci_reset

Now we do :
- hcd->has_tt = 1;
- ehci_halt
- ehci_init
- ehci_reset

PS : now we handle correctly the device -> host transition.

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Kconfig: fix typos in USB_FUNCTIONFS* description
Michael Prokop [Mon, 6 Sep 2010 07:53:48 +0000 (09:53 +0200)]
USB: Kconfig: fix typos in USB_FUNCTIONFS* description

It's spelled "Function Filesystem" / "FunctionFS". This patch
fixes some typos (FunctioFS->FunctionFS, Funcion->Function,
funcion->function, redundant "as") in the Kconfig description of
USB_FUNCTIONFS*.

Signed-off-by: Michael Prokop <mika@grml.org>
Acked-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: g_file_storage: don't generate automatic serial string
Alan Stern [Fri, 3 Sep 2010 15:15:41 +0000 (11:15 -0400)]
USB: g_file_storage: don't generate automatic serial string

This patch (as1413) changes g_file_storage to avoid generating a bogus
automatic serial-number string descriptor.  If the user doesn't provide
a valid serial number via a module parameter then a warning is logged
and the gadget won't have any serial string descriptor at all.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <david-b@pacbell.net>
CC: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: langwell: Remove unnecessary return's from void functions
Joe Perches [Thu, 2 Sep 2010 14:34:36 +0000 (16:34 +0200)]
USB: langwell: Remove unnecessary return's from void functions

There are about 2500 void functions in drivers/usb
Only a few used return; at end of function.

Standardize them a bit.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: output an error message when the pipe type doesn't match the endpoint type
Simon Arlott [Mon, 30 Aug 2010 21:50:20 +0000 (22:50 +0100)]
USB: output an error message when the pipe type doesn't match the endpoint type

Commit f661c6f8c67bd55e93348f160d590ff9edf08904 adds a check of the pipe type if
CONFIG_USB_DEBUG is enabled, but it doesn't output anything if this scenario
occurs.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: amd5536udc.c: Remove double test
Julia Lawall [Sat, 28 Aug 2010 16:48:56 +0000 (18:48 +0200)]
USB: gadget: amd5536udc.c: Remove double test

The same expression is tested twice and the result is the same each time.
Instead test for use_dma_ppb as in the test above.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@expression@
expression E;
@@

(
* E
  || ... || E
|
* E
  && ... && E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoinit.h: add some more documentation to __ref* tags
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:56 +0000 (17:43 +0200)]
init.h: add some more documentation to __ref* tags

The __ref* tags may have been confusing for new kernel
developers (I was confused by them for sure) so adding a few
more sentences to comment to clear things up for people who
see those for the first time.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb gadget: don't save bind callback in struct usb_configuration
Uwe Kleine-König [Thu, 12 Aug 2010 15:43:55 +0000 (17:43 +0200)]
usb gadget: don't save bind callback in struct usb_configuration

The bind function is most of the time only called at init time so there
is no need to save a pointer to it in the configuration structure.

This fixes many section mismatches reported by modpost.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
[m.nazarewicz@samsung.com: updated for -next]
Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb gadget: don't save bind callback in struct usb_composite_driver
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:54 +0000 (17:43 +0200)]
usb gadget: don't save bind callback in struct usb_composite_driver

The bind function is most of the time only called at init time so there
is no need to save a pointer to it in the composite driver structure.

This fixes many section mismatches reported by modpost.

Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb gadget: don't save bind callback in struct usb_gadget_driver
Uwe Kleine-König [Thu, 12 Aug 2010 15:43:53 +0000 (17:43 +0200)]
usb gadget: don't save bind callback in struct usb_gadget_driver

To accomplish this the function to register a gadget driver takes the bind
function as a second argument.  To make things clearer rename the function
to resemble platform_driver_probe.

This fixes many section mismatches like

WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatch in
reference from the variable printer_driver to the function
.init.text:printer_bind()
The variable printer_driver references
the function __init printer_bind()

All callers are fixed.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
[m.nazarewicz@samsung.com: added dbgp]
Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Revert "USB: gadget: section mismatch warning fixed"
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:52 +0000 (17:43 +0200)]
USB: Revert "USB: gadget: section mismatch warning fixed"

This reverts a commit which proposed an invalid solution
for a section mismatch.  Next 3 commits will fix it correctly.

Conflicts:

drivers/usb/gadget/mass_storage.c

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: g_multi: moved strings handling code to composite
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:49 +0000 (17:43 +0200)]
USB: gadget: g_multi: moved strings handling code to composite

This patch removes some of the string registration from the
Multifunction Composite Gadget as composite layer can handle
the iManufacturer and iProduct for us.

This also adds the "needs_serial" so that composite layer will
issue a warning if user space fails to provide the iSerialNumber
module parameter.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: mass_storage: moved strings handling code to composite
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:47 +0000 (17:43 +0200)]
USB: gadget: mass_storage: moved strings handling code to composite

This patch removes string registration from the Mass Storage
Gadget.  With recent changes to the composite framework, all
that we need is handled by the composite layer.  This means
composite registers a string ID for manufacturer and product.

This also adds the "needs_serial" so that composite layer will
issue a warning if user space fails to provide the iSerialNumber
module parameter.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: composite: Better string override handling
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:46 +0000 (17:43 +0200)]
USB: gadget: composite: Better string override handling

The iManufatcurer, iProduct and iSerialNumber composite module
parameters were only used when the gadget driver registers
strings for manufacturer, product and serial number.  If the
gadget never bothered to set corresponding fields in USB device
descriptors those module parameters are ignored.

This commit makes the parameters work even if the strings ID
have not been assigned.  It also changes the way IDs are
overridden -- what IDs are overridden is now saved in
usb_composite_dev structure -- which makes it unnecessary to
modify the string tables the way previous code did.

The commit also adds a iProduct and iManufatcurer fields to the
usb_composite_device structure.  If they are set, appropriate
strings are reserved and added to device descriptor.  This makes
it unnecessary for gadget drivers to maintain code for setting
those.  If iProduct is not set it defaults to
usb_composite_device::name; if iManufatcurer is not set
a default "<system> <release> with <gadget-name>" is used.

The last thing is that if needs_serial field of
usb_composite_device is set and user failed to provided
iSerialNumber parameter a warning is issued.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: functionfs: code cleanup
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:48 +0000 (17:43 +0200)]
USB: gadget: functionfs: code cleanup

This patch removes some of the string registration from the
FunctionFS Gadget as composite layer can handle the
iManufacturer and iProduct for us.

It also removes some of the module parameters which were
redundant as well as changes the name of others to better much
the module parameter of the composite layer.

Other then that, it also fixes formatting of multiline comments
to match the coding style.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: mass_storage: optional SCSI WRITE FUA bit
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:51 +0000 (17:43 +0200)]
usb: gadget: mass_storage: optional SCSI WRITE FUA bit

The nofua parameter (optionally ignore SCSI WRITE FUA) was added
to the File Storage Gadget some time ago.  This patch adds the
same functionality to the Mass Storage Function.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: storage: remove nofua file when unbinding
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:50 +0000 (17:43 +0200)]
usb: gadget: storage: remove nofua file when unbinding

The dev_attr_nofua file was created during fsg_bind() but
was never removed.  Made it a bit more symmetrical and added
code to remove the file in fsg_unbind().

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Acked-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: g_ffs: fixed vendor and product ID
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:45 +0000 (17:43 +0200)]
USB: gadget: g_ffs: fixed vendor and product ID

This patch fixes the vendor and product ID the gadget uses
by replacing the temporary IDs that were used during
development (which should never get into mainline) with
proper IDs.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: g_multi: fixed vendor and product ID
Michal Nazarewicz [Thu, 12 Aug 2010 15:43:44 +0000 (17:43 +0200)]
USB: gadget: g_multi: fixed vendor and product ID

This patch fixes the vendor and product ID the gadget uses
by replacing the temporary IDs that were used during
development (which should never get into mainline) with
proper IDs.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: core: update comment to match current function name
Wolfram Sang [Sun, 29 Aug 2010 16:17:14 +0000 (18:17 +0200)]
USB: core: update comment to match current function name

Found while debugging a USB problem and trying to find the mentioned function.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB Gadget: Verify VBUS current before setting the device self-powered bit
Parirajan Muthalagu [Wed, 25 Aug 2010 11:03:26 +0000 (16:33 +0530)]
USB Gadget: Verify VBUS current before setting the device self-powered bit

Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Praveena Nadahally <praveen.nadahally@stericsson.com>
Signed-off-by: Parirajan Muthalagu <parirajan.muthalagu@stericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: sam-ba: add driver for Atmel SAM Boot Assistant (SAM-BA)
Johan Hovold [Wed, 18 Aug 2010 22:13:48 +0000 (00:13 +0200)]
USB: sam-ba: add driver for Atmel SAM Boot Assistant (SAM-BA)

Add new driver to access the SAM-BA boot application of Atmel AT91SAM
devices.

The SAM-BA firmware cannot handle merged write requests so we cannot use
the generic write implementation (which uses the port write fifo).

Tested with the SAM-BA 2.10 tools and an Atmel at91sam9260-ek.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Tested-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: dbgp: cleanup: remove unneeded check
Dan Carpenter [Thu, 12 Aug 2010 07:40:30 +0000 (09:40 +0200)]
USB: gadget: dbgp: cleanup: remove unneeded check

len is always greater than or equal to zero here.  First of all, it's
type is unsigned and also we only assign it numbers which are greater
than or equal to zero.

Removing the check lets us pull everything in an indent level.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Stephane duverger <stephane.duverger@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: langwell: USB Client driver memory handling
JiebingLi [Thu, 5 Aug 2010 13:18:29 +0000 (14:18 +0100)]
USB: langwell: USB Client driver memory handling

SRAM Memory handling for USB client function

Signed-off-by: JiebingLi <jiebing.li@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: langwell: USB Client Remote Wakeup Support
JiebingLi [Thu, 5 Aug 2010 13:18:21 +0000 (14:18 +0100)]
USB: langwell: USB Client Remote Wakeup Support

Remote wakeup support in client driver. Made non-debug only this time.

Signed-off-by: JiebingLi <jiebing.li@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: langwell: USB Client PHY low power mode setting
JiebingLi [Thu, 5 Aug 2010 13:18:13 +0000 (14:18 +0100)]
USB: langwell: USB Client PHY low power mode setting

PHY low power mode setting with a static function

Signed-off-by: JiebingLi <jiebing.li@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: langwell: USB Client Endpoint initialization
JiebingLi [Thu, 5 Aug 2010 13:18:05 +0000 (14:18 +0100)]
USB: langwell: USB Client Endpoint initialization

Endpoint software structure initialization

Signed-off-by: JiebingLi <jiebing.li@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: langwell: USB Client driver code cleanup
JiebingLi [Thu, 5 Aug 2010 13:17:54 +0000 (14:17 +0100)]
USB: langwell: USB Client driver code cleanup

Code cleanup by using standard debugging API's and USB inline functions

Signed-off-by: JiebingLi <jiebing.li@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: Add Intel Langwell USB OTG Transceiver Driver
Hao Wu [Thu, 5 Aug 2010 13:17:28 +0000 (14:17 +0100)]
usb: Add Intel Langwell USB OTG Transceiver Driver

This adds support for the USB transceiver driver in the Langwell chipset used
on the Intel MID platforms. It folds up the original patch set which includes
basic support for the device, PHY low power mode (Please notice that there is
a limitation, after we drive VBus down, 2ms delay is required from SCU FW to
sync up OTGSC register with USBCFG register), software timers (the hardware
timers do not work in low power mode), HNP, SRP.

Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial8250: ratelimit "too much work" error
Daniel Drake [Wed, 20 Oct 2010 23:00:48 +0000 (16:00 -0700)]
serial8250: ratelimit "too much work" error

Running a serial console, if too many kernel messages are generated within
a short time causing a lot of serial I/O, the 8250 driver will generate
another kernel message reporting this, which just adds to the I/O. It has
a cascading effect and quickly results the system being brought to its knees
by a flood of "too much work" messages.

Ratelimit the error message to avoid this.

[akpm@linux-foundation.org: use the superior printk_ratelimited()]
[akpm@linux-foundation.org: printk_ratelimited() needs ratelimit.h]
Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: bfin_sport_uart: speed up sport RX sample rate to be 3% faster
Sonic Zhang [Sat, 16 Oct 2010 22:22:34 +0000 (18:22 -0400)]
serial: bfin_sport_uart: speed up sport RX sample rate to be 3% faster

The actual uart baud rate of devices vary between +/-2% of what is
asked.  The SPORT RX sample rate should be faster than double of the
worst case.  Otherwise, wrong data may be received.  So set SPORT RX
clock to be 3% faster in general.

Reported-by: Olivier STOCK <ostockemer@ereca.fr>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: abstraction for 8250 legacy ports
Alan Cox [Mon, 18 Oct 2010 18:38:02 +0000 (11:38 -0700)]
serial: abstraction for 8250 legacy ports

Not every platform that has generic legacy 8250 ports manages to have them
clocked the right way or without errata. Provide a generic interface to
allow platforms to override the default behaviour in a manner that dumps
the complexity in *their* code not the 8250 driver.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial/imx: check that the buffer is non-empty before sending it out
Volker Ernst [Wed, 13 Oct 2010 09:03:57 +0000 (11:03 +0200)]
serial/imx: check that the buffer is non-empty before sending it out

The .start_tx callback (imx_start_tx here) isn't only called when the
buffer is non-empty.  E.g. after resume or when handshaking is enabled
and the other side starts to signal being ready.

So check for an empty puffer already before sending the first character.
This prevents sending out stale (or uninitialised) data.

Signed-off-by: Volker Ernst <volker.ernst@txtr.com>
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Andy Green <andy@warmcat.com>
[ukl: reword commit log, put check in while condition]
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: mfd: add more baud rates support
Feng Tang [Thu, 14 Oct 2010 09:47:35 +0000 (17:47 +0800)]
serial: mfd: add more baud rates support

Add more baud rates support referring the baud_table[] defined
in drivers/char/tty_ioctl.c: 3000000/2000000/1000000/500000

Signed-off-by: Feng Tang <feng.tang@intel.com>
Acked-by: Alan Cox <alan.cox@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agojsm: Remove the uart port on errors
Breno Leitao [Thu, 7 Oct 2010 16:40:42 +0000 (13:40 -0300)]
jsm: Remove the uart port on errors

If kzmalloc fails, the uart port is not removed causing a leak.
This patch just add another label that removes the uart when the
kzmalloc fails.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoAlchemy: Add UART PM methods.
Manuel Lauss [Sat, 25 Sep 2010 13:13:46 +0000 (15:13 +0200)]
Alchemy: Add UART PM methods.

Custom UART PM hook for Alchemy chips:  do standard UART pm and
additionally en/disable uart block clocks as needed.
This allows to get rid of a debug port PM hack in the Alchemy pm code.

Tested on Db1200.

Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years ago8250: allow platforms to override PM hook.
Manuel Lauss [Sat, 25 Sep 2010 13:13:45 +0000 (15:13 +0200)]
8250: allow platforms to override PM hook.

Add a hook for platforms to specify custom pm methods.

Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoaltera_uart: Don't use plain integer as NULL pointer
Anton Vorontsov [Fri, 1 Oct 2010 13:23:13 +0000 (17:23 +0400)]
altera_uart: Don't use plain integer as NULL pointer

Fixes sparse warning.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Acked-by: Tobias Klauser <tklauser@distanz.ch>
13 years agoaltera_uart: Fix missing prototype for registering an early console
Anton Vorontsov [Fri, 1 Oct 2010 13:22:55 +0000 (17:22 +0400)]
altera_uart: Fix missing prototype for registering an early console

Simply add an early_altera_uart_setup() prototype declaration, otherwise
platform code have to do it in .c files, which is ugly.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoaltera_uart: Fixup type usage of port flags
Anton Vorontsov [Fri, 1 Oct 2010 13:22:37 +0000 (17:22 +0400)]
altera_uart: Fixup type usage of port flags

port->flags is of type upf_t, which corresponds to UPF_* flags.

ASYNC_BOOT_AUTOCONF is an unsigned integer, which happen to
be the same as UPF_BOOT_AUTOCONF.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoaltera_uart: Make it possible to use Altera UART and 8250 ports together
Anton Vorontsov [Fri, 1 Oct 2010 14:23:24 +0000 (18:23 +0400)]
altera_uart: Make it possible to use Altera UART and 8250 ports together

This fixes tty name, major and minor numbers. The major number
204 is used across many platform-specific serial drivers, so we
use that.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoaltera_uart: Add support for different address strides
Anton Vorontsov [Fri, 1 Oct 2010 13:21:54 +0000 (17:21 +0400)]
altera_uart: Add support for different address strides

Some controllers implement registers with a stride, to support
those we must implement the proper IO accessors.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoaltera_uart: Add support for getting mapbase and IRQ from resources
Anton Vorontsov [Fri, 1 Oct 2010 13:21:42 +0000 (17:21 +0400)]
altera_uart: Add support for getting mapbase and IRQ from resources

This makes it much easier to integrate the driver with the rest of
the Linux (e.g. MFD subsystem).

The old method is still supported though.

Also, from now on, there is one platform device per port (no
changes are needed for the platform code, as no one registers
the devices anywhere in-tree yet).

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Alan Cox <alan@linux.intel.com>,
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoaltera_uart: Add support for polling mode (IRQ-less)
Anton Vorontsov [Fri, 1 Oct 2010 13:21:33 +0000 (17:21 +0400)]
altera_uart: Add support for polling mode (IRQ-less)

Some Altera UART implementations doesn't route the IRQ line, so we have
to work in polling mode.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: Factor out uart_poll_timeout() from 8250 driver
Anton Vorontsov [Fri, 1 Oct 2010 13:21:25 +0000 (17:21 +0400)]
serial: Factor out uart_poll_timeout() from 8250 driver

Soon we will use that handy function in the altera_uart driver.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: mark the 8250 driver as maintained
Greg Kroah-Hartman [Wed, 6 Oct 2010 20:29:44 +0000 (13:29 -0700)]
serial: mark the 8250 driver as maintained

Clearly I have gone insane, so I might as well tell the world about it.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: 8250: Don't delay after transmitter is ready.
David Daney [Tue, 5 Oct 2010 18:40:07 +0000 (11:40 -0700)]
serial: 8250: Don't delay after transmitter is ready.

The loop in wait_for_xmitr() is delaying one extra uS after the ready
condition has been met.  Rewrite the loop to only delay if the
transmitter is not ready.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agotty: MAINTAINERS: add drivers/serial/jsm/ as maintained driver
Breno Leitao [Wed, 6 Oct 2010 16:04:48 +0000 (13:04 -0300)]
tty: MAINTAINERS: add drivers/serial/jsm/ as maintained driver

Soott Kilau is handing off the maintainership of the jsm serial
driver to me, and this patch just add the driver as maintained.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agovcs: invoke the vt update callback when /dev/vcs* is written to
Nicolas Pitre [Fri, 1 Oct 2010 04:10:44 +0000 (00:10 -0400)]
vcs: invoke the vt update callback when /dev/vcs* is written to

A notifier chain is called whenever the vt code modifies a terminal
content, except for one case which is when the modification comes
through writes to /dev/vcs* devices.  Let's add the missing notifier
invocation at the end of vcs_write() for that case too.

Signed-off-by: Nicolas Pitre <nicolas.pitre@canonical.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agovcs: add poll/fasync support
Nicolas Pitre [Tue, 5 Oct 2010 18:22:37 +0000 (14:22 -0400)]
vcs: add poll/fasync support

The /dev/vcs* devices are used, amongst other things, by accessibility
applications such as BRLTTY to display the screen content onto refreshable
braille displays.  Currently this is performed by constantly reading from
/dev/vcsa0 whether or not the screen content has changed.  Given the
default braille refresh rate of 25 times per second, this easily qualifies
as the biggest source of wake-up events preventing laptops from entering
deeper power saving states.

To avoid this periodic polling, let's add support for select()/poll() and
SIGIO with the /dev/vcs* devices.  The implemented semantic is to report
data availability whenever the corresponding vt has seen some update after
the last read() operation.  The application still has to lseek() back
as usual in order to read() the new data.

Not to create unwanted overhead, the needed data structure is allocated
and the vt notification callback is registered only when the poll or
fasync method is invoked for the first time per file instance.

Signed-off-by: Nicolas Pitre <nicolas.pitre@canonical.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agotty: Add a new file /proc/tty/consoles
Dr. Werner Fink [Wed, 22 Sep 2010 10:45:40 +0000 (12:45 +0200)]
tty: Add a new file /proc/tty/consoles

Add a new file /proc/tty/consoles to be able to determine the registered
system console lines.  If the reading process holds /dev/console open at
the regular standard input stream the active device will be marked by an
asterisk.  Show possible operations and also decode the used flags of
the listed console lines.

Signed-off-by: Werner Fink <werner@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agotty: Fix warning left over from TIOCGICOUNT changes
Alan Cox [Fri, 24 Sep 2010 14:49:18 +0000 (15:49 +0100)]
tty: Fix warning left over from TIOCGICOUNT changes

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agotty: icount changeover for other main devices
Alan Cox [Thu, 16 Sep 2010 17:21:52 +0000 (18:21 +0100)]
tty: icount changeover for other main devices

Again basically cut and paste

Convert the main driver set to use the hooks for GICOUNT

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agotty: Convert the USB drivers to the new icount interface
Alan Cox [Thu, 16 Sep 2010 17:21:40 +0000 (18:21 +0100)]
tty: Convert the USB drivers to the new icount interface

Simple pasting job using the new ops function. Also fix a couple of devices
directly returning the internal struct (which happens at this point to match
for the fields that matter but isn't correct or futureproof)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agotty: Make tiocgicount a handler
Alan Cox [Thu, 16 Sep 2010 17:21:24 +0000 (18:21 +0100)]
tty: Make tiocgicount a handler

Dan Rosenberg noted that various drivers return the struct with uncleared
fields. Instead of spending forever trying to stomp all the drivers that
get it wrong (and every new driver) do the job in one place.

This first patch adds the needed operations and hooks them up, including
the needed USB midlayer and serial core plumbing.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: max3107: Fix memory leaks when returning on error
Davidlohr Bueso [Mon, 13 Sep 2010 16:08:11 +0000 (12:08 -0400)]
serial: max3107: Fix memory leaks when returning on error

Fix memory leaks in max3107_probe() when returning on error.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: mrst_max3110: Make the IRQ option runtime
Alan Cox [Mon, 13 Sep 2010 07:39:56 +0000 (15:39 +0800)]
serial: mrst_max3110: Make the IRQ option runtime

And while we are at it allow it to fail to find one. Without this the IRQ
option will cause the 3110 driver to fail on 0.7 SFI firmware.

Acked-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial: mrst_max3110: some code cleanup
Feng Tang [Mon, 13 Sep 2010 07:39:48 +0000 (15:39 +0800)]
serial: mrst_max3110: some code cleanup

The cleanup for mrst_max3110 includes:
* remove unneeded head files
* make the spi_transfer dma safe, so that driver is more portable
* add more check for error return value
* use mutex_trylock for read thread

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agotty_io: check return code of tty_register_device
Vasiliy Kulikov [Sun, 5 Sep 2010 18:32:22 +0000 (22:32 +0400)]
tty_io: check return code of tty_register_device

Function tty_register_device may return ERR_PTR(...). Check for it.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoChar: mxser, call pci_disable_device from probe/remove
Jiri Slaby [Fri, 3 Sep 2010 08:31:37 +0000 (10:31 +0200)]
Char: mxser, call pci_disable_device from probe/remove

Vasiliy found that pci_disable_device is not called on fail paths in
mxser_probe. Actually, it is called from nowhere in the driver.

There are three changes needed:
1) don't use pseudo-generic mxser_release_res. Let's use it only from
   ISA paths from now on. All the pci stuff is moved to probe and
   remove PCI-related functions.
2) reorder fail-paths in the probe function so that it makes sense and
   we can call them from the sequential code naturally (the further we
   are the earlier label we go to).
3) add pci_disable_device both to mxser_probe and mxser_remove.

There is a nit of adding CONFIG_PCI ifdef to mxser_remove. it is
because this driver supports ISA-only compilations and it would choke
up on the newly added calls now.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoadd ttyprintk driver
Samo Pogacnik [Wed, 25 Aug 2010 18:44:07 +0000 (20:44 +0200)]
add ttyprintk driver

Ttyprintk is a pseudo TTY driver, which allows users to make printk
messages, via output to ttyprintk device. It is possible to store
"console" messages inline with kernel messages for better analyses of
the boot process, for example.

Signed-off-by: Samo Pogacnik <samo_pogacnik@t-2.net>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial-core: restore termios settings when resume console ports
Jason Wang [Sat, 21 Aug 2010 07:14:42 +0000 (15:14 +0800)]
serial-core: restore termios settings when resume console ports

The commit 4547be7 rewrites suspend and resume functions. According
to this rewrite, when a serial port is a printk console device and
can suspend(without set no_console_suspend flag), it will definitely
call set_termios function during its resume, but parameter termios
isn't initialized, this will pass an unpredictable config to the
serial port. If this serial port is not a userspace opened tty device
, a suspend and resume action will make this serial port unusable.
I.E. ttyS0 is a printk console device, ttyS1 or keyboard+display is
userspace tty device, a suspend/resume action will make ttyS0
unusable.

If a serial port is both a printk console device and an opened tty
device, this issue can be overcome because it will call set_termios
again with the correct parameter in the uart_change_speed function.

Refer to the deleted content of commit 4547be7, revert parts relate
to restore settings into parameter termios. It is safe because if
a serial port is a printk console only device, the only meaningful
field in termios is c_cflag and its old config is saved in
uport->cons->cflag, if this port is also an opened tty device,
it will clear uport->cons->cflag in the uart_open and the old config
is saved in tty->termios.

Signed-off-by: Jason Wang <jason77.wang@gmail.com>
Acked-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoserial-core: skip call set_termios/console_start when no_console_suspend
Jason Wang [Sat, 21 Aug 2010 07:14:41 +0000 (15:14 +0800)]
serial-core: skip call set_termios/console_start when no_console_suspend

The commit 4547be7 rewrites suspend and resume functions, this
introduces a problem on the OMAP3EVM platoform. when the kernel boots
with no_console_suspend and we suspend the kernel, then resume it,
the serial console will be not usable. This problem should be common
for all platforms.
The cause for this problem is that when enter suspend, if we choose
no_console_suspend, the console_stop will be skiped. But in resume
function, the console port will be set to uninitialized state by
calling set_termios function and the console_start is called without
checking whether the no_console_suspend is set, Now fix it.

Signed-off-by: Jason Wang <jason77.wang@gmail.com>
Acked-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoioctl: Use asm-generic/ioctls.h on s390 (enables termiox)
Jeff Mahoney [Fri, 20 Aug 2010 21:14:11 +0000 (17:14 -0400)]
ioctl: Use asm-generic/ioctls.h on s390 (enables termiox)

This patch converts s390 to use asm-generic/ioctls.h instead of its
own version.

The differences between the arch-specific version and the generic
version are as follows:

- S390 defines its own value for FIOQSIZE, asm-generic/ioctls.h keeps it
- The generic version adds TIOCGRS485 and TIOCGRS485, which are unused
  by any driver available on this architecture
- The generic version adds support for termiox

Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoioctl: Use asm-generic/ioctls.h on mn10300 (enables termiox)
Jeff Mahoney [Fri, 20 Aug 2010 21:14:10 +0000 (17:14 -0400)]
ioctl: Use asm-generic/ioctls.h on mn10300 (enables termiox)

This patch converts mn10300 to use asm-generic/ioctls.h instead of its
own version.

The differences between the arch-specific version and the generic
version are as follows:

- The generic version provides TIOCGRS485 and TIOCSRS485 but they
  are unused by any driver available for this architecture.
- The generic version adds support for termiox

Cc: David Howells <dhowells@redhat.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>