Commit graph

16 commits

Author SHA1 Message Date
Alan Cox 4b3b49bb77 tty: sdio_uart: add modem functionality
Add the POSIX block for carrier

Linux TIOCMIWAIT functionality is still lacking from the driver.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 15:18:06 -08:00
Alan Cox c271cf37ba tty: sdio_uart: Style fixes
Running the current code through checkpatch shows a few bits of noise
mostly but not entirely from before the changes.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 15:18:06 -08:00
Alan Cox 6238e712af tty: sdio_uart: Fix termios handling
Switching between two non standard baud rates fails because of the cflag
test. Do as we did elsewhere and just kill the "optimisation".

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 15:18:06 -08:00
Alan Cox 584abc3775 tty: sdio_uart: Switch to the open/close helpers
Gets us proper tty semantics, removes some code and fixes up a few corner
case races (hangup during open etc)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 15:18:05 -08:00
Alan Cox 0a68f64feb sdio_uart: Move the open lock
When we move to the tty_port logic the port mutex will protect open v close
v hangup. Move to this first in the existing open code so we have a bisection
point.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 15:18:05 -08:00
Alan Cox 530646f469 sdio_uart: refcount the tty objects
The tty can go away underneath us, so we must refcount it. Do the naïve
implementation initially. We will worry about startup shortly.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 15:18:05 -08:00
Nicolas Pitre 0395b48c78 sdio_uart: Fix oops caused by the previous changeset
Now... testing reveals that the very first patch "sdio_uart: use
tty_port" causes a segmentation fault in sdio_uart_open():

Unable to handle kernel NULL pointer dereference at virtual address 00000084
pgd = dfb44000 [00000084] *pgd=1fb99031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT
last sysfs file:
/sys/devices/platform/mvsdio/mmc_host/mmc0/mmc0:f111/uevent
Modules linked in:
CPU: 0    Not tainted  (2.6.32-rc5-next-20091102-00001-gb36eae9 #10)
PC is at sdio_uart_open+0x204/0x2cc
[...]

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 15:18:05 -08:00
Alan Cox b5849b1a82 sdio_uart: use tty_port
Add a tty_port object to the sdio uart. For the moment just begin using the
tty field of the port, as this is the critical one to clean up.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 15:18:05 -08:00
Thadeu Lima de Souza Cascardo 1e04b7ae70 sdio_uart: coding style fixes
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 15:39:48 +01:00
Alexey Dobriyan 201a50ba66 proc tty: switch sdio_uart to ->proc_fops
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-01 08:59:09 -07:00
David Howells c43d863697 sdio_uart: Fix SDIO break control to now return success or an error
This is a consequence of patch 9ea761bfef52c116fed4715d4043392c2503fe6a.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-15 15:47:04 +02:00
Andre Haupt a960d5dc71 sdio_uart: fix sign of paramter status in sdio_uart_receive_chars()
This also fixes a sparse warning about different signedness.
Only compile tested, because i do not have the hardware.

Signed-off-by: Andre Haupt <andre@bitwigglers.org>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-11-29 19:10:30 +01:00
Nicolas Pitre 15b82b46de sdio: fix recursion issues between sdio-uart driver and tty layer
In a few places, sdio_uart_irq() is called directly instead of waiting
for the actual interrupt to be raised and the SDIO IRQ thread scheduled
in order to reduce latency.  However, some interaction with the tty core
may end up calling us back (serial echo, flow control, etc.) creating
two issues:

 - the host lock gets claimed twice from the same thread causing a
   deadlock;

 - the same direct calls to sdio_uart_irq() may be performed causing
   unexpected reentrancy into the IRQ handler.

This patch handles both of those issues.

Signed-off-by: Nicolas Pitre <npitre@mvista.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23 21:24:52 +02:00
Nicolas Pitre 2ba30eedec sdio: add default c_ispeed/c_ospeed values to sdio_uart driver
Note that the default baudrate is 4800 instead of 9600 as a convenience
because that's what GPS devices want which is still the main use for
this driver.

Signed-off-by: Nicolas Pitre <npitre@mvista.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23 21:24:48 +02:00
Nicolas Pitre 5ed334a1f8 sdio: add /proc interface to sdio_uart driver
This mimics what the serial_core does.  Useful for diagnostics.

Signed-off-by: Nicolas Pitre <npitre@mvista.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23 21:02:57 +02:00
Nicolas Pitre 6e418a9d26 sdio: UART/GPS driver
This currently only accepts the GPS class since that's all I have for
testing.  Tested with a Matsushita GPS and gpsd version 2.34.

Signed-off-by: Nicolas Pitre <npitre@mvista.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23 21:02:45 +02:00