summaryrefslogtreecommitdiff
path: root/drivers/serial
AgeCommit message (Collapse)Author
2010-12-14Merge branch 'for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb: kgdboc,input: Fix regression with keyboard release key and early debugging
2010-12-14kgdboc,input: Fix regression with keyboard release key and early debuggingJason Wessel
The commit 111c182340cd22e238ab1cc6564df336c6ebd7cb (kgdboc: reset input devices (keyboards) when exiting debugger) introduced a regression in early debugging such that you get a kernel oops on continue (with the go command) if you boot a kernel with: earlyprintk=vga ekgdboc=kbd kgdbwait The restore kgdboc_restore_input() routine schedules work for the purpose of sending key release events for any keys that were in the depressed state prior to entering the kernel debugger. A simple fix to the crash is to not invoke the schedule_work() if the kernel system_state is anything other than SYSTEM_RUNNING. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Sergei Shtylyov <sshtylyov@mvista.com>
2010-12-02Merge branch 'tty-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 * 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: serial: mfd: adjust the baud rate setting TTY: open/hangup race fixup TTY: don't allow reopen when ldisc is changing NET: wan/x25, fix ldisc->open retval TTY: ldisc, fix open flag handling serial8250: Mark console as CON_ANYTIME
2010-12-01serial: mfd: adjust the baud rate settingFeng Tang
Previous baud rate setting code only has been tested with 3.5M/9600/ 115200/230400/460800 bps, and recently we got a 3M bps device to test, which needs to modify current MUL register setting, and with this patch 2.5M/2M/1.5M/1M/0.5M should also work as they just use a MUL value scale down from 3M's. Also got some reference register setting from silicon guys for different baud rates, which tries to keep the pre-scalar register value to 16. Signed-off-by: Feng Tang <feng.tang@intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-17BKL: remove extraneous #include <smp_lock.h>Arnd Bergmann
The big kernel lock has been removed from all these files at some point, leaving only the #include. Remove this too as a cleanup. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-16serial8250: Mark console as CON_ANYTIMEPeter Zijlstra
While trying to debug a cpu-hotplug issue I noticed printk() stopped working once the cpu got marked offline, since the 8250 serial console doesn't have any per-cpu resources the CON_ANYTIME bit is the safe and documented way to make it work again. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-13Revert "8250: Fix tcsetattr to avoid ioctl(TIOCMIWAIT) hang"Ingo Molnar
This reverts commit 47d3904fe40d62deee8cd46e79ca784e7a548acd. Crashes any x86 serial console bootup: Console: colour VGA+ 80x25 BUG: unable to handle kernel NULL pointer dereference at 0000000000000158 IP: [<ffffffff811ebcb4>] serial8250_do_set_termios+0x1d4/0x430 ... Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Greg KH <gregkh@suse.de> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-13Merge branch 'tty-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 * 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: n_gsm: Fix length handling n_gsm: Copy n2 over when configuring via ioctl interface serial: bfin_5xx: grab port lock before making port termios changes serial: bfin_5xx: disable CON_PRINTBUFFER for consoles serial: bfin_5xx: remove redundant SSYNC to improve TX speed serial: bfin_5xx: always include DMA headers vcs: make proper usage of the poll flags amiserial: Remove unused variable icount 8250: Fix tcsetattr to avoid ioctl(TIOCMIWAIT) hang tty_ldisc: Fix BUG() on hangup TTY: restore tty_ldisc_wait_idle SERIAL: blacklist si3052 chip drivers/serial/bfin_5xx.c: Fix line continuation defects tty: prevent DOS in the flush_to_ldisc 8250: add support for Kouwell KW-L221N-2 nozomi: Fix warning from the previous TIOCGCOUNT changes tty: fix warning in synclink driver tty: Fix formatting in tty.h tty: the development tree is now done in git
2010-11-11serial: bfin_5xx: grab port lock before making port termios changesSonic Zhang
The port lock exists to protect these resources, so we need to grab it before making changes. 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>
2010-11-11serial: bfin_5xx: disable CON_PRINTBUFFER for consolesSonic Zhang
If we are using early serial, don't let the normal console rewind the log buffer, since that causes things to be printed multiple times. 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>
2010-11-11serial: bfin_5xx: remove redundant SSYNC to improve TX speedSonic Zhang
We don't need to force a SSYNC here as the LSR register will already be updated by the time we get back to reading it. This speeds up TX throughput and lowers general system overhead (since SSYNC is system wide, not peripheral-specific). 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>
2010-11-11serial: bfin_5xx: always include DMA headersSonic Zhang
On Blackfin systems, peripherals that have optional DMA support always route their interrupts through the corresponding DMA channel -- even when DMA is not being used. So in PIO mode, we still need to request the DMA channel (so interrupts are delivered) which means we need to always include the DMA header for the DMA defines/functions. 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>
2010-11-118250: Fix tcsetattr to avoid ioctl(TIOCMIWAIT) hangLawrence Rust
Calling tcsetattr prevents any thread(s) currently suspended in ioctl TIOCMIWAIT for the same device from ever resuming. If a thread is suspended inside a call to ioctl TIOCMIWAIT, waiting for a modem status change, then the 8250 driver enables modem status interrupts (MSI). The device interrupt service routine resumes the suspended thread(s) on the next MSI. If while the thread(s) are suspended, another thread calls tcsetattr then the 8250 driver disables MSI (unless CTS/RTS handshaking is enabled) thus preventing the suspended thread(s) from ever being resumed. This patch only disables MSI in tcsetattr handling if there are no suspended threads. Program to demonstrate bug & fix: /* gcc miwait.c -o miwait -l pthread */ #include <stdio.h> #include <errno.h> #include <unistd.h> #include <fcntl.h> #include <pthread.h> #include <termios.h> #include <sys/ioctl.h> #include <linux/serial.h> static void* monitor( void* pv); static int s_fd; int main( void) { const char kszDev[] = "/dev/ttyS0"; pthread_t t; struct termios tio; s_fd = open( kszDev, O_RDWR | O_NONBLOCK); if ( s_fd < 0) return fprintf( stderr, "Error(%d) opening %s: %s\n", errno, kszDev, strerror( errno)), 1; pthread_create( &t, NULL, &monitor, NULL); /* Modem status changes seen here */ puts( "Main: awaiting status changes"); sleep( 5); tcgetattr( s_fd, &tio); tio.c_cflag ^= CSTOPB; /* But not after here */ puts( "Main: tcsetattr called"); tcsetattr( s_fd, TCSANOW, &tio); for (;;) sleep( 1); } static void* monitor( void* pv) { (void)pv; for(;;) { unsigned uModem; struct serial_icounter_struct cnt; if ( ioctl( s_fd, TIOCMGET, &uModem) < 0) fprintf( stderr, "Error(%d) in TIOCMGET: %s\n", errno, strerror( errno)); printf( "Modem status:%s%s%s%s%s%s\n", (uModem & TIOCM_RTS) ? " RTS" : "", (uModem & TIOCM_DTR) ? " DTR" : "", (uModem & TIOCM_CTS) ? " CTS" : "", (uModem & TIOCM_DSR) ? " DSR" : "", (uModem & TIOCM_CD) ? " CD" : "", (uModem & TIOCM_RI) ? " RI" : "" ); if ( ioctl( s_fd, TIOCGICOUNT, &cnt) < 0) fprintf( stderr, "Error(%d) in TIOCGICOUNT: %s\n", errno, strerror( errno)); printf( "Irqs: CTS:%d DSR:%d RNG:%d DCD:%d Rx:%d Tx:%d Frame:%d Orun:%d Par:%d Brk:%d Oflow:%d\n", cnt.cts, cnt.dsr, cnt.rng, cnt.dcd, cnt.rx, cnt.tx, cnt.frame, cnt.overrun, cnt.parity, cnt.brk, cnt.buf_overrun ); fputs( "Waiting...", stdout), fflush( stdout); if ( 0 > ioctl( s_fd, TIOCMIWAIT, (unsigned long)(TIOCM_CAR | TIOCM_RNG | TIOCM_DSR | TIOCM_CTS))) fprintf( stderr, "\nError(%d) in TIOCMIWAIT: %s\n", errno, strerror( errno)); fputs( "\n", stdout); } return NULL; } Signed-off by Lawrence Rust <lawrence@softsystem.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09SERIAL: blacklist si3052 chipMaciej Szmigiero
[SERIAL]blacklist si3052 chip Si3052-based softmodems aren't serial ports so don't bind serial driver to them. Allows proper driver to bind to them. Signed-off-by: Maciej Szmigiero <mhej@o2.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09drivers/serial/bfin_5xx.c: Fix line continuation defectsJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-098250: add support for Kouwell KW-L221N-2Mikulas Patocka
Add support for Kouwell KW-L221N-2 card. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-03kgdboc: reset input devices (keyboards) when exiting debuggerDmitry Torokhov
Use the newly exported input_reset_device() call to reset LED state and mark all keys/buttons as released on all keyboard-like devices when exiting the debugger. [jason.wessel@windriver.com: fix compile without keyboard input driver] Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-11-01Merge branch 'for-linus' of git://www.jni.nu/crisLinus Torvalds
* 'for-linus' of git://www.jni.nu/cris: CRIS: Add paths for CRISv10 serial driver CRIS: Fix RS485 delay handling. Add missing "struct" to in sizeof.
2010-10-28CRIS: Fix RS485 delay handling.Jesper Nilsson
Very recently, the RS485 interface has been fixed by adding two further fields (see commit 1b6331848b69d1ed165a6bdc75c4046d68767563). Check the value of the flag SER_RS485_RTS_BEFORE_SEND before delaying. Signed-off-by: Claudio Scordino <claudio@evidence.eu.com> Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
2010-10-28Add missing "struct" to in sizeof.Jesper Nilsson
Lead to a compile error when the struct was no longer typedef'd. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
2010-10-25Merge branch 'omap-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 * 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (163 commits) omap: complete removal of machine_desc.io_pg_offst and .phys_io omap: UART: fix wakeup registers for OMAP24xx UART2 omap: Fix spotty MMC voltages ASoC: OMAP4: MCPDM: Remove unnecessary include of plat/control.h serial: omap-serial: fix signess error OMAP3: DMA: Errata i541: sDMA FIFO draining does not finish omap: dma: Fix buffering disable bit setting for omap24xx omap: serial: Fix the boot-up crash/reboot without CONFIG_PM OMAP3: PM: fix scratchpad memory accesses for off-mode omap4: pandaboard: enable the ehci port on pandaboard omap4: pandaboard: Fix the init if CONFIG_MMC_OMAP_HS is not set omap4: pandaboard: remove unused hsmmc definition OMAP: McBSP: Remove null omap44xx ops comment OMAP: McBSP: Swap CLKS source definition OMAP: McBSP: Fix CLKR and FSR signal muxing OMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks OMAP: control: move plat-omap/control.h to mach-omap2/control.h OMAP: split plat-omap/common.c OMAP: McBSP: implement functional clock switching via clock framework OMAP: McBSP: implement McBSP CLKR and FSR signal muxing via mach-omap2/mcbsp.c ... Fixed up trivial conflicts in arch/arm/mach-omap2/ {board-zoom-peripherals.c,devices.c} as per Tony
2010-10-25Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: mtd/m25p80: add support to parse the partitions by OF node of/irq: of_irq.c needs to include linux/irq.h of/mips: Cleanup some include directives/files. of/mips: Add device tree support to MIPS of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch of/device: Rework to use common platform_device_alloc() for allocating devices of/xsysace: Fix OF probing on little-endian systems of: use __be32 types for big-endian device tree data of/irq: remove references to NO_IRQ in drivers/of/platform.c of/promtree: add package-to-path support to pdt of/promtree: add of_pdt namespace to pdt code of/promtree: no longer call prom_ functions directly; use an ops structure of/promtree: make drivers/of/pdt.c no longer sparc-only sparc: break out some PROM device-tree building code out into drivers/of of/sparc: convert various prom_* functions to use phandle sparc: stop exporting openprom.h header powerpc, of_serial: Endianness issues setting up the serial ports of: MTD: Fix OF probing on little-endian systems of: GPIO: Fix OF probing on little-endian systems
2010-10-25Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (110 commits) sh: i2c-sh7760: Replase from ctrl_* to __raw_* sh: clkfwk: Shuffle around to match the intc split up. sh: clkfwk: modify for_each_frequency end condition sh: fix clk_get() error handling sh: clkfwk: Fix fault in frequency iterator. sh: clkfwk: Add a helper for rate rounding by divisor ranges. sh: clkfwk: Abstract rate rounding helper. sh: clkfwk: support clock remapping. sh: pci: Convert to upper/lower_32_bits() helpers. sh: mach-sdk7786: Add support for the FPGA SRAM. sh: Provide a generic SRAM pool for tiny memories. sh: pci: Support secondary FPGA-driven PCIe clocks on SDK7786. sh: pci: Support slot 4 routing on SDK7786. sh: Fix up PMB locking. sh: mach-sdk7786: Add support for fpga gpios. sh: use pr_fmt for clock framework, too. sh: remove name and id from struct clk sh: free-without-alloc fix for sh_mobile_lcdcfb sh: perf: Set up perf_max_events. sh: perf: Support SH-X3 hardware counters. ... Fix up trivial conflicts (perf_max_events got removed) in arch/sh/kernel/perf_event.c
2010-10-25Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: (21 commits) m68knommu: convert to using tracehook_report_syscall_* m68knommu: some boards use fixed phy for FEC ethernet m68knommu: support the external GPIO based interrupts of the 5272 m68knommu: mask of vector bits in exception word properly m68knommu: change to new flag variables m68knommu: Fix MCFUART_TXFIFOSIZE for m548x. m68knommu: add basic mmu-less m548x support m68knommu: .gitignore vmlinux.lds m68knommu: stop using __do_IRQ m68knommu: rename PT_OFF_VECTOR to PT_OFF_FORMATVEC. m68knommu: add support for Coldfire 547x/548x interrupt controller m68k{nommu}: Remove unused DEFINE's from asm-offsets.c m68knommu: whitespace cleanup in 68328/entry.S m68knommu: Document supported chips in intc-2.c and intc-simr.c. m68knommu: fix strace support for 68328/68360 m68knommu: fix default starting date arch/m68knommu: Removing dead 68328_SERIAL_UART2 config option arch/m68knommu: Removing dead RAM_{16,32}_MB config option arch/m68knommu: Removing dead M68KFPU_EMU config option arch/m68knommu: Removing dead RELOCATE config option ...
2010-10-24Merge branch 'for-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits) Update broken web addresses in arch directory. Update broken web addresses in the kernel. Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget Revert "Fix typo: configuation => configuration" partially ida: document IDA_BITMAP_LONGS calculation ext2: fix a typo on comment in ext2/inode.c drivers/scsi: Remove unnecessary casts of private_data drivers/s390: Remove unnecessary casts of private_data net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data drivers/infiniband: Remove unnecessary casts of private_data drivers/gpu/drm: Remove unnecessary casts of private_data kernel/pm_qos_params.c: Remove unnecessary casts of private_data fs/ecryptfs: Remove unnecessary casts of private_data fs/seq_file.c: Remove unnecessary casts of private_data arm: uengine.c: remove C99 comments arm: scoop.c: remove C99 comments Fix typo configue => configure in comments Fix typo: configuation => configuration Fix typo interrest[ing|ed] => interest[ing|ed] Fix various typos of valid in comments ... Fix up trivial conflicts in: drivers/char/ipmi/ipmi_si_intf.c drivers/usb/gadget/rndis.c net/irda/irnet/irnet_ppp.c
2010-10-23Merge branch 'for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb: kdb,debug_core: adjust master cpu switch logic against new debug_core locking debug_core: refactor locking for master/slave cpus x86,kgdb: remove unnecessary call to kgdb_correct_hw_break() debug_core: disable hw_breakpoints on all cores in kgdb_cpu_enter() kdb,kgdb: fix sparse fixups kdb: Fix oops in kdb_unregister kdb,ftdump: Remove reference to internal kdb include kdb: Allow kernel loadable modules to add kdb shell functions debug_core: stop rcu warnings on kernel resume debug_core: move all watch dog syncs to a single function x86,kgdb: fix debugger hw breakpoint test regression in 2.6.35
2010-10-23Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (49 commits) serial8250: ratelimit "too much work" error serial: bfin_sport_uart: speed up sport RX sample rate to be 3% faster serial: abstraction for 8250 legacy ports serial/imx: check that the buffer is non-empty before sending it out serial: mfd: add more baud rates support jsm: Remove the uart port on errors Alchemy: Add UART PM methods. 8250: allow platforms to override PM hook. altera_uart: Don't use plain integer as NULL pointer altera_uart: Fix missing prototype for registering an early console altera_uart: Fixup type usage of port flags altera_uart: Make it possible to use Altera UART and 8250 ports together altera_uart: Add support for different address strides altera_uart: Add support for getting mapbase and IRQ from resources altera_uart: Add support for polling mode (IRQ-less) serial: Factor out uart_poll_timeout() from 8250 driver serial: mark the 8250 driver as maintained serial: 8250: Don't delay after transmitter is ready. tty: MAINTAINERS: add drivers/serial/jsm/ as maintained driver vcs: invoke the vt update callback when /dev/vcs* is written to ...
2010-10-22kdb,kgdb: fix sparse fixupsJason Wessel
Fix the following sparse warnings: kdb_main.c:328:5: warning: symbol 'kdbgetu64arg' was not declared. Should it be static? kgdboc.c:246:12: warning: symbol 'kgdboc_early_init' was not declared. Should it be static? kgdb.c:652:26: warning: incorrect type in argument 1 (different address spaces) kgdb.c:652:26: expected void const *ptr kgdb.c:652:26: got struct perf_event *[noderef] <asn:3>*pev The one in kgdb.c required the (void * __force) because of the return code from register_wide_hw_breakpoint looking like: return (void __percpu __force *)ERR_PTR(err); Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2010-10-22Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bklLinus Torvalds
* 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl: vfs: make no_llseek the default vfs: don't use BKL in default_llseek llseek: automatically add .llseek fop libfs: use generic_file_llseek for simple_attr mac80211: disallow seeks in minstrel debug code lirc: make chardev nonseekable viotape: use noop_llseek raw: use explicit llseek file operations ibmasmfs: use generic_file_llseek spufs: use llseek in all file operations arm/omap: use generic_file_llseek in iommu_debug lkdtm: use generic_file_llseek in debugfs net/wireless: use generic_file_llseek in debugfs drm: use noop_llseek
2010-10-22serial8250: ratelimit "too much work" errorDaniel Drake
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>
2010-10-22serial: bfin_sport_uart: speed up sport RX sample rate to be 3% fasterSonic Zhang
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>
2010-10-22serial: abstraction for 8250 legacy portsAlan Cox
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>
2010-10-22serial/imx: check that the buffer is non-empty before sending it outVolker Ernst
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>
2010-10-22serial: mfd: add more baud rates supportFeng Tang
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>
2010-10-22jsm: Remove the uart port on errorsBreno Leitao
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>
2010-10-228250: allow platforms to override PM hook.Manuel Lauss
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>
2010-10-22altera_uart: Don't use plain integer as NULL pointerAnton Vorontsov
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>
2010-10-22altera_uart: Fixup type usage of port flagsAnton Vorontsov
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>
2010-10-22altera_uart: Make it possible to use Altera UART and 8250 ports togetherAnton Vorontsov
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>
2010-10-22altera_uart: Add support for different address stridesAnton Vorontsov
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>
2010-10-22altera_uart: Add support for getting mapbase and IRQ from resourcesAnton Vorontsov
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>
2010-10-22altera_uart: Add support for polling mode (IRQ-less)Anton Vorontsov
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>
2010-10-22serial: Factor out uart_poll_timeout() from 8250 driverAnton Vorontsov
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>
2010-10-22serial: 8250: Don't delay after transmitter is ready.David Daney
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>
2010-10-22tty: icount changeover for other main devicesAlan Cox
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>
2010-10-22tty: Make tiocgicount a handlerAlan Cox
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>
2010-10-22serial: max3107: Fix memory leaks when returning on errorDavidlohr Bueso
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>
2010-10-22serial: mrst_max3110: Make the IRQ option runtimeAlan Cox
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>
2010-10-22serial: mrst_max3110: some code cleanupFeng Tang
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>
2010-10-22serial-core: restore termios settings when resume console portsJason Wang
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>