Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6

* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (76 commits)
pch_uart: reference clock on CM-iTC
pch_phub: add new device ML7213
n_gsm: fix UIH control byte : P bit should be 0
n_gsm: add a documentation
serial: msm_serial_hs: Add MSM high speed UART driver
tty_audit: fix tty_audit_add_data live lock on audit disabled
tty: move cd1865.h to drivers/staging/tty/
Staging: tty: fix build with epca.c driver
pcmcia: synclink_cs: fix prototype for mgslpc_ioctl()
Staging: generic_serial: fix double locking bug
nozomi: don't use flush_scheduled_work()
tty/serial: Relax the device_type restriction from of_serial
MAINTAINERS: Update HVC file patterns
tty: phase out of ioctl file pointer for tty3270 as well
tty: forgot to remove ipwireless from drivers/char/pcmcia/Makefile
pch_uart: Fix DMA channel miss-setting issue.
pch_uart: fix exclusive access issue
pch_uart: fix auto flow control miss-setting issue
pch_uart: fix uart clock setting issue
pch_uart : Use dev_xxx not pr_xxx
...

Fix up trivial conflicts in drivers/misc/pch_phub.c (same patch applied
twice, then changes to the same area in one branch)

+3926 -1358
+89
Documentation/serial/n_gsm.txt
··· 1 + n_gsm.c GSM 0710 tty multiplexor HOWTO 2 + =================================================== 3 + 4 + This line discipline implements the GSM 07.10 multiplexing protocol 5 + detailed in the following 3GPP document : 6 + http://www.3gpp.org/ftp/Specs/archive/07_series/07.10/0710-720.zip 7 + 8 + This document give some hints on how to use this driver with GPRS and 3G 9 + modems connected to a physical serial port. 10 + 11 + How to use it 12 + ------------- 13 + 1- initialize the modem in 0710 mux mode (usually AT+CMUX= command) through 14 + its serial port. Depending on the modem used, you can pass more or less 15 + parameters to this command, 16 + 2- switch the serial line to using the n_gsm line discipline by using 17 + TIOCSETD ioctl, 18 + 3- configure the mux using GSMIOC_GETCONF / GSMIOC_SETCONF ioctl, 19 + 20 + Major parts of the initialization program : 21 + (a good starting point is util-linux-ng/sys-utils/ldattach.c) 22 + #include <linux/gsmmux.h> 23 + #define N_GSM0710 21 /* GSM 0710 Mux */ 24 + #define DEFAULT_SPEED B115200 25 + #define SERIAL_PORT /dev/ttyS0 26 + 27 + int ldisc = N_GSM0710; 28 + struct gsm_config c; 29 + struct termios configuration; 30 + 31 + /* open the serial port connected to the modem */ 32 + fd = open(SERIAL_PORT, O_RDWR | O_NOCTTY | O_NDELAY); 33 + 34 + /* configure the serial port : speed, flow control ... */ 35 + 36 + /* send the AT commands to switch the modem to CMUX mode 37 + and check that it's succesful (should return OK) */ 38 + write(fd, "AT+CMUX=0\r", 10); 39 + 40 + /* experience showed that some modems need some time before 41 + being able to answer to the first MUX packet so a delay 42 + may be needed here in some case */ 43 + sleep(3); 44 + 45 + /* use n_gsm line discipline */ 46 + ioctl(fd, TIOCSETD, &ldisc); 47 + 48 + /* get n_gsm configuration */ 49 + ioctl(fd, GSMIOC_GETCONF, &c); 50 + /* we are initiator and need encoding 0 (basic) */ 51 + c.initiator = 1; 52 + c.encapsulation = 0; 53 + /* our modem defaults to a maximum size of 127 bytes */ 54 + c.mru = 127; 55 + c.mtu = 127; 56 + /* set the new configuration */ 57 + ioctl(fd, GSMIOC_SETCONF, &c); 58 + 59 + /* and wait for ever to keep the line discipline enabled */ 60 + daemon(0,0); 61 + pause(); 62 + 63 + 4- create the devices corresponding to the "virtual" serial ports (take care, 64 + each modem has its configuration and some DLC have dedicated functions, 65 + for example GPS), starting with minor 1 (DLC0 is reserved for the management 66 + of the mux) 67 + 68 + MAJOR=`cat /proc/devices |grep gsmtty | awk '{print $1}` 69 + for i in `seq 1 4`; do 70 + mknod /dev/ttygsm$i c $MAJOR $i 71 + done 72 + 73 + 5- use these devices as plain serial ports. 74 + for example, it's possible : 75 + - and to use gnokii to send / receive SMS on ttygsm1 76 + - to use ppp to establish a datalink on ttygsm2 77 + 78 + 6- first close all virtual ports before closing the physical port. 79 + 80 + Additional Documentation 81 + ------------------------ 82 + More practical details on the protocol and how it's supported by industrial 83 + modems can be found in the following documents : 84 + http://www.telit.com/module/infopool/download.php?id=616 85 + http://www.u-blox.com/images/downloads/Product_Docs/LEON-G100-G200-MuxImplementation_ApplicationNote_%28GSM%20G1-CS-10002%29.pdf 86 + http://www.sierrawireless.com/Support/Downloads/AirPrime/WMP_Series/~/media/Support_Downloads/AirPrime/Application_notes/CMUX_Feature_Application_Note-Rev004.ashx 87 + http://wm.sim.com/sim/News/photo/2010721161442.pdf 88 + 89 + 11-03-08 - Eric Bénard - <eric@eukrea.com>
+13 -3
MAINTAINERS
··· 465 465 L: linux-alpha@vger.kernel.org 466 466 F: arch/alpha/ 467 467 468 + ALTERA UART/JTAG UART SERIAL DRIVERS 469 + M: Tobias Klauser <tklauser@distanz.ch> 470 + L: linux-serial@vger.kernel.org 471 + L: nios2-dev@sopc.et.ntust.edu.tw (moderated for non-subscribers) 472 + S: Maintained 473 + F: drivers/tty/serial/altera_uart.c 474 + F: drivers/tty/serial/altera_jtaguart.c 475 + F: include/linux/altera_uart.h 476 + F: include/linux/altera_jtaguart.h 477 + 468 478 AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER 469 479 M: Thomas Dahlmann <dahlmann.thomas@arcor.de> 470 480 L: linux-geode@lists.infradead.org (moderated for non-subscribers) ··· 2843 2833 HYPERVISOR VIRTUAL CONSOLE DRIVER 2844 2834 L: linuxppc-dev@lists.ozlabs.org 2845 2835 S: Odd Fixes 2846 - F: drivers/char/hvc_* 2836 + F: drivers/tty/hvc/ 2847 2837 2848 2838 iSCSI BOOT FIRMWARE TABLE (iBFT) DRIVER 2849 2839 M: Peter Jones <pjones@redhat.com> ··· 3458 3448 M: David Sterba <dsterba@suse.cz> 3459 3449 S: Maintained 3460 3450 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git 3461 - F: drivers/char/pcmcia/ipwireless/ 3451 + F: drivers/tty/ipwireless/ 3462 3452 3463 3453 IPX NETWORK LAYER 3464 3454 M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> ··· 6112 6102 W: http://www.tilera.com/scm/ 6113 6103 S: Supported 6114 6104 F: arch/tile/ 6115 - F: drivers/char/hvc_tile.c 6105 + F: drivers/tty/hvc/hvc_tile.c 6116 6106 F: drivers/net/tile/ 6117 6107 6118 6108 TLAN NETWORK DRIVER
+1
arch/alpha/include/asm/ioctls.h
··· 94 94 #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 95 95 #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ 96 96 #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ 97 + #define TIOCVHANGUP 0x5437 97 98 98 99 #define TIOCSERCONFIG 0x5453 99 100 #define TIOCSERGWILD 0x5454
+1 -2
arch/ia64/hp/sim/simserial.c
··· 390 390 } 391 391 392 392 393 - static int rs_ioctl(struct tty_struct *tty, struct file * file, 394 - unsigned int cmd, unsigned long arg) 393 + static int rs_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) 395 394 { 396 395 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 397 396 (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
-8
arch/m68k/Kconfig
··· 554 554 This is the driver for the serial ports on the Motorola MVME147 555 555 boards. Everyone using one of these boards should say Y here. 556 556 557 - config SERIAL167 558 - bool "CD2401 support for MVME166/7 serial ports" 559 - depends on MVME16x 560 - help 561 - This is the driver for the serial ports on the Motorola MVME166, 562 - 167, and 172 boards. Everyone using one of these boards should say 563 - Y here. 564 - 565 557 config MVME162_SCC 566 558 bool "SCC support for MVME162 serial ports" 567 559 depends on MVME16x && BROKEN
+1
arch/mips/include/asm/ioctls.h
··· 85 85 #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ 86 86 #define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */ 87 87 #define TIOCSIG _IOW('T', 0x36, int) /* Generate signal on Pty slave */ 88 + #define TIOCVHANGUP 0x5437 88 89 89 90 /* I hope the range from 0x5480 on is free ... */ 90 91 #define TIOCSCTTY 0x5480 /* become controlling tty */
+1
arch/parisc/include/asm/ioctls.h
··· 54 54 #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55 55 #define TIOCGDEV _IOR('T',0x32, int) /* Get primary device node of /dev/console */ 56 56 #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ 57 + #define TIOCVHANGUP 0x5437 57 58 58 59 #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ 59 60 #define FIOCLEX 0x5451
+1
arch/powerpc/include/asm/ioctls.h
··· 96 96 #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 97 97 #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ 98 98 #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ 99 + #define TIOCVHANGUP 0x5437 99 100 100 101 #define TIOCSERCONFIG 0x5453 101 102 #define TIOCSERGWILD 0x5454
+1
arch/sh/include/asm/ioctls.h
··· 87 87 #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 88 88 #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ 89 89 #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ 90 + #define TIOCVHANGUP _IO('T', 0x37) 90 91 91 92 #define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */ 92 93 #define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */
+1
arch/sparc/include/asm/ioctls.h
··· 20 20 #define TCSETSW2 _IOW('T', 14, struct termios2) 21 21 #define TCSETSF2 _IOW('T', 15, struct termios2) 22 22 #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ 23 + #define TIOCVHANGUP _IO('T', 0x37) 23 24 24 25 /* Note that all the ioctls that are not available in Linux have a 25 26 * double underscore on the front to: a) avoid some programs to
+1
arch/xtensa/include/asm/ioctls.h
··· 100 100 #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 101 101 #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ 102 102 #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ 103 + #define TIOCVHANGUP _IO('T', 0x37) 103 104 104 105 #define TIOCSERCONFIG _IO('T', 83) 105 106 #define TIOCSERGWILD _IOR('T', 84, int)
+13 -13
drivers/bluetooth/hci_ath.c
··· 51 51 52 52 static int ath_wakeup_ar3k(struct tty_struct *tty) 53 53 { 54 - struct termios settings; 55 - int status = tty->driver->ops->tiocmget(tty, NULL); 54 + struct ktermios ktermios; 55 + int status = tty->driver->ops->tiocmget(tty); 56 56 57 57 if (status & TIOCM_CTS) 58 58 return status; 59 59 60 60 /* Disable Automatic RTSCTS */ 61 - n_tty_ioctl_helper(tty, NULL, TCGETS, (unsigned long)&settings); 62 - settings.c_cflag &= ~CRTSCTS; 63 - n_tty_ioctl_helper(tty, NULL, TCSETS, (unsigned long)&settings); 61 + memcpy(&ktermios, tty->termios, sizeof(ktermios)); 62 + ktermios.c_cflag &= ~CRTSCTS; 63 + tty_set_termios(tty, &ktermios); 64 64 65 65 /* Clear RTS first */ 66 - status = tty->driver->ops->tiocmget(tty, NULL); 67 - tty->driver->ops->tiocmset(tty, NULL, 0x00, TIOCM_RTS); 66 + status = tty->driver->ops->tiocmget(tty); 67 + tty->driver->ops->tiocmset(tty, 0x00, TIOCM_RTS); 68 68 mdelay(20); 69 69 70 70 /* Set RTS, wake up board */ 71 - status = tty->driver->ops->tiocmget(tty, NULL); 72 - tty->driver->ops->tiocmset(tty, NULL, TIOCM_RTS, 0x00); 71 + status = tty->driver->ops->tiocmget(tty); 72 + tty->driver->ops->tiocmset(tty, TIOCM_RTS, 0x00); 73 73 mdelay(20); 74 74 75 - status = tty->driver->ops->tiocmget(tty, NULL); 75 + status = tty->driver->ops->tiocmget(tty); 76 76 77 - n_tty_ioctl_helper(tty, NULL, TCGETS, (unsigned long)&settings); 78 - settings.c_cflag |= CRTSCTS; 79 - n_tty_ioctl_helper(tty, NULL, TCSETS, (unsigned long)&settings); 77 + /* Disable Automatic RTSCTS */ 78 + ktermios.c_cflag |= CRTSCTS; 79 + status = tty_set_termios(tty, &ktermios); 80 80 81 81 return status; 82 82 }
+2 -538
drivers/char/Kconfig
··· 4 4 5 5 menu "Character devices" 6 6 7 - config VT 8 - bool "Virtual terminal" if EXPERT 9 - depends on !S390 10 - select INPUT 11 - default y 12 - ---help--- 13 - If you say Y here, you will get support for terminal devices with 14 - display and keyboard devices. These are called "virtual" because you 15 - can run several virtual terminals (also called virtual consoles) on 16 - one physical terminal. This is rather useful, for example one 17 - virtual terminal can collect system messages and warnings, another 18 - one can be used for a text-mode user session, and a third could run 19 - an X session, all in parallel. Switching between virtual terminals 20 - is done with certain key combinations, usually Alt-<function key>. 21 - 22 - The setterm command ("man setterm") can be used to change the 23 - properties (such as colors or beeping) of a virtual terminal. The 24 - man page console_codes(4) ("man console_codes") contains the special 25 - character sequences that can be used to change those properties 26 - directly. The fonts used on virtual terminals can be changed with 27 - the setfont ("man setfont") command and the key bindings are defined 28 - with the loadkeys ("man loadkeys") command. 29 - 30 - You need at least one virtual terminal device in order to make use 31 - of your keyboard and monitor. Therefore, only people configuring an 32 - embedded system would want to say N here in order to save some 33 - memory; the only way to log into such a system is then via a serial 34 - or network connection. 35 - 36 - If unsure, say Y, or else you won't be able to do much with your new 37 - shiny Linux system :-) 38 - 39 - config CONSOLE_TRANSLATIONS 40 - depends on VT 41 - default y 42 - bool "Enable character translations in console" if EXPERT 43 - ---help--- 44 - This enables support for font mapping and Unicode translation 45 - on virtual consoles. 46 - 47 - config VT_CONSOLE 48 - bool "Support for console on virtual terminal" if EXPERT 49 - depends on VT 50 - default y 51 - ---help--- 52 - The system console is the device which receives all kernel messages 53 - and warnings and which allows logins in single user mode. If you 54 - answer Y here, a virtual terminal (the device used to interact with 55 - a physical terminal) can be used as system console. This is the most 56 - common mode of operations, so you should say Y here unless you want 57 - the kernel messages be output only to a serial port (in which case 58 - you should say Y to "Console on serial port", below). 59 - 60 - If you do say Y here, by default the currently visible virtual 61 - terminal (/dev/tty0) will be used as system console. You can change 62 - that with a kernel command line option such as "console=tty3" which 63 - would use the third virtual terminal as system console. (Try "man 64 - bootparam" or see the documentation of your boot loader (lilo or 65 - loadlin) about how to pass options to the kernel at boot time.) 66 - 67 - If unsure, say Y. 68 - 69 - config HW_CONSOLE 70 - bool 71 - depends on VT && !S390 && !UML 72 - default y 73 - 74 - config VT_HW_CONSOLE_BINDING 75 - bool "Support for binding and unbinding console drivers" 76 - depends on HW_CONSOLE 77 - default n 78 - ---help--- 79 - The virtual terminal is the device that interacts with the physical 80 - terminal through console drivers. On these systems, at least one 81 - console driver is loaded. In other configurations, additional console 82 - drivers may be enabled, such as the framebuffer console. If more than 83 - 1 console driver is enabled, setting this to 'y' will allow you to 84 - select the console driver that will serve as the backend for the 85 - virtual terminals. 86 - 87 - See <file:Documentation/console/console.txt> for more 88 - information. For framebuffer console users, please refer to 89 - <file:Documentation/fb/fbcon.txt>. 7 + source "drivers/tty/Kconfig" 90 8 91 9 config DEVKMEM 92 10 bool "/dev/kmem virtual device support" ··· 14 96 /dev/kmem device is rarely used, but can be used for certain 15 97 kind of kernel debugging operations. 16 98 When in doubt, say "N". 17 - 18 - config BFIN_JTAG_COMM 19 - tristate "Blackfin JTAG Communication" 20 - depends on BLACKFIN 21 - help 22 - Add support for emulating a TTY device over the Blackfin JTAG. 23 - 24 - To compile this driver as a module, choose M here: the 25 - module will be called bfin_jtag_comm. 26 - 27 - config BFIN_JTAG_COMM_CONSOLE 28 - bool "Console on Blackfin JTAG" 29 - depends on BFIN_JTAG_COMM=y 30 - 31 - config SERIAL_NONSTANDARD 32 - bool "Non-standard serial port support" 33 - depends on HAS_IOMEM 34 - ---help--- 35 - Say Y here if you have any non-standard serial boards -- boards 36 - which aren't supported using the standard "dumb" serial driver. 37 - This includes intelligent serial boards such as Cyclades, 38 - Digiboards, etc. These are usually used for systems that need many 39 - serial ports because they serve many terminals or dial-in 40 - connections. 41 - 42 - Note that the answer to this question won't directly affect the 43 - kernel: saying N will just cause the configurator to skip all 44 - the questions about non-standard serial boards. 45 - 46 - Most people can say N here. 47 - 48 - config COMPUTONE 49 - tristate "Computone IntelliPort Plus serial support" 50 - depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI) 51 - ---help--- 52 - This driver supports the entire family of Intelliport II/Plus 53 - controllers with the exception of the MicroChannel controllers and 54 - products previous to the Intelliport II. These are multiport cards, 55 - which give you many serial ports. You would need something like this 56 - to connect more than two modems to your Linux box, for instance in 57 - order to become a dial-in server. If you have a card like that, say 58 - Y here and read <file:Documentation/serial/computone.txt>. 59 - 60 - To compile this driver as module, choose M here: the 61 - module will be called ip2. 62 - 63 - config ROCKETPORT 64 - tristate "Comtrol RocketPort support" 65 - depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI) 66 - help 67 - This driver supports Comtrol RocketPort and RocketModem PCI boards. 68 - These boards provide 2, 4, 8, 16, or 32 high-speed serial ports or 69 - modems. For information about the RocketPort/RocketModem boards 70 - and this driver read <file:Documentation/serial/rocket.txt>. 71 - 72 - To compile this driver as a module, choose M here: the 73 - module will be called rocket. 74 - 75 - If you want to compile this driver into the kernel, say Y here. If 76 - you don't have a Comtrol RocketPort/RocketModem card installed, say N. 77 - 78 - config CYCLADES 79 - tristate "Cyclades async mux support" 80 - depends on SERIAL_NONSTANDARD && (PCI || ISA) 81 - select FW_LOADER 82 - ---help--- 83 - This driver supports Cyclades Z and Y multiserial boards. 84 - You would need something like this to connect more than two modems to 85 - your Linux box, for instance in order to become a dial-in server. 86 - 87 - For information about the Cyclades-Z card, read 88 - <file:Documentation/serial/README.cycladesZ>. 89 - 90 - To compile this driver as a module, choose M here: the 91 - module will be called cyclades. 92 - 93 - If you haven't heard about it, it's safe to say N. 94 - 95 - config CYZ_INTR 96 - bool "Cyclades-Z interrupt mode operation (EXPERIMENTAL)" 97 - depends on EXPERIMENTAL && CYCLADES 98 - help 99 - The Cyclades-Z family of multiport cards allows 2 (two) driver op 100 - modes: polling and interrupt. In polling mode, the driver will check 101 - the status of the Cyclades-Z ports every certain amount of time 102 - (which is called polling cycle and is configurable). In interrupt 103 - mode, it will use an interrupt line (IRQ) in order to check the 104 - status of the Cyclades-Z ports. The default op mode is polling. If 105 - unsure, say N. 106 - 107 - config DIGIEPCA 108 - tristate "Digiboard Intelligent Async Support" 109 - depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI) 110 - ---help--- 111 - This is a driver for Digi International's Xx, Xeve, and Xem series 112 - of cards which provide multiple serial ports. You would need 113 - something like this to connect more than two modems to your Linux 114 - box, for instance in order to become a dial-in server. This driver 115 - supports the original PC (ISA) boards as well as PCI, and EISA. If 116 - you have a card like this, say Y here and read the file 117 - <file:Documentation/serial/digiepca.txt>. 118 - 119 - To compile this driver as a module, choose M here: the 120 - module will be called epca. 121 - 122 - config MOXA_INTELLIO 123 - tristate "Moxa Intellio support" 124 - depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI) 125 - select FW_LOADER 126 - help 127 - Say Y here if you have a Moxa Intellio multiport serial card. 128 - 129 - To compile this driver as a module, choose M here: the 130 - module will be called moxa. 131 - 132 - config MOXA_SMARTIO 133 - tristate "Moxa SmartIO support v. 2.0" 134 - depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA) 135 - help 136 - Say Y here if you have a Moxa SmartIO multiport serial card and/or 137 - want to help develop a new version of this driver. 138 - 139 - This is upgraded (1.9.1) driver from original Moxa drivers with 140 - changes finally resulting in PCI probing. 141 - 142 - This driver can also be built as a module. The module will be called 143 - mxser. If you want to do that, say M here. 144 - 145 - config ISI 146 - tristate "Multi-Tech multiport card support (EXPERIMENTAL)" 147 - depends on SERIAL_NONSTANDARD && PCI 148 - select FW_LOADER 149 - help 150 - This is a driver for the Multi-Tech cards which provide several 151 - serial ports. The driver is experimental and can currently only be 152 - built as a module. The module will be called isicom. 153 - If you want to do that, choose M here. 154 - 155 - config SYNCLINK 156 - tristate "Microgate SyncLink card support" 157 - depends on SERIAL_NONSTANDARD && PCI && ISA_DMA_API 158 - help 159 - Provides support for the SyncLink ISA and PCI multiprotocol serial 160 - adapters. These adapters support asynchronous and HDLC bit 161 - synchronous communication up to 10Mbps (PCI adapter). 162 - 163 - This driver can only be built as a module ( = code which can be 164 - inserted in and removed from the running kernel whenever you want). 165 - The module will be called synclink. If you want to do that, say M 166 - here. 167 - 168 - config SYNCLINKMP 169 - tristate "SyncLink Multiport support" 170 - depends on SERIAL_NONSTANDARD && PCI 171 - help 172 - Enable support for the SyncLink Multiport (2 or 4 ports) 173 - serial adapter, running asynchronous and HDLC communications up 174 - to 2.048Mbps. Each ports is independently selectable for 175 - RS-232, V.35, RS-449, RS-530, and X.21 176 - 177 - This driver may be built as a module ( = code which can be 178 - inserted in and removed from the running kernel whenever you want). 179 - The module will be called synclinkmp. If you want to do that, say M 180 - here. 181 - 182 - config SYNCLINK_GT 183 - tristate "SyncLink GT/AC support" 184 - depends on SERIAL_NONSTANDARD && PCI 185 - help 186 - Support for SyncLink GT and SyncLink AC families of 187 - synchronous and asynchronous serial adapters 188 - manufactured by Microgate Systems, Ltd. (www.microgate.com) 189 - 190 - config N_HDLC 191 - tristate "HDLC line discipline support" 192 - depends on SERIAL_NONSTANDARD 193 - help 194 - Allows synchronous HDLC communications with tty device drivers that 195 - support synchronous HDLC such as the Microgate SyncLink adapter. 196 - 197 - This driver can be built as a module ( = code which can be 198 - inserted in and removed from the running kernel whenever you want). 199 - The module will be called n_hdlc. If you want to do that, say M 200 - here. 201 - 202 - config N_GSM 203 - tristate "GSM MUX line discipline support (EXPERIMENTAL)" 204 - depends on EXPERIMENTAL 205 - depends on NET 206 - help 207 - This line discipline provides support for the GSM MUX protocol and 208 - presents the mux as a set of 61 individual tty devices. 209 - 210 - config RISCOM8 211 - tristate "SDL RISCom/8 card support" 212 - depends on SERIAL_NONSTANDARD 213 - help 214 - This is a driver for the SDL Communications RISCom/8 multiport card, 215 - which gives you many serial ports. You would need something like 216 - this to connect more than two modems to your Linux box, for instance 217 - in order to become a dial-in server. If you have a card like that, 218 - say Y here and read the file <file:Documentation/serial/riscom8.txt>. 219 - 220 - Also it's possible to say M here and compile this driver as kernel 221 - loadable module; the module will be called riscom8. 222 - 223 - config SPECIALIX 224 - tristate "Specialix IO8+ card support" 225 - depends on SERIAL_NONSTANDARD 226 - help 227 - This is a driver for the Specialix IO8+ multiport card (both the 228 - ISA and the PCI version) which gives you many serial ports. You 229 - would need something like this to connect more than two modems to 230 - your Linux box, for instance in order to become a dial-in server. 231 - 232 - If you have a card like that, say Y here and read the file 233 - <file:Documentation/serial/specialix.txt>. Also it's possible to say 234 - M here and compile this driver as kernel loadable module which will be 235 - called specialix. 236 - 237 - config SX 238 - tristate "Specialix SX (and SI) card support" 239 - depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA) && BROKEN 240 - help 241 - This is a driver for the SX and SI multiport serial cards. 242 - Please read the file <file:Documentation/serial/sx.txt> for details. 243 - 244 - This driver can only be built as a module ( = code which can be 245 - inserted in and removed from the running kernel whenever you want). 246 - The module will be called sx. If you want to do that, say M here. 247 - 248 - config RIO 249 - tristate "Specialix RIO system support" 250 - depends on SERIAL_NONSTANDARD && BROKEN 251 - help 252 - This is a driver for the Specialix RIO, a smart serial card which 253 - drives an outboard box that can support up to 128 ports. Product 254 - information is at <http://www.perle.com/support/documentation.html#multiport>. 255 - There are both ISA and PCI versions. 256 - 257 - config RIO_OLDPCI 258 - bool "Support really old RIO/PCI cards" 259 - depends on RIO 260 - help 261 - Older RIO PCI cards need some initialization-time configuration to 262 - determine the IRQ and some control addresses. If you have a RIO and 263 - this doesn't seem to work, try setting this to Y. 264 99 265 100 config STALDRV 266 101 bool "Stallion multiport serial support" ··· 26 355 questions. Make sure to read <file:Documentation/serial/stallion.txt> 27 356 in this case. If you have never heard about all this, it's safe to 28 357 say N. 29 - 30 - config STALLION 31 - tristate "Stallion EasyIO or EC8/32 support" 32 - depends on STALDRV && (ISA || EISA || PCI) 33 - help 34 - If you have an EasyIO or EasyConnection 8/32 multiport Stallion 35 - card, then this is for you; say Y. Make sure to read 36 - <file:Documentation/serial/stallion.txt>. 37 - 38 - To compile this driver as a module, choose M here: the 39 - module will be called stallion. 40 - 41 - config ISTALLION 42 - tristate "Stallion EC8/64, ONboard, Brumby support" 43 - depends on STALDRV && (ISA || EISA || PCI) 44 - help 45 - If you have an EasyConnection 8/64, ONboard, Brumby or Stallion 46 - serial multiport card, say Y here. Make sure to read 47 - <file:Documentation/serial/stallion.txt>. 48 - 49 - To compile this driver as a module, choose M here: the 50 - module will be called istallion. 51 - 52 - config NOZOMI 53 - tristate "HSDPA Broadband Wireless Data Card - Globe Trotter" 54 - depends on PCI && EXPERIMENTAL 55 - help 56 - If you have a HSDPA driver Broadband Wireless Data Card - 57 - Globe Trotter PCMCIA card, say Y here. 58 - 59 - To compile this driver as a module, choose M here, the module 60 - will be called nozomi. 61 - 62 - config A2232 63 - tristate "Commodore A2232 serial support (EXPERIMENTAL)" 64 - depends on EXPERIMENTAL && ZORRO && BROKEN 65 - ---help--- 66 - This option supports the 2232 7-port serial card shipped with the 67 - Amiga 2000 and other Zorro-bus machines, dating from 1989. At 68 - a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip 69 - each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The 70 - ports were connected with 8 pin DIN connectors on the card bracket, 71 - for which 8 pin to DB25 adapters were supplied. The card also had 72 - jumpers internally to toggle various pinning configurations. 73 - 74 - This driver can be built as a module; but then "generic_serial" 75 - will also be built as a module. This has to be loaded before 76 - "ser_a2232". If you want to do this, answer M here. 77 358 78 359 config SGI_SNSC 79 360 bool "SGI Altix system controller communication support" ··· 50 427 say Y or M here, otherwise say N. 51 428 52 429 source "drivers/tty/serial/Kconfig" 53 - 54 - config UNIX98_PTYS 55 - bool "Unix98 PTY support" if EXPERT 56 - default y 57 - ---help--- 58 - A pseudo terminal (PTY) is a software device consisting of two 59 - halves: a master and a slave. The slave device behaves identical to 60 - a physical terminal; the master device is used by a process to 61 - read data from and write data to the slave, thereby emulating a 62 - terminal. Typical programs for the master side are telnet servers 63 - and xterms. 64 - 65 - Linux has traditionally used the BSD-like names /dev/ptyxx for 66 - masters and /dev/ttyxx for slaves of pseudo terminals. This scheme 67 - has a number of problems. The GNU C library glibc 2.1 and later, 68 - however, supports the Unix98 naming standard: in order to acquire a 69 - pseudo terminal, a process opens /dev/ptmx; the number of the pseudo 70 - terminal is then made available to the process and the pseudo 71 - terminal slave can be accessed as /dev/pts/<number>. What was 72 - traditionally /dev/ttyp2 will then be /dev/pts/2, for example. 73 - 74 - All modern Linux systems use the Unix98 ptys. Say Y unless 75 - you're on an embedded system and want to conserve memory. 76 - 77 - config DEVPTS_MULTIPLE_INSTANCES 78 - bool "Support multiple instances of devpts" 79 - depends on UNIX98_PTYS 80 - default n 81 - ---help--- 82 - Enable support for multiple instances of devpts filesystem. 83 - If you want to have isolated PTY namespaces (eg: in containers), 84 - say Y here. Otherwise, say N. If enabled, each mount of devpts 85 - filesystem with the '-o newinstance' option will create an 86 - independent PTY namespace. 87 - 88 - config LEGACY_PTYS 89 - bool "Legacy (BSD) PTY support" 90 - default y 91 - ---help--- 92 - A pseudo terminal (PTY) is a software device consisting of two 93 - halves: a master and a slave. The slave device behaves identical to 94 - a physical terminal; the master device is used by a process to 95 - read data from and write data to the slave, thereby emulating a 96 - terminal. Typical programs for the master side are telnet servers 97 - and xterms. 98 - 99 - Linux has traditionally used the BSD-like names /dev/ptyxx 100 - for masters and /dev/ttyxx for slaves of pseudo 101 - terminals. This scheme has a number of problems, including 102 - security. This option enables these legacy devices; on most 103 - systems, it is safe to say N. 104 - 105 - 106 - config LEGACY_PTY_COUNT 107 - int "Maximum number of legacy PTY in use" 108 - depends on LEGACY_PTYS 109 - range 0 256 110 - default "256" 111 - ---help--- 112 - The maximum number of legacy PTYs that can be used at any one time. 113 - The default is 256, and should be more than enough. Embedded 114 - systems may want to reduce this to save memory. 115 - 116 - When not in use, each legacy PTY occupies 12 bytes on 32-bit 117 - architectures and 24 bytes on 64-bit architectures. 118 430 119 431 config TTY_PRINTK 120 432 bool "TTY driver to output user messages via printk" ··· 170 612 171 613 If unsure, say N. 172 614 173 - config HVC_DRIVER 174 - bool 175 - help 176 - Generic "hypervisor virtual console" infrastructure for various 177 - hypervisors (pSeries, iSeries, Xen, lguest). 178 - It will automatically be selected if one of the back-end console drivers 179 - is selected. 180 - 181 - config HVC_IRQ 182 - bool 183 - 184 - config HVC_CONSOLE 185 - bool "pSeries Hypervisor Virtual Console support" 186 - depends on PPC_PSERIES 187 - select HVC_DRIVER 188 - select HVC_IRQ 189 - help 190 - pSeries machines when partitioned support a hypervisor virtual 191 - console. This driver allows each pSeries partition to have a console 192 - which is accessed via the HMC. 193 - 194 - config HVC_ISERIES 195 - bool "iSeries Hypervisor Virtual Console support" 196 - depends on PPC_ISERIES 197 - default y 198 - select HVC_DRIVER 199 - select HVC_IRQ 200 - select VIOPATH 201 - help 202 - iSeries machines support a hypervisor virtual console. 203 - 204 - config HVC_RTAS 205 - bool "IBM RTAS Console support" 206 - depends on PPC_RTAS 207 - select HVC_DRIVER 208 - help 209 - IBM Console device driver which makes use of RTAS 210 - 211 - config HVC_BEAT 212 - bool "Toshiba's Beat Hypervisor Console support" 213 - depends on PPC_CELLEB 214 - select HVC_DRIVER 215 - help 216 - Toshiba's Cell Reference Set Beat Console device driver 217 - 218 - config HVC_IUCV 219 - bool "z/VM IUCV Hypervisor console support (VM only)" 220 - depends on S390 221 - select HVC_DRIVER 222 - select IUCV 223 - default y 224 - help 225 - This driver provides a Hypervisor console (HVC) back-end to access 226 - a Linux (console) terminal via a z/VM IUCV communication path. 227 - 228 - config HVC_XEN 229 - bool "Xen Hypervisor Console support" 230 - depends on XEN 231 - select HVC_DRIVER 232 - select HVC_IRQ 233 - default y 234 - help 235 - Xen virtual console device driver 236 - 237 - config HVC_UDBG 238 - bool "udbg based fake hypervisor console" 239 - depends on PPC && EXPERIMENTAL 240 - select HVC_DRIVER 241 - default n 242 - 243 - config HVC_DCC 244 - bool "ARM JTAG DCC console" 245 - depends on ARM 246 - select HVC_DRIVER 247 - help 248 - This console uses the JTAG DCC on ARM to create a console under the HVC 249 - driver. This console is used through a JTAG only on ARM. If you don't have 250 - a JTAG then you probably don't want this option. 615 + source "drivers/tty/hvc/Kconfig" 251 616 252 617 config VIRTIO_CONSOLE 253 618 tristate "Virtio console" ··· 187 706 attribute called 'name' will be populated with a name for 188 707 the port which can be used by udev scripts to create a 189 708 symlink to the device. 190 - 191 - config HVCS 192 - tristate "IBM Hypervisor Virtual Console Server support" 193 - depends on PPC_PSERIES && HVC_CONSOLE 194 - help 195 - Partitionable IBM Power5 ppc64 machines allow hosting of 196 - firmware virtual consoles from one Linux partition by 197 - another Linux partition. This driver allows console data 198 - from Linux partitions to be accessed through TTY device 199 - interfaces in the device tree of a Linux partition running 200 - this driver. 201 - 202 - To compile this driver as a module, choose M here: the 203 - module will be called hvcs. Additionally, this module 204 - will depend on arch specific APIs exported from hvcserver.ko 205 - which will also be compiled when this driver is built as a 206 - module. 207 709 208 710 config IBM_BSR 209 711 tristate "IBM POWER Barrier Synchronization Register support"
-24
drivers/char/Makefile
··· 5 5 obj-y += mem.o random.o 6 6 obj-$(CONFIG_TTY_PRINTK) += ttyprintk.o 7 7 obj-y += misc.o 8 - obj-$(CONFIG_BFIN_JTAG_COMM) += bfin_jtag_comm.o 9 - obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o 10 - obj-$(CONFIG_MVME162_SCC) += generic_serial.o vme_scc.o 11 - obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o 12 - obj-$(CONFIG_ROCKETPORT) += rocket.o 13 - obj-$(CONFIG_SERIAL167) += serial167.o 14 - obj-$(CONFIG_CYCLADES) += cyclades.o 15 - obj-$(CONFIG_STALLION) += stallion.o 16 - obj-$(CONFIG_ISTALLION) += istallion.o 17 - obj-$(CONFIG_NOZOMI) += nozomi.o 18 - obj-$(CONFIG_DIGIEPCA) += epca.o 19 - obj-$(CONFIG_SPECIALIX) += specialix.o 20 - obj-$(CONFIG_MOXA_INTELLIO) += moxa.o 21 - obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o 22 8 obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o 23 - obj-$(CONFIG_MOXA_SMARTIO) += mxser.o 24 - obj-$(CONFIG_COMPUTONE) += ip2/ 25 - obj-$(CONFIG_RISCOM8) += riscom8.o 26 - obj-$(CONFIG_ISI) += isicom.o 27 - obj-$(CONFIG_SYNCLINK) += synclink.o 28 - obj-$(CONFIG_SYNCLINKMP) += synclinkmp.o 29 - obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o 30 - obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o 31 - obj-$(CONFIG_SX) += sx.o generic_serial.o 32 - obj-$(CONFIG_RIO) += rio/ generic_serial.o 33 9 obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o 34 10 obj-$(CONFIG_RAW_DRIVER) += raw.o 35 11 obj-$(CONFIG_SGI_SNSC) += snsc.o snsc_event.o
+4 -4
drivers/char/amiserial.c drivers/tty/amiserial.c
··· 1194 1194 } 1195 1195 1196 1196 1197 - static int rs_tiocmget(struct tty_struct *tty, struct file *file) 1197 + static int rs_tiocmget(struct tty_struct *tty) 1198 1198 { 1199 1199 struct async_struct * info = tty->driver_data; 1200 1200 unsigned char control, status; ··· 1216 1216 | (!(status & SER_CTS) ? TIOCM_CTS : 0); 1217 1217 } 1218 1218 1219 - static int rs_tiocmset(struct tty_struct *tty, struct file *file, 1220 - unsigned int set, unsigned int clear) 1219 + static int rs_tiocmset(struct tty_struct *tty, unsigned int set, 1220 + unsigned int clear) 1221 1221 { 1222 1222 struct async_struct * info = tty->driver_data; 1223 1223 unsigned long flags; ··· 1293 1293 return 0; 1294 1294 } 1295 1295 1296 - static int rs_ioctl(struct tty_struct *tty, struct file * file, 1296 + static int rs_ioctl(struct tty_struct *tty, 1297 1297 unsigned int cmd, unsigned long arg) 1298 1298 { 1299 1299 struct async_struct * info = tty->driver_data;
drivers/char/bfin_jtag_comm.c drivers/tty/bfin_jtag_comm.c
drivers/char/cd1865.h drivers/staging/tty/cd1865.h
+3 -3
drivers/char/cyclades.c drivers/tty/cyclades.c
··· 2429 2429 return put_user(result, (unsigned long __user *)value); 2430 2430 } 2431 2431 2432 - static int cy_tiocmget(struct tty_struct *tty, struct file *file) 2432 + static int cy_tiocmget(struct tty_struct *tty) 2433 2433 { 2434 2434 struct cyclades_port *info = tty->driver_data; 2435 2435 struct cyclades_card *card; ··· 2483 2483 } /* cy_tiomget */ 2484 2484 2485 2485 static int 2486 - cy_tiocmset(struct tty_struct *tty, struct file *file, 2486 + cy_tiocmset(struct tty_struct *tty, 2487 2487 unsigned int set, unsigned int clear) 2488 2488 { 2489 2489 struct cyclades_port *info = tty->driver_data; ··· 2680 2680 * not recognized by the driver, it should return ENOIOCTLCMD. 2681 2681 */ 2682 2682 static int 2683 - cy_ioctl(struct tty_struct *tty, struct file *file, 2683 + cy_ioctl(struct tty_struct *tty, 2684 2684 unsigned int cmd, unsigned long arg) 2685 2685 { 2686 2686 struct cyclades_port *info = tty->driver_data;
drivers/char/digi1.h drivers/staging/tty/digi1.h
drivers/char/digiFep1.h drivers/staging/tty/digiFep1.h
drivers/char/digiPCI.h drivers/staging/tty/digiPCI.h
+8 -8
drivers/char/epca.c drivers/staging/tty/epca.c
··· 175 175 static unsigned termios2digi_c(struct channel *ch, unsigned); 176 176 static void epcaparam(struct tty_struct *, struct channel *); 177 177 static void receive_data(struct channel *, struct tty_struct *tty); 178 - static int pc_ioctl(struct tty_struct *, struct file *, 178 + static int pc_ioctl(struct tty_struct *, 179 179 unsigned int, unsigned long); 180 - static int info_ioctl(struct tty_struct *, struct file *, 180 + static int info_ioctl(struct tty_struct *, 181 181 unsigned int, unsigned long); 182 182 static void pc_set_termios(struct tty_struct *, struct ktermios *); 183 183 static void do_softint(struct work_struct *work); ··· 1919 1919 tty_schedule_flip(tty); 1920 1920 } 1921 1921 1922 - static int info_ioctl(struct tty_struct *tty, struct file *file, 1922 + static int info_ioctl(struct tty_struct *tty, 1923 1923 unsigned int cmd, unsigned long arg) 1924 1924 { 1925 1925 switch (cmd) { ··· 1982 1982 return 0; 1983 1983 } 1984 1984 1985 - static int pc_tiocmget(struct tty_struct *tty, struct file *file) 1985 + static int pc_tiocmget(struct tty_struct *tty) 1986 1986 { 1987 1987 struct channel *ch = tty->driver_data; 1988 1988 struct board_chan __iomem *bc; ··· 2015 2015 return mflag; 2016 2016 } 2017 2017 2018 - static int pc_tiocmset(struct tty_struct *tty, struct file *file, 2018 + static int pc_tiocmset(struct tty_struct *tty, 2019 2019 unsigned int set, unsigned int clear) 2020 2020 { 2021 2021 struct channel *ch = tty->driver_data; ··· 2057 2057 return 0; 2058 2058 } 2059 2059 2060 - static int pc_ioctl(struct tty_struct *tty, struct file *file, 2060 + static int pc_ioctl(struct tty_struct *tty, 2061 2061 unsigned int cmd, unsigned long arg) 2062 2062 { 2063 2063 digiflow_t dflow; ··· 2074 2074 return -EINVAL; 2075 2075 switch (cmd) { 2076 2076 case TIOCMODG: 2077 - mflag = pc_tiocmget(tty, file); 2077 + mflag = pc_tiocmget(tty); 2078 2078 if (put_user(mflag, (unsigned long __user *)argp)) 2079 2079 return -EFAULT; 2080 2080 break; 2081 2081 case TIOCMODS: 2082 2082 if (get_user(mstat, (unsigned __user *)argp)) 2083 2083 return -EFAULT; 2084 - return pc_tiocmset(tty, file, mstat, ~mstat); 2084 + return pc_tiocmset(tty, mstat, ~mstat); 2085 2085 case TIOCSDTR: 2086 2086 spin_lock_irqsave(&epca_lock, flags); 2087 2087 ch->omodem |= ch->m_dtr;
drivers/char/epca.h drivers/staging/tty/epca.h
drivers/char/epcaconfig.h drivers/staging/tty/epcaconfig.h
+2 -2
drivers/char/generic_serial.c drivers/staging/generic_serial/generic_serial.c
··· 566 566 * line status register. 567 567 */ 568 568 569 - spin_lock_irqsave(&port->driver_lock, flags); 569 + spin_lock(&port->driver_lock); 570 570 port->rd->disable_rx_interrupts (port); 571 - spin_unlock_irqrestore(&port->driver_lock, flags); 571 + spin_unlock(&port->driver_lock); 572 572 spin_unlock_irqrestore(&port->port.lock, flags); 573 573 574 574 /* close has no way of returning "EINTR", so discard return value */
drivers/char/ip2/Makefile drivers/staging/tty/ip2/Makefile
drivers/char/ip2/i2cmd.c drivers/staging/tty/ip2/i2cmd.c
drivers/char/ip2/i2cmd.h drivers/staging/tty/ip2/i2cmd.h
drivers/char/ip2/i2ellis.c drivers/staging/tty/ip2/i2ellis.c
drivers/char/ip2/i2ellis.h drivers/staging/tty/ip2/i2ellis.h
drivers/char/ip2/i2hw.h drivers/staging/tty/ip2/i2hw.h
drivers/char/ip2/i2lib.c drivers/staging/tty/ip2/i2lib.c
drivers/char/ip2/i2lib.h drivers/staging/tty/ip2/i2lib.h
drivers/char/ip2/i2pack.h drivers/staging/tty/ip2/i2pack.h
drivers/char/ip2/ip2.h drivers/staging/tty/ip2/ip2.h
drivers/char/ip2/ip2ioctl.h drivers/staging/tty/ip2/ip2ioctl.h
+6 -6
drivers/char/ip2/ip2main.c drivers/staging/tty/ip2/ip2main.c
··· 173 173 static int ip2_write_room(PTTY); 174 174 static int ip2_chars_in_buf(PTTY); 175 175 static void ip2_flush_buffer(PTTY); 176 - static int ip2_ioctl(PTTY, struct file *, UINT, ULONG); 176 + static int ip2_ioctl(PTTY, UINT, ULONG); 177 177 static void ip2_set_termios(PTTY, struct ktermios *); 178 178 static void ip2_set_line_discipline(PTTY); 179 179 static void ip2_throttle(PTTY); ··· 181 181 static void ip2_stop(PTTY); 182 182 static void ip2_start(PTTY); 183 183 static void ip2_hangup(PTTY); 184 - static int ip2_tiocmget(struct tty_struct *tty, struct file *file); 185 - static int ip2_tiocmset(struct tty_struct *tty, struct file *file, 184 + static int ip2_tiocmget(struct tty_struct *tty); 185 + static int ip2_tiocmset(struct tty_struct *tty, 186 186 unsigned int set, unsigned int clear); 187 187 static int ip2_get_icount(struct tty_struct *tty, 188 188 struct serial_icounter_struct *icount); ··· 2038 2038 /* Device Ioctl Section */ 2039 2039 /******************************************************************************/ 2040 2040 2041 - static int ip2_tiocmget(struct tty_struct *tty, struct file *file) 2041 + static int ip2_tiocmget(struct tty_struct *tty) 2042 2042 { 2043 2043 i2ChanStrPtr pCh = DevTable[tty->index]; 2044 2044 #ifdef ENABLE_DSSNOW ··· 2085 2085 | ((pCh->dataSetIn & I2_CTS) ? TIOCM_CTS : 0); 2086 2086 } 2087 2087 2088 - static int ip2_tiocmset(struct tty_struct *tty, struct file *file, 2088 + static int ip2_tiocmset(struct tty_struct *tty, 2089 2089 unsigned int set, unsigned int clear) 2090 2090 { 2091 2091 i2ChanStrPtr pCh = DevTable[tty->index]; ··· 2127 2127 /* */ 2128 2128 /******************************************************************************/ 2129 2129 static int 2130 - ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) 2130 + ip2_ioctl ( PTTY tty, UINT cmd, ULONG arg ) 2131 2131 { 2132 2132 wait_queue_t wait; 2133 2133 i2ChanStrPtr pCh = DevTable[tty->index];
drivers/char/ip2/ip2trace.h drivers/staging/tty/ip2/ip2trace.h
drivers/char/ip2/ip2types.h drivers/staging/tty/ip2/ip2types.h
+4 -4
drivers/char/isicom.c drivers/tty/isicom.c
··· 1065 1065 return 0; 1066 1066 } 1067 1067 1068 - static int isicom_tiocmget(struct tty_struct *tty, struct file *file) 1068 + static int isicom_tiocmget(struct tty_struct *tty) 1069 1069 { 1070 1070 struct isi_port *port = tty->driver_data; 1071 1071 /* just send the port status */ ··· 1082 1082 ((status & ISI_RI ) ? TIOCM_RI : 0); 1083 1083 } 1084 1084 1085 - static int isicom_tiocmset(struct tty_struct *tty, struct file *file, 1086 - unsigned int set, unsigned int clear) 1085 + static int isicom_tiocmset(struct tty_struct *tty, 1086 + unsigned int set, unsigned int clear) 1087 1087 { 1088 1088 struct isi_port *port = tty->driver_data; 1089 1089 unsigned long flags; ··· 1167 1167 return 0; 1168 1168 } 1169 1169 1170 - static int isicom_ioctl(struct tty_struct *tty, struct file *filp, 1170 + static int isicom_ioctl(struct tty_struct *tty, 1171 1171 unsigned int cmd, unsigned long arg) 1172 1172 { 1173 1173 struct isi_port *port = tty->driver_data;
+4 -4
drivers/char/istallion.c drivers/staging/tty/istallion.c
··· 603 603 static void stli_flushchars(struct tty_struct *tty); 604 604 static int stli_writeroom(struct tty_struct *tty); 605 605 static int stli_charsinbuffer(struct tty_struct *tty); 606 - static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg); 606 + static int stli_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg); 607 607 static void stli_settermios(struct tty_struct *tty, struct ktermios *old); 608 608 static void stli_throttle(struct tty_struct *tty); 609 609 static void stli_unthrottle(struct tty_struct *tty); ··· 1501 1501 1502 1502 /*****************************************************************************/ 1503 1503 1504 - static int stli_tiocmget(struct tty_struct *tty, struct file *file) 1504 + static int stli_tiocmget(struct tty_struct *tty) 1505 1505 { 1506 1506 struct stliport *portp = tty->driver_data; 1507 1507 struct stlibrd *brdp; ··· 1524 1524 return stli_mktiocm(portp->asig.sigvalue); 1525 1525 } 1526 1526 1527 - static int stli_tiocmset(struct tty_struct *tty, struct file *file, 1527 + static int stli_tiocmset(struct tty_struct *tty, 1528 1528 unsigned int set, unsigned int clear) 1529 1529 { 1530 1530 struct stliport *portp = tty->driver_data; ··· 1556 1556 sizeof(asysigs_t), 0); 1557 1557 } 1558 1558 1559 - static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) 1559 + static int stli_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) 1560 1560 { 1561 1561 struct stliport *portp; 1562 1562 struct stlibrd *brdp;
+5 -5
drivers/char/moxa.c drivers/tty/moxa.c
··· 199 199 static void moxa_stop(struct tty_struct *); 200 200 static void moxa_start(struct tty_struct *); 201 201 static void moxa_hangup(struct tty_struct *); 202 - static int moxa_tiocmget(struct tty_struct *tty, struct file *file); 203 - static int moxa_tiocmset(struct tty_struct *tty, struct file *file, 202 + static int moxa_tiocmget(struct tty_struct *tty); 203 + static int moxa_tiocmset(struct tty_struct *tty, 204 204 unsigned int set, unsigned int clear); 205 205 static void moxa_poll(unsigned long); 206 206 static void moxa_set_tty_param(struct tty_struct *, struct ktermios *); ··· 287 287 * TTY operations 288 288 */ 289 289 290 - static int moxa_ioctl(struct tty_struct *tty, struct file *file, 290 + static int moxa_ioctl(struct tty_struct *tty, 291 291 unsigned int cmd, unsigned long arg) 292 292 { 293 293 struct moxa_port *ch = tty->driver_data; ··· 1257 1257 return chars; 1258 1258 } 1259 1259 1260 - static int moxa_tiocmget(struct tty_struct *tty, struct file *file) 1260 + static int moxa_tiocmget(struct tty_struct *tty) 1261 1261 { 1262 1262 struct moxa_port *ch = tty->driver_data; 1263 1263 int flag = 0, dtr, rts; ··· 1277 1277 return flag; 1278 1278 } 1279 1279 1280 - static int moxa_tiocmset(struct tty_struct *tty, struct file *file, 1280 + static int moxa_tiocmset(struct tty_struct *tty, 1281 1281 unsigned int set, unsigned int clear) 1282 1282 { 1283 1283 struct moxa_port *ch;
drivers/char/moxa.h drivers/tty/moxa.h
+3 -3
drivers/char/mxser.c drivers/tty/mxser.c
··· 1320 1320 return put_user(result, value); 1321 1321 } 1322 1322 1323 - static int mxser_tiocmget(struct tty_struct *tty, struct file *file) 1323 + static int mxser_tiocmget(struct tty_struct *tty) 1324 1324 { 1325 1325 struct mxser_port *info = tty->driver_data; 1326 1326 unsigned char control, status; ··· 1347 1347 ((status & UART_MSR_CTS) ? TIOCM_CTS : 0); 1348 1348 } 1349 1349 1350 - static int mxser_tiocmset(struct tty_struct *tty, struct file *file, 1350 + static int mxser_tiocmset(struct tty_struct *tty, 1351 1351 unsigned int set, unsigned int clear) 1352 1352 { 1353 1353 struct mxser_port *info = tty->driver_data; ··· 1655 1655 return ret; 1656 1656 } 1657 1657 1658 - static int mxser_ioctl(struct tty_struct *tty, struct file *file, 1658 + static int mxser_ioctl(struct tty_struct *tty, 1659 1659 unsigned int cmd, unsigned long arg) 1660 1660 { 1661 1661 struct mxser_port *info = tty->driver_data;
drivers/char/mxser.h drivers/tty/mxser.h
+4 -6
drivers/char/nozomi.c drivers/tty/nozomi.c
··· 1514 1514 1515 1515 DBG1(" "); 1516 1516 1517 - flush_scheduled_work(); 1518 - 1519 1517 for (i = 0; i < MAX_PORT; ++i) { 1520 1518 struct tty_struct *tty = tty_port_tty_get(&dc->port[i].port); 1521 1519 if (tty && list_empty(&tty->hangup_work.entry)) ··· 1748 1750 } 1749 1751 1750 1752 /* Gets io control parameters */ 1751 - static int ntty_tiocmget(struct tty_struct *tty, struct file *file) 1753 + static int ntty_tiocmget(struct tty_struct *tty) 1752 1754 { 1753 1755 const struct port *port = tty->driver_data; 1754 1756 const struct ctrl_dl *ctrl_dl = &port->ctrl_dl; ··· 1765 1767 } 1766 1768 1767 1769 /* Sets io controls parameters */ 1768 - static int ntty_tiocmset(struct tty_struct *tty, struct file *file, 1769 - unsigned int set, unsigned int clear) 1770 + static int ntty_tiocmset(struct tty_struct *tty, 1771 + unsigned int set, unsigned int clear) 1770 1772 { 1771 1773 struct nozomi *dc = get_dc_by_tty(tty); 1772 1774 unsigned long flags; ··· 1822 1824 return 0; 1823 1825 } 1824 1826 1825 - static int ntty_ioctl(struct tty_struct *tty, struct file *file, 1827 + static int ntty_ioctl(struct tty_struct *tty, 1826 1828 unsigned int cmd, unsigned long arg) 1827 1829 { 1828 1830 struct port *port = tty->driver_data;
-2
drivers/char/pcmcia/Makefile
··· 4 4 # Makefile for the Linux PCMCIA char device drivers. 5 5 # 6 6 7 - obj-y += ipwireless/ 8 - 9 7 obj-$(CONFIG_SYNCLINK_CS) += synclink_cs.o 10 8 obj-$(CONFIG_CARDMAN_4000) += cm4000_cs.o 11 9 obj-$(CONFIG_CARDMAN_4040) += cm4040_cs.o
drivers/char/pcmcia/ipwireless/Makefile drivers/tty/ipwireless/Makefile
drivers/char/pcmcia/ipwireless/hardware.c drivers/tty/ipwireless/hardware.c
drivers/char/pcmcia/ipwireless/hardware.h drivers/tty/ipwireless/hardware.h
drivers/char/pcmcia/ipwireless/main.c drivers/tty/ipwireless/main.c
drivers/char/pcmcia/ipwireless/main.h drivers/tty/ipwireless/main.h
drivers/char/pcmcia/ipwireless/network.c drivers/tty/ipwireless/network.c
drivers/char/pcmcia/ipwireless/network.h drivers/tty/ipwireless/network.h
drivers/char/pcmcia/ipwireless/setup_protocol.h drivers/tty/ipwireless/setup_protocol.h
+4 -4
drivers/char/pcmcia/ipwireless/tty.c drivers/tty/ipwireless/tty.c
··· 395 395 return 0; 396 396 } 397 397 398 - static int ipw_tiocmget(struct tty_struct *linux_tty, struct file *file) 398 + static int ipw_tiocmget(struct tty_struct *linux_tty) 399 399 { 400 400 struct ipw_tty *tty = linux_tty->driver_data; 401 401 /* FIXME: Exactly how is the tty object locked here .. */ ··· 410 410 } 411 411 412 412 static int 413 - ipw_tiocmset(struct tty_struct *linux_tty, struct file *file, 413 + ipw_tiocmset(struct tty_struct *linux_tty, 414 414 unsigned int set, unsigned int clear) 415 415 { 416 416 struct ipw_tty *tty = linux_tty->driver_data; ··· 425 425 return set_control_lines(tty, set, clear); 426 426 } 427 427 428 - static int ipw_ioctl(struct tty_struct *linux_tty, struct file *file, 428 + static int ipw_ioctl(struct tty_struct *linux_tty, 429 429 unsigned int cmd, unsigned long arg) 430 430 { 431 431 struct ipw_tty *tty = linux_tty->driver_data; ··· 484 484 return tty_perform_flush(linux_tty, arg); 485 485 } 486 486 } 487 - return tty_mode_ioctl(linux_tty, file, cmd , arg); 487 + return -ENOIOCTLCMD; 488 488 } 489 489 490 490 static int add_tty(int j,
drivers/char/pcmcia/ipwireless/tty.h drivers/tty/ipwireless/tty.h
drivers/char/rio/Makefile drivers/staging/generic_serial/rio/Makefile
drivers/char/rio/board.h drivers/staging/generic_serial/rio/board.h
drivers/char/rio/cirrus.h drivers/staging/generic_serial/rio/cirrus.h
drivers/char/rio/cmdblk.h drivers/staging/generic_serial/rio/cmdblk.h
drivers/char/rio/cmdpkt.h drivers/staging/generic_serial/rio/cmdpkt.h
drivers/char/rio/daemon.h drivers/staging/generic_serial/rio/daemon.h
drivers/char/rio/errors.h drivers/staging/generic_serial/rio/errors.h
drivers/char/rio/func.h drivers/staging/generic_serial/rio/func.h
drivers/char/rio/host.h drivers/staging/generic_serial/rio/host.h
drivers/char/rio/link.h drivers/staging/generic_serial/rio/link.h
drivers/char/rio/linux_compat.h drivers/staging/generic_serial/rio/linux_compat.h
drivers/char/rio/map.h drivers/staging/generic_serial/rio/map.h
drivers/char/rio/param.h drivers/staging/generic_serial/rio/param.h
drivers/char/rio/parmmap.h drivers/staging/generic_serial/rio/parmmap.h
drivers/char/rio/pci.h drivers/staging/generic_serial/rio/pci.h
drivers/char/rio/phb.h drivers/staging/generic_serial/rio/phb.h
drivers/char/rio/pkt.h drivers/staging/generic_serial/rio/pkt.h
drivers/char/rio/port.h drivers/staging/generic_serial/rio/port.h
drivers/char/rio/protsts.h drivers/staging/generic_serial/rio/protsts.h
drivers/char/rio/rio.h drivers/staging/generic_serial/rio/rio.h
drivers/char/rio/rio_linux.c drivers/staging/generic_serial/rio/rio_linux.c
drivers/char/rio/rio_linux.h drivers/staging/generic_serial/rio/rio_linux.h
drivers/char/rio/rioboard.h drivers/staging/generic_serial/rio/rioboard.h
drivers/char/rio/rioboot.c drivers/staging/generic_serial/rio/rioboot.c
drivers/char/rio/riocmd.c drivers/staging/generic_serial/rio/riocmd.c
drivers/char/rio/rioctrl.c drivers/staging/generic_serial/rio/rioctrl.c
drivers/char/rio/riodrvr.h drivers/staging/generic_serial/rio/riodrvr.h
drivers/char/rio/rioinfo.h drivers/staging/generic_serial/rio/rioinfo.h
drivers/char/rio/rioinit.c drivers/staging/generic_serial/rio/rioinit.c
drivers/char/rio/riointr.c drivers/staging/generic_serial/rio/riointr.c
drivers/char/rio/rioioctl.h drivers/staging/generic_serial/rio/rioioctl.h
drivers/char/rio/rioparam.c drivers/staging/generic_serial/rio/rioparam.c
drivers/char/rio/rioroute.c drivers/staging/generic_serial/rio/rioroute.c
drivers/char/rio/riospace.h drivers/staging/generic_serial/rio/riospace.h
drivers/char/rio/riotable.c drivers/staging/generic_serial/rio/riotable.c
drivers/char/rio/riotty.c drivers/staging/generic_serial/rio/riotty.c
drivers/char/rio/route.h drivers/staging/generic_serial/rio/route.h
drivers/char/rio/rup.h drivers/staging/generic_serial/rio/rup.h
drivers/char/rio/unixrup.h drivers/staging/generic_serial/rio/unixrup.h
+4 -4
drivers/char/riscom8.c drivers/staging/tty/riscom8.c
··· 1086 1086 return port->xmit_cnt; 1087 1087 } 1088 1088 1089 - static int rc_tiocmget(struct tty_struct *tty, struct file *file) 1089 + static int rc_tiocmget(struct tty_struct *tty) 1090 1090 { 1091 1091 struct riscom_port *port = tty->driver_data; 1092 1092 struct riscom_board *bp; ··· 1115 1115 return result; 1116 1116 } 1117 1117 1118 - static int rc_tiocmset(struct tty_struct *tty, struct file *file, 1119 - unsigned int set, unsigned int clear) 1118 + static int rc_tiocmset(struct tty_struct *tty, 1119 + unsigned int set, unsigned int clear) 1120 1120 { 1121 1121 struct riscom_port *port = tty->driver_data; 1122 1122 unsigned long flags; ··· 1236 1236 return copy_to_user(retinfo, &tmp, sizeof(tmp)) ? -EFAULT : 0; 1237 1237 } 1238 1238 1239 - static int rc_ioctl(struct tty_struct *tty, struct file *filp, 1239 + static int rc_ioctl(struct tty_struct *tty, 1240 1240 unsigned int cmd, unsigned long arg) 1241 1241 { 1242 1242 struct riscom_port *port = tty->driver_data;
drivers/char/riscom8.h drivers/staging/tty/riscom8.h
drivers/char/riscom8_reg.h drivers/staging/tty/riscom8_reg.h
+4 -4
drivers/char/rocket.c drivers/tty/rocket.c
··· 1169 1169 * Returns the state of the serial modem control lines. These next 2 functions 1170 1170 * are the way kernel versions > 2.5 handle modem control lines rather than IOCTLs. 1171 1171 */ 1172 - static int rp_tiocmget(struct tty_struct *tty, struct file *file) 1172 + static int rp_tiocmget(struct tty_struct *tty) 1173 1173 { 1174 1174 struct r_port *info = tty->driver_data; 1175 1175 unsigned int control, result, ChanStatus; ··· 1189 1189 /* 1190 1190 * Sets the modem control lines 1191 1191 */ 1192 - static int rp_tiocmset(struct tty_struct *tty, struct file *file, 1193 - unsigned int set, unsigned int clear) 1192 + static int rp_tiocmset(struct tty_struct *tty, 1193 + unsigned int set, unsigned int clear) 1194 1194 { 1195 1195 struct r_port *info = tty->driver_data; 1196 1196 ··· 1326 1326 } 1327 1327 1328 1328 /* IOCTL call handler into the driver */ 1329 - static int rp_ioctl(struct tty_struct *tty, struct file *file, 1329 + static int rp_ioctl(struct tty_struct *tty, 1330 1330 unsigned int cmd, unsigned long arg) 1331 1331 { 1332 1332 struct r_port *info = tty->driver_data;
drivers/char/rocket.h drivers/tty/rocket.h
drivers/char/rocket_int.h drivers/tty/rocket_int.h
+3 -3
drivers/char/ser_a2232.c drivers/staging/generic_serial/ser_a2232.c
··· 133 133 /* END GENERIC_SERIAL PROTOTYPES */ 134 134 135 135 /* Functions that the TTY driver struct expects */ 136 - static int a2232_ioctl(struct tty_struct *tty, struct file *file, 137 - unsigned int cmd, unsigned long arg); 136 + static int a2232_ioctl(struct tty_struct *tty, 137 + unsigned int cmd, unsigned long arg); 138 138 static void a2232_throttle(struct tty_struct *tty); 139 139 static void a2232_unthrottle(struct tty_struct *tty); 140 140 static int a2232_open(struct tty_struct * tty, struct file * filp); ··· 447 447 /*** END OF REAL_DRIVER FUNCTIONS ***/ 448 448 449 449 /*** BEGIN FUNCTIONS EXPECTED BY TTY DRIVER STRUCTS ***/ 450 - static int a2232_ioctl( struct tty_struct *tty, struct file *file, 450 + static int a2232_ioctl( struct tty_struct *tty, 451 451 unsigned int cmd, unsigned long arg) 452 452 { 453 453 return -ENOIOCTLCMD;
drivers/char/ser_a2232.h drivers/staging/generic_serial/ser_a2232.h
drivers/char/ser_a2232fw.ax drivers/staging/generic_serial/ser_a2232fw.ax
drivers/char/ser_a2232fw.h drivers/staging/generic_serial/ser_a2232fw.h
+3 -4
drivers/char/serial167.c drivers/staging/tty/serial167.c
··· 1308 1308 return startup(info); 1309 1309 } /* set_serial_info */ 1310 1310 1311 - static int cy_tiocmget(struct tty_struct *tty, struct file *file) 1311 + static int cy_tiocmget(struct tty_struct *tty) 1312 1312 { 1313 1313 struct cyclades_port *info = tty->driver_data; 1314 1314 int channel; ··· 1331 1331 } /* cy_tiocmget */ 1332 1332 1333 1333 static int 1334 - cy_tiocmset(struct tty_struct *tty, struct file *file, 1335 - unsigned int set, unsigned int clear) 1334 + cy_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) 1336 1335 { 1337 1336 struct cyclades_port *info = tty->driver_data; 1338 1337 int channel; ··· 1492 1493 } 1493 1494 1494 1495 static int 1495 - cy_ioctl(struct tty_struct *tty, struct file *file, 1496 + cy_ioctl(struct tty_struct *tty, 1496 1497 unsigned int cmd, unsigned long arg) 1497 1498 { 1498 1499 struct cyclades_port *info = tty->driver_data;
+3 -3
drivers/char/specialix.c drivers/staging/tty/specialix.c
··· 1737 1737 return port->xmit_cnt; 1738 1738 } 1739 1739 1740 - static int sx_tiocmget(struct tty_struct *tty, struct file *file) 1740 + static int sx_tiocmget(struct tty_struct *tty) 1741 1741 { 1742 1742 struct specialix_port *port = tty->driver_data; 1743 1743 struct specialix_board *bp; ··· 1778 1778 } 1779 1779 1780 1780 1781 - static int sx_tiocmset(struct tty_struct *tty, struct file *file, 1781 + static int sx_tiocmset(struct tty_struct *tty, 1782 1782 unsigned int set, unsigned int clear) 1783 1783 { 1784 1784 struct specialix_port *port = tty->driver_data; ··· 1928 1928 } 1929 1929 1930 1930 1931 - static int sx_ioctl(struct tty_struct *tty, struct file *filp, 1931 + static int sx_ioctl(struct tty_struct *tty, 1932 1932 unsigned int cmd, unsigned long arg) 1933 1933 { 1934 1934 struct specialix_port *port = tty->driver_data;
drivers/char/specialix_io8.h drivers/staging/tty/specialix_io8.h
+4 -5
drivers/char/stallion.c drivers/staging/tty/stallion.c
··· 1094 1094 1095 1095 /*****************************************************************************/ 1096 1096 1097 - static int stl_tiocmget(struct tty_struct *tty, struct file *file) 1097 + static int stl_tiocmget(struct tty_struct *tty) 1098 1098 { 1099 1099 struct stlport *portp; 1100 1100 ··· 1107 1107 return stl_getsignals(portp); 1108 1108 } 1109 1109 1110 - static int stl_tiocmset(struct tty_struct *tty, struct file *file, 1110 + static int stl_tiocmset(struct tty_struct *tty, 1111 1111 unsigned int set, unsigned int clear) 1112 1112 { 1113 1113 struct stlport *portp; ··· 1132 1132 return 0; 1133 1133 } 1134 1134 1135 - static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) 1135 + static int stl_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) 1136 1136 { 1137 1137 struct stlport *portp; 1138 1138 int rc; 1139 1139 void __user *argp = (void __user *)arg; 1140 1140 1141 - pr_debug("stl_ioctl(tty=%p,file=%p,cmd=%x,arg=%lx)\n", tty, file, cmd, 1142 - arg); 1141 + pr_debug("stl_ioctl(tty=%p,cmd=%x,arg=%lx)\n", tty, cmd, arg); 1143 1142 1144 1143 portp = tty->driver_data; 1145 1144 if (portp == NULL)
+4 -4
drivers/char/sx.c drivers/staging/generic_serial/sx.c
··· 1873 1873 return 0; 1874 1874 } 1875 1875 1876 - static int sx_tiocmget(struct tty_struct *tty, struct file *file) 1876 + static int sx_tiocmget(struct tty_struct *tty) 1877 1877 { 1878 1878 struct sx_port *port = tty->driver_data; 1879 1879 return sx_getsignals(port); 1880 1880 } 1881 1881 1882 - static int sx_tiocmset(struct tty_struct *tty, struct file *file, 1883 - unsigned int set, unsigned int clear) 1882 + static int sx_tiocmset(struct tty_struct *tty, 1883 + unsigned int set, unsigned int clear) 1884 1884 { 1885 1885 struct sx_port *port = tty->driver_data; 1886 1886 int rts = -1, dtr = -1; ··· 1899 1899 return 0; 1900 1900 } 1901 1901 1902 - static int sx_ioctl(struct tty_struct *tty, struct file *filp, 1902 + static int sx_ioctl(struct tty_struct *tty, 1903 1903 unsigned int cmd, unsigned long arg) 1904 1904 { 1905 1905 int rc;
drivers/char/sx.h drivers/staging/generic_serial/sx.h
drivers/char/sxboards.h drivers/staging/generic_serial/sxboards.h
drivers/char/sxwindow.h drivers/staging/generic_serial/sxwindow.h
+6 -7
drivers/char/synclink.c drivers/tty/synclink.c
··· 823 823 /* 824 824 * ioctl call handlers 825 825 */ 826 - static int tiocmget(struct tty_struct *tty, struct file *file); 827 - static int tiocmset(struct tty_struct *tty, struct file *file, 826 + static int tiocmget(struct tty_struct *tty); 827 + static int tiocmset(struct tty_struct *tty, 828 828 unsigned int set, unsigned int clear); 829 829 static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount 830 830 __user *user_icount); ··· 2846 2846 2847 2847 /* return the state of the serial control and status signals 2848 2848 */ 2849 - static int tiocmget(struct tty_struct *tty, struct file *file) 2849 + static int tiocmget(struct tty_struct *tty) 2850 2850 { 2851 2851 struct mgsl_struct *info = tty->driver_data; 2852 2852 unsigned int result; ··· 2871 2871 2872 2872 /* set modem control signals (DTR/RTS) 2873 2873 */ 2874 - static int tiocmset(struct tty_struct *tty, struct file *file, 2875 - unsigned int set, unsigned int clear) 2874 + static int tiocmset(struct tty_struct *tty, 2875 + unsigned int set, unsigned int clear) 2876 2876 { 2877 2877 struct mgsl_struct *info = tty->driver_data; 2878 2878 unsigned long flags; ··· 2962 2962 * Arguments: 2963 2963 * 2964 2964 * tty pointer to tty instance data 2965 - * file pointer to associated file object for device 2966 2965 * cmd IOCTL command code 2967 2966 * arg command argument/context 2968 2967 * 2969 2968 * Return Value: 0 if success, otherwise error code 2970 2969 */ 2971 - static int mgsl_ioctl(struct tty_struct *tty, struct file * file, 2970 + static int mgsl_ioctl(struct tty_struct *tty, 2972 2971 unsigned int cmd, unsigned long arg) 2973 2972 { 2974 2973 struct mgsl_struct * info = tty->driver_data;
+8 -9
drivers/char/synclinkmp.c drivers/tty/synclinkmp.c
··· 520 520 static void tx_hold(struct tty_struct *tty); 521 521 static void tx_release(struct tty_struct *tty); 522 522 523 - static int ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg); 523 + static int ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg); 524 524 static int chars_in_buffer(struct tty_struct *tty); 525 525 static void throttle(struct tty_struct * tty); 526 526 static void unthrottle(struct tty_struct * tty); ··· 546 546 static int rx_enable(SLMP_INFO *info, int enable); 547 547 static int modem_input_wait(SLMP_INFO *info,int arg); 548 548 static int wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr); 549 - static int tiocmget(struct tty_struct *tty, struct file *file); 550 - static int tiocmset(struct tty_struct *tty, struct file *file, 551 - unsigned int set, unsigned int clear); 549 + static int tiocmget(struct tty_struct *tty); 550 + static int tiocmset(struct tty_struct *tty, 551 + unsigned int set, unsigned int clear); 552 552 static int set_break(struct tty_struct *tty, int break_state); 553 553 554 554 static void add_device(SLMP_INFO *info); ··· 1248 1248 * Arguments: 1249 1249 * 1250 1250 * tty pointer to tty instance data 1251 - * file pointer to associated file object for device 1252 1251 * cmd IOCTL command code 1253 1252 * arg command argument/context 1254 1253 * 1255 1254 * Return Value: 0 if success, otherwise error code 1256 1255 */ 1257 - static int ioctl(struct tty_struct *tty, struct file *file, 1256 + static int ioctl(struct tty_struct *tty, 1258 1257 unsigned int cmd, unsigned long arg) 1259 1258 { 1260 1259 SLMP_INFO *info = tty->driver_data; ··· 3206 3207 3207 3208 /* return the state of the serial control and status signals 3208 3209 */ 3209 - static int tiocmget(struct tty_struct *tty, struct file *file) 3210 + static int tiocmget(struct tty_struct *tty) 3210 3211 { 3211 3212 SLMP_INFO *info = tty->driver_data; 3212 3213 unsigned int result; ··· 3231 3232 3232 3233 /* set modem control signals (DTR/RTS) 3233 3234 */ 3234 - static int tiocmset(struct tty_struct *tty, struct file *file, 3235 - unsigned int set, unsigned int clear) 3235 + static int tiocmset(struct tty_struct *tty, 3236 + unsigned int set, unsigned int clear) 3236 3237 { 3237 3238 SLMP_INFO *info = tty->driver_data; 3238 3239 unsigned long flags;
+1 -1
drivers/char/ttyprintk.c
··· 144 144 /* 145 145 * TTY operations ioctl function. 146 146 */ 147 - static int tpk_ioctl(struct tty_struct *tty, struct file *file, 147 + static int tpk_ioctl(struct tty_struct *tty, 148 148 unsigned int cmd, unsigned long arg) 149 149 { 150 150 struct ttyprintk_port *tpkp = tty->driver_data;
+2 -2
drivers/char/vme_scc.c drivers/staging/generic_serial/vme_scc.c
··· 75 75 static void scc_close(void *ptr); 76 76 static int scc_chars_in_buffer(void * ptr); 77 77 static int scc_open(struct tty_struct * tty, struct file * filp); 78 - static int scc_ioctl(struct tty_struct * tty, struct file * filp, 78 + static int scc_ioctl(struct tty_struct * tty, 79 79 unsigned int cmd, unsigned long arg); 80 80 static void scc_throttle(struct tty_struct *tty); 81 81 static void scc_unthrottle(struct tty_struct *tty); ··· 1046 1046 } 1047 1047 1048 1048 1049 - static int scc_ioctl(struct tty_struct *tty, struct file *file, 1049 + static int scc_ioctl(struct tty_struct *tty, 1050 1050 unsigned int cmd, unsigned long arg) 1051 1051 { 1052 1052 return -ENOIOCTLCMD;
+2 -8
drivers/isdn/capi/capi.c
··· 1219 1219 return mp->outbytes; 1220 1220 } 1221 1221 1222 - static int capinc_tty_ioctl(struct tty_struct *tty, struct file * file, 1222 + static int capinc_tty_ioctl(struct tty_struct *tty, 1223 1223 unsigned int cmd, unsigned long arg) 1224 1224 { 1225 - int error = 0; 1226 - switch (cmd) { 1227 - default: 1228 - error = n_tty_ioctl_helper(tty, file, cmd, arg); 1229 - break; 1230 - } 1231 - return error; 1225 + return -ENOIOCTLCMD; 1232 1226 } 1233 1227 1234 1228 static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios * old)
+6 -6
drivers/isdn/gigaset/interface.c
··· 115 115 116 116 static int if_open(struct tty_struct *tty, struct file *filp); 117 117 static void if_close(struct tty_struct *tty, struct file *filp); 118 - static int if_ioctl(struct tty_struct *tty, struct file *file, 118 + static int if_ioctl(struct tty_struct *tty, 119 119 unsigned int cmd, unsigned long arg); 120 120 static int if_write_room(struct tty_struct *tty); 121 121 static int if_chars_in_buffer(struct tty_struct *tty); 122 122 static void if_throttle(struct tty_struct *tty); 123 123 static void if_unthrottle(struct tty_struct *tty); 124 124 static void if_set_termios(struct tty_struct *tty, struct ktermios *old); 125 - static int if_tiocmget(struct tty_struct *tty, struct file *file); 126 - static int if_tiocmset(struct tty_struct *tty, struct file *file, 125 + static int if_tiocmget(struct tty_struct *tty); 126 + static int if_tiocmset(struct tty_struct *tty, 127 127 unsigned int set, unsigned int clear); 128 128 static int if_write(struct tty_struct *tty, 129 129 const unsigned char *buf, int count); ··· 205 205 module_put(cs->driver->owner); 206 206 } 207 207 208 - static int if_ioctl(struct tty_struct *tty, struct file *file, 208 + static int if_ioctl(struct tty_struct *tty, 209 209 unsigned int cmd, unsigned long arg) 210 210 { 211 211 struct cardstate *cs; ··· 280 280 return retval; 281 281 } 282 282 283 - static int if_tiocmget(struct tty_struct *tty, struct file *file) 283 + static int if_tiocmget(struct tty_struct *tty) 284 284 { 285 285 struct cardstate *cs; 286 286 int retval; ··· 303 303 return retval; 304 304 } 305 305 306 - static int if_tiocmset(struct tty_struct *tty, struct file *file, 306 + static int if_tiocmset(struct tty_struct *tty, 307 307 unsigned int set, unsigned int clear) 308 308 { 309 309 struct cardstate *cs;
+1 -1
drivers/isdn/gigaset/ser-gigaset.c
··· 440 440 if (!set && !clear) 441 441 return 0; 442 442 gig_dbg(DEBUG_IF, "tiocmset set %x clear %x", set, clear); 443 - return tty->ops->tiocmset(tty, NULL, set, clear); 443 + return tty->ops->tiocmset(tty, set, clear); 444 444 } 445 445 446 446 static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
+3 -4
drivers/isdn/i4l/isdn_tty.c
··· 1345 1345 1346 1346 1347 1347 static int 1348 - isdn_tty_tiocmget(struct tty_struct *tty, struct file *file) 1348 + isdn_tty_tiocmget(struct tty_struct *tty) 1349 1349 { 1350 1350 modem_info *info = (modem_info *) tty->driver_data; 1351 1351 u_char control, status; ··· 1372 1372 } 1373 1373 1374 1374 static int 1375 - isdn_tty_tiocmset(struct tty_struct *tty, struct file *file, 1375 + isdn_tty_tiocmset(struct tty_struct *tty, 1376 1376 unsigned int set, unsigned int clear) 1377 1377 { 1378 1378 modem_info *info = (modem_info *) tty->driver_data; ··· 1413 1413 } 1414 1414 1415 1415 static int 1416 - isdn_tty_ioctl(struct tty_struct *tty, struct file *file, 1417 - uint cmd, ulong arg) 1416 + isdn_tty_ioctl(struct tty_struct *tty, uint cmd, ulong arg) 1418 1417 { 1419 1418 modem_info *info = (modem_info *) tty->driver_data; 1420 1419 int retval;
+20
drivers/misc/pch_phub.c
··· 27 27 #include <linux/mutex.h> 28 28 #include <linux/if_ether.h> 29 29 #include <linux/ctype.h> 30 + #include <linux/dmi.h> 30 31 31 32 #define PHUB_STATUS 0x00 /* Status Register offset */ 32 33 #define PHUB_CONTROL 0x04 /* Control Register offset */ ··· 47 46 #define PCH_MINOR_NOS 1 48 47 #define CLKCFG_CAN_50MHZ 0x12000000 49 48 #define CLKCFG_CANCLK_MASK 0xFF000000 49 + #define CLKCFG_UART_MASK 0xFFFFFF 50 + 51 + /* CM-iTC */ 52 + #define CLKCFG_UART_48MHZ (1 << 16) 53 + #define CLKCFG_BAUDDIV (2 << 20) 54 + #define CLKCFG_PLL2VCO (8 << 9) 55 + #define CLKCFG_UARTCLKSEL (1 << 18) 56 + 57 + /* Macros for ML7213 */ 58 + #define PCI_VENDOR_ID_ROHM 0x10db 59 + #define PCI_DEVICE_ID_ROHM_ML7213_PHUB 0x801A 50 60 51 61 /* Macros for ML7213 */ 52 62 #define PCI_VENDOR_ID_ROHM 0x10db ··· 629 617 (unsigned int)CLKCFG_REG_OFFSET, 630 618 CLKCFG_CAN_50MHZ, 631 619 CLKCFG_CANCLK_MASK); 620 + 621 + /* quirk for CM-iTC board */ 622 + if (strstr(dmi_get_system_info(DMI_BOARD_NAME), "CM-iTC")) 623 + pch_phub_read_modify_write_reg(chip, 624 + (unsigned int)CLKCFG_REG_OFFSET, 625 + CLKCFG_UART_48MHZ | CLKCFG_BAUDDIV | 626 + CLKCFG_PLL2VCO | CLKCFG_UARTCLKSEL, 627 + CLKCFG_UART_MASK); 632 628 633 629 /* set the prefech value */ 634 630 iowrite32(0x000affaa, chip->pch_phub_base_address + 0x14);
+2 -2
drivers/mmc/card/sdio_uart.c
··· 956 956 return 0; 957 957 } 958 958 959 - static int sdio_uart_tiocmget(struct tty_struct *tty, struct file *file) 959 + static int sdio_uart_tiocmget(struct tty_struct *tty) 960 960 { 961 961 struct sdio_uart_port *port = tty->driver_data; 962 962 int result; ··· 970 970 return result; 971 971 } 972 972 973 - static int sdio_uart_tiocmset(struct tty_struct *tty, struct file *file, 973 + static int sdio_uart_tiocmset(struct tty_struct *tty, 974 974 unsigned int set, unsigned int clear) 975 975 { 976 976 struct sdio_uart_port *port = tty->driver_data;
+1 -1
drivers/net/irda/irtty-sir.c
··· 167 167 * let's be careful... Jean II 168 168 */ 169 169 IRDA_ASSERT(priv->tty->ops->tiocmset != NULL, return -1;); 170 - priv->tty->ops->tiocmset(priv->tty, NULL, set, clear); 170 + priv->tty->ops->tiocmset(priv->tty, set, clear); 171 171 172 172 return 0; 173 173 }
+5 -5
drivers/net/usb/hso.c
··· 324 324 /* Prototypes */ 325 325 /*****************************************************************************/ 326 326 /* Serial driver functions */ 327 - static int hso_serial_tiocmset(struct tty_struct *tty, struct file *file, 327 + static int hso_serial_tiocmset(struct tty_struct *tty, 328 328 unsigned int set, unsigned int clear); 329 329 static void ctrl_callback(struct urb *urb); 330 330 static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial); ··· 1335 1335 1336 1336 /* done */ 1337 1337 if (result) 1338 - hso_serial_tiocmset(tty, NULL, TIOCM_RTS | TIOCM_DTR, 0); 1338 + hso_serial_tiocmset(tty, TIOCM_RTS | TIOCM_DTR, 0); 1339 1339 err_out: 1340 1340 mutex_unlock(&serial->parent->mutex); 1341 1341 return result; ··· 1656 1656 } 1657 1657 1658 1658 1659 - static int hso_serial_tiocmget(struct tty_struct *tty, struct file *file) 1659 + static int hso_serial_tiocmget(struct tty_struct *tty) 1660 1660 { 1661 1661 int retval; 1662 1662 struct hso_serial *serial = get_serial_by_tty(tty); ··· 1687 1687 return retval; 1688 1688 } 1689 1689 1690 - static int hso_serial_tiocmset(struct tty_struct *tty, struct file *file, 1690 + static int hso_serial_tiocmset(struct tty_struct *tty, 1691 1691 unsigned int set, unsigned int clear) 1692 1692 { 1693 1693 int val = 0; ··· 1730 1730 USB_CTRL_SET_TIMEOUT); 1731 1731 } 1732 1732 1733 - static int hso_serial_ioctl(struct tty_struct *tty, struct file *file, 1733 + static int hso_serial_ioctl(struct tty_struct *tty, 1734 1734 unsigned int cmd, unsigned long arg) 1735 1735 { 1736 1736 struct hso_serial *serial = get_serial_by_tty(tty);
+4 -5
drivers/net/wan/pc300_tty.c
··· 131 131 static void cpc_tty_signal_off(pc300dev_t *pc300dev, unsigned char); 132 132 static void cpc_tty_signal_on(pc300dev_t *pc300dev, unsigned char); 133 133 134 - static int pc300_tiocmset(struct tty_struct *, struct file *, 135 - unsigned int, unsigned int); 136 - static int pc300_tiocmget(struct tty_struct *, struct file *); 134 + static int pc300_tiocmset(struct tty_struct *, unsigned int, unsigned int); 135 + static int pc300_tiocmget(struct tty_struct *); 137 136 138 137 /* functions called by PC300 driver */ 139 138 void cpc_tty_init(pc300dev_t *dev); ··· 542 543 return 0; 543 544 } 544 545 545 - static int pc300_tiocmset(struct tty_struct *tty, struct file *file, 546 + static int pc300_tiocmset(struct tty_struct *tty, 546 547 unsigned int set, unsigned int clear) 547 548 { 548 549 st_cpc_tty_area *cpc_tty; ··· 569 570 return 0; 570 571 } 571 572 572 - static int pc300_tiocmget(struct tty_struct *tty, struct file *file) 573 + static int pc300_tiocmget(struct tty_struct *tty) 573 574 { 574 575 unsigned int result; 575 576 unsigned char status;
+1 -3
drivers/s390/char/keyboard.c
··· 455 455 return 0; 456 456 } 457 457 458 - int 459 - kbd_ioctl(struct kbd_data *kbd, struct file *file, 460 - unsigned int cmd, unsigned long arg) 458 + int kbd_ioctl(struct kbd_data *kbd, unsigned int cmd, unsigned long arg) 461 459 { 462 460 void __user *argp; 463 461 unsigned int ct;
+1 -1
drivers/s390/char/keyboard.h
··· 36 36 void kbd_ascebc(struct kbd_data *, unsigned char *); 37 37 38 38 void kbd_keycode(struct kbd_data *, unsigned int); 39 - int kbd_ioctl(struct kbd_data *, struct file *, unsigned int, unsigned long); 39 + int kbd_ioctl(struct kbd_data *, unsigned int, unsigned long); 40 40 41 41 /* 42 42 * Helper Functions.
+6 -8
drivers/s390/char/tty3270.c
··· 1718 1718 { 1719 1719 } 1720 1720 1721 - static int 1722 - tty3270_ioctl(struct tty_struct *tty, struct file *file, 1723 - unsigned int cmd, unsigned long arg) 1721 + static int tty3270_ioctl(struct tty_struct *tty, unsigned int cmd, 1722 + unsigned long arg) 1724 1723 { 1725 1724 struct tty3270 *tp; 1726 1725 ··· 1728 1729 return -ENODEV; 1729 1730 if (tty->flags & (1 << TTY_IO_ERROR)) 1730 1731 return -EIO; 1731 - return kbd_ioctl(tp->kbd, file, cmd, arg); 1732 + return kbd_ioctl(tp->kbd, cmd, arg); 1732 1733 } 1733 1734 1734 1735 #ifdef CONFIG_COMPAT 1735 - static long 1736 - tty3270_compat_ioctl(struct tty_struct *tty, struct file *file, 1737 - unsigned int cmd, unsigned long arg) 1736 + static long tty3270_compat_ioctl(struct tty_struct *tty, 1737 + unsigned int cmd, unsigned long arg) 1738 1738 { 1739 1739 struct tty3270 *tp; 1740 1740 ··· 1742 1744 return -ENODEV; 1743 1745 if (tty->flags & (1 << TTY_IO_ERROR)) 1744 1746 return -EIO; 1745 - return kbd_ioctl(tp->kbd, file, cmd, (unsigned long)compat_ptr(arg)); 1747 + return kbd_ioctl(tp->kbd, cmd, (unsigned long)compat_ptr(arg)); 1746 1748 } 1747 1749 #endif 1748 1750
+4
drivers/staging/Kconfig
··· 41 41 42 42 if !STAGING_EXCLUDE_BUILD 43 43 44 + source "drivers/staging/tty/Kconfig" 45 + 46 + source "drivers/staging/generic_serial/Kconfig" 47 + 44 48 source "drivers/staging/et131x/Kconfig" 45 49 46 50 source "drivers/staging/slicoss/Kconfig"
+2
drivers/staging/Makefile
··· 3 3 # fix for build system bug... 4 4 obj-$(CONFIG_STAGING) += staging.o 5 5 6 + obj-y += tty/ 7 + obj-y += generic_serial/ 6 8 obj-$(CONFIG_ET131X) += et131x/ 7 9 obj-$(CONFIG_SLICOSS) += slicoss/ 8 10 obj-$(CONFIG_VIDEO_GO7007) += go7007/
+45
drivers/staging/generic_serial/Kconfig
··· 1 + config A2232 2 + tristate "Commodore A2232 serial support (EXPERIMENTAL)" 3 + depends on EXPERIMENTAL && ZORRO && BROKEN 4 + ---help--- 5 + This option supports the 2232 7-port serial card shipped with the 6 + Amiga 2000 and other Zorro-bus machines, dating from 1989. At 7 + a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip 8 + each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The 9 + ports were connected with 8 pin DIN connectors on the card bracket, 10 + for which 8 pin to DB25 adapters were supplied. The card also had 11 + jumpers internally to toggle various pinning configurations. 12 + 13 + This driver can be built as a module; but then "generic_serial" 14 + will also be built as a module. This has to be loaded before 15 + "ser_a2232". If you want to do this, answer M here. 16 + 17 + config SX 18 + tristate "Specialix SX (and SI) card support" 19 + depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA) && BROKEN 20 + help 21 + This is a driver for the SX and SI multiport serial cards. 22 + Please read the file <file:Documentation/serial/sx.txt> for details. 23 + 24 + This driver can only be built as a module ( = code which can be 25 + inserted in and removed from the running kernel whenever you want). 26 + The module will be called sx. If you want to do that, say M here. 27 + 28 + config RIO 29 + tristate "Specialix RIO system support" 30 + depends on SERIAL_NONSTANDARD && BROKEN 31 + help 32 + This is a driver for the Specialix RIO, a smart serial card which 33 + drives an outboard box that can support up to 128 ports. Product 34 + information is at <http://www.perle.com/support/documentation.html#multiport>. 35 + There are both ISA and PCI versions. 36 + 37 + config RIO_OLDPCI 38 + bool "Support really old RIO/PCI cards" 39 + depends on RIO 40 + help 41 + Older RIO PCI cards need some initialization-time configuration to 42 + determine the IRQ and some control addresses. If you have a RIO and 43 + this doesn't seem to work, try setting this to Y. 44 + 45 +
+6
drivers/staging/generic_serial/Makefile
··· 1 + obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o 2 + obj-$(CONFIG_MVME162_SCC) += generic_serial.o vme_scc.o 3 + obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o 4 + obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o 5 + obj-$(CONFIG_SX) += sx.o generic_serial.o 6 + obj-$(CONFIG_RIO) += rio/ generic_serial.o
+6
drivers/staging/generic_serial/TODO
··· 1 + These are a few tty/serial drivers that either do not build, 2 + or work if they do build, or if they seem to work, are for obsolete 3 + hardware, or are full of unfixable races and no one uses them anymore. 4 + 5 + If no one steps up to adopt any of these drivers, they will be removed 6 + in the 2.6.41 release.
+3 -3
drivers/staging/quatech_usb2/quatech_usb2.c
··· 852 852 * TIOCMGET and TIOCMSET are filtered off to their own methods before they get 853 853 * here, so we don't have to handle them. 854 854 */ 855 - static int qt2_ioctl(struct tty_struct *tty, struct file *file, 855 + static int qt2_ioctl(struct tty_struct *tty, 856 856 unsigned int cmd, unsigned long arg) 857 857 { 858 858 struct usb_serial_port *port = tty->driver_data; ··· 1078 1078 } 1079 1079 } 1080 1080 1081 - static int qt2_tiocmget(struct tty_struct *tty, struct file *file) 1081 + static int qt2_tiocmget(struct tty_struct *tty) 1082 1082 { 1083 1083 struct usb_serial_port *port = tty->driver_data; 1084 1084 struct usb_serial *serial = port->serial; ··· 1121 1121 } 1122 1122 } 1123 1123 1124 - static int qt2_tiocmset(struct tty_struct *tty, struct file *file, 1124 + static int qt2_tiocmset(struct tty_struct *tty, 1125 1125 unsigned int set, unsigned int clear) 1126 1126 { 1127 1127 struct usb_serial_port *port = tty->driver_data;
+6 -7
drivers/staging/serqt_usb2/serqt_usb2.c
··· 1191 1191 1192 1192 } 1193 1193 1194 - static int qt_ioctl(struct tty_struct *tty, struct file *file, 1194 + static int qt_ioctl(struct tty_struct *tty, 1195 1195 unsigned int cmd, unsigned long arg) 1196 1196 { 1197 1197 struct usb_serial_port *port = tty->driver_data; ··· 1383 1383 1384 1384 static inline int qt_real_tiocmget(struct tty_struct *tty, 1385 1385 struct usb_serial_port *port, 1386 - struct file *file, struct usb_serial *serial) 1386 + struct usb_serial *serial) 1387 1387 { 1388 1388 1389 1389 u8 mcr; ··· 1425 1425 1426 1426 static inline int qt_real_tiocmset(struct tty_struct *tty, 1427 1427 struct usb_serial_port *port, 1428 - struct file *file, 1429 1428 struct usb_serial *serial, 1430 1429 unsigned int value) 1431 1430 { ··· 1461 1462 return 0; 1462 1463 } 1463 1464 1464 - static int qt_tiocmget(struct tty_struct *tty, struct file *file) 1465 + static int qt_tiocmget(struct tty_struct *tty) 1465 1466 { 1466 1467 struct usb_serial_port *port = tty->driver_data; 1467 1468 struct usb_serial *serial = get_usb_serial(port, __func__); ··· 1479 1480 dbg("%s - port %d\n", __func__, port->number); 1480 1481 dbg("%s - port->RxHolding = %d\n", __func__, qt_port->RxHolding); 1481 1482 1482 - retval = qt_real_tiocmget(tty, port, file, serial); 1483 + retval = qt_real_tiocmget(tty, port, serial); 1483 1484 1484 1485 spin_unlock_irqrestore(&qt_port->lock, flags); 1485 1486 return retval; 1486 1487 } 1487 1488 1488 - static int qt_tiocmset(struct tty_struct *tty, struct file *file, 1489 + static int qt_tiocmset(struct tty_struct *tty, 1489 1490 unsigned int set, unsigned int clear) 1490 1491 { 1491 1492 ··· 1505 1506 dbg("%s - port %d\n", __func__, port->number); 1506 1507 dbg("%s - qt_port->RxHolding = %d\n", __func__, qt_port->RxHolding); 1507 1508 1508 - retval = qt_real_tiocmset(tty, port, file, serial, set); 1509 + retval = qt_real_tiocmset(tty, port, serial, set); 1509 1510 1510 1511 spin_unlock_irqrestore(&qt_port->lock, flags); 1511 1512 return retval;
+87
drivers/staging/tty/Kconfig
··· 1 + config STALLION 2 + tristate "Stallion EasyIO or EC8/32 support" 3 + depends on STALDRV && (ISA || EISA || PCI) 4 + help 5 + If you have an EasyIO or EasyConnection 8/32 multiport Stallion 6 + card, then this is for you; say Y. Make sure to read 7 + <file:Documentation/serial/stallion.txt>. 8 + 9 + To compile this driver as a module, choose M here: the 10 + module will be called stallion. 11 + 12 + config ISTALLION 13 + tristate "Stallion EC8/64, ONboard, Brumby support" 14 + depends on STALDRV && (ISA || EISA || PCI) 15 + help 16 + If you have an EasyConnection 8/64, ONboard, Brumby or Stallion 17 + serial multiport card, say Y here. Make sure to read 18 + <file:Documentation/serial/stallion.txt>. 19 + 20 + To compile this driver as a module, choose M here: the 21 + module will be called istallion. 22 + 23 + config DIGIEPCA 24 + tristate "Digiboard Intelligent Async Support" 25 + depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI) 26 + ---help--- 27 + This is a driver for Digi International's Xx, Xeve, and Xem series 28 + of cards which provide multiple serial ports. You would need 29 + something like this to connect more than two modems to your Linux 30 + box, for instance in order to become a dial-in server. This driver 31 + supports the original PC (ISA) boards as well as PCI, and EISA. If 32 + you have a card like this, say Y here and read the file 33 + <file:Documentation/serial/digiepca.txt>. 34 + 35 + To compile this driver as a module, choose M here: the 36 + module will be called epca. 37 + 38 + config RISCOM8 39 + tristate "SDL RISCom/8 card support" 40 + depends on SERIAL_NONSTANDARD 41 + help 42 + This is a driver for the SDL Communications RISCom/8 multiport card, 43 + which gives you many serial ports. You would need something like 44 + this to connect more than two modems to your Linux box, for instance 45 + in order to become a dial-in server. If you have a card like that, 46 + say Y here and read the file <file:Documentation/serial/riscom8.txt>. 47 + 48 + Also it's possible to say M here and compile this driver as kernel 49 + loadable module; the module will be called riscom8. 50 + 51 + config SPECIALIX 52 + tristate "Specialix IO8+ card support" 53 + depends on SERIAL_NONSTANDARD 54 + help 55 + This is a driver for the Specialix IO8+ multiport card (both the 56 + ISA and the PCI version) which gives you many serial ports. You 57 + would need something like this to connect more than two modems to 58 + your Linux box, for instance in order to become a dial-in server. 59 + 60 + If you have a card like that, say Y here and read the file 61 + <file:Documentation/serial/specialix.txt>. Also it's possible to say 62 + M here and compile this driver as kernel loadable module which will be 63 + called specialix. 64 + 65 + config COMPUTONE 66 + tristate "Computone IntelliPort Plus serial support" 67 + depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI) 68 + ---help--- 69 + This driver supports the entire family of Intelliport II/Plus 70 + controllers with the exception of the MicroChannel controllers and 71 + products previous to the Intelliport II. These are multiport cards, 72 + which give you many serial ports. You would need something like this 73 + to connect more than two modems to your Linux box, for instance in 74 + order to become a dial-in server. If you have a card like that, say 75 + Y here and read <file:Documentation/serial/computone.txt>. 76 + 77 + To compile this driver as module, choose M here: the 78 + module will be called ip2. 79 + 80 + config SERIAL167 81 + bool "CD2401 support for MVME166/7 serial ports" 82 + depends on MVME16x 83 + help 84 + This is the driver for the serial ports on the Motorola MVME166, 85 + 167, and 172 boards. Everyone using one of these boards should say 86 + Y here. 87 +
+7
drivers/staging/tty/Makefile
··· 1 + obj-$(CONFIG_STALLION) += stallion.o 2 + obj-$(CONFIG_ISTALLION) += istallion.o 3 + obj-$(CONFIG_DIGIEPCA) += epca.o 4 + obj-$(CONFIG_SERIAL167) += serial167.o 5 + obj-$(CONFIG_SPECIALIX) += specialix.o 6 + obj-$(CONFIG_RISCOM8) += riscom8.o 7 + obj-$(CONFIG_COMPUTONE) += ip2/
+6
drivers/staging/tty/TODO
··· 1 + These are a few tty/serial drivers that either do not build, 2 + or work if they do build, or if they seem to work, are for obsolete 3 + hardware, or are full of unfixable races and no one uses them anymore. 4 + 5 + If no one steps up to adopt any of these drivers, they will be removed 6 + in the 2.6.41 release.
+321
drivers/tty/Kconfig
··· 1 + config VT 2 + bool "Virtual terminal" if EXPERT 3 + depends on !S390 4 + select INPUT 5 + default y 6 + ---help--- 7 + If you say Y here, you will get support for terminal devices with 8 + display and keyboard devices. These are called "virtual" because you 9 + can run several virtual terminals (also called virtual consoles) on 10 + one physical terminal. This is rather useful, for example one 11 + virtual terminal can collect system messages and warnings, another 12 + one can be used for a text-mode user session, and a third could run 13 + an X session, all in parallel. Switching between virtual terminals 14 + is done with certain key combinations, usually Alt-<function key>. 15 + 16 + The setterm command ("man setterm") can be used to change the 17 + properties (such as colors or beeping) of a virtual terminal. The 18 + man page console_codes(4) ("man console_codes") contains the special 19 + character sequences that can be used to change those properties 20 + directly. The fonts used on virtual terminals can be changed with 21 + the setfont ("man setfont") command and the key bindings are defined 22 + with the loadkeys ("man loadkeys") command. 23 + 24 + You need at least one virtual terminal device in order to make use 25 + of your keyboard and monitor. Therefore, only people configuring an 26 + embedded system would want to say N here in order to save some 27 + memory; the only way to log into such a system is then via a serial 28 + or network connection. 29 + 30 + If unsure, say Y, or else you won't be able to do much with your new 31 + shiny Linux system :-) 32 + 33 + config CONSOLE_TRANSLATIONS 34 + depends on VT 35 + default y 36 + bool "Enable character translations in console" if EXPERT 37 + ---help--- 38 + This enables support for font mapping and Unicode translation 39 + on virtual consoles. 40 + 41 + config VT_CONSOLE 42 + bool "Support for console on virtual terminal" if EXPERT 43 + depends on VT 44 + default y 45 + ---help--- 46 + The system console is the device which receives all kernel messages 47 + and warnings and which allows logins in single user mode. If you 48 + answer Y here, a virtual terminal (the device used to interact with 49 + a physical terminal) can be used as system console. This is the most 50 + common mode of operations, so you should say Y here unless you want 51 + the kernel messages be output only to a serial port (in which case 52 + you should say Y to "Console on serial port", below). 53 + 54 + If you do say Y here, by default the currently visible virtual 55 + terminal (/dev/tty0) will be used as system console. You can change 56 + that with a kernel command line option such as "console=tty3" which 57 + would use the third virtual terminal as system console. (Try "man 58 + bootparam" or see the documentation of your boot loader (lilo or 59 + loadlin) about how to pass options to the kernel at boot time.) 60 + 61 + If unsure, say Y. 62 + 63 + config HW_CONSOLE 64 + bool 65 + depends on VT && !S390 && !UML 66 + default y 67 + 68 + config VT_HW_CONSOLE_BINDING 69 + bool "Support for binding and unbinding console drivers" 70 + depends on HW_CONSOLE 71 + default n 72 + ---help--- 73 + The virtual terminal is the device that interacts with the physical 74 + terminal through console drivers. On these systems, at least one 75 + console driver is loaded. In other configurations, additional console 76 + drivers may be enabled, such as the framebuffer console. If more than 77 + 1 console driver is enabled, setting this to 'y' will allow you to 78 + select the console driver that will serve as the backend for the 79 + virtual terminals. 80 + 81 + See <file:Documentation/console/console.txt> for more 82 + information. For framebuffer console users, please refer to 83 + <file:Documentation/fb/fbcon.txt>. 84 + 85 + config UNIX98_PTYS 86 + bool "Unix98 PTY support" if EXPERT 87 + default y 88 + ---help--- 89 + A pseudo terminal (PTY) is a software device consisting of two 90 + halves: a master and a slave. The slave device behaves identical to 91 + a physical terminal; the master device is used by a process to 92 + read data from and write data to the slave, thereby emulating a 93 + terminal. Typical programs for the master side are telnet servers 94 + and xterms. 95 + 96 + Linux has traditionally used the BSD-like names /dev/ptyxx for 97 + masters and /dev/ttyxx for slaves of pseudo terminals. This scheme 98 + has a number of problems. The GNU C library glibc 2.1 and later, 99 + however, supports the Unix98 naming standard: in order to acquire a 100 + pseudo terminal, a process opens /dev/ptmx; the number of the pseudo 101 + terminal is then made available to the process and the pseudo 102 + terminal slave can be accessed as /dev/pts/<number>. What was 103 + traditionally /dev/ttyp2 will then be /dev/pts/2, for example. 104 + 105 + All modern Linux systems use the Unix98 ptys. Say Y unless 106 + you're on an embedded system and want to conserve memory. 107 + 108 + config DEVPTS_MULTIPLE_INSTANCES 109 + bool "Support multiple instances of devpts" 110 + depends on UNIX98_PTYS 111 + default n 112 + ---help--- 113 + Enable support for multiple instances of devpts filesystem. 114 + If you want to have isolated PTY namespaces (eg: in containers), 115 + say Y here. Otherwise, say N. If enabled, each mount of devpts 116 + filesystem with the '-o newinstance' option will create an 117 + independent PTY namespace. 118 + 119 + config LEGACY_PTYS 120 + bool "Legacy (BSD) PTY support" 121 + default y 122 + ---help--- 123 + A pseudo terminal (PTY) is a software device consisting of two 124 + halves: a master and a slave. The slave device behaves identical to 125 + a physical terminal; the master device is used by a process to 126 + read data from and write data to the slave, thereby emulating a 127 + terminal. Typical programs for the master side are telnet servers 128 + and xterms. 129 + 130 + Linux has traditionally used the BSD-like names /dev/ptyxx 131 + for masters and /dev/ttyxx for slaves of pseudo 132 + terminals. This scheme has a number of problems, including 133 + security. This option enables these legacy devices; on most 134 + systems, it is safe to say N. 135 + 136 + 137 + config LEGACY_PTY_COUNT 138 + int "Maximum number of legacy PTY in use" 139 + depends on LEGACY_PTYS 140 + range 0 256 141 + default "256" 142 + ---help--- 143 + The maximum number of legacy PTYs that can be used at any one time. 144 + The default is 256, and should be more than enough. Embedded 145 + systems may want to reduce this to save memory. 146 + 147 + When not in use, each legacy PTY occupies 12 bytes on 32-bit 148 + architectures and 24 bytes on 64-bit architectures. 149 + 150 + config BFIN_JTAG_COMM 151 + tristate "Blackfin JTAG Communication" 152 + depends on BLACKFIN 153 + help 154 + Add support for emulating a TTY device over the Blackfin JTAG. 155 + 156 + To compile this driver as a module, choose M here: the 157 + module will be called bfin_jtag_comm. 158 + 159 + config BFIN_JTAG_COMM_CONSOLE 160 + bool "Console on Blackfin JTAG" 161 + depends on BFIN_JTAG_COMM=y 162 + 163 + config SERIAL_NONSTANDARD 164 + bool "Non-standard serial port support" 165 + depends on HAS_IOMEM 166 + ---help--- 167 + Say Y here if you have any non-standard serial boards -- boards 168 + which aren't supported using the standard "dumb" serial driver. 169 + This includes intelligent serial boards such as Cyclades, 170 + Digiboards, etc. These are usually used for systems that need many 171 + serial ports because they serve many terminals or dial-in 172 + connections. 173 + 174 + Note that the answer to this question won't directly affect the 175 + kernel: saying N will just cause the configurator to skip all 176 + the questions about non-standard serial boards. 177 + 178 + Most people can say N here. 179 + 180 + config ROCKETPORT 181 + tristate "Comtrol RocketPort support" 182 + depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI) 183 + help 184 + This driver supports Comtrol RocketPort and RocketModem PCI boards. 185 + These boards provide 2, 4, 8, 16, or 32 high-speed serial ports or 186 + modems. For information about the RocketPort/RocketModem boards 187 + and this driver read <file:Documentation/serial/rocket.txt>. 188 + 189 + To compile this driver as a module, choose M here: the 190 + module will be called rocket. 191 + 192 + If you want to compile this driver into the kernel, say Y here. If 193 + you don't have a Comtrol RocketPort/RocketModem card installed, say N. 194 + 195 + config CYCLADES 196 + tristate "Cyclades async mux support" 197 + depends on SERIAL_NONSTANDARD && (PCI || ISA) 198 + select FW_LOADER 199 + ---help--- 200 + This driver supports Cyclades Z and Y multiserial boards. 201 + You would need something like this to connect more than two modems to 202 + your Linux box, for instance in order to become a dial-in server. 203 + 204 + For information about the Cyclades-Z card, read 205 + <file:Documentation/serial/README.cycladesZ>. 206 + 207 + To compile this driver as a module, choose M here: the 208 + module will be called cyclades. 209 + 210 + If you haven't heard about it, it's safe to say N. 211 + 212 + config CYZ_INTR 213 + bool "Cyclades-Z interrupt mode operation (EXPERIMENTAL)" 214 + depends on EXPERIMENTAL && CYCLADES 215 + help 216 + The Cyclades-Z family of multiport cards allows 2 (two) driver op 217 + modes: polling and interrupt. In polling mode, the driver will check 218 + the status of the Cyclades-Z ports every certain amount of time 219 + (which is called polling cycle and is configurable). In interrupt 220 + mode, it will use an interrupt line (IRQ) in order to check the 221 + status of the Cyclades-Z ports. The default op mode is polling. If 222 + unsure, say N. 223 + 224 + config MOXA_INTELLIO 225 + tristate "Moxa Intellio support" 226 + depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI) 227 + select FW_LOADER 228 + help 229 + Say Y here if you have a Moxa Intellio multiport serial card. 230 + 231 + To compile this driver as a module, choose M here: the 232 + module will be called moxa. 233 + 234 + config MOXA_SMARTIO 235 + tristate "Moxa SmartIO support v. 2.0" 236 + depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA) 237 + help 238 + Say Y here if you have a Moxa SmartIO multiport serial card and/or 239 + want to help develop a new version of this driver. 240 + 241 + This is upgraded (1.9.1) driver from original Moxa drivers with 242 + changes finally resulting in PCI probing. 243 + 244 + This driver can also be built as a module. The module will be called 245 + mxser. If you want to do that, say M here. 246 + 247 + config SYNCLINK 248 + tristate "Microgate SyncLink card support" 249 + depends on SERIAL_NONSTANDARD && PCI && ISA_DMA_API 250 + help 251 + Provides support for the SyncLink ISA and PCI multiprotocol serial 252 + adapters. These adapters support asynchronous and HDLC bit 253 + synchronous communication up to 10Mbps (PCI adapter). 254 + 255 + This driver can only be built as a module ( = code which can be 256 + inserted in and removed from the running kernel whenever you want). 257 + The module will be called synclink. If you want to do that, say M 258 + here. 259 + 260 + config SYNCLINKMP 261 + tristate "SyncLink Multiport support" 262 + depends on SERIAL_NONSTANDARD && PCI 263 + help 264 + Enable support for the SyncLink Multiport (2 or 4 ports) 265 + serial adapter, running asynchronous and HDLC communications up 266 + to 2.048Mbps. Each ports is independently selectable for 267 + RS-232, V.35, RS-449, RS-530, and X.21 268 + 269 + This driver may be built as a module ( = code which can be 270 + inserted in and removed from the running kernel whenever you want). 271 + The module will be called synclinkmp. If you want to do that, say M 272 + here. 273 + 274 + config SYNCLINK_GT 275 + tristate "SyncLink GT/AC support" 276 + depends on SERIAL_NONSTANDARD && PCI 277 + help 278 + Support for SyncLink GT and SyncLink AC families of 279 + synchronous and asynchronous serial adapters 280 + manufactured by Microgate Systems, Ltd. (www.microgate.com) 281 + 282 + config NOZOMI 283 + tristate "HSDPA Broadband Wireless Data Card - Globe Trotter" 284 + depends on PCI && EXPERIMENTAL 285 + help 286 + If you have a HSDPA driver Broadband Wireless Data Card - 287 + Globe Trotter PCMCIA card, say Y here. 288 + 289 + To compile this driver as a module, choose M here, the module 290 + will be called nozomi. 291 + 292 + config ISI 293 + tristate "Multi-Tech multiport card support (EXPERIMENTAL)" 294 + depends on SERIAL_NONSTANDARD && PCI 295 + select FW_LOADER 296 + help 297 + This is a driver for the Multi-Tech cards which provide several 298 + serial ports. The driver is experimental and can currently only be 299 + built as a module. The module will be called isicom. 300 + If you want to do that, choose M here. 301 + 302 + config N_HDLC 303 + tristate "HDLC line discipline support" 304 + depends on SERIAL_NONSTANDARD 305 + help 306 + Allows synchronous HDLC communications with tty device drivers that 307 + support synchronous HDLC such as the Microgate SyncLink adapter. 308 + 309 + This driver can be built as a module ( = code which can be 310 + inserted in and removed from the running kernel whenever you want). 311 + The module will be called n_hdlc. If you want to do that, say M 312 + here. 313 + 314 + config N_GSM 315 + tristate "GSM MUX line discipline support (EXPERIMENTAL)" 316 + depends on EXPERIMENTAL 317 + depends on NET 318 + help 319 + This line discipline provides support for the GSM MUX protocol and 320 + presents the mux as a set of 61 individual tty devices. 321 +
+15
drivers/tty/Makefile
··· 11 11 obj-y += vt/ 12 12 obj-$(CONFIG_HVC_DRIVER) += hvc/ 13 13 obj-y += serial/ 14 + 15 + # tty drivers 16 + obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o 17 + obj-$(CONFIG_BFIN_JTAG_COMM) += bfin_jtag_comm.o 18 + obj-$(CONFIG_CYCLADES) += cyclades.o 19 + obj-$(CONFIG_ISI) += isicom.o 20 + obj-$(CONFIG_MOXA_INTELLIO) += moxa.o 21 + obj-$(CONFIG_MOXA_SMARTIO) += mxser.o 22 + obj-$(CONFIG_NOZOMI) += nozomi.o 23 + obj-$(CONFIG_ROCKETPORT) += rocket.o 24 + obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o 25 + obj-$(CONFIG_SYNCLINKMP) += synclinkmp.o 26 + obj-$(CONFIG_SYNCLINK) += synclink.o 27 + 28 + obj-y += ipwireless/
+105
drivers/tty/hvc/Kconfig
··· 1 + config HVC_DRIVER 2 + bool 3 + help 4 + Generic "hypervisor virtual console" infrastructure for various 5 + hypervisors (pSeries, iSeries, Xen, lguest). 6 + It will automatically be selected if one of the back-end console drivers 7 + is selected. 8 + 9 + config HVC_IRQ 10 + bool 11 + 12 + config HVC_CONSOLE 13 + bool "pSeries Hypervisor Virtual Console support" 14 + depends on PPC_PSERIES 15 + select HVC_DRIVER 16 + select HVC_IRQ 17 + help 18 + pSeries machines when partitioned support a hypervisor virtual 19 + console. This driver allows each pSeries partition to have a console 20 + which is accessed via the HMC. 21 + 22 + config HVC_ISERIES 23 + bool "iSeries Hypervisor Virtual Console support" 24 + depends on PPC_ISERIES 25 + default y 26 + select HVC_DRIVER 27 + select HVC_IRQ 28 + select VIOPATH 29 + help 30 + iSeries machines support a hypervisor virtual console. 31 + 32 + config HVC_RTAS 33 + bool "IBM RTAS Console support" 34 + depends on PPC_RTAS 35 + select HVC_DRIVER 36 + help 37 + IBM Console device driver which makes use of RTAS 38 + 39 + config HVC_BEAT 40 + bool "Toshiba's Beat Hypervisor Console support" 41 + depends on PPC_CELLEB 42 + select HVC_DRIVER 43 + help 44 + Toshiba's Cell Reference Set Beat Console device driver 45 + 46 + config HVC_IUCV 47 + bool "z/VM IUCV Hypervisor console support (VM only)" 48 + depends on S390 49 + select HVC_DRIVER 50 + select IUCV 51 + default y 52 + help 53 + This driver provides a Hypervisor console (HVC) back-end to access 54 + a Linux (console) terminal via a z/VM IUCV communication path. 55 + 56 + config HVC_XEN 57 + bool "Xen Hypervisor Console support" 58 + depends on XEN 59 + select HVC_DRIVER 60 + select HVC_IRQ 61 + default y 62 + help 63 + Xen virtual console device driver 64 + 65 + config HVC_UDBG 66 + bool "udbg based fake hypervisor console" 67 + depends on PPC && EXPERIMENTAL 68 + select HVC_DRIVER 69 + default n 70 + 71 + config HVC_DCC 72 + bool "ARM JTAG DCC console" 73 + depends on ARM 74 + select HVC_DRIVER 75 + help 76 + This console uses the JTAG DCC on ARM to create a console under the HVC 77 + driver. This console is used through a JTAG only on ARM. If you don't have 78 + a JTAG then you probably don't want this option. 79 + 80 + config HVC_BFIN_JTAG 81 + bool "Blackfin JTAG console" 82 + depends on BLACKFIN 83 + select HVC_DRIVER 84 + help 85 + This console uses the Blackfin JTAG to create a console under the 86 + the HVC driver. If you don't have JTAG, then you probably don't 87 + want this option. 88 + 89 + config HVCS 90 + tristate "IBM Hypervisor Virtual Console Server support" 91 + depends on PPC_PSERIES && HVC_CONSOLE 92 + help 93 + Partitionable IBM Power5 ppc64 machines allow hosting of 94 + firmware virtual consoles from one Linux partition by 95 + another Linux partition. This driver allows console data 96 + from Linux partitions to be accessed through TTY device 97 + interfaces in the device tree of a Linux partition running 98 + this driver. 99 + 100 + To compile this driver as a module, choose M here: the 101 + module will be called hvcs. Additionally, this module 102 + will depend on arch specific APIs exported from hvcserver.ko 103 + which will also be compiled when this driver is built as a 104 + module. 105 +
+1
drivers/tty/hvc/Makefile
··· 9 9 obj-$(CONFIG_HVC_XEN) += hvc_xen.o 10 10 obj-$(CONFIG_HVC_IUCV) += hvc_iucv.o 11 11 obj-$(CONFIG_HVC_UDBG) += hvc_udbg.o 12 + obj-$(CONFIG_HVC_BFIN_JTAG) += hvc_bfin_jtag.o 12 13 obj-$(CONFIG_HVCS) += hvcs.o
+105
drivers/tty/hvc/hvc_bfin_jtag.c
··· 1 + /* 2 + * Console via Blackfin JTAG Communication 3 + * 4 + * Copyright 2008-2011 Analog Devices Inc. 5 + * 6 + * Enter bugs at http://blackfin.uclinux.org/ 7 + * 8 + * Licensed under the GPL-2 or later. 9 + */ 10 + 11 + #include <linux/console.h> 12 + #include <linux/delay.h> 13 + #include <linux/err.h> 14 + #include <linux/init.h> 15 + #include <linux/moduleparam.h> 16 + #include <linux/types.h> 17 + 18 + #include "hvc_console.h" 19 + 20 + /* See the Debug/Emulation chapter in the HRM */ 21 + #define EMUDOF 0x00000001 /* EMUDAT_OUT full & valid */ 22 + #define EMUDIF 0x00000002 /* EMUDAT_IN full & valid */ 23 + #define EMUDOOVF 0x00000004 /* EMUDAT_OUT overflow */ 24 + #define EMUDIOVF 0x00000008 /* EMUDAT_IN overflow */ 25 + 26 + /* Helper functions to glue the register API to simple C operations */ 27 + static inline uint32_t bfin_write_emudat(uint32_t emudat) 28 + { 29 + __asm__ __volatile__("emudat = %0;" : : "d"(emudat)); 30 + return emudat; 31 + } 32 + 33 + static inline uint32_t bfin_read_emudat(void) 34 + { 35 + uint32_t emudat; 36 + __asm__ __volatile__("%0 = emudat;" : "=d"(emudat)); 37 + return emudat; 38 + } 39 + 40 + /* Send data to the host */ 41 + static int hvc_bfin_put_chars(uint32_t vt, const char *buf, int count) 42 + { 43 + static uint32_t outbound_len; 44 + uint32_t emudat; 45 + int ret; 46 + 47 + if (bfin_read_DBGSTAT() & EMUDOF) 48 + return 0; 49 + 50 + if (!outbound_len) { 51 + outbound_len = count; 52 + bfin_write_emudat(outbound_len); 53 + return 0; 54 + } 55 + 56 + ret = min(outbound_len, (uint32_t)4); 57 + memcpy(&emudat, buf, ret); 58 + bfin_write_emudat(emudat); 59 + outbound_len -= ret; 60 + 61 + return ret; 62 + } 63 + 64 + /* Receive data from the host */ 65 + static int hvc_bfin_get_chars(uint32_t vt, char *buf, int count) 66 + { 67 + static uint32_t inbound_len; 68 + uint32_t emudat; 69 + int ret; 70 + 71 + if (!(bfin_read_DBGSTAT() & EMUDIF)) 72 + return 0; 73 + emudat = bfin_read_emudat(); 74 + 75 + if (!inbound_len) { 76 + inbound_len = emudat; 77 + return 0; 78 + } 79 + 80 + ret = min(inbound_len, (uint32_t)4); 81 + memcpy(buf, &emudat, ret); 82 + inbound_len -= ret; 83 + 84 + return ret; 85 + } 86 + 87 + /* Glue the HVC layers to the Blackfin layers */ 88 + static const struct hv_ops hvc_bfin_get_put_ops = { 89 + .get_chars = hvc_bfin_get_chars, 90 + .put_chars = hvc_bfin_put_chars, 91 + }; 92 + 93 + static int __init hvc_bfin_console_init(void) 94 + { 95 + hvc_instantiate(0, 0, &hvc_bfin_get_put_ops); 96 + return 0; 97 + } 98 + console_initcall(hvc_bfin_console_init); 99 + 100 + static int __init hvc_bfin_init(void) 101 + { 102 + hvc_alloc(0, 0, &hvc_bfin_get_put_ops, 128); 103 + return 0; 104 + } 105 + device_initcall(hvc_bfin_init);
+7 -36
drivers/tty/hvc/hvc_dcc.c
··· 33 33 static inline u32 __dcc_getstatus(void) 34 34 { 35 35 u32 __ret; 36 - 37 - asm("mrc p14, 0, %0, c0, c1, 0 @ read comms ctrl reg" 36 + asm volatile("mrc p14, 0, %0, c0, c1, 0 @ read comms ctrl reg" 38 37 : "=r" (__ret) : : "cc"); 39 38 40 39 return __ret; 41 40 } 42 41 43 42 44 - #if defined(CONFIG_CPU_V7) 45 43 static inline char __dcc_getchar(void) 46 44 { 47 45 char __c; 48 46 49 - asm("get_wait: mrc p14, 0, pc, c0, c1, 0 \n\ 50 - bne get_wait \n\ 51 - mrc p14, 0, %0, c0, c5, 0 @ read comms data reg" 52 - : "=r" (__c) : : "cc"); 53 - 54 - return __c; 55 - } 56 - #else 57 - static inline char __dcc_getchar(void) 58 - { 59 - char __c; 60 - 61 - asm("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg" 47 + asm volatile("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg" 62 48 : "=r" (__c)); 63 49 64 50 return __c; 65 51 } 66 - #endif 67 52 68 - #if defined(CONFIG_CPU_V7) 69 53 static inline void __dcc_putchar(char c) 70 54 { 71 - asm("put_wait: mrc p14, 0, pc, c0, c1, 0 \n\ 72 - bcs put_wait \n\ 73 - mcr p14, 0, %0, c0, c5, 0 " 74 - : : "r" (c) : "cc"); 75 - } 76 - #else 77 - static inline void __dcc_putchar(char c) 78 - { 79 - asm("mcr p14, 0, %0, c0, c5, 0 @ write a char" 55 + asm volatile("mcr p14, 0, %0, c0, c5, 0 @ write a char" 80 56 : /* no output register */ 81 57 : "r" (c)); 82 58 } 83 - #endif 84 59 85 60 static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count) 86 61 { ··· 65 90 while (__dcc_getstatus() & DCC_STATUS_TX) 66 91 cpu_relax(); 67 92 68 - __dcc_putchar((char)(buf[i] & 0xFF)); 93 + __dcc_putchar(buf[i]); 69 94 } 70 95 71 96 return count; ··· 75 100 { 76 101 int i; 77 102 78 - for (i = 0; i < count; ++i) { 79 - int c = -1; 80 - 103 + for (i = 0; i < count; ++i) 81 104 if (__dcc_getstatus() & DCC_STATUS_RX) 82 - c = __dcc_getchar(); 83 - if (c < 0) 105 + buf[i] = __dcc_getchar(); 106 + else 84 107 break; 85 - buf[i] = c; 86 - } 87 108 88 109 return i; 89 110 }
+3 -3
drivers/tty/hvc/hvsi.c
··· 1095 1095 h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE); 1096 1096 } 1097 1097 1098 - static int hvsi_tiocmget(struct tty_struct *tty, struct file *file) 1098 + static int hvsi_tiocmget(struct tty_struct *tty) 1099 1099 { 1100 1100 struct hvsi_struct *hp = tty->driver_data; 1101 1101 ··· 1103 1103 return hp->mctrl; 1104 1104 } 1105 1105 1106 - static int hvsi_tiocmset(struct tty_struct *tty, struct file *file, 1107 - unsigned int set, unsigned int clear) 1106 + static int hvsi_tiocmset(struct tty_struct *tty, 1107 + unsigned int set, unsigned int clear) 1108 1108 { 1109 1109 struct hvsi_struct *hp = tty->driver_data; 1110 1110 unsigned long flags;
+4 -5
drivers/tty/n_gsm.c
··· 1250 1250 1251 1251 static void gsm_control_transmit(struct gsm_mux *gsm, struct gsm_control *ctrl) 1252 1252 { 1253 - struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 1, 1254 - gsm->ftype|PF); 1253 + struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 1, gsm->ftype); 1255 1254 if (msg == NULL) 1256 1255 return; 1257 1256 msg->data[0] = (ctrl->cmd << 1) | 2 | EA; /* command */ ··· 2648 2649 to do here */ 2649 2650 } 2650 2651 2651 - static int gsmtty_tiocmget(struct tty_struct *tty, struct file *filp) 2652 + static int gsmtty_tiocmget(struct tty_struct *tty) 2652 2653 { 2653 2654 struct gsm_dlci *dlci = tty->driver_data; 2654 2655 return dlci->modem_rx; 2655 2656 } 2656 2657 2657 - static int gsmtty_tiocmset(struct tty_struct *tty, struct file *filp, 2658 + static int gsmtty_tiocmset(struct tty_struct *tty, 2658 2659 unsigned int set, unsigned int clear) 2659 2660 { 2660 2661 struct gsm_dlci *dlci = tty->driver_data; ··· 2671 2672 } 2672 2673 2673 2674 2674 - static int gsmtty_ioctl(struct tty_struct *tty, struct file *filp, 2675 + static int gsmtty_ioctl(struct tty_struct *tty, 2675 2676 unsigned int cmd, unsigned long arg) 2676 2677 { 2677 2678 return -ENOIOCTLCMD;
+2 -2
drivers/tty/pty.c
··· 334 334 return -ENOMEM; 335 335 } 336 336 337 - static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file, 337 + static int pty_bsd_ioctl(struct tty_struct *tty, 338 338 unsigned int cmd, unsigned long arg) 339 339 { 340 340 switch (cmd) { ··· 489 489 }; 490 490 491 491 492 - static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file, 492 + static int pty_unix98_ioctl(struct tty_struct *tty, 493 493 unsigned int cmd, unsigned long arg) 494 494 { 495 495 switch (cmd) {
+1 -24
drivers/tty/serial/68328serial.c
··· 393 393 #endif 394 394 } 395 395 396 - /* 397 - * This routine is called from the scheduler tqueue when the interrupt 398 - * routine has signalled that a hangup has occurred. The path of 399 - * hangup processing is: 400 - * 401 - * serial interrupt routine -> (scheduler tqueue) -> 402 - * do_serial_hangup() -> tty->hangup() -> rs_hangup() 403 - * 404 - */ 405 - static void do_serial_hangup(struct work_struct *work) 406 - { 407 - struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup); 408 - struct tty_struct *tty; 409 - 410 - tty = info->tty; 411 - if (!tty) 412 - return; 413 - 414 - tty_hangup(tty); 415 - } 416 - 417 - 418 396 static int startup(struct m68k_serial * info) 419 397 { 420 398 m68328_uart *uart = &uart_addr[info->line]; ··· 945 967 local_irq_restore(flags); 946 968 } 947 969 948 - static int rs_ioctl(struct tty_struct *tty, struct file * file, 970 + static int rs_ioctl(struct tty_struct *tty, 949 971 unsigned int cmd, unsigned long arg) 950 972 { 951 973 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data; ··· 1325 1347 info->count = 0; 1326 1348 info->blocked_open = 0; 1327 1349 INIT_WORK(&info->tqueue, do_softint); 1328 - INIT_WORK(&info->tqueue_hangup, do_serial_hangup); 1329 1350 init_waitqueue_head(&info->open_wait); 1330 1351 init_waitqueue_head(&info->close_wait); 1331 1352 info->line = i;
-1
drivers/tty/serial/68328serial.h
··· 159 159 int xmit_tail; 160 160 int xmit_cnt; 161 161 struct work_struct tqueue; 162 - struct work_struct tqueue_hangup; 163 162 wait_queue_head_t open_wait; 164 163 wait_queue_head_t close_wait; 165 164 };
+3 -3
drivers/tty/serial/68360serial.c
··· 1240 1240 } 1241 1241 #endif 1242 1242 1243 - static int rs_360_tiocmget(struct tty_struct *tty, struct file *file) 1243 + static int rs_360_tiocmget(struct tty_struct *tty) 1244 1244 { 1245 1245 ser_info_t *info = (ser_info_t *)tty->driver_data; 1246 1246 unsigned int result = 0; ··· 1271 1271 return result; 1272 1272 } 1273 1273 1274 - static int rs_360_tiocmset(struct tty_struct *tty, struct file *file, 1274 + static int rs_360_tiocmset(struct tty_struct *tty, 1275 1275 unsigned int set, unsigned int clear) 1276 1276 { 1277 1277 #ifdef modem_control ··· 1405 1405 return 0; 1406 1406 } 1407 1407 1408 - static int rs_360_ioctl(struct tty_struct *tty, struct file * file, 1408 + static int rs_360_ioctl(struct tty_struct *tty, 1409 1409 unsigned int cmd, unsigned long arg) 1410 1410 { 1411 1411 int error;
+21 -12
drivers/tty/serial/8250.c
··· 954 954 return 0; 955 955 } 956 956 957 + static inline int ns16550a_goto_highspeed(struct uart_8250_port *up) 958 + { 959 + unsigned char status; 960 + 961 + status = serial_in(up, 0x04); /* EXCR2 */ 962 + #define PRESL(x) ((x) & 0x30) 963 + if (PRESL(status) == 0x10) { 964 + /* already in high speed mode */ 965 + return 0; 966 + } else { 967 + status &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ 968 + status |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ 969 + serial_outp(up, 0x04, status); 970 + } 971 + return 1; 972 + } 973 + 957 974 /* 958 975 * We know that the chip has FIFOs. Does it have an EFR? The 959 976 * EFR is located in the same register position as the IIR and ··· 1042 1025 quot = serial_dl_read(up); 1043 1026 quot <<= 3; 1044 1027 1045 - status1 = serial_in(up, 0x04); /* EXCR2 */ 1046 - status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ 1047 - status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ 1048 - serial_outp(up, 0x04, status1); 1049 - 1050 - serial_dl_write(up, quot); 1028 + if (ns16550a_goto_highspeed(up)) 1029 + serial_dl_write(up, quot); 1051 1030 1052 1031 serial_outp(up, UART_LCR, 0); 1053 1032 ··· 3038 3025 struct uart_8250_port *up = &serial8250_ports[line]; 3039 3026 3040 3027 if (up->capabilities & UART_NATSEMI) { 3041 - unsigned char tmp; 3042 - 3043 3028 /* Ensure it's still in high speed mode */ 3044 3029 serial_outp(up, UART_LCR, 0xE0); 3045 3030 3046 - tmp = serial_in(up, 0x04); /* EXCR2 */ 3047 - tmp &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ 3048 - tmp |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ 3049 - serial_outp(up, 0x04, tmp); 3031 + ns16550a_goto_highspeed(up); 3050 3032 3051 3033 serial_outp(up, UART_LCR, 0); 3034 + up->port.uartclk = 921600*16; 3052 3035 } 3053 3036 uart_resume_port(&serial8250_reg, &up->port); 3054 3037 }
+28 -3
drivers/tty/serial/Kconfig
··· 1319 1319 depends on SERIAL_MSM=y 1320 1320 select SERIAL_CORE_CONSOLE 1321 1321 1322 + config SERIAL_MSM_HS 1323 + tristate "MSM UART High Speed: Serial Driver" 1324 + depends on ARCH_MSM 1325 + select SERIAL_CORE 1326 + help 1327 + If you have a machine based on MSM family of SoCs, you 1328 + can enable its onboard high speed serial port by enabling 1329 + this option. 1330 + 1331 + Choose M here to compile it as a module. The module will be 1332 + called msm_serial_hs. 1333 + 1322 1334 config SERIAL_VT8500 1323 1335 bool "VIA VT8500 on-chip serial port support" 1324 1336 depends on ARM && ARCH_VT8500 ··· 1600 1588 Support for the IFX6x60 modem devices on Intel MID platforms. 1601 1589 1602 1590 config SERIAL_PCH_UART 1603 - tristate "Intel EG20T PCH UART" 1604 - depends on PCI && DMADEVICES 1591 + tristate "Intel EG20T PCH UART/OKI SEMICONDUCTOR ML7213 IOH" 1592 + depends on PCI 1605 1593 select SERIAL_CORE 1606 - select PCH_DMA 1607 1594 help 1608 1595 This driver is for PCH(Platform controller Hub) UART of Intel EG20T 1609 1596 which is an IOH(Input/Output Hub) for x86 embedded processor. 1610 1597 Enabling PCH_DMA, this PCH UART works as DMA mode. 1598 + 1599 + This driver also can be used for OKI SEMICONDUCTOR ML7213 IOH(Input/ 1600 + Output Hub) which is for IVI(In-Vehicle Infotainment) use. 1601 + ML7213 is companion chip for Intel Atom E6xx series. 1602 + ML7213 is completely compatible for Intel EG20T PCH. 1603 + 1604 + config SERIAL_MSM_SMD 1605 + bool "Enable tty device interface for some SMD ports" 1606 + default n 1607 + depends on MSM_SMD 1608 + help 1609 + Enables userspace clients to read and write to some streaming SMD 1610 + ports via tty device interface for MSM chipset. 1611 + 1611 1612 endmenu
+2
drivers/tty/serial/Makefile
··· 76 76 obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o 77 77 obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o 78 78 obj-$(CONFIG_SERIAL_MSM) += msm_serial.o 79 + obj-$(CONFIG_SERIAL_MSM_HS) += msm_serial_hs.o 79 80 obj-$(CONFIG_SERIAL_NETX) += netx-serial.o 80 81 obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o 81 82 obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o ··· 93 92 obj-$(CONFIG_SERIAL_MFD_HSU) += mfd.o 94 93 obj-$(CONFIG_SERIAL_IFX6X60) += ifx6x60.o 95 94 obj-$(CONFIG_SERIAL_PCH_UART) += pch_uart.o 95 + obj-$(CONFIG_SERIAL_MSM_SMD) += msm_smd_tty.o
+43 -42
drivers/tty/serial/altera_jtaguart.c
··· 305 305 306 306 #if defined(CONFIG_SERIAL_ALTERA_JTAGUART_CONSOLE) 307 307 308 - int __init early_altera_jtaguart_setup(struct altera_jtaguart_platform_uart 309 - *platp) 310 - { 311 - struct uart_port *port; 312 - int i; 313 - 314 - for (i = 0; i < ALTERA_JTAGUART_MAXPORTS && platp[i].mapbase; i++) { 315 - port = &altera_jtaguart_ports[i].port; 316 - 317 - port->line = i; 318 - port->type = PORT_ALTERA_JTAGUART; 319 - port->mapbase = platp[i].mapbase; 320 - port->membase = ioremap(port->mapbase, ALTERA_JTAGUART_SIZE); 321 - port->iotype = SERIAL_IO_MEM; 322 - port->irq = platp[i].irq; 323 - port->flags = ASYNC_BOOT_AUTOCONF; 324 - port->ops = &altera_jtaguart_ops; 325 - } 326 - 327 - return 0; 328 - } 329 - 330 308 #if defined(CONFIG_SERIAL_ALTERA_JTAGUART_CONSOLE_BYPASS) 331 309 static void altera_jtaguart_console_putc(struct console *co, const char c) 332 310 { ··· 362 384 if (co->index < 0 || co->index >= ALTERA_JTAGUART_MAXPORTS) 363 385 return -EINVAL; 364 386 port = &altera_jtaguart_ports[co->index].port; 365 - if (port->membase == 0) 387 + if (port->membase == NULL) 366 388 return -ENODEV; 367 389 return 0; 368 390 } ··· 409 431 { 410 432 struct altera_jtaguart_platform_uart *platp = pdev->dev.platform_data; 411 433 struct uart_port *port; 412 - int i; 434 + struct resource *res_irq, *res_mem; 435 + int i = pdev->id; 413 436 414 - for (i = 0; i < ALTERA_JTAGUART_MAXPORTS && platp[i].mapbase; i++) { 415 - port = &altera_jtaguart_ports[i].port; 437 + /* -1 emphasizes that the platform must have one port, no .N suffix */ 438 + if (i == -1) 439 + i = 0; 416 440 417 - port->line = i; 418 - port->type = PORT_ALTERA_JTAGUART; 419 - port->mapbase = platp[i].mapbase; 420 - port->membase = ioremap(port->mapbase, ALTERA_JTAGUART_SIZE); 421 - port->iotype = SERIAL_IO_MEM; 422 - port->irq = platp[i].irq; 423 - port->ops = &altera_jtaguart_ops; 424 - port->flags = ASYNC_BOOT_AUTOCONF; 441 + if (i >= ALTERA_JTAGUART_MAXPORTS) 442 + return -EINVAL; 425 443 426 - uart_add_one_port(&altera_jtaguart_driver, port); 427 - } 444 + port = &altera_jtaguart_ports[i].port; 445 + 446 + res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 447 + if (res_mem) 448 + port->mapbase = res_mem->start; 449 + else if (platp) 450 + port->mapbase = platp->mapbase; 451 + else 452 + return -ENODEV; 453 + 454 + res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 455 + if (res_irq) 456 + port->irq = res_irq->start; 457 + else if (platp) 458 + port->irq = platp->irq; 459 + else 460 + return -ENODEV; 461 + 462 + port->membase = ioremap(port->mapbase, ALTERA_JTAGUART_SIZE); 463 + if (!port->membase) 464 + return -ENOMEM; 465 + 466 + port->line = i; 467 + port->type = PORT_ALTERA_JTAGUART; 468 + port->iotype = SERIAL_IO_MEM; 469 + port->ops = &altera_jtaguart_ops; 470 + port->flags = UPF_BOOT_AUTOCONF; 471 + 472 + uart_add_one_port(&altera_jtaguart_driver, port); 428 473 429 474 return 0; 430 475 } ··· 455 454 static int __devexit altera_jtaguart_remove(struct platform_device *pdev) 456 455 { 457 456 struct uart_port *port; 458 - int i; 457 + int i = pdev->id; 459 458 460 - for (i = 0; i < ALTERA_JTAGUART_MAXPORTS; i++) { 461 - port = &altera_jtaguart_ports[i].port; 462 - if (port) 463 - uart_remove_one_port(&altera_jtaguart_driver, port); 464 - } 459 + if (i == -1) 460 + i = 0; 461 + 462 + port = &altera_jtaguart_ports[i].port; 463 + uart_remove_one_port(&altera_jtaguart_driver, port); 465 464 466 465 return 0; 467 466 }
+14 -8
drivers/tty/serial/altera_uart.c
··· 86 86 87 87 static u32 altera_uart_readl(struct uart_port *port, int reg) 88 88 { 89 - struct altera_uart_platform_uart *platp = port->private_data; 90 - 91 - return readl(port->membase + (reg << platp->bus_shift)); 89 + return readl(port->membase + (reg << port->regshift)); 92 90 } 93 91 94 92 static void altera_uart_writel(struct uart_port *port, u32 dat, int reg) 95 93 { 96 - struct altera_uart_platform_uart *platp = port->private_data; 97 - 98 - writel(dat, port->membase + (reg << platp->bus_shift)); 94 + writel(dat, port->membase + (reg << port->regshift)); 99 95 } 100 96 101 97 static unsigned int altera_uart_tx_empty(struct uart_port *port) ··· 542 546 if (!port->membase) 543 547 return -ENOMEM; 544 548 549 + if (platp) 550 + port->regshift = platp->bus_shift; 551 + else 552 + port->regshift = 0; 553 + 545 554 port->line = i; 546 555 port->type = PORT_ALTERA_UART; 547 556 port->iotype = SERIAL_IO_MEM; 548 557 port->uartclk = platp->uartclk; 549 558 port->ops = &altera_uart_ops; 550 559 port->flags = UPF_BOOT_AUTOCONF; 551 - port->private_data = platp; 552 560 553 561 uart_add_one_port(&altera_uart_driver, port); 554 562 ··· 561 561 562 562 static int __devexit altera_uart_remove(struct platform_device *pdev) 563 563 { 564 - struct uart_port *port = &altera_uart_ports[pdev->id].port; 564 + struct uart_port *port; 565 + int i = pdev->id; 565 566 567 + if (i == -1) 568 + i = 0; 569 + 570 + port = &altera_uart_ports[i].port; 566 571 uart_remove_one_port(&altera_uart_driver, port); 572 + 567 573 return 0; 568 574 } 569 575
+16
drivers/tty/serial/atmel_serial.c
··· 1240 1240 spin_unlock_irqrestore(&port->lock, flags); 1241 1241 } 1242 1242 1243 + static void atmel_set_ldisc(struct uart_port *port, int new) 1244 + { 1245 + int line = port->line; 1246 + 1247 + if (line >= port->state->port.tty->driver->num) 1248 + return; 1249 + 1250 + if (port->state->port.tty->ldisc->ops->num == N_PPS) { 1251 + port->flags |= UPF_HARDPPS_CD; 1252 + atmel_enable_ms(port); 1253 + } else { 1254 + port->flags &= ~UPF_HARDPPS_CD; 1255 + } 1256 + } 1257 + 1243 1258 /* 1244 1259 * Return string describing the specified port 1245 1260 */ ··· 1395 1380 .shutdown = atmel_shutdown, 1396 1381 .flush_buffer = atmel_flush_buffer, 1397 1382 .set_termios = atmel_set_termios, 1383 + .set_ldisc = atmel_set_ldisc, 1398 1384 .type = atmel_type, 1399 1385 .release_port = atmel_release_port, 1400 1386 .request_port = atmel_request_port,
+1 -1
drivers/tty/serial/bfin_sport_uart.c
··· 788 788 sport->port.mapbase = res->start; 789 789 790 790 sport->port.irq = platform_get_irq(pdev, 0); 791 - if (sport->port.irq < 0) { 791 + if ((int)sport->port.irq < 0) { 792 792 dev_err(&pdev->dev, "No sport RX/TX IRQ specified\n"); 793 793 ret = -ENOENT; 794 794 goto out_error_unmap;
+3 -4
drivers/tty/serial/crisv10.c
··· 3581 3581 } 3582 3582 3583 3583 static int 3584 - rs_tiocmset(struct tty_struct *tty, struct file *file, 3585 - unsigned int set, unsigned int clear) 3584 + rs_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) 3586 3585 { 3587 3586 struct e100_serial *info = (struct e100_serial *)tty->driver_data; 3588 3587 unsigned long flags; ··· 3613 3614 } 3614 3615 3615 3616 static int 3616 - rs_tiocmget(struct tty_struct *tty, struct file *file) 3617 + rs_tiocmget(struct tty_struct *tty) 3617 3618 { 3618 3619 struct e100_serial *info = (struct e100_serial *)tty->driver_data; 3619 3620 unsigned int result; ··· 3647 3648 3648 3649 3649 3650 static int 3650 - rs_ioctl(struct tty_struct *tty, struct file * file, 3651 + rs_ioctl(struct tty_struct *tty, 3651 3652 unsigned int cmd, unsigned long arg) 3652 3653 { 3653 3654 struct e100_serial * info = (struct e100_serial *)tty->driver_data;
+39 -29
drivers/tty/serial/ifx6x60.c
··· 8 8 * Jan Dumon <j.dumon@option.com> 9 9 * 10 10 * Copyright (C) 2009, 2010 Intel Corp 11 - * Russ Gorby <richardx.r.gorby@intel.com> 11 + * Russ Gorby <russ.gorby@intel.com> 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of the GNU General Public License version 2 as ··· 67 67 #define IFX_SPI_MORE_MASK 0x10 68 68 #define IFX_SPI_MORE_BIT 12 /* bit position in u16 */ 69 69 #define IFX_SPI_CTS_BIT 13 /* bit position in u16 */ 70 + #define IFX_SPI_MODE SPI_MODE_1 70 71 #define IFX_SPI_TTY_ID 0 71 72 #define IFX_SPI_TIMEOUT_SEC 2 72 73 #define IFX_SPI_HEADER_0 (-1) ··· 77 76 static void ifx_spi_handle_srdy(struct ifx_spi_device *ifx_dev); 78 77 79 78 /* local variables */ 80 - static int spi_b16 = 1; /* 8 or 16 bit word length */ 79 + static int spi_bpw = 16; /* 8, 16 or 32 bit word length */ 81 80 static struct tty_driver *tty_drv; 82 81 static struct ifx_spi_device *saved_ifx_dev; 83 82 static struct lock_class_key ifx_spi_key; ··· 245 244 * Map the signal state into Linux modem flags and report the value 246 245 * in Linux terms 247 246 */ 248 - static int ifx_spi_tiocmget(struct tty_struct *tty, struct file *filp) 247 + static int ifx_spi_tiocmget(struct tty_struct *tty) 249 248 { 250 249 unsigned int value; 251 250 struct ifx_spi_device *ifx_dev = tty->driver_data; ··· 263 262 /** 264 263 * ifx_spi_tiocmset - set modem bits 265 264 * @tty: the tty structure 266 - * @filp: file handle issuing the request 267 265 * @set: bits to set 268 266 * @clear: bits to clear 269 267 * ··· 271 271 * 272 272 * FIXME: do we need to kick the tranfers when we do this ? 273 273 */ 274 - static int ifx_spi_tiocmset(struct tty_struct *tty, struct file *filp, 274 + static int ifx_spi_tiocmset(struct tty_struct *tty, 275 275 unsigned int set, unsigned int clear) 276 276 { 277 277 struct ifx_spi_device *ifx_dev = tty->driver_data; ··· 722 722 /* note len is BYTES, not transfers */ 723 723 ifx_dev->spi_xfer.len = IFX_SPI_TRANSFER_SIZE; 724 724 ifx_dev->spi_xfer.cs_change = 0; 725 - ifx_dev->spi_xfer.speed_hz = 12500000; 725 + ifx_dev->spi_xfer.speed_hz = ifx_dev->spi_dev->max_speed_hz; 726 726 /* ifx_dev->spi_xfer.speed_hz = 390625; */ 727 - ifx_dev->spi_xfer.bits_per_word = spi_b16 ? 16 : 8; 727 + ifx_dev->spi_xfer.bits_per_word = spi_bpw; 728 728 729 729 ifx_dev->spi_xfer.tx_buf = ifx_dev->tx_buffer; 730 730 ifx_dev->spi_xfer.rx_buf = ifx_dev->rx_buffer; ··· 732 732 /* 733 733 * setup dma pointers 734 734 */ 735 - if (ifx_dev->is_6160) { 735 + if (ifx_dev->use_dma) { 736 736 ifx_dev->spi_msg.is_dma_mapped = 1; 737 737 ifx_dev->tx_dma = ifx_dev->tx_bus; 738 738 ifx_dev->rx_dma = ifx_dev->rx_bus; ··· 798 798 goto error_ret; 799 799 } 800 800 801 - pport->ops = &ifx_tty_port_ops; 802 801 tty_port_init(pport); 802 + pport->ops = &ifx_tty_port_ops; 803 803 ifx_dev->minor = IFX_SPI_TTY_ID; 804 804 ifx_dev->tty_dev = tty_register_device(tty_drv, ifx_dev->minor, 805 805 &ifx_dev->spi_dev->dev); ··· 960 960 { 961 961 int ret; 962 962 int srdy; 963 - struct ifx_modem_platform_data *pl_data = NULL; 963 + struct ifx_modem_platform_data *pl_data; 964 964 struct ifx_spi_device *ifx_dev; 965 965 966 966 if (saved_ifx_dev) { 967 967 dev_dbg(&spi->dev, "ignoring subsequent detection"); 968 + return -ENODEV; 969 + } 970 + 971 + pl_data = (struct ifx_modem_platform_data *)spi->dev.platform_data; 972 + if (!pl_data) { 973 + dev_err(&spi->dev, "missing platform data!"); 968 974 return -ENODEV; 969 975 } 970 976 ··· 989 983 init_timer(&ifx_dev->spi_timer); 990 984 ifx_dev->spi_timer.function = ifx_spi_timeout; 991 985 ifx_dev->spi_timer.data = (unsigned long)ifx_dev; 992 - ifx_dev->is_6160 = pl_data->is_6160; 986 + ifx_dev->modem = pl_data->modem_type; 987 + ifx_dev->use_dma = pl_data->use_dma; 988 + ifx_dev->max_hz = pl_data->max_hz; 989 + /* initialize spi mode, etc */ 990 + spi->max_speed_hz = ifx_dev->max_hz; 991 + spi->mode = IFX_SPI_MODE | (SPI_LOOP & spi->mode); 992 + spi->bits_per_word = spi_bpw; 993 + ret = spi_setup(spi); 994 + if (ret) { 995 + dev_err(&spi->dev, "SPI setup wasn't successful %d", ret); 996 + return -ENODEV; 997 + } 993 998 994 999 /* ensure SPI protocol flags are initialized to enable transfer */ 995 1000 ifx_dev->spi_more = 0; 996 1001 ifx_dev->spi_slave_cts = 0; 997 1002 998 1003 /*initialize transfer and dma buffers */ 999 - ifx_dev->tx_buffer = dma_alloc_coherent(&ifx_dev->spi_dev->dev, 1004 + ifx_dev->tx_buffer = dma_alloc_coherent(ifx_dev->spi_dev->dev.parent, 1000 1005 IFX_SPI_TRANSFER_SIZE, 1001 1006 &ifx_dev->tx_bus, 1002 1007 GFP_KERNEL); ··· 1016 999 ret = -ENOMEM; 1017 1000 goto error_ret; 1018 1001 } 1019 - ifx_dev->rx_buffer = dma_alloc_coherent(&ifx_dev->spi_dev->dev, 1002 + ifx_dev->rx_buffer = dma_alloc_coherent(ifx_dev->spi_dev->dev.parent, 1020 1003 IFX_SPI_TRANSFER_SIZE, 1021 1004 &ifx_dev->rx_bus, 1022 1005 GFP_KERNEL); ··· 1042 1025 goto error_ret; 1043 1026 } 1044 1027 1045 - pl_data = (struct ifx_modem_platform_data *)spi->dev.platform_data; 1046 - if (pl_data) { 1047 - ifx_dev->gpio.reset = pl_data->rst_pmu; 1048 - ifx_dev->gpio.po = pl_data->pwr_on; 1049 - ifx_dev->gpio.mrdy = pl_data->mrdy; 1050 - ifx_dev->gpio.srdy = pl_data->srdy; 1051 - ifx_dev->gpio.reset_out = pl_data->rst_out; 1052 - } else { 1053 - dev_err(&spi->dev, "missing platform data!"); 1054 - ret = -ENODEV; 1055 - goto error_ret; 1056 - } 1028 + ifx_dev->gpio.reset = pl_data->rst_pmu; 1029 + ifx_dev->gpio.po = pl_data->pwr_on; 1030 + ifx_dev->gpio.mrdy = pl_data->mrdy; 1031 + ifx_dev->gpio.srdy = pl_data->srdy; 1032 + ifx_dev->gpio.reset_out = pl_data->rst_out; 1057 1033 1058 1034 dev_info(&spi->dev, "gpios %d, %d, %d, %d, %d", 1059 1035 ifx_dev->gpio.reset, ifx_dev->gpio.po, ifx_dev->gpio.mrdy, ··· 1332 1322 MODULE_DEVICE_TABLE(spi, ifx_id_table); 1333 1323 1334 1324 /* spi operations */ 1335 - static const struct spi_driver ifx_spi_driver_6160 = { 1325 + static const struct spi_driver ifx_spi_driver = { 1336 1326 .driver = { 1337 - .name = "ifx6160", 1327 + .name = DRVNAME, 1338 1328 .bus = &spi_bus_type, 1339 1329 .pm = &ifx_spi_pm, 1340 1330 .owner = THIS_MODULE}, ··· 1356 1346 { 1357 1347 /* unregister */ 1358 1348 tty_unregister_driver(tty_drv); 1359 - spi_unregister_driver((void *)&ifx_spi_driver_6160); 1349 + spi_unregister_driver((void *)&ifx_spi_driver); 1360 1350 } 1361 1351 1362 1352 /** ··· 1398 1388 return result; 1399 1389 } 1400 1390 1401 - result = spi_register_driver((void *)&ifx_spi_driver_6160); 1391 + result = spi_register_driver((void *)&ifx_spi_driver); 1402 1392 if (result) { 1403 1393 pr_err("%s: spi_register_driver failed(%d)", 1404 1394 DRVNAME, result);
+3 -3
drivers/tty/serial/ifx6x60.h
··· 29 29 #define DRVNAME "ifx6x60" 30 30 #define TTYNAME "ttyIFX" 31 31 32 - /* #define IFX_THROTTLE_CODE */ 33 - 34 32 #define IFX_SPI_MAX_MINORS 1 35 33 #define IFX_SPI_TRANSFER_SIZE 2048 36 34 #define IFX_SPI_FIFO_SIZE 4096 ··· 86 88 dma_addr_t rx_dma; 87 89 dma_addr_t tx_dma; 88 90 89 - int is_6160; /* Modem type */ 91 + int modem; /* Modem type */ 92 + int use_dma; /* provide dma-able addrs in SPI msg */ 93 + long max_hz; /* max SPI frequency */ 90 94 91 95 spinlock_t write_lock; 92 96 int write_pending;
+15 -58
drivers/tty/serial/mfd.c
··· 16 16 * 2/3 chan to port 1, 4/5 chan to port 3. Even number chans 17 17 * are used for RX, odd chans for TX 18 18 * 19 - * 2. In A0 stepping, UART will not support TX half empty flag 20 - * 21 - * 3. The RI/DSR/DCD/DTR are not pinned out, DCD & DSR are always 19 + * 2. The RI/DSR/DCD/DTR are not pinned out, DCD & DSR are always 22 20 * asserted, only when the HW is reset the DDCD and DDSR will 23 21 * be triggered 24 22 */ ··· 39 41 #include <linux/io.h> 40 42 #include <linux/debugfs.h> 41 43 42 - #define MFD_HSU_A0_STEPPING 1 43 - 44 44 #define HSU_DMA_BUF_SIZE 2048 45 45 46 46 #define chan_readl(chan, offset) readl(chan->reg + offset) ··· 47 51 #define mfd_readl(obj, offset) readl(obj->reg + offset) 48 52 #define mfd_writel(obj, offset, val) writel(val, obj->reg + offset) 49 53 50 - #define HSU_DMA_TIMEOUT_CHECK_FREQ (HZ/10) 54 + static int hsu_dma_enable; 55 + module_param(hsu_dma_enable, int, 0); 56 + MODULE_PARM_DESC(hsu_dma_enable, "It is a bitmap to set working mode, if \ 57 + bit[x] is 1, then port[x] will work in DMA mode, otherwise in PIO mode."); 51 58 52 59 struct hsu_dma_buffer { 53 60 u8 *buf; ··· 64 65 enum dma_data_direction dirt; 65 66 struct uart_hsu_port *uport; 66 67 void __iomem *reg; 67 - struct timer_list rx_timer; /* only needed by RX channel */ 68 68 }; 69 69 70 70 struct uart_hsu_port { ··· 353 355 | (0x1 << 24) /* timeout bit, see HSU Errata 1 */ 354 356 ); 355 357 chan_writel(rxc, HSU_CH_CR, 0x3); 356 - 357 - mod_timer(&rxc->rx_timer, jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ); 358 358 } 359 359 360 360 /* Protected by spin_lock_irqsave(port->lock) */ ··· 416 420 chan_writel(chan, HSU_CH_CR, 0x3); 417 421 return; 418 422 } 419 - del_timer(&chan->rx_timer); 420 423 421 424 dma_sync_single_for_cpu(port->dev, dbuf->dma_addr, 422 425 dbuf->dma_size, DMA_FROM_DEVICE); ··· 443 448 tty_flip_buffer_push(tty); 444 449 445 450 chan_writel(chan, HSU_CH_CR, 0x3); 446 - chan->rx_timer.expires = jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ; 447 - add_timer(&chan->rx_timer); 448 451 449 452 } 450 453 ··· 544 551 return; 545 552 } 546 553 547 - #ifndef MFD_HSU_A0_STEPPING 554 + /* The IRQ is for TX FIFO half-empty */ 548 555 count = up->port.fifosize / 2; 549 - #else 550 - /* 551 - * A0 only supports fully empty IRQ, and the first char written 552 - * into it won't clear the EMPT bit, so we may need be cautious 553 - * by useing a shorter buffer 554 - */ 555 - count = up->port.fifosize - 4; 556 - #endif 556 + 557 557 do { 558 558 serial_out(up, UART_TX, xmit->buf[xmit->tail]); 559 559 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); ··· 755 769 /* 756 770 * What special to do: 757 771 * 1. chose the 64B fifo mode 758 - * 2. make sure not to select half empty mode for A0 stepping 759 - * 3. start dma or pio depends on configuration 760 - * 4. we only allocate dma memory when needed 772 + * 2. start dma or pio depends on configuration 773 + * 3. we only allocate dma memory when needed 761 774 */ 762 775 static int serial_hsu_startup(struct uart_port *port) 763 776 { ··· 854 869 struct uart_hsu_port *up = 855 870 container_of(port, struct uart_hsu_port, port); 856 871 unsigned long flags; 857 - 858 - del_timer_sync(&up->rxc->rx_timer); 859 872 860 873 /* Disable interrupts from this port */ 861 874 up->ier = 0; ··· 960 977 fcr = UART_FCR_ENABLE_FIFO | UART_FCR_HSU_64_32B; 961 978 962 979 fcr |= UART_FCR_HSU_64B_FIFO; 963 - #ifdef MFD_HSU_A0_STEPPING 964 - /* A0 doesn't support half empty IRQ */ 965 - fcr |= UART_FCR_FULL_EMPT_TXI; 966 - #endif 967 980 968 981 /* 969 982 * Ok, we're now changing the port state. Do it with ··· 1322 1343 return ret; 1323 1344 } 1324 1345 1325 - static void hsu_dma_rx_timeout(unsigned long data) 1326 - { 1327 - struct hsu_dma_chan *chan = (void *)data; 1328 - struct uart_hsu_port *up = chan->uport; 1329 - struct hsu_dma_buffer *dbuf = &up->rxbuf; 1330 - int count = 0; 1331 - unsigned long flags; 1332 - 1333 - spin_lock_irqsave(&up->port.lock, flags); 1334 - 1335 - count = chan_readl(chan, HSU_CH_D0SAR) - dbuf->dma_addr; 1336 - 1337 - if (!count) { 1338 - mod_timer(&chan->rx_timer, jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ); 1339 - goto exit; 1340 - } 1341 - 1342 - hsu_dma_rx(up, 0); 1343 - exit: 1344 - spin_unlock_irqrestore(&up->port.lock, flags); 1345 - } 1346 - 1347 1346 static void hsu_global_init(void) 1348 1347 { 1349 1348 struct hsu_port *hsu; ··· 1372 1415 1373 1416 serial_hsu_ports[i] = uport; 1374 1417 uport->index = i; 1418 + 1419 + if (hsu_dma_enable & (1<<i)) 1420 + uport->use_dma = 1; 1421 + else 1422 + uport->use_dma = 0; 1423 + 1375 1424 uport++; 1376 1425 } 1377 1426 ··· 1390 1427 dchan->reg = hsu->reg + HSU_DMA_CHANS_REG_OFFSET + 1391 1428 i * HSU_DMA_CHANS_REG_LENGTH; 1392 1429 1393 - /* Work around for RX */ 1394 - if (dchan->dirt == DMA_FROM_DEVICE) { 1395 - init_timer(&dchan->rx_timer); 1396 - dchan->rx_timer.function = hsu_dma_rx_timeout; 1397 - dchan->rx_timer.data = (unsigned long)dchan; 1398 - } 1399 1430 dchan++; 1400 1431 } 1401 1432
+1 -1
drivers/tty/serial/mrst_max3110.c
··· 51 51 struct uart_max3110 { 52 52 struct uart_port port; 53 53 struct spi_device *spi; 54 - char name[24]; 54 + char name[SPI_NAME_SIZE]; 55 55 56 56 wait_queue_head_t wq; 57 57 struct task_struct *main_thread;
+1880
drivers/tty/serial/msm_serial_hs.c
··· 1 + /* 2 + * MSM 7k/8k High speed uart driver 3 + * 4 + * Copyright (c) 2007-2011, Code Aurora Forum. All rights reserved. 5 + * Copyright (c) 2008 Google Inc. 6 + * Modified: Nick Pelly <npelly@google.com> 7 + * 8 + * This program is free software; you can redistribute it and/or 9 + * modify it under the terms of the GNU General Public License 10 + * version 2 as published by the Free Software Foundation. 11 + * 12 + * This program is distributed in the hope that it will be useful, 13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 + * See the GNU General Public License for more details. 16 + * 17 + * Has optional support for uart power management independent of linux 18 + * suspend/resume: 19 + * 20 + * RX wakeup. 21 + * UART wakeup can be triggered by RX activity (using a wakeup GPIO on the 22 + * UART RX pin). This should only be used if there is not a wakeup 23 + * GPIO on the UART CTS, and the first RX byte is known (for example, with the 24 + * Bluetooth Texas Instruments HCILL protocol), since the first RX byte will 25 + * always be lost. RTS will be asserted even while the UART is off in this mode 26 + * of operation. See msm_serial_hs_platform_data.rx_wakeup_irq. 27 + */ 28 + 29 + #include <linux/module.h> 30 + 31 + #include <linux/serial.h> 32 + #include <linux/serial_core.h> 33 + #include <linux/slab.h> 34 + #include <linux/init.h> 35 + #include <linux/interrupt.h> 36 + #include <linux/irq.h> 37 + #include <linux/io.h> 38 + #include <linux/ioport.h> 39 + #include <linux/kernel.h> 40 + #include <linux/timer.h> 41 + #include <linux/clk.h> 42 + #include <linux/platform_device.h> 43 + #include <linux/pm_runtime.h> 44 + #include <linux/dma-mapping.h> 45 + #include <linux/dmapool.h> 46 + #include <linux/wait.h> 47 + #include <linux/workqueue.h> 48 + 49 + #include <linux/atomic.h> 50 + #include <asm/irq.h> 51 + #include <asm/system.h> 52 + 53 + #include <mach/hardware.h> 54 + #include <mach/dma.h> 55 + #include <linux/platform_data/msm_serial_hs.h> 56 + 57 + /* HSUART Registers */ 58 + #define UARTDM_MR1_ADDR 0x0 59 + #define UARTDM_MR2_ADDR 0x4 60 + 61 + /* Data Mover result codes */ 62 + #define RSLT_FIFO_CNTR_BMSK (0xE << 28) 63 + #define RSLT_VLD BIT(1) 64 + 65 + /* write only register */ 66 + #define UARTDM_CSR_ADDR 0x8 67 + #define UARTDM_CSR_115200 0xFF 68 + #define UARTDM_CSR_57600 0xEE 69 + #define UARTDM_CSR_38400 0xDD 70 + #define UARTDM_CSR_28800 0xCC 71 + #define UARTDM_CSR_19200 0xBB 72 + #define UARTDM_CSR_14400 0xAA 73 + #define UARTDM_CSR_9600 0x99 74 + #define UARTDM_CSR_7200 0x88 75 + #define UARTDM_CSR_4800 0x77 76 + #define UARTDM_CSR_3600 0x66 77 + #define UARTDM_CSR_2400 0x55 78 + #define UARTDM_CSR_1200 0x44 79 + #define UARTDM_CSR_600 0x33 80 + #define UARTDM_CSR_300 0x22 81 + #define UARTDM_CSR_150 0x11 82 + #define UARTDM_CSR_75 0x00 83 + 84 + /* write only register */ 85 + #define UARTDM_TF_ADDR 0x70 86 + #define UARTDM_TF2_ADDR 0x74 87 + #define UARTDM_TF3_ADDR 0x78 88 + #define UARTDM_TF4_ADDR 0x7C 89 + 90 + /* write only register */ 91 + #define UARTDM_CR_ADDR 0x10 92 + #define UARTDM_IMR_ADDR 0x14 93 + 94 + #define UARTDM_IPR_ADDR 0x18 95 + #define UARTDM_TFWR_ADDR 0x1c 96 + #define UARTDM_RFWR_ADDR 0x20 97 + #define UARTDM_HCR_ADDR 0x24 98 + #define UARTDM_DMRX_ADDR 0x34 99 + #define UARTDM_IRDA_ADDR 0x38 100 + #define UARTDM_DMEN_ADDR 0x3c 101 + 102 + /* UART_DM_NO_CHARS_FOR_TX */ 103 + #define UARTDM_NCF_TX_ADDR 0x40 104 + 105 + #define UARTDM_BADR_ADDR 0x44 106 + 107 + #define UARTDM_SIM_CFG_ADDR 0x80 108 + /* Read Only register */ 109 + #define UARTDM_SR_ADDR 0x8 110 + 111 + /* Read Only register */ 112 + #define UARTDM_RF_ADDR 0x70 113 + #define UARTDM_RF2_ADDR 0x74 114 + #define UARTDM_RF3_ADDR 0x78 115 + #define UARTDM_RF4_ADDR 0x7C 116 + 117 + /* Read Only register */ 118 + #define UARTDM_MISR_ADDR 0x10 119 + 120 + /* Read Only register */ 121 + #define UARTDM_ISR_ADDR 0x14 122 + #define UARTDM_RX_TOTAL_SNAP_ADDR 0x38 123 + 124 + #define UARTDM_RXFS_ADDR 0x50 125 + 126 + /* Register field Mask Mapping */ 127 + #define UARTDM_SR_PAR_FRAME_BMSK BIT(5) 128 + #define UARTDM_SR_OVERRUN_BMSK BIT(4) 129 + #define UARTDM_SR_TXEMT_BMSK BIT(3) 130 + #define UARTDM_SR_TXRDY_BMSK BIT(2) 131 + #define UARTDM_SR_RXRDY_BMSK BIT(0) 132 + 133 + #define UARTDM_CR_TX_DISABLE_BMSK BIT(3) 134 + #define UARTDM_CR_RX_DISABLE_BMSK BIT(1) 135 + #define UARTDM_CR_TX_EN_BMSK BIT(2) 136 + #define UARTDM_CR_RX_EN_BMSK BIT(0) 137 + 138 + /* UARTDM_CR channel_comman bit value (register field is bits 8:4) */ 139 + #define RESET_RX 0x10 140 + #define RESET_TX 0x20 141 + #define RESET_ERROR_STATUS 0x30 142 + #define RESET_BREAK_INT 0x40 143 + #define START_BREAK 0x50 144 + #define STOP_BREAK 0x60 145 + #define RESET_CTS 0x70 146 + #define RESET_STALE_INT 0x80 147 + #define RFR_LOW 0xD0 148 + #define RFR_HIGH 0xE0 149 + #define CR_PROTECTION_EN 0x100 150 + #define STALE_EVENT_ENABLE 0x500 151 + #define STALE_EVENT_DISABLE 0x600 152 + #define FORCE_STALE_EVENT 0x400 153 + #define CLEAR_TX_READY 0x300 154 + #define RESET_TX_ERROR 0x800 155 + #define RESET_TX_DONE 0x810 156 + 157 + #define UARTDM_MR1_AUTO_RFR_LEVEL1_BMSK 0xffffff00 158 + #define UARTDM_MR1_AUTO_RFR_LEVEL0_BMSK 0x3f 159 + #define UARTDM_MR1_CTS_CTL_BMSK 0x40 160 + #define UARTDM_MR1_RX_RDY_CTL_BMSK 0x80 161 + 162 + #define UARTDM_MR2_ERROR_MODE_BMSK 0x40 163 + #define UARTDM_MR2_BITS_PER_CHAR_BMSK 0x30 164 + 165 + /* bits per character configuration */ 166 + #define FIVE_BPC (0 << 4) 167 + #define SIX_BPC (1 << 4) 168 + #define SEVEN_BPC (2 << 4) 169 + #define EIGHT_BPC (3 << 4) 170 + 171 + #define UARTDM_MR2_STOP_BIT_LEN_BMSK 0xc 172 + #define STOP_BIT_ONE (1 << 2) 173 + #define STOP_BIT_TWO (3 << 2) 174 + 175 + #define UARTDM_MR2_PARITY_MODE_BMSK 0x3 176 + 177 + /* Parity configuration */ 178 + #define NO_PARITY 0x0 179 + #define EVEN_PARITY 0x1 180 + #define ODD_PARITY 0x2 181 + #define SPACE_PARITY 0x3 182 + 183 + #define UARTDM_IPR_STALE_TIMEOUT_MSB_BMSK 0xffffff80 184 + #define UARTDM_IPR_STALE_LSB_BMSK 0x1f 185 + 186 + /* These can be used for both ISR and IMR register */ 187 + #define UARTDM_ISR_TX_READY_BMSK BIT(7) 188 + #define UARTDM_ISR_CURRENT_CTS_BMSK BIT(6) 189 + #define UARTDM_ISR_DELTA_CTS_BMSK BIT(5) 190 + #define UARTDM_ISR_RXLEV_BMSK BIT(4) 191 + #define UARTDM_ISR_RXSTALE_BMSK BIT(3) 192 + #define UARTDM_ISR_RXBREAK_BMSK BIT(2) 193 + #define UARTDM_ISR_RXHUNT_BMSK BIT(1) 194 + #define UARTDM_ISR_TXLEV_BMSK BIT(0) 195 + 196 + /* Field definitions for UART_DM_DMEN*/ 197 + #define UARTDM_TX_DM_EN_BMSK 0x1 198 + #define UARTDM_RX_DM_EN_BMSK 0x2 199 + 200 + #define UART_FIFOSIZE 64 201 + #define UARTCLK 7372800 202 + 203 + /* Rx DMA request states */ 204 + enum flush_reason { 205 + FLUSH_NONE, 206 + FLUSH_DATA_READY, 207 + FLUSH_DATA_INVALID, /* values after this indicate invalid data */ 208 + FLUSH_IGNORE = FLUSH_DATA_INVALID, 209 + FLUSH_STOP, 210 + FLUSH_SHUTDOWN, 211 + }; 212 + 213 + /* UART clock states */ 214 + enum msm_hs_clk_states_e { 215 + MSM_HS_CLK_PORT_OFF, /* port not in use */ 216 + MSM_HS_CLK_OFF, /* clock disabled */ 217 + MSM_HS_CLK_REQUEST_OFF, /* disable after TX and RX flushed */ 218 + MSM_HS_CLK_ON, /* clock enabled */ 219 + }; 220 + 221 + /* Track the forced RXSTALE flush during clock off sequence. 222 + * These states are only valid during MSM_HS_CLK_REQUEST_OFF */ 223 + enum msm_hs_clk_req_off_state_e { 224 + CLK_REQ_OFF_START, 225 + CLK_REQ_OFF_RXSTALE_ISSUED, 226 + CLK_REQ_OFF_FLUSH_ISSUED, 227 + CLK_REQ_OFF_RXSTALE_FLUSHED, 228 + }; 229 + 230 + /** 231 + * struct msm_hs_tx 232 + * @tx_ready_int_en: ok to dma more tx? 233 + * @dma_in_flight: tx dma in progress 234 + * @xfer: top level DMA command pointer structure 235 + * @command_ptr: third level command struct pointer 236 + * @command_ptr_ptr: second level command list struct pointer 237 + * @mapped_cmd_ptr: DMA view of third level command struct 238 + * @mapped_cmd_ptr_ptr: DMA view of second level command list struct 239 + * @tx_count: number of bytes to transfer in DMA transfer 240 + * @dma_base: DMA view of UART xmit buffer 241 + * 242 + * This structure describes a single Tx DMA transaction. MSM DMA 243 + * commands have two levels of indirection. The top level command 244 + * ptr points to a list of command ptr which in turn points to a 245 + * single DMA 'command'. In our case each Tx transaction consists 246 + * of a single second level pointer pointing to a 'box type' command. 247 + */ 248 + struct msm_hs_tx { 249 + unsigned int tx_ready_int_en; 250 + unsigned int dma_in_flight; 251 + struct msm_dmov_cmd xfer; 252 + dmov_box *command_ptr; 253 + u32 *command_ptr_ptr; 254 + dma_addr_t mapped_cmd_ptr; 255 + dma_addr_t mapped_cmd_ptr_ptr; 256 + int tx_count; 257 + dma_addr_t dma_base; 258 + }; 259 + 260 + /** 261 + * struct msm_hs_rx 262 + * @flush: Rx DMA request state 263 + * @xfer: top level DMA command pointer structure 264 + * @cmdptr_dmaaddr: DMA view of second level command structure 265 + * @command_ptr: third level DMA command pointer structure 266 + * @command_ptr_ptr: second level DMA command list pointer 267 + * @mapped_cmd_ptr: DMA view of the third level command structure 268 + * @wait: wait for DMA completion before shutdown 269 + * @buffer: destination buffer for RX DMA 270 + * @rbuffer: DMA view of buffer 271 + * @pool: dma pool out of which coherent rx buffer is allocated 272 + * @tty_work: private work-queue for tty flip buffer push task 273 + * 274 + * This structure describes a single Rx DMA transaction. Rx DMA 275 + * transactions use box mode DMA commands. 276 + */ 277 + struct msm_hs_rx { 278 + enum flush_reason flush; 279 + struct msm_dmov_cmd xfer; 280 + dma_addr_t cmdptr_dmaaddr; 281 + dmov_box *command_ptr; 282 + u32 *command_ptr_ptr; 283 + dma_addr_t mapped_cmd_ptr; 284 + wait_queue_head_t wait; 285 + dma_addr_t rbuffer; 286 + unsigned char *buffer; 287 + struct dma_pool *pool; 288 + struct work_struct tty_work; 289 + }; 290 + 291 + /** 292 + * struct msm_hs_rx_wakeup 293 + * @irq: IRQ line to be configured as interrupt source on Rx activity 294 + * @ignore: boolean value. 1 = ignore the wakeup interrupt 295 + * @rx_to_inject: extra character to be inserted to Rx tty on wakeup 296 + * @inject_rx: 1 = insert rx_to_inject. 0 = do not insert extra character 297 + * 298 + * This is an optional structure required for UART Rx GPIO IRQ based 299 + * wakeup from low power state. UART wakeup can be triggered by RX activity 300 + * (using a wakeup GPIO on the UART RX pin). This should only be used if 301 + * there is not a wakeup GPIO on the UART CTS, and the first RX byte is 302 + * known (eg., with the Bluetooth Texas Instruments HCILL protocol), 303 + * since the first RX byte will always be lost. RTS will be asserted even 304 + * while the UART is clocked off in this mode of operation. 305 + */ 306 + struct msm_hs_rx_wakeup { 307 + int irq; /* < 0 indicates low power wakeup disabled */ 308 + unsigned char ignore; 309 + unsigned char inject_rx; 310 + char rx_to_inject; 311 + }; 312 + 313 + /** 314 + * struct msm_hs_port 315 + * @uport: embedded uart port structure 316 + * @imr_reg: shadow value of UARTDM_IMR 317 + * @clk: uart input clock handle 318 + * @tx: Tx transaction related data structure 319 + * @rx: Rx transaction related data structure 320 + * @dma_tx_channel: Tx DMA command channel 321 + * @dma_rx_channel Rx DMA command channel 322 + * @dma_tx_crci: Tx channel rate control interface number 323 + * @dma_rx_crci: Rx channel rate control interface number 324 + * @clk_off_timer: Timer to poll DMA event completion before clock off 325 + * @clk_off_delay: clk_off_timer poll interval 326 + * @clk_state: overall clock state 327 + * @clk_req_off_state: post flush clock states 328 + * @rx_wakeup: optional rx_wakeup feature related data 329 + * @exit_lpm_cb: optional callback to exit low power mode 330 + * 331 + * Low level serial port structure. 332 + */ 333 + struct msm_hs_port { 334 + struct uart_port uport; 335 + unsigned long imr_reg; 336 + struct clk *clk; 337 + struct msm_hs_tx tx; 338 + struct msm_hs_rx rx; 339 + 340 + int dma_tx_channel; 341 + int dma_rx_channel; 342 + int dma_tx_crci; 343 + int dma_rx_crci; 344 + 345 + struct hrtimer clk_off_timer; 346 + ktime_t clk_off_delay; 347 + enum msm_hs_clk_states_e clk_state; 348 + enum msm_hs_clk_req_off_state_e clk_req_off_state; 349 + 350 + struct msm_hs_rx_wakeup rx_wakeup; 351 + void (*exit_lpm_cb)(struct uart_port *); 352 + }; 353 + 354 + #define MSM_UARTDM_BURST_SIZE 16 /* DM burst size (in bytes) */ 355 + #define UARTDM_TX_BUF_SIZE UART_XMIT_SIZE 356 + #define UARTDM_RX_BUF_SIZE 512 357 + 358 + #define UARTDM_NR 2 359 + 360 + static struct msm_hs_port q_uart_port[UARTDM_NR]; 361 + static struct platform_driver msm_serial_hs_platform_driver; 362 + static struct uart_driver msm_hs_driver; 363 + static struct uart_ops msm_hs_ops; 364 + static struct workqueue_struct *msm_hs_workqueue; 365 + 366 + #define UARTDM_TO_MSM(uart_port) \ 367 + container_of((uart_port), struct msm_hs_port, uport) 368 + 369 + static unsigned int use_low_power_rx_wakeup(struct msm_hs_port 370 + *msm_uport) 371 + { 372 + return (msm_uport->rx_wakeup.irq >= 0); 373 + } 374 + 375 + static unsigned int msm_hs_read(struct uart_port *uport, 376 + unsigned int offset) 377 + { 378 + return ioread32(uport->membase + offset); 379 + } 380 + 381 + static void msm_hs_write(struct uart_port *uport, unsigned int offset, 382 + unsigned int value) 383 + { 384 + iowrite32(value, uport->membase + offset); 385 + } 386 + 387 + static void msm_hs_release_port(struct uart_port *port) 388 + { 389 + iounmap(port->membase); 390 + } 391 + 392 + static int msm_hs_request_port(struct uart_port *port) 393 + { 394 + port->membase = ioremap(port->mapbase, PAGE_SIZE); 395 + if (unlikely(!port->membase)) 396 + return -ENOMEM; 397 + 398 + /* configure the CR Protection to Enable */ 399 + msm_hs_write(port, UARTDM_CR_ADDR, CR_PROTECTION_EN); 400 + return 0; 401 + } 402 + 403 + static int __devexit msm_hs_remove(struct platform_device *pdev) 404 + { 405 + 406 + struct msm_hs_port *msm_uport; 407 + struct device *dev; 408 + 409 + if (pdev->id < 0 || pdev->id >= UARTDM_NR) { 410 + printk(KERN_ERR "Invalid plaform device ID = %d\n", pdev->id); 411 + return -EINVAL; 412 + } 413 + 414 + msm_uport = &q_uart_port[pdev->id]; 415 + dev = msm_uport->uport.dev; 416 + 417 + dma_unmap_single(dev, msm_uport->rx.mapped_cmd_ptr, sizeof(dmov_box), 418 + DMA_TO_DEVICE); 419 + dma_pool_free(msm_uport->rx.pool, msm_uport->rx.buffer, 420 + msm_uport->rx.rbuffer); 421 + dma_pool_destroy(msm_uport->rx.pool); 422 + 423 + dma_unmap_single(dev, msm_uport->rx.cmdptr_dmaaddr, sizeof(u32 *), 424 + DMA_TO_DEVICE); 425 + dma_unmap_single(dev, msm_uport->tx.mapped_cmd_ptr_ptr, sizeof(u32 *), 426 + DMA_TO_DEVICE); 427 + dma_unmap_single(dev, msm_uport->tx.mapped_cmd_ptr, sizeof(dmov_box), 428 + DMA_TO_DEVICE); 429 + 430 + uart_remove_one_port(&msm_hs_driver, &msm_uport->uport); 431 + clk_put(msm_uport->clk); 432 + 433 + /* Free the tx resources */ 434 + kfree(msm_uport->tx.command_ptr); 435 + kfree(msm_uport->tx.command_ptr_ptr); 436 + 437 + /* Free the rx resources */ 438 + kfree(msm_uport->rx.command_ptr); 439 + kfree(msm_uport->rx.command_ptr_ptr); 440 + 441 + iounmap(msm_uport->uport.membase); 442 + 443 + return 0; 444 + } 445 + 446 + static int msm_hs_init_clk_locked(struct uart_port *uport) 447 + { 448 + int ret; 449 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 450 + 451 + ret = clk_enable(msm_uport->clk); 452 + if (ret) { 453 + printk(KERN_ERR "Error could not turn on UART clk\n"); 454 + return ret; 455 + } 456 + 457 + /* Set up the MREG/NREG/DREG/MNDREG */ 458 + ret = clk_set_rate(msm_uport->clk, uport->uartclk); 459 + if (ret) { 460 + printk(KERN_WARNING "Error setting clock rate on UART\n"); 461 + clk_disable(msm_uport->clk); 462 + return ret; 463 + } 464 + 465 + msm_uport->clk_state = MSM_HS_CLK_ON; 466 + return 0; 467 + } 468 + 469 + /* Enable and Disable clocks (Used for power management) */ 470 + static void msm_hs_pm(struct uart_port *uport, unsigned int state, 471 + unsigned int oldstate) 472 + { 473 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 474 + 475 + if (use_low_power_rx_wakeup(msm_uport) || 476 + msm_uport->exit_lpm_cb) 477 + return; /* ignore linux PM states, 478 + use msm_hs_request_clock API */ 479 + 480 + switch (state) { 481 + case 0: 482 + clk_enable(msm_uport->clk); 483 + break; 484 + case 3: 485 + clk_disable(msm_uport->clk); 486 + break; 487 + default: 488 + dev_err(uport->dev, "msm_serial: Unknown PM state %d\n", 489 + state); 490 + } 491 + } 492 + 493 + /* 494 + * programs the UARTDM_CSR register with correct bit rates 495 + * 496 + * Interrupts should be disabled before we are called, as 497 + * we modify Set Baud rate 498 + * Set receive stale interrupt level, dependant on Bit Rate 499 + * Goal is to have around 8 ms before indicate stale. 500 + * roundup (((Bit Rate * .008) / 10) + 1 501 + */ 502 + static void msm_hs_set_bps_locked(struct uart_port *uport, 503 + unsigned int bps) 504 + { 505 + unsigned long rxstale; 506 + unsigned long data; 507 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 508 + 509 + switch (bps) { 510 + case 300: 511 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_75); 512 + rxstale = 1; 513 + break; 514 + case 600: 515 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_150); 516 + rxstale = 1; 517 + break; 518 + case 1200: 519 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_300); 520 + rxstale = 1; 521 + break; 522 + case 2400: 523 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_600); 524 + rxstale = 1; 525 + break; 526 + case 4800: 527 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_1200); 528 + rxstale = 1; 529 + break; 530 + case 9600: 531 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_2400); 532 + rxstale = 2; 533 + break; 534 + case 14400: 535 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_3600); 536 + rxstale = 3; 537 + break; 538 + case 19200: 539 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_4800); 540 + rxstale = 4; 541 + break; 542 + case 28800: 543 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_7200); 544 + rxstale = 6; 545 + break; 546 + case 38400: 547 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_9600); 548 + rxstale = 8; 549 + break; 550 + case 57600: 551 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_14400); 552 + rxstale = 16; 553 + break; 554 + case 76800: 555 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_19200); 556 + rxstale = 16; 557 + break; 558 + case 115200: 559 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_28800); 560 + rxstale = 31; 561 + break; 562 + case 230400: 563 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_57600); 564 + rxstale = 31; 565 + break; 566 + case 460800: 567 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_115200); 568 + rxstale = 31; 569 + break; 570 + case 4000000: 571 + case 3686400: 572 + case 3200000: 573 + case 3500000: 574 + case 3000000: 575 + case 2500000: 576 + case 1500000: 577 + case 1152000: 578 + case 1000000: 579 + case 921600: 580 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_115200); 581 + rxstale = 31; 582 + break; 583 + default: 584 + msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_2400); 585 + /* default to 9600 */ 586 + bps = 9600; 587 + rxstale = 2; 588 + break; 589 + } 590 + if (bps > 460800) 591 + uport->uartclk = bps * 16; 592 + else 593 + uport->uartclk = UARTCLK; 594 + 595 + if (clk_set_rate(msm_uport->clk, uport->uartclk)) { 596 + printk(KERN_WARNING "Error setting clock rate on UART\n"); 597 + return; 598 + } 599 + 600 + data = rxstale & UARTDM_IPR_STALE_LSB_BMSK; 601 + data |= UARTDM_IPR_STALE_TIMEOUT_MSB_BMSK & (rxstale << 2); 602 + 603 + msm_hs_write(uport, UARTDM_IPR_ADDR, data); 604 + } 605 + 606 + /* 607 + * termios : new ktermios 608 + * oldtermios: old ktermios previous setting 609 + * 610 + * Configure the serial port 611 + */ 612 + static void msm_hs_set_termios(struct uart_port *uport, 613 + struct ktermios *termios, 614 + struct ktermios *oldtermios) 615 + { 616 + unsigned int bps; 617 + unsigned long data; 618 + unsigned long flags; 619 + unsigned int c_cflag = termios->c_cflag; 620 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 621 + 622 + spin_lock_irqsave(&uport->lock, flags); 623 + clk_enable(msm_uport->clk); 624 + 625 + /* 300 is the minimum baud support by the driver */ 626 + bps = uart_get_baud_rate(uport, termios, oldtermios, 200, 4000000); 627 + 628 + /* Temporary remapping 200 BAUD to 3.2 mbps */ 629 + if (bps == 200) 630 + bps = 3200000; 631 + 632 + msm_hs_set_bps_locked(uport, bps); 633 + 634 + data = msm_hs_read(uport, UARTDM_MR2_ADDR); 635 + data &= ~UARTDM_MR2_PARITY_MODE_BMSK; 636 + /* set parity */ 637 + if (PARENB == (c_cflag & PARENB)) { 638 + if (PARODD == (c_cflag & PARODD)) 639 + data |= ODD_PARITY; 640 + else if (CMSPAR == (c_cflag & CMSPAR)) 641 + data |= SPACE_PARITY; 642 + else 643 + data |= EVEN_PARITY; 644 + } 645 + 646 + /* Set bits per char */ 647 + data &= ~UARTDM_MR2_BITS_PER_CHAR_BMSK; 648 + 649 + switch (c_cflag & CSIZE) { 650 + case CS5: 651 + data |= FIVE_BPC; 652 + break; 653 + case CS6: 654 + data |= SIX_BPC; 655 + break; 656 + case CS7: 657 + data |= SEVEN_BPC; 658 + break; 659 + default: 660 + data |= EIGHT_BPC; 661 + break; 662 + } 663 + /* stop bits */ 664 + if (c_cflag & CSTOPB) { 665 + data |= STOP_BIT_TWO; 666 + } else { 667 + /* otherwise 1 stop bit */ 668 + data |= STOP_BIT_ONE; 669 + } 670 + data |= UARTDM_MR2_ERROR_MODE_BMSK; 671 + /* write parity/bits per char/stop bit configuration */ 672 + msm_hs_write(uport, UARTDM_MR2_ADDR, data); 673 + 674 + /* Configure HW flow control */ 675 + data = msm_hs_read(uport, UARTDM_MR1_ADDR); 676 + 677 + data &= ~(UARTDM_MR1_CTS_CTL_BMSK | UARTDM_MR1_RX_RDY_CTL_BMSK); 678 + 679 + if (c_cflag & CRTSCTS) { 680 + data |= UARTDM_MR1_CTS_CTL_BMSK; 681 + data |= UARTDM_MR1_RX_RDY_CTL_BMSK; 682 + } 683 + 684 + msm_hs_write(uport, UARTDM_MR1_ADDR, data); 685 + 686 + uport->ignore_status_mask = termios->c_iflag & INPCK; 687 + uport->ignore_status_mask |= termios->c_iflag & IGNPAR; 688 + uport->read_status_mask = (termios->c_cflag & CREAD); 689 + 690 + msm_hs_write(uport, UARTDM_IMR_ADDR, 0); 691 + 692 + /* Set Transmit software time out */ 693 + uart_update_timeout(uport, c_cflag, bps); 694 + 695 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_RX); 696 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_TX); 697 + 698 + if (msm_uport->rx.flush == FLUSH_NONE) { 699 + msm_uport->rx.flush = FLUSH_IGNORE; 700 + msm_dmov_stop_cmd(msm_uport->dma_rx_channel, NULL, 1); 701 + } 702 + 703 + msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg); 704 + 705 + clk_disable(msm_uport->clk); 706 + spin_unlock_irqrestore(&uport->lock, flags); 707 + } 708 + 709 + /* 710 + * Standard API, Transmitter 711 + * Any character in the transmit shift register is sent 712 + */ 713 + static unsigned int msm_hs_tx_empty(struct uart_port *uport) 714 + { 715 + unsigned int data; 716 + unsigned int ret = 0; 717 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 718 + 719 + clk_enable(msm_uport->clk); 720 + 721 + data = msm_hs_read(uport, UARTDM_SR_ADDR); 722 + if (data & UARTDM_SR_TXEMT_BMSK) 723 + ret = TIOCSER_TEMT; 724 + 725 + clk_disable(msm_uport->clk); 726 + 727 + return ret; 728 + } 729 + 730 + /* 731 + * Standard API, Stop transmitter. 732 + * Any character in the transmit shift register is sent as 733 + * well as the current data mover transfer . 734 + */ 735 + static void msm_hs_stop_tx_locked(struct uart_port *uport) 736 + { 737 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 738 + 739 + msm_uport->tx.tx_ready_int_en = 0; 740 + } 741 + 742 + /* 743 + * Standard API, Stop receiver as soon as possible. 744 + * 745 + * Function immediately terminates the operation of the 746 + * channel receiver and any incoming characters are lost. None 747 + * of the receiver status bits are affected by this command and 748 + * characters that are already in the receive FIFO there. 749 + */ 750 + static void msm_hs_stop_rx_locked(struct uart_port *uport) 751 + { 752 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 753 + unsigned int data; 754 + 755 + clk_enable(msm_uport->clk); 756 + 757 + /* disable dlink */ 758 + data = msm_hs_read(uport, UARTDM_DMEN_ADDR); 759 + data &= ~UARTDM_RX_DM_EN_BMSK; 760 + msm_hs_write(uport, UARTDM_DMEN_ADDR, data); 761 + 762 + /* Disable the receiver */ 763 + if (msm_uport->rx.flush == FLUSH_NONE) 764 + msm_dmov_stop_cmd(msm_uport->dma_rx_channel, NULL, 1); 765 + 766 + if (msm_uport->rx.flush != FLUSH_SHUTDOWN) 767 + msm_uport->rx.flush = FLUSH_STOP; 768 + 769 + clk_disable(msm_uport->clk); 770 + } 771 + 772 + /* Transmit the next chunk of data */ 773 + static void msm_hs_submit_tx_locked(struct uart_port *uport) 774 + { 775 + int left; 776 + int tx_count; 777 + dma_addr_t src_addr; 778 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 779 + struct msm_hs_tx *tx = &msm_uport->tx; 780 + struct circ_buf *tx_buf = &msm_uport->uport.state->xmit; 781 + 782 + if (uart_circ_empty(tx_buf) || uport->state->port.tty->stopped) { 783 + msm_hs_stop_tx_locked(uport); 784 + return; 785 + } 786 + 787 + tx->dma_in_flight = 1; 788 + 789 + tx_count = uart_circ_chars_pending(tx_buf); 790 + 791 + if (UARTDM_TX_BUF_SIZE < tx_count) 792 + tx_count = UARTDM_TX_BUF_SIZE; 793 + 794 + left = UART_XMIT_SIZE - tx_buf->tail; 795 + 796 + if (tx_count > left) 797 + tx_count = left; 798 + 799 + src_addr = tx->dma_base + tx_buf->tail; 800 + dma_sync_single_for_device(uport->dev, src_addr, tx_count, 801 + DMA_TO_DEVICE); 802 + 803 + tx->command_ptr->num_rows = (((tx_count + 15) >> 4) << 16) | 804 + ((tx_count + 15) >> 4); 805 + tx->command_ptr->src_row_addr = src_addr; 806 + 807 + dma_sync_single_for_device(uport->dev, tx->mapped_cmd_ptr, 808 + sizeof(dmov_box), DMA_TO_DEVICE); 809 + 810 + *tx->command_ptr_ptr = CMD_PTR_LP | DMOV_CMD_ADDR(tx->mapped_cmd_ptr); 811 + 812 + dma_sync_single_for_device(uport->dev, tx->mapped_cmd_ptr_ptr, 813 + sizeof(u32 *), DMA_TO_DEVICE); 814 + 815 + /* Save tx_count to use in Callback */ 816 + tx->tx_count = tx_count; 817 + msm_hs_write(uport, UARTDM_NCF_TX_ADDR, tx_count); 818 + 819 + /* Disable the tx_ready interrupt */ 820 + msm_uport->imr_reg &= ~UARTDM_ISR_TX_READY_BMSK; 821 + msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg); 822 + msm_dmov_enqueue_cmd(msm_uport->dma_tx_channel, &tx->xfer); 823 + } 824 + 825 + /* Start to receive the next chunk of data */ 826 + static void msm_hs_start_rx_locked(struct uart_port *uport) 827 + { 828 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 829 + 830 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_STALE_INT); 831 + msm_hs_write(uport, UARTDM_DMRX_ADDR, UARTDM_RX_BUF_SIZE); 832 + msm_hs_write(uport, UARTDM_CR_ADDR, STALE_EVENT_ENABLE); 833 + msm_uport->imr_reg |= UARTDM_ISR_RXLEV_BMSK; 834 + msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg); 835 + 836 + msm_uport->rx.flush = FLUSH_NONE; 837 + msm_dmov_enqueue_cmd(msm_uport->dma_rx_channel, &msm_uport->rx.xfer); 838 + 839 + /* might have finished RX and be ready to clock off */ 840 + hrtimer_start(&msm_uport->clk_off_timer, msm_uport->clk_off_delay, 841 + HRTIMER_MODE_REL); 842 + } 843 + 844 + /* Enable the transmitter Interrupt */ 845 + static void msm_hs_start_tx_locked(struct uart_port *uport) 846 + { 847 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 848 + 849 + clk_enable(msm_uport->clk); 850 + 851 + if (msm_uport->exit_lpm_cb) 852 + msm_uport->exit_lpm_cb(uport); 853 + 854 + if (msm_uport->tx.tx_ready_int_en == 0) { 855 + msm_uport->tx.tx_ready_int_en = 1; 856 + msm_hs_submit_tx_locked(uport); 857 + } 858 + 859 + clk_disable(msm_uport->clk); 860 + } 861 + 862 + /* 863 + * This routine is called when we are done with a DMA transfer 864 + * 865 + * This routine is registered with Data mover when we set 866 + * up a Data Mover transfer. It is called from Data mover ISR 867 + * when the DMA transfer is done. 868 + */ 869 + static void msm_hs_dmov_tx_callback(struct msm_dmov_cmd *cmd_ptr, 870 + unsigned int result, 871 + struct msm_dmov_errdata *err) 872 + { 873 + unsigned long flags; 874 + struct msm_hs_port *msm_uport; 875 + 876 + /* DMA did not finish properly */ 877 + WARN_ON((((result & RSLT_FIFO_CNTR_BMSK) >> 28) == 1) && 878 + !(result & RSLT_VLD)); 879 + 880 + msm_uport = container_of(cmd_ptr, struct msm_hs_port, tx.xfer); 881 + 882 + spin_lock_irqsave(&msm_uport->uport.lock, flags); 883 + clk_enable(msm_uport->clk); 884 + 885 + msm_uport->imr_reg |= UARTDM_ISR_TX_READY_BMSK; 886 + msm_hs_write(&msm_uport->uport, UARTDM_IMR_ADDR, msm_uport->imr_reg); 887 + 888 + clk_disable(msm_uport->clk); 889 + spin_unlock_irqrestore(&msm_uport->uport.lock, flags); 890 + } 891 + 892 + /* 893 + * This routine is called when we are done with a DMA transfer or the 894 + * a flush has been sent to the data mover driver. 895 + * 896 + * This routine is registered with Data mover when we set up a Data Mover 897 + * transfer. It is called from Data mover ISR when the DMA transfer is done. 898 + */ 899 + static void msm_hs_dmov_rx_callback(struct msm_dmov_cmd *cmd_ptr, 900 + unsigned int result, 901 + struct msm_dmov_errdata *err) 902 + { 903 + int retval; 904 + int rx_count; 905 + unsigned long status; 906 + unsigned int error_f = 0; 907 + unsigned long flags; 908 + unsigned int flush; 909 + struct tty_struct *tty; 910 + struct uart_port *uport; 911 + struct msm_hs_port *msm_uport; 912 + 913 + msm_uport = container_of(cmd_ptr, struct msm_hs_port, rx.xfer); 914 + uport = &msm_uport->uport; 915 + 916 + spin_lock_irqsave(&uport->lock, flags); 917 + clk_enable(msm_uport->clk); 918 + 919 + tty = uport->state->port.tty; 920 + 921 + msm_hs_write(uport, UARTDM_CR_ADDR, STALE_EVENT_DISABLE); 922 + 923 + status = msm_hs_read(uport, UARTDM_SR_ADDR); 924 + 925 + /* overflow is not connect to data in a FIFO */ 926 + if (unlikely((status & UARTDM_SR_OVERRUN_BMSK) && 927 + (uport->read_status_mask & CREAD))) { 928 + tty_insert_flip_char(tty, 0, TTY_OVERRUN); 929 + uport->icount.buf_overrun++; 930 + error_f = 1; 931 + } 932 + 933 + if (!(uport->ignore_status_mask & INPCK)) 934 + status = status & ~(UARTDM_SR_PAR_FRAME_BMSK); 935 + 936 + if (unlikely(status & UARTDM_SR_PAR_FRAME_BMSK)) { 937 + /* Can not tell difference between parity & frame error */ 938 + uport->icount.parity++; 939 + error_f = 1; 940 + if (uport->ignore_status_mask & IGNPAR) 941 + tty_insert_flip_char(tty, 0, TTY_PARITY); 942 + } 943 + 944 + if (error_f) 945 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_ERROR_STATUS); 946 + 947 + if (msm_uport->clk_req_off_state == CLK_REQ_OFF_FLUSH_ISSUED) 948 + msm_uport->clk_req_off_state = CLK_REQ_OFF_RXSTALE_FLUSHED; 949 + 950 + flush = msm_uport->rx.flush; 951 + if (flush == FLUSH_IGNORE) 952 + msm_hs_start_rx_locked(uport); 953 + if (flush == FLUSH_STOP) 954 + msm_uport->rx.flush = FLUSH_SHUTDOWN; 955 + if (flush >= FLUSH_DATA_INVALID) 956 + goto out; 957 + 958 + rx_count = msm_hs_read(uport, UARTDM_RX_TOTAL_SNAP_ADDR); 959 + 960 + if (0 != (uport->read_status_mask & CREAD)) { 961 + retval = tty_insert_flip_string(tty, msm_uport->rx.buffer, 962 + rx_count); 963 + BUG_ON(retval != rx_count); 964 + } 965 + 966 + msm_hs_start_rx_locked(uport); 967 + 968 + out: 969 + clk_disable(msm_uport->clk); 970 + 971 + spin_unlock_irqrestore(&uport->lock, flags); 972 + 973 + if (flush < FLUSH_DATA_INVALID) 974 + queue_work(msm_hs_workqueue, &msm_uport->rx.tty_work); 975 + } 976 + 977 + static void msm_hs_tty_flip_buffer_work(struct work_struct *work) 978 + { 979 + struct msm_hs_port *msm_uport = 980 + container_of(work, struct msm_hs_port, rx.tty_work); 981 + struct tty_struct *tty = msm_uport->uport.state->port.tty; 982 + 983 + tty_flip_buffer_push(tty); 984 + } 985 + 986 + /* 987 + * Standard API, Current states of modem control inputs 988 + * 989 + * Since CTS can be handled entirely by HARDWARE we always 990 + * indicate clear to send and count on the TX FIFO to block when 991 + * it fills up. 992 + * 993 + * - TIOCM_DCD 994 + * - TIOCM_CTS 995 + * - TIOCM_DSR 996 + * - TIOCM_RI 997 + * (Unsupported) DCD and DSR will return them high. RI will return low. 998 + */ 999 + static unsigned int msm_hs_get_mctrl_locked(struct uart_port *uport) 1000 + { 1001 + return TIOCM_DSR | TIOCM_CAR | TIOCM_CTS; 1002 + } 1003 + 1004 + /* 1005 + * True enables UART auto RFR, which indicates we are ready for data if the RX 1006 + * buffer is not full. False disables auto RFR, and deasserts RFR to indicate 1007 + * we are not ready for data. Must be called with UART clock on. 1008 + */ 1009 + static void set_rfr_locked(struct uart_port *uport, int auto_rfr) 1010 + { 1011 + unsigned int data; 1012 + 1013 + data = msm_hs_read(uport, UARTDM_MR1_ADDR); 1014 + 1015 + if (auto_rfr) { 1016 + /* enable auto ready-for-receiving */ 1017 + data |= UARTDM_MR1_RX_RDY_CTL_BMSK; 1018 + msm_hs_write(uport, UARTDM_MR1_ADDR, data); 1019 + } else { 1020 + /* disable auto ready-for-receiving */ 1021 + data &= ~UARTDM_MR1_RX_RDY_CTL_BMSK; 1022 + msm_hs_write(uport, UARTDM_MR1_ADDR, data); 1023 + /* RFR is active low, set high */ 1024 + msm_hs_write(uport, UARTDM_CR_ADDR, RFR_HIGH); 1025 + } 1026 + } 1027 + 1028 + /* 1029 + * Standard API, used to set or clear RFR 1030 + */ 1031 + static void msm_hs_set_mctrl_locked(struct uart_port *uport, 1032 + unsigned int mctrl) 1033 + { 1034 + unsigned int auto_rfr; 1035 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 1036 + 1037 + clk_enable(msm_uport->clk); 1038 + 1039 + auto_rfr = TIOCM_RTS & mctrl ? 1 : 0; 1040 + set_rfr_locked(uport, auto_rfr); 1041 + 1042 + clk_disable(msm_uport->clk); 1043 + } 1044 + 1045 + /* Standard API, Enable modem status (CTS) interrupt */ 1046 + static void msm_hs_enable_ms_locked(struct uart_port *uport) 1047 + { 1048 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 1049 + 1050 + clk_enable(msm_uport->clk); 1051 + 1052 + /* Enable DELTA_CTS Interrupt */ 1053 + msm_uport->imr_reg |= UARTDM_ISR_DELTA_CTS_BMSK; 1054 + msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg); 1055 + 1056 + clk_disable(msm_uport->clk); 1057 + 1058 + } 1059 + 1060 + /* 1061 + * Standard API, Break Signal 1062 + * 1063 + * Control the transmission of a break signal. ctl eq 0 => break 1064 + * signal terminate ctl ne 0 => start break signal 1065 + */ 1066 + static void msm_hs_break_ctl(struct uart_port *uport, int ctl) 1067 + { 1068 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 1069 + 1070 + clk_enable(msm_uport->clk); 1071 + msm_hs_write(uport, UARTDM_CR_ADDR, ctl ? START_BREAK : STOP_BREAK); 1072 + clk_disable(msm_uport->clk); 1073 + } 1074 + 1075 + static void msm_hs_config_port(struct uart_port *uport, int cfg_flags) 1076 + { 1077 + unsigned long flags; 1078 + 1079 + spin_lock_irqsave(&uport->lock, flags); 1080 + if (cfg_flags & UART_CONFIG_TYPE) { 1081 + uport->type = PORT_MSM; 1082 + msm_hs_request_port(uport); 1083 + } 1084 + spin_unlock_irqrestore(&uport->lock, flags); 1085 + } 1086 + 1087 + /* Handle CTS changes (Called from interrupt handler) */ 1088 + static void msm_hs_handle_delta_cts(struct uart_port *uport) 1089 + { 1090 + unsigned long flags; 1091 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 1092 + 1093 + spin_lock_irqsave(&uport->lock, flags); 1094 + clk_enable(msm_uport->clk); 1095 + 1096 + /* clear interrupt */ 1097 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_CTS); 1098 + uport->icount.cts++; 1099 + 1100 + clk_disable(msm_uport->clk); 1101 + spin_unlock_irqrestore(&uport->lock, flags); 1102 + 1103 + /* clear the IOCTL TIOCMIWAIT if called */ 1104 + wake_up_interruptible(&uport->state->port.delta_msr_wait); 1105 + } 1106 + 1107 + /* check if the TX path is flushed, and if so clock off 1108 + * returns 0 did not clock off, need to retry (still sending final byte) 1109 + * -1 did not clock off, do not retry 1110 + * 1 if we clocked off 1111 + */ 1112 + static int msm_hs_check_clock_off_locked(struct uart_port *uport) 1113 + { 1114 + unsigned long sr_status; 1115 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 1116 + struct circ_buf *tx_buf = &uport->state->xmit; 1117 + 1118 + /* Cancel if tx tty buffer is not empty, dma is in flight, 1119 + * or tx fifo is not empty, or rx fifo is not empty */ 1120 + if (msm_uport->clk_state != MSM_HS_CLK_REQUEST_OFF || 1121 + !uart_circ_empty(tx_buf) || msm_uport->tx.dma_in_flight || 1122 + (msm_uport->imr_reg & UARTDM_ISR_TXLEV_BMSK) || 1123 + !(msm_uport->imr_reg & UARTDM_ISR_RXLEV_BMSK)) { 1124 + return -1; 1125 + } 1126 + 1127 + /* Make sure the uart is finished with the last byte */ 1128 + sr_status = msm_hs_read(uport, UARTDM_SR_ADDR); 1129 + if (!(sr_status & UARTDM_SR_TXEMT_BMSK)) 1130 + return 0; /* retry */ 1131 + 1132 + /* Make sure forced RXSTALE flush complete */ 1133 + switch (msm_uport->clk_req_off_state) { 1134 + case CLK_REQ_OFF_START: 1135 + msm_uport->clk_req_off_state = CLK_REQ_OFF_RXSTALE_ISSUED; 1136 + msm_hs_write(uport, UARTDM_CR_ADDR, FORCE_STALE_EVENT); 1137 + return 0; /* RXSTALE flush not complete - retry */ 1138 + case CLK_REQ_OFF_RXSTALE_ISSUED: 1139 + case CLK_REQ_OFF_FLUSH_ISSUED: 1140 + return 0; /* RXSTALE flush not complete - retry */ 1141 + case CLK_REQ_OFF_RXSTALE_FLUSHED: 1142 + break; /* continue */ 1143 + } 1144 + 1145 + if (msm_uport->rx.flush != FLUSH_SHUTDOWN) { 1146 + if (msm_uport->rx.flush == FLUSH_NONE) 1147 + msm_hs_stop_rx_locked(uport); 1148 + return 0; /* come back later to really clock off */ 1149 + } 1150 + 1151 + /* we really want to clock off */ 1152 + clk_disable(msm_uport->clk); 1153 + msm_uport->clk_state = MSM_HS_CLK_OFF; 1154 + 1155 + if (use_low_power_rx_wakeup(msm_uport)) { 1156 + msm_uport->rx_wakeup.ignore = 1; 1157 + enable_irq(msm_uport->rx_wakeup.irq); 1158 + } 1159 + return 1; 1160 + } 1161 + 1162 + static enum hrtimer_restart msm_hs_clk_off_retry(struct hrtimer *timer) 1163 + { 1164 + unsigned long flags; 1165 + int ret = HRTIMER_NORESTART; 1166 + struct msm_hs_port *msm_uport = container_of(timer, struct msm_hs_port, 1167 + clk_off_timer); 1168 + struct uart_port *uport = &msm_uport->uport; 1169 + 1170 + spin_lock_irqsave(&uport->lock, flags); 1171 + 1172 + if (!msm_hs_check_clock_off_locked(uport)) { 1173 + hrtimer_forward_now(timer, msm_uport->clk_off_delay); 1174 + ret = HRTIMER_RESTART; 1175 + } 1176 + 1177 + spin_unlock_irqrestore(&uport->lock, flags); 1178 + 1179 + return ret; 1180 + } 1181 + 1182 + static irqreturn_t msm_hs_isr(int irq, void *dev) 1183 + { 1184 + unsigned long flags; 1185 + unsigned long isr_status; 1186 + struct msm_hs_port *msm_uport = dev; 1187 + struct uart_port *uport = &msm_uport->uport; 1188 + struct circ_buf *tx_buf = &uport->state->xmit; 1189 + struct msm_hs_tx *tx = &msm_uport->tx; 1190 + struct msm_hs_rx *rx = &msm_uport->rx; 1191 + 1192 + spin_lock_irqsave(&uport->lock, flags); 1193 + 1194 + isr_status = msm_hs_read(uport, UARTDM_MISR_ADDR); 1195 + 1196 + /* Uart RX starting */ 1197 + if (isr_status & UARTDM_ISR_RXLEV_BMSK) { 1198 + msm_uport->imr_reg &= ~UARTDM_ISR_RXLEV_BMSK; 1199 + msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg); 1200 + } 1201 + /* Stale rx interrupt */ 1202 + if (isr_status & UARTDM_ISR_RXSTALE_BMSK) { 1203 + msm_hs_write(uport, UARTDM_CR_ADDR, STALE_EVENT_DISABLE); 1204 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_STALE_INT); 1205 + 1206 + if (msm_uport->clk_req_off_state == CLK_REQ_OFF_RXSTALE_ISSUED) 1207 + msm_uport->clk_req_off_state = 1208 + CLK_REQ_OFF_FLUSH_ISSUED; 1209 + if (rx->flush == FLUSH_NONE) { 1210 + rx->flush = FLUSH_DATA_READY; 1211 + msm_dmov_stop_cmd(msm_uport->dma_rx_channel, NULL, 1); 1212 + } 1213 + } 1214 + /* tx ready interrupt */ 1215 + if (isr_status & UARTDM_ISR_TX_READY_BMSK) { 1216 + /* Clear TX Ready */ 1217 + msm_hs_write(uport, UARTDM_CR_ADDR, CLEAR_TX_READY); 1218 + 1219 + if (msm_uport->clk_state == MSM_HS_CLK_REQUEST_OFF) { 1220 + msm_uport->imr_reg |= UARTDM_ISR_TXLEV_BMSK; 1221 + msm_hs_write(uport, UARTDM_IMR_ADDR, 1222 + msm_uport->imr_reg); 1223 + } 1224 + 1225 + /* Complete DMA TX transactions and submit new transactions */ 1226 + tx_buf->tail = (tx_buf->tail + tx->tx_count) & ~UART_XMIT_SIZE; 1227 + 1228 + tx->dma_in_flight = 0; 1229 + 1230 + uport->icount.tx += tx->tx_count; 1231 + if (tx->tx_ready_int_en) 1232 + msm_hs_submit_tx_locked(uport); 1233 + 1234 + if (uart_circ_chars_pending(tx_buf) < WAKEUP_CHARS) 1235 + uart_write_wakeup(uport); 1236 + } 1237 + if (isr_status & UARTDM_ISR_TXLEV_BMSK) { 1238 + /* TX FIFO is empty */ 1239 + msm_uport->imr_reg &= ~UARTDM_ISR_TXLEV_BMSK; 1240 + msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg); 1241 + if (!msm_hs_check_clock_off_locked(uport)) 1242 + hrtimer_start(&msm_uport->clk_off_timer, 1243 + msm_uport->clk_off_delay, 1244 + HRTIMER_MODE_REL); 1245 + } 1246 + 1247 + /* Change in CTS interrupt */ 1248 + if (isr_status & UARTDM_ISR_DELTA_CTS_BMSK) 1249 + msm_hs_handle_delta_cts(uport); 1250 + 1251 + spin_unlock_irqrestore(&uport->lock, flags); 1252 + 1253 + return IRQ_HANDLED; 1254 + } 1255 + 1256 + void msm_hs_request_clock_off_locked(struct uart_port *uport) 1257 + { 1258 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 1259 + 1260 + if (msm_uport->clk_state == MSM_HS_CLK_ON) { 1261 + msm_uport->clk_state = MSM_HS_CLK_REQUEST_OFF; 1262 + msm_uport->clk_req_off_state = CLK_REQ_OFF_START; 1263 + if (!use_low_power_rx_wakeup(msm_uport)) 1264 + set_rfr_locked(uport, 0); 1265 + msm_uport->imr_reg |= UARTDM_ISR_TXLEV_BMSK; 1266 + msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg); 1267 + } 1268 + } 1269 + 1270 + /** 1271 + * msm_hs_request_clock_off - request to (i.e. asynchronously) turn off uart 1272 + * clock once pending TX is flushed and Rx DMA command is terminated. 1273 + * @uport: uart_port structure for the device instance. 1274 + * 1275 + * This functions puts the device into a partially active low power mode. It 1276 + * waits to complete all pending tx transactions, flushes ongoing Rx DMA 1277 + * command and terminates UART side Rx transaction, puts UART HW in non DMA 1278 + * mode and then clocks off the device. A client calls this when no UART 1279 + * data is expected. msm_request_clock_on() must be called before any further 1280 + * UART can be sent or received. 1281 + */ 1282 + void msm_hs_request_clock_off(struct uart_port *uport) 1283 + { 1284 + unsigned long flags; 1285 + 1286 + spin_lock_irqsave(&uport->lock, flags); 1287 + msm_hs_request_clock_off_locked(uport); 1288 + spin_unlock_irqrestore(&uport->lock, flags); 1289 + } 1290 + 1291 + void msm_hs_request_clock_on_locked(struct uart_port *uport) 1292 + { 1293 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 1294 + unsigned int data; 1295 + 1296 + switch (msm_uport->clk_state) { 1297 + case MSM_HS_CLK_OFF: 1298 + clk_enable(msm_uport->clk); 1299 + disable_irq_nosync(msm_uport->rx_wakeup.irq); 1300 + /* fall-through */ 1301 + case MSM_HS_CLK_REQUEST_OFF: 1302 + if (msm_uport->rx.flush == FLUSH_STOP || 1303 + msm_uport->rx.flush == FLUSH_SHUTDOWN) { 1304 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_RX); 1305 + data = msm_hs_read(uport, UARTDM_DMEN_ADDR); 1306 + data |= UARTDM_RX_DM_EN_BMSK; 1307 + msm_hs_write(uport, UARTDM_DMEN_ADDR, data); 1308 + } 1309 + hrtimer_try_to_cancel(&msm_uport->clk_off_timer); 1310 + if (msm_uport->rx.flush == FLUSH_SHUTDOWN) 1311 + msm_hs_start_rx_locked(uport); 1312 + if (!use_low_power_rx_wakeup(msm_uport)) 1313 + set_rfr_locked(uport, 1); 1314 + if (msm_uport->rx.flush == FLUSH_STOP) 1315 + msm_uport->rx.flush = FLUSH_IGNORE; 1316 + msm_uport->clk_state = MSM_HS_CLK_ON; 1317 + break; 1318 + case MSM_HS_CLK_ON: 1319 + break; 1320 + case MSM_HS_CLK_PORT_OFF: 1321 + break; 1322 + } 1323 + } 1324 + 1325 + /** 1326 + * msm_hs_request_clock_on - Switch the device from partially active low 1327 + * power mode to fully active (i.e. clock on) mode. 1328 + * @uport: uart_port structure for the device. 1329 + * 1330 + * This function switches on the input clock, puts UART HW into DMA mode 1331 + * and enqueues an Rx DMA command if the device was in partially active 1332 + * mode. It has no effect if called with the device in inactive state. 1333 + */ 1334 + void msm_hs_request_clock_on(struct uart_port *uport) 1335 + { 1336 + unsigned long flags; 1337 + 1338 + spin_lock_irqsave(&uport->lock, flags); 1339 + msm_hs_request_clock_on_locked(uport); 1340 + spin_unlock_irqrestore(&uport->lock, flags); 1341 + } 1342 + 1343 + static irqreturn_t msm_hs_rx_wakeup_isr(int irq, void *dev) 1344 + { 1345 + unsigned int wakeup = 0; 1346 + unsigned long flags; 1347 + struct msm_hs_port *msm_uport = dev; 1348 + struct uart_port *uport = &msm_uport->uport; 1349 + struct tty_struct *tty = NULL; 1350 + 1351 + spin_lock_irqsave(&uport->lock, flags); 1352 + if (msm_uport->clk_state == MSM_HS_CLK_OFF) { 1353 + /* ignore the first irq - it is a pending irq that occured 1354 + * before enable_irq() */ 1355 + if (msm_uport->rx_wakeup.ignore) 1356 + msm_uport->rx_wakeup.ignore = 0; 1357 + else 1358 + wakeup = 1; 1359 + } 1360 + 1361 + if (wakeup) { 1362 + /* the uart was clocked off during an rx, wake up and 1363 + * optionally inject char into tty rx */ 1364 + msm_hs_request_clock_on_locked(uport); 1365 + if (msm_uport->rx_wakeup.inject_rx) { 1366 + tty = uport->state->port.tty; 1367 + tty_insert_flip_char(tty, 1368 + msm_uport->rx_wakeup.rx_to_inject, 1369 + TTY_NORMAL); 1370 + queue_work(msm_hs_workqueue, &msm_uport->rx.tty_work); 1371 + } 1372 + } 1373 + 1374 + spin_unlock_irqrestore(&uport->lock, flags); 1375 + 1376 + return IRQ_HANDLED; 1377 + } 1378 + 1379 + static const char *msm_hs_type(struct uart_port *port) 1380 + { 1381 + return (port->type == PORT_MSM) ? "MSM_HS_UART" : NULL; 1382 + } 1383 + 1384 + /* Called when port is opened */ 1385 + static int msm_hs_startup(struct uart_port *uport) 1386 + { 1387 + int ret; 1388 + int rfr_level; 1389 + unsigned long flags; 1390 + unsigned int data; 1391 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 1392 + struct circ_buf *tx_buf = &uport->state->xmit; 1393 + struct msm_hs_tx *tx = &msm_uport->tx; 1394 + struct msm_hs_rx *rx = &msm_uport->rx; 1395 + 1396 + rfr_level = uport->fifosize; 1397 + if (rfr_level > 16) 1398 + rfr_level -= 16; 1399 + 1400 + tx->dma_base = dma_map_single(uport->dev, tx_buf->buf, UART_XMIT_SIZE, 1401 + DMA_TO_DEVICE); 1402 + 1403 + /* do not let tty layer execute RX in global workqueue, use a 1404 + * dedicated workqueue managed by this driver */ 1405 + uport->state->port.tty->low_latency = 1; 1406 + 1407 + /* turn on uart clk */ 1408 + ret = msm_hs_init_clk_locked(uport); 1409 + if (unlikely(ret)) { 1410 + printk(KERN_ERR "Turning uartclk failed!\n"); 1411 + goto err_msm_hs_init_clk; 1412 + } 1413 + 1414 + /* Set auto RFR Level */ 1415 + data = msm_hs_read(uport, UARTDM_MR1_ADDR); 1416 + data &= ~UARTDM_MR1_AUTO_RFR_LEVEL1_BMSK; 1417 + data &= ~UARTDM_MR1_AUTO_RFR_LEVEL0_BMSK; 1418 + data |= (UARTDM_MR1_AUTO_RFR_LEVEL1_BMSK & (rfr_level << 2)); 1419 + data |= (UARTDM_MR1_AUTO_RFR_LEVEL0_BMSK & rfr_level); 1420 + msm_hs_write(uport, UARTDM_MR1_ADDR, data); 1421 + 1422 + /* Make sure RXSTALE count is non-zero */ 1423 + data = msm_hs_read(uport, UARTDM_IPR_ADDR); 1424 + if (!data) { 1425 + data |= 0x1f & UARTDM_IPR_STALE_LSB_BMSK; 1426 + msm_hs_write(uport, UARTDM_IPR_ADDR, data); 1427 + } 1428 + 1429 + /* Enable Data Mover Mode */ 1430 + data = UARTDM_TX_DM_EN_BMSK | UARTDM_RX_DM_EN_BMSK; 1431 + msm_hs_write(uport, UARTDM_DMEN_ADDR, data); 1432 + 1433 + /* Reset TX */ 1434 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_TX); 1435 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_RX); 1436 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_ERROR_STATUS); 1437 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_BREAK_INT); 1438 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_STALE_INT); 1439 + msm_hs_write(uport, UARTDM_CR_ADDR, RESET_CTS); 1440 + msm_hs_write(uport, UARTDM_CR_ADDR, RFR_LOW); 1441 + /* Turn on Uart Receiver */ 1442 + msm_hs_write(uport, UARTDM_CR_ADDR, UARTDM_CR_RX_EN_BMSK); 1443 + 1444 + /* Turn on Uart Transmitter */ 1445 + msm_hs_write(uport, UARTDM_CR_ADDR, UARTDM_CR_TX_EN_BMSK); 1446 + 1447 + /* Initialize the tx */ 1448 + tx->tx_ready_int_en = 0; 1449 + tx->dma_in_flight = 0; 1450 + 1451 + tx->xfer.complete_func = msm_hs_dmov_tx_callback; 1452 + tx->xfer.execute_func = NULL; 1453 + 1454 + tx->command_ptr->cmd = CMD_LC | 1455 + CMD_DST_CRCI(msm_uport->dma_tx_crci) | CMD_MODE_BOX; 1456 + 1457 + tx->command_ptr->src_dst_len = (MSM_UARTDM_BURST_SIZE << 16) 1458 + | (MSM_UARTDM_BURST_SIZE); 1459 + 1460 + tx->command_ptr->row_offset = (MSM_UARTDM_BURST_SIZE << 16); 1461 + 1462 + tx->command_ptr->dst_row_addr = 1463 + msm_uport->uport.mapbase + UARTDM_TF_ADDR; 1464 + 1465 + 1466 + /* Turn on Uart Receive */ 1467 + rx->xfer.complete_func = msm_hs_dmov_rx_callback; 1468 + rx->xfer.execute_func = NULL; 1469 + 1470 + rx->command_ptr->cmd = CMD_LC | 1471 + CMD_SRC_CRCI(msm_uport->dma_rx_crci) | CMD_MODE_BOX; 1472 + 1473 + rx->command_ptr->src_dst_len = (MSM_UARTDM_BURST_SIZE << 16) 1474 + | (MSM_UARTDM_BURST_SIZE); 1475 + rx->command_ptr->row_offset = MSM_UARTDM_BURST_SIZE; 1476 + rx->command_ptr->src_row_addr = uport->mapbase + UARTDM_RF_ADDR; 1477 + 1478 + 1479 + msm_uport->imr_reg |= UARTDM_ISR_RXSTALE_BMSK; 1480 + /* Enable reading the current CTS, no harm even if CTS is ignored */ 1481 + msm_uport->imr_reg |= UARTDM_ISR_CURRENT_CTS_BMSK; 1482 + 1483 + msm_hs_write(uport, UARTDM_TFWR_ADDR, 0); /* TXLEV on empty TX fifo */ 1484 + 1485 + 1486 + ret = request_irq(uport->irq, msm_hs_isr, IRQF_TRIGGER_HIGH, 1487 + "msm_hs_uart", msm_uport); 1488 + if (unlikely(ret)) { 1489 + printk(KERN_ERR "Request msm_hs_uart IRQ failed!\n"); 1490 + goto err_request_irq; 1491 + } 1492 + if (use_low_power_rx_wakeup(msm_uport)) { 1493 + ret = request_irq(msm_uport->rx_wakeup.irq, 1494 + msm_hs_rx_wakeup_isr, 1495 + IRQF_TRIGGER_FALLING, 1496 + "msm_hs_rx_wakeup", msm_uport); 1497 + if (unlikely(ret)) { 1498 + printk(KERN_ERR "Request msm_hs_rx_wakeup IRQ failed!\n"); 1499 + free_irq(uport->irq, msm_uport); 1500 + goto err_request_irq; 1501 + } 1502 + disable_irq(msm_uport->rx_wakeup.irq); 1503 + } 1504 + 1505 + spin_lock_irqsave(&uport->lock, flags); 1506 + 1507 + msm_hs_write(uport, UARTDM_RFWR_ADDR, 0); 1508 + msm_hs_start_rx_locked(uport); 1509 + 1510 + spin_unlock_irqrestore(&uport->lock, flags); 1511 + ret = pm_runtime_set_active(uport->dev); 1512 + if (ret) 1513 + dev_err(uport->dev, "set active error:%d\n", ret); 1514 + pm_runtime_enable(uport->dev); 1515 + 1516 + return 0; 1517 + 1518 + err_request_irq: 1519 + err_msm_hs_init_clk: 1520 + dma_unmap_single(uport->dev, tx->dma_base, 1521 + UART_XMIT_SIZE, DMA_TO_DEVICE); 1522 + return ret; 1523 + } 1524 + 1525 + /* Initialize tx and rx data structures */ 1526 + static int __devinit uartdm_init_port(struct uart_port *uport) 1527 + { 1528 + int ret = 0; 1529 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 1530 + struct msm_hs_tx *tx = &msm_uport->tx; 1531 + struct msm_hs_rx *rx = &msm_uport->rx; 1532 + 1533 + /* Allocate the command pointer. Needs to be 64 bit aligned */ 1534 + tx->command_ptr = kmalloc(sizeof(dmov_box), GFP_KERNEL | __GFP_DMA); 1535 + if (!tx->command_ptr) 1536 + return -ENOMEM; 1537 + 1538 + tx->command_ptr_ptr = kmalloc(sizeof(u32 *), GFP_KERNEL | __GFP_DMA); 1539 + if (!tx->command_ptr_ptr) { 1540 + ret = -ENOMEM; 1541 + goto err_tx_command_ptr_ptr; 1542 + } 1543 + 1544 + tx->mapped_cmd_ptr = dma_map_single(uport->dev, tx->command_ptr, 1545 + sizeof(dmov_box), DMA_TO_DEVICE); 1546 + tx->mapped_cmd_ptr_ptr = dma_map_single(uport->dev, 1547 + tx->command_ptr_ptr, 1548 + sizeof(u32 *), DMA_TO_DEVICE); 1549 + tx->xfer.cmdptr = DMOV_CMD_ADDR(tx->mapped_cmd_ptr_ptr); 1550 + 1551 + init_waitqueue_head(&rx->wait); 1552 + 1553 + rx->pool = dma_pool_create("rx_buffer_pool", uport->dev, 1554 + UARTDM_RX_BUF_SIZE, 16, 0); 1555 + if (!rx->pool) { 1556 + pr_err("%s(): cannot allocate rx_buffer_pool", __func__); 1557 + ret = -ENOMEM; 1558 + goto err_dma_pool_create; 1559 + } 1560 + 1561 + rx->buffer = dma_pool_alloc(rx->pool, GFP_KERNEL, &rx->rbuffer); 1562 + if (!rx->buffer) { 1563 + pr_err("%s(): cannot allocate rx->buffer", __func__); 1564 + ret = -ENOMEM; 1565 + goto err_dma_pool_alloc; 1566 + } 1567 + 1568 + /* Allocate the command pointer. Needs to be 64 bit aligned */ 1569 + rx->command_ptr = kmalloc(sizeof(dmov_box), GFP_KERNEL | __GFP_DMA); 1570 + if (!rx->command_ptr) { 1571 + pr_err("%s(): cannot allocate rx->command_ptr", __func__); 1572 + ret = -ENOMEM; 1573 + goto err_rx_command_ptr; 1574 + } 1575 + 1576 + rx->command_ptr_ptr = kmalloc(sizeof(u32 *), GFP_KERNEL | __GFP_DMA); 1577 + if (!rx->command_ptr_ptr) { 1578 + pr_err("%s(): cannot allocate rx->command_ptr_ptr", __func__); 1579 + ret = -ENOMEM; 1580 + goto err_rx_command_ptr_ptr; 1581 + } 1582 + 1583 + rx->command_ptr->num_rows = ((UARTDM_RX_BUF_SIZE >> 4) << 16) | 1584 + (UARTDM_RX_BUF_SIZE >> 4); 1585 + 1586 + rx->command_ptr->dst_row_addr = rx->rbuffer; 1587 + 1588 + rx->mapped_cmd_ptr = dma_map_single(uport->dev, rx->command_ptr, 1589 + sizeof(dmov_box), DMA_TO_DEVICE); 1590 + 1591 + *rx->command_ptr_ptr = CMD_PTR_LP | DMOV_CMD_ADDR(rx->mapped_cmd_ptr); 1592 + 1593 + rx->cmdptr_dmaaddr = dma_map_single(uport->dev, rx->command_ptr_ptr, 1594 + sizeof(u32 *), DMA_TO_DEVICE); 1595 + rx->xfer.cmdptr = DMOV_CMD_ADDR(rx->cmdptr_dmaaddr); 1596 + 1597 + INIT_WORK(&rx->tty_work, msm_hs_tty_flip_buffer_work); 1598 + 1599 + return ret; 1600 + 1601 + err_rx_command_ptr_ptr: 1602 + kfree(rx->command_ptr); 1603 + err_rx_command_ptr: 1604 + dma_pool_free(msm_uport->rx.pool, msm_uport->rx.buffer, 1605 + msm_uport->rx.rbuffer); 1606 + err_dma_pool_alloc: 1607 + dma_pool_destroy(msm_uport->rx.pool); 1608 + err_dma_pool_create: 1609 + dma_unmap_single(uport->dev, msm_uport->tx.mapped_cmd_ptr_ptr, 1610 + sizeof(u32 *), DMA_TO_DEVICE); 1611 + dma_unmap_single(uport->dev, msm_uport->tx.mapped_cmd_ptr, 1612 + sizeof(dmov_box), DMA_TO_DEVICE); 1613 + kfree(msm_uport->tx.command_ptr_ptr); 1614 + err_tx_command_ptr_ptr: 1615 + kfree(msm_uport->tx.command_ptr); 1616 + return ret; 1617 + } 1618 + 1619 + static int __devinit msm_hs_probe(struct platform_device *pdev) 1620 + { 1621 + int ret; 1622 + struct uart_port *uport; 1623 + struct msm_hs_port *msm_uport; 1624 + struct resource *resource; 1625 + const struct msm_serial_hs_platform_data *pdata = 1626 + pdev->dev.platform_data; 1627 + 1628 + if (pdev->id < 0 || pdev->id >= UARTDM_NR) { 1629 + printk(KERN_ERR "Invalid plaform device ID = %d\n", pdev->id); 1630 + return -EINVAL; 1631 + } 1632 + 1633 + msm_uport = &q_uart_port[pdev->id]; 1634 + uport = &msm_uport->uport; 1635 + 1636 + uport->dev = &pdev->dev; 1637 + 1638 + resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1639 + if (unlikely(!resource)) 1640 + return -ENXIO; 1641 + 1642 + uport->mapbase = resource->start; 1643 + uport->irq = platform_get_irq(pdev, 0); 1644 + if (unlikely(uport->irq < 0)) 1645 + return -ENXIO; 1646 + 1647 + if (unlikely(set_irq_wake(uport->irq, 1))) 1648 + return -ENXIO; 1649 + 1650 + if (pdata == NULL || pdata->rx_wakeup_irq < 0) 1651 + msm_uport->rx_wakeup.irq = -1; 1652 + else { 1653 + msm_uport->rx_wakeup.irq = pdata->rx_wakeup_irq; 1654 + msm_uport->rx_wakeup.ignore = 1; 1655 + msm_uport->rx_wakeup.inject_rx = pdata->inject_rx_on_wakeup; 1656 + msm_uport->rx_wakeup.rx_to_inject = pdata->rx_to_inject; 1657 + 1658 + if (unlikely(msm_uport->rx_wakeup.irq < 0)) 1659 + return -ENXIO; 1660 + 1661 + if (unlikely(set_irq_wake(msm_uport->rx_wakeup.irq, 1))) 1662 + return -ENXIO; 1663 + } 1664 + 1665 + if (pdata == NULL) 1666 + msm_uport->exit_lpm_cb = NULL; 1667 + else 1668 + msm_uport->exit_lpm_cb = pdata->exit_lpm_cb; 1669 + 1670 + resource = platform_get_resource_byname(pdev, IORESOURCE_DMA, 1671 + "uartdm_channels"); 1672 + if (unlikely(!resource)) 1673 + return -ENXIO; 1674 + 1675 + msm_uport->dma_tx_channel = resource->start; 1676 + msm_uport->dma_rx_channel = resource->end; 1677 + 1678 + resource = platform_get_resource_byname(pdev, IORESOURCE_DMA, 1679 + "uartdm_crci"); 1680 + if (unlikely(!resource)) 1681 + return -ENXIO; 1682 + 1683 + msm_uport->dma_tx_crci = resource->start; 1684 + msm_uport->dma_rx_crci = resource->end; 1685 + 1686 + uport->iotype = UPIO_MEM; 1687 + uport->fifosize = UART_FIFOSIZE; 1688 + uport->ops = &msm_hs_ops; 1689 + uport->flags = UPF_BOOT_AUTOCONF; 1690 + uport->uartclk = UARTCLK; 1691 + msm_uport->imr_reg = 0x0; 1692 + msm_uport->clk = clk_get(&pdev->dev, "uartdm_clk"); 1693 + if (IS_ERR(msm_uport->clk)) 1694 + return PTR_ERR(msm_uport->clk); 1695 + 1696 + ret = uartdm_init_port(uport); 1697 + if (unlikely(ret)) 1698 + return ret; 1699 + 1700 + msm_uport->clk_state = MSM_HS_CLK_PORT_OFF; 1701 + hrtimer_init(&msm_uport->clk_off_timer, CLOCK_MONOTONIC, 1702 + HRTIMER_MODE_REL); 1703 + msm_uport->clk_off_timer.function = msm_hs_clk_off_retry; 1704 + msm_uport->clk_off_delay = ktime_set(0, 1000000); /* 1ms */ 1705 + 1706 + uport->line = pdev->id; 1707 + return uart_add_one_port(&msm_hs_driver, uport); 1708 + } 1709 + 1710 + static int __init msm_serial_hs_init(void) 1711 + { 1712 + int ret, i; 1713 + 1714 + /* Init all UARTS as non-configured */ 1715 + for (i = 0; i < UARTDM_NR; i++) 1716 + q_uart_port[i].uport.type = PORT_UNKNOWN; 1717 + 1718 + msm_hs_workqueue = create_singlethread_workqueue("msm_serial_hs"); 1719 + if (unlikely(!msm_hs_workqueue)) 1720 + return -ENOMEM; 1721 + 1722 + ret = uart_register_driver(&msm_hs_driver); 1723 + if (unlikely(ret)) { 1724 + printk(KERN_ERR "%s failed to load\n", __func__); 1725 + goto err_uart_register_driver; 1726 + } 1727 + 1728 + ret = platform_driver_register(&msm_serial_hs_platform_driver); 1729 + if (ret) { 1730 + printk(KERN_ERR "%s failed to load\n", __func__); 1731 + goto err_platform_driver_register; 1732 + } 1733 + 1734 + return ret; 1735 + 1736 + err_platform_driver_register: 1737 + uart_unregister_driver(&msm_hs_driver); 1738 + err_uart_register_driver: 1739 + destroy_workqueue(msm_hs_workqueue); 1740 + return ret; 1741 + } 1742 + module_init(msm_serial_hs_init); 1743 + 1744 + /* 1745 + * Called by the upper layer when port is closed. 1746 + * - Disables the port 1747 + * - Unhook the ISR 1748 + */ 1749 + static void msm_hs_shutdown(struct uart_port *uport) 1750 + { 1751 + unsigned long flags; 1752 + struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); 1753 + 1754 + BUG_ON(msm_uport->rx.flush < FLUSH_STOP); 1755 + 1756 + spin_lock_irqsave(&uport->lock, flags); 1757 + clk_enable(msm_uport->clk); 1758 + 1759 + /* Disable the transmitter */ 1760 + msm_hs_write(uport, UARTDM_CR_ADDR, UARTDM_CR_TX_DISABLE_BMSK); 1761 + /* Disable the receiver */ 1762 + msm_hs_write(uport, UARTDM_CR_ADDR, UARTDM_CR_RX_DISABLE_BMSK); 1763 + 1764 + pm_runtime_disable(uport->dev); 1765 + pm_runtime_set_suspended(uport->dev); 1766 + 1767 + /* Free the interrupt */ 1768 + free_irq(uport->irq, msm_uport); 1769 + if (use_low_power_rx_wakeup(msm_uport)) 1770 + free_irq(msm_uport->rx_wakeup.irq, msm_uport); 1771 + 1772 + msm_uport->imr_reg = 0; 1773 + msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg); 1774 + 1775 + wait_event(msm_uport->rx.wait, msm_uport->rx.flush == FLUSH_SHUTDOWN); 1776 + 1777 + clk_disable(msm_uport->clk); /* to balance local clk_enable() */ 1778 + if (msm_uport->clk_state != MSM_HS_CLK_OFF) 1779 + clk_disable(msm_uport->clk); /* to balance clk_state */ 1780 + msm_uport->clk_state = MSM_HS_CLK_PORT_OFF; 1781 + 1782 + dma_unmap_single(uport->dev, msm_uport->tx.dma_base, 1783 + UART_XMIT_SIZE, DMA_TO_DEVICE); 1784 + 1785 + spin_unlock_irqrestore(&uport->lock, flags); 1786 + 1787 + if (cancel_work_sync(&msm_uport->rx.tty_work)) 1788 + msm_hs_tty_flip_buffer_work(&msm_uport->rx.tty_work); 1789 + } 1790 + 1791 + static void __exit msm_serial_hs_exit(void) 1792 + { 1793 + flush_workqueue(msm_hs_workqueue); 1794 + destroy_workqueue(msm_hs_workqueue); 1795 + platform_driver_unregister(&msm_serial_hs_platform_driver); 1796 + uart_unregister_driver(&msm_hs_driver); 1797 + } 1798 + module_exit(msm_serial_hs_exit); 1799 + 1800 + #ifdef CONFIG_PM_RUNTIME 1801 + static int msm_hs_runtime_idle(struct device *dev) 1802 + { 1803 + /* 1804 + * returning success from idle results in runtime suspend to be 1805 + * called 1806 + */ 1807 + return 0; 1808 + } 1809 + 1810 + static int msm_hs_runtime_resume(struct device *dev) 1811 + { 1812 + struct platform_device *pdev = container_of(dev, struct 1813 + platform_device, dev); 1814 + struct msm_hs_port *msm_uport = &q_uart_port[pdev->id]; 1815 + 1816 + msm_hs_request_clock_on(&msm_uport->uport); 1817 + return 0; 1818 + } 1819 + 1820 + static int msm_hs_runtime_suspend(struct device *dev) 1821 + { 1822 + struct platform_device *pdev = container_of(dev, struct 1823 + platform_device, dev); 1824 + struct msm_hs_port *msm_uport = &q_uart_port[pdev->id]; 1825 + 1826 + msm_hs_request_clock_off(&msm_uport->uport); 1827 + return 0; 1828 + } 1829 + #else 1830 + #define msm_hs_runtime_idle NULL 1831 + #define msm_hs_runtime_resume NULL 1832 + #define msm_hs_runtime_suspend NULL 1833 + #endif 1834 + 1835 + static const struct dev_pm_ops msm_hs_dev_pm_ops = { 1836 + .runtime_suspend = msm_hs_runtime_suspend, 1837 + .runtime_resume = msm_hs_runtime_resume, 1838 + .runtime_idle = msm_hs_runtime_idle, 1839 + }; 1840 + 1841 + static struct platform_driver msm_serial_hs_platform_driver = { 1842 + .probe = msm_hs_probe, 1843 + .remove = __devexit_p(msm_hs_remove), 1844 + .driver = { 1845 + .name = "msm_serial_hs", 1846 + .owner = THIS_MODULE, 1847 + .pm = &msm_hs_dev_pm_ops, 1848 + }, 1849 + }; 1850 + 1851 + static struct uart_driver msm_hs_driver = { 1852 + .owner = THIS_MODULE, 1853 + .driver_name = "msm_serial_hs", 1854 + .dev_name = "ttyHS", 1855 + .nr = UARTDM_NR, 1856 + .cons = 0, 1857 + }; 1858 + 1859 + static struct uart_ops msm_hs_ops = { 1860 + .tx_empty = msm_hs_tx_empty, 1861 + .set_mctrl = msm_hs_set_mctrl_locked, 1862 + .get_mctrl = msm_hs_get_mctrl_locked, 1863 + .stop_tx = msm_hs_stop_tx_locked, 1864 + .start_tx = msm_hs_start_tx_locked, 1865 + .stop_rx = msm_hs_stop_rx_locked, 1866 + .enable_ms = msm_hs_enable_ms_locked, 1867 + .break_ctl = msm_hs_break_ctl, 1868 + .startup = msm_hs_startup, 1869 + .shutdown = msm_hs_shutdown, 1870 + .set_termios = msm_hs_set_termios, 1871 + .pm = msm_hs_pm, 1872 + .type = msm_hs_type, 1873 + .config_port = msm_hs_config_port, 1874 + .release_port = msm_hs_release_port, 1875 + .request_port = msm_hs_request_port, 1876 + }; 1877 + 1878 + MODULE_DESCRIPTION("High Speed UART Driver for the MSM chipset"); 1879 + MODULE_VERSION("1.2"); 1880 + MODULE_LICENSE("GPL v2");
+236
drivers/tty/serial/msm_smd_tty.c
··· 1 + /* drivers/tty/serial/msm_smd_tty.c 2 + * 3 + * Copyright (C) 2007 Google, Inc. 4 + * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 5 + * Author: Brian Swetland <swetland@google.com> 6 + * 7 + * This software is licensed under the terms of the GNU General Public 8 + * License version 2, as published by the Free Software Foundation, and 9 + * may be copied, distributed, and modified under those terms. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + * 16 + */ 17 + 18 + #include <linux/module.h> 19 + #include <linux/fs.h> 20 + #include <linux/cdev.h> 21 + #include <linux/device.h> 22 + #include <linux/wait.h> 23 + 24 + #include <linux/tty.h> 25 + #include <linux/tty_driver.h> 26 + #include <linux/tty_flip.h> 27 + 28 + #include <mach/msm_smd.h> 29 + 30 + #define MAX_SMD_TTYS 32 31 + 32 + struct smd_tty_info { 33 + struct tty_port port; 34 + smd_channel_t *ch; 35 + }; 36 + 37 + struct smd_tty_channel_desc { 38 + int id; 39 + const char *name; 40 + }; 41 + 42 + static struct smd_tty_info smd_tty[MAX_SMD_TTYS]; 43 + 44 + static const struct smd_tty_channel_desc smd_default_tty_channels[] = { 45 + { .id = 0, .name = "SMD_DS" }, 46 + { .id = 27, .name = "SMD_GPSNMEA" }, 47 + }; 48 + 49 + static const struct smd_tty_channel_desc *smd_tty_channels = 50 + smd_default_tty_channels; 51 + static int smd_tty_channels_len = ARRAY_SIZE(smd_default_tty_channels); 52 + 53 + static void smd_tty_notify(void *priv, unsigned event) 54 + { 55 + unsigned char *ptr; 56 + int avail; 57 + struct smd_tty_info *info = priv; 58 + struct tty_struct *tty; 59 + 60 + if (event != SMD_EVENT_DATA) 61 + return; 62 + 63 + tty = tty_port_tty_get(&info->port); 64 + if (!tty) 65 + return; 66 + 67 + for (;;) { 68 + if (test_bit(TTY_THROTTLED, &tty->flags)) 69 + break; 70 + avail = smd_read_avail(info->ch); 71 + if (avail == 0) 72 + break; 73 + 74 + avail = tty_prepare_flip_string(tty, &ptr, avail); 75 + 76 + if (smd_read(info->ch, ptr, avail) != avail) { 77 + /* shouldn't be possible since we're in interrupt 78 + ** context here and nobody else could 'steal' our 79 + ** characters. 80 + */ 81 + pr_err("OOPS - smd_tty_buffer mismatch?!"); 82 + } 83 + 84 + tty_flip_buffer_push(tty); 85 + } 86 + 87 + /* XXX only when writable and necessary */ 88 + tty_wakeup(tty); 89 + tty_kref_put(tty); 90 + } 91 + 92 + static int smd_tty_port_activate(struct tty_port *tport, struct tty_struct *tty) 93 + { 94 + int i, res = 0; 95 + int n = tty->index; 96 + const char *name = NULL; 97 + struct smd_tty_info *info = smd_tty + n; 98 + 99 + for (i = 0; i < smd_tty_channels_len; i++) { 100 + if (smd_tty_channels[i].id == n) { 101 + name = smd_tty_channels[i].name; 102 + break; 103 + } 104 + } 105 + if (!name) 106 + return -ENODEV; 107 + 108 + if (info->ch) 109 + smd_kick(info->ch); 110 + else 111 + res = smd_open(name, &info->ch, info, smd_tty_notify); 112 + 113 + if (!res) 114 + tty->driver_data = info; 115 + 116 + return res; 117 + } 118 + 119 + static void smd_tty_port_shutdown(struct tty_port *tport) 120 + { 121 + struct smd_tty_info *info; 122 + struct tty_struct *tty = tty_port_tty_get(tport); 123 + 124 + info = tty->driver_data; 125 + if (info->ch) { 126 + smd_close(info->ch); 127 + info->ch = 0; 128 + } 129 + 130 + tty->driver_data = 0; 131 + tty_kref_put(tty); 132 + } 133 + 134 + static int smd_tty_open(struct tty_struct *tty, struct file *f) 135 + { 136 + struct smd_tty_info *info = smd_tty + tty->index; 137 + 138 + return tty_port_open(&info->port, tty, f); 139 + } 140 + 141 + static void smd_tty_close(struct tty_struct *tty, struct file *f) 142 + { 143 + struct smd_tty_info *info = tty->driver_data; 144 + 145 + tty_port_close(&info->port, tty, f); 146 + } 147 + 148 + static int smd_tty_write(struct tty_struct *tty, 149 + const unsigned char *buf, int len) 150 + { 151 + struct smd_tty_info *info = tty->driver_data; 152 + int avail; 153 + 154 + /* if we're writing to a packet channel we will 155 + ** never be able to write more data than there 156 + ** is currently space for 157 + */ 158 + avail = smd_write_avail(info->ch); 159 + if (len > avail) 160 + len = avail; 161 + 162 + return smd_write(info->ch, buf, len); 163 + } 164 + 165 + static int smd_tty_write_room(struct tty_struct *tty) 166 + { 167 + struct smd_tty_info *info = tty->driver_data; 168 + return smd_write_avail(info->ch); 169 + } 170 + 171 + static int smd_tty_chars_in_buffer(struct tty_struct *tty) 172 + { 173 + struct smd_tty_info *info = tty->driver_data; 174 + return smd_read_avail(info->ch); 175 + } 176 + 177 + static void smd_tty_unthrottle(struct tty_struct *tty) 178 + { 179 + struct smd_tty_info *info = tty->driver_data; 180 + smd_kick(info->ch); 181 + } 182 + 183 + static const struct tty_port_operations smd_tty_port_ops = { 184 + .shutdown = smd_tty_port_shutdown, 185 + .activate = smd_tty_port_activate, 186 + }; 187 + 188 + static const struct tty_operations smd_tty_ops = { 189 + .open = smd_tty_open, 190 + .close = smd_tty_close, 191 + .write = smd_tty_write, 192 + .write_room = smd_tty_write_room, 193 + .chars_in_buffer = smd_tty_chars_in_buffer, 194 + .unthrottle = smd_tty_unthrottle, 195 + }; 196 + 197 + static struct tty_driver *smd_tty_driver; 198 + 199 + static int __init smd_tty_init(void) 200 + { 201 + int ret, i; 202 + 203 + smd_tty_driver = alloc_tty_driver(MAX_SMD_TTYS); 204 + if (smd_tty_driver == 0) 205 + return -ENOMEM; 206 + 207 + smd_tty_driver->owner = THIS_MODULE; 208 + smd_tty_driver->driver_name = "smd_tty_driver"; 209 + smd_tty_driver->name = "smd"; 210 + smd_tty_driver->major = 0; 211 + smd_tty_driver->minor_start = 0; 212 + smd_tty_driver->type = TTY_DRIVER_TYPE_SERIAL; 213 + smd_tty_driver->subtype = SERIAL_TYPE_NORMAL; 214 + smd_tty_driver->init_termios = tty_std_termios; 215 + smd_tty_driver->init_termios.c_iflag = 0; 216 + smd_tty_driver->init_termios.c_oflag = 0; 217 + smd_tty_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; 218 + smd_tty_driver->init_termios.c_lflag = 0; 219 + smd_tty_driver->flags = TTY_DRIVER_RESET_TERMIOS | 220 + TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; 221 + tty_set_operations(smd_tty_driver, &smd_tty_ops); 222 + 223 + ret = tty_register_driver(smd_tty_driver); 224 + if (ret) 225 + return ret; 226 + 227 + for (i = 0; i < smd_tty_channels_len; i++) { 228 + tty_port_init(&smd_tty[smd_tty_channels[i].id].port); 229 + smd_tty[smd_tty_channels[i].id].port.ops = &smd_tty_port_ops; 230 + tty_register_device(smd_tty_driver, smd_tty_channels[i].id, 0); 231 + } 232 + 233 + return 0; 234 + } 235 + 236 + module_init(smd_tty_init);
+9 -9
drivers/tty/serial/of_serial.c
··· 160 160 * A few common types, add more as needed. 161 161 */ 162 162 static struct of_device_id __devinitdata of_platform_serial_table[] = { 163 - { .type = "serial", .compatible = "ns8250", .data = (void *)PORT_8250, }, 164 - { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, }, 165 - { .type = "serial", .compatible = "ns16550a", .data = (void *)PORT_16550A, }, 166 - { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, }, 167 - { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, }, 168 - { .type = "serial", .compatible = "ns16850", .data = (void *)PORT_16850, }, 163 + { .compatible = "ns8250", .data = (void *)PORT_8250, }, 164 + { .compatible = "ns16450", .data = (void *)PORT_16450, }, 165 + { .compatible = "ns16550a", .data = (void *)PORT_16550A, }, 166 + { .compatible = "ns16550", .data = (void *)PORT_16550, }, 167 + { .compatible = "ns16750", .data = (void *)PORT_16750, }, 168 + { .compatible = "ns16850", .data = (void *)PORT_16850, }, 169 169 #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL 170 - { .type = "serial", .compatible = "ibm,qpace-nwp-serial", 171 - .data = (void *)PORT_NWPSERIAL, }, 170 + { .compatible = "ibm,qpace-nwp-serial", 171 + .data = (void *)PORT_NWPSERIAL, }, 172 172 #endif 173 - { .type = "serial", .data = (void *)PORT_UNKNOWN, }, 173 + { .type = "serial", .data = (void *)PORT_UNKNOWN, }, 174 174 { /* end of list */ }, 175 175 }; 176 176
+7 -4
drivers/tty/serial/omap-serial.c
··· 20 20 * this driver as required for the omap-platform. 21 21 */ 22 22 23 + #if defined(CONFIG_SERIAL_OMAP_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 24 + #define SUPPORT_SYSRQ 25 + #endif 26 + 23 27 #include <linux/module.h> 24 28 #include <linux/init.h> 25 29 #include <linux/console.h> ··· 194 190 if (up->port.line == up->port.cons->index) { 195 191 /* Recover the break flag from console xmit */ 196 192 lsr |= up->lsr_break_flag; 197 - up->lsr_break_flag = 0; 198 193 } 199 194 #endif 200 195 if (lsr & UART_LSR_BI) ··· 520 517 up->ier = UART_IER_RLSI | UART_IER_RDI; 521 518 serial_out(up, UART_IER, up->ier); 522 519 520 + /* Enable module level wake up */ 521 + serial_out(up, UART_OMAP_WER, OMAP_UART_WER_MOD_WKUP); 522 + 523 523 up->port_activity = jiffies; 524 524 return 0; 525 525 } ··· 830 824 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 831 825 serial_out(up, UART_EFR, efr); 832 826 serial_out(up, UART_LCR, 0); 833 - /* Enable module level wake up */ 834 - serial_out(up, UART_OMAP_WER, 835 - (state != 0) ? OMAP_UART_WER_MOD_WKUP : 0); 836 827 } 837 828 838 829 static void serial_omap_release_port(struct uart_port *port)
+241 -90
drivers/tty/serial/pch_uart.c
··· 21 21 #include <linux/serial_core.h> 22 22 #include <linux/interrupt.h> 23 23 #include <linux/io.h> 24 + #include <linux/dmi.h> 24 25 25 26 #include <linux/dmaengine.h> 26 27 #include <linux/pch_dma.h> ··· 41 40 42 41 #define PCH_UART_DRIVER_DEVICE "ttyPCH" 43 42 44 - #define PCH_UART_NR_GE_256FIFO 1 45 - #define PCH_UART_NR_GE_64FIFO 3 46 - #define PCH_UART_NR_GE (PCH_UART_NR_GE_256FIFO+PCH_UART_NR_GE_64FIFO) 47 - #define PCH_UART_NR PCH_UART_NR_GE 43 + /* Set the max number of UART port 44 + * Intel EG20T PCH: 4 port 45 + * OKI SEMICONDUCTOR ML7213 IOH: 3 port 46 + */ 47 + #define PCH_UART_NR 4 48 48 49 49 #define PCH_UART_HANDLED_RX_INT (1<<((PCH_UART_HANDLED_RX_INT_SHIFT)<<1)) 50 50 #define PCH_UART_HANDLED_TX_INT (1<<((PCH_UART_HANDLED_TX_INT_SHIFT)<<1)) ··· 194 192 #define PCH_UART_HAL_LOOP (PCH_UART_MCR_LOOP) 195 193 #define PCH_UART_HAL_AFE (PCH_UART_MCR_AFE) 196 194 195 + #define PCI_VENDOR_ID_ROHM 0x10DB 196 + 197 197 struct pch_uart_buffer { 198 198 unsigned char *buf; 199 199 int size; ··· 219 215 struct pch_uart_buffer rxbuf; 220 216 unsigned int dmsr; 221 217 unsigned int fcr; 218 + unsigned int mcr; 222 219 unsigned int use_dma; 223 220 unsigned int use_dma_flag; 224 221 struct dma_async_tx_descriptor *desc_tx; ··· 228 223 struct pch_dma_slave param_rx; 229 224 struct dma_chan *chan_tx; 230 225 struct dma_chan *chan_rx; 231 - struct scatterlist sg_tx; 226 + struct scatterlist *sg_tx_p; 227 + int nent; 232 228 struct scatterlist sg_rx; 233 229 int tx_dma_use; 234 230 void *rx_buf_virt; 235 231 dma_addr_t rx_buf_dma; 232 + }; 233 + 234 + /** 235 + * struct pch_uart_driver_data - private data structure for UART-DMA 236 + * @port_type: The number of DMA channel 237 + * @line_no: UART port line number (0, 1, 2...) 238 + */ 239 + struct pch_uart_driver_data { 240 + int port_type; 241 + int line_no; 242 + }; 243 + 244 + enum pch_uart_num_t { 245 + pch_et20t_uart0 = 0, 246 + pch_et20t_uart1, 247 + pch_et20t_uart2, 248 + pch_et20t_uart3, 249 + pch_ml7213_uart0, 250 + pch_ml7213_uart1, 251 + pch_ml7213_uart2, 252 + }; 253 + 254 + static struct pch_uart_driver_data drv_dat[] = { 255 + [pch_et20t_uart0] = {PCH_UART_8LINE, 0}, 256 + [pch_et20t_uart1] = {PCH_UART_2LINE, 1}, 257 + [pch_et20t_uart2] = {PCH_UART_2LINE, 2}, 258 + [pch_et20t_uart3] = {PCH_UART_2LINE, 3}, 259 + [pch_ml7213_uart0] = {PCH_UART_8LINE, 0}, 260 + [pch_ml7213_uart1] = {PCH_UART_2LINE, 1}, 261 + [pch_ml7213_uart2] = {PCH_UART_2LINE, 2}, 236 262 }; 237 263 238 264 static unsigned int default_baud = 9600; ··· 314 278 315 279 div = DIV_ROUND(priv->base_baud / 16, baud); 316 280 if (div < 0 || USHRT_MAX <= div) { 317 - pr_err("Invalid Baud(div=0x%x)\n", div); 281 + dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div); 318 282 return -EINVAL; 319 283 } 320 284 ··· 322 286 dlm = ((unsigned int)div >> 8) & 0x00FFU; 323 287 324 288 if (parity & ~(PCH_UART_LCR_PEN | PCH_UART_LCR_EPS | PCH_UART_LCR_SP)) { 325 - pr_err("Invalid parity(0x%x)\n", parity); 289 + dev_err(priv->port.dev, "Invalid parity(0x%x)\n", parity); 326 290 return -EINVAL; 327 291 } 328 292 329 293 if (bits & ~PCH_UART_LCR_WLS) { 330 - pr_err("Invalid bits(0x%x)\n", bits); 294 + dev_err(priv->port.dev, "Invalid bits(0x%x)\n", bits); 331 295 return -EINVAL; 332 296 } 333 297 334 298 if (stb & ~PCH_UART_LCR_STB) { 335 - pr_err("Invalid STB(0x%x)\n", stb); 299 + dev_err(priv->port.dev, "Invalid STB(0x%x)\n", stb); 336 300 return -EINVAL; 337 301 } 338 302 ··· 340 304 lcr |= bits; 341 305 lcr |= stb; 342 306 343 - pr_debug("%s:baud = %d, div = %04x, lcr = %02x (%lu)\n", 307 + dev_dbg(priv->port.dev, "%s:baud = %d, div = %04x, lcr = %02x (%lu)\n", 344 308 __func__, baud, div, lcr, jiffies); 345 309 iowrite8(PCH_UART_LCR_DLAB, priv->membase + UART_LCR); 346 310 iowrite8(dll, priv->membase + PCH_UART_DLL); ··· 354 318 unsigned int flag) 355 319 { 356 320 if (flag & ~(PCH_UART_FCR_TFR | PCH_UART_FCR_RFR)) { 357 - pr_err("%s:Invalid flag(0x%x)\n", __func__, flag); 321 + dev_err(priv->port.dev, "%s:Invalid flag(0x%x)\n", 322 + __func__, flag); 358 323 return -EINVAL; 359 324 } 360 325 ··· 374 337 u8 fcr; 375 338 376 339 if (dmamode & ~PCH_UART_FCR_DMS) { 377 - pr_err("%s:Invalid DMA Mode(0x%x)\n", __func__, dmamode); 340 + dev_err(priv->port.dev, "%s:Invalid DMA Mode(0x%x)\n", 341 + __func__, dmamode); 378 342 return -EINVAL; 379 343 } 380 344 381 345 if (fifo_size & ~(PCH_UART_FCR_FIFOE | PCH_UART_FCR_FIFO256)) { 382 - pr_err("%s:Invalid FIFO SIZE(0x%x)\n", __func__, fifo_size); 346 + dev_err(priv->port.dev, "%s:Invalid FIFO SIZE(0x%x)\n", 347 + __func__, fifo_size); 383 348 return -EINVAL; 384 349 } 385 350 386 351 if (trigger & ~PCH_UART_FCR_RFTL) { 387 - pr_err("%s:Invalid TRIGGER(0x%x)\n", __func__, trigger); 352 + dev_err(priv->port.dev, "%s:Invalid TRIGGER(0x%x)\n", 353 + __func__, trigger); 388 354 return -EINVAL; 389 355 } 390 356 ··· 426 386 return get_msr(priv, priv->membase); 427 387 } 428 388 429 - static int pch_uart_hal_write(struct eg20t_port *priv, 389 + static void pch_uart_hal_write(struct eg20t_port *priv, 430 390 const unsigned char *buf, int tx_size) 431 391 { 432 392 int i; ··· 436 396 thr = buf[i++]; 437 397 iowrite8(thr, priv->membase + PCH_UART_THR); 438 398 } 439 - return i; 440 399 } 441 400 442 401 static int pch_uart_hal_read(struct eg20t_port *priv, unsigned char *buf, ··· 491 452 port = &priv->port; 492 453 tty = tty_port_tty_get(&port->state->port); 493 454 if (!tty) { 494 - pr_debug("%s:tty is busy now", __func__); 455 + dev_dbg(priv->port.dev, "%s:tty is busy now", __func__); 495 456 return -EBUSY; 496 457 } 497 458 ··· 508 469 struct uart_port *port = &priv->port; 509 470 510 471 if (port->x_char) { 511 - pr_debug("%s:X character send %02x (%lu)\n", __func__, 512 - port->x_char, jiffies); 472 + dev_dbg(priv->port.dev, "%s:X character send %02x (%lu)\n", 473 + __func__, port->x_char, jiffies); 513 474 buf[0] = port->x_char; 514 475 port->x_char = 0; 515 476 ret = 1; ··· 529 490 port = &priv->port; 530 491 tty = tty_port_tty_get(&port->state->port); 531 492 if (!tty) { 532 - pr_debug("%s:tty is busy now", __func__); 493 + dev_dbg(priv->port.dev, "%s:tty is busy now", __func__); 533 494 return 0; 534 495 } 535 496 ··· 599 560 /* Set Tx DMA */ 600 561 param = &priv->param_tx; 601 562 param->dma_dev = &dma_dev->dev; 602 - param->chan_id = priv->port.line; 563 + param->chan_id = priv->port.line * 2; /* Tx = 0, 2, 4, ... */ 564 + 603 565 param->tx_reg = port->mapbase + UART_TX; 604 566 chan = dma_request_channel(mask, filter, param); 605 567 if (!chan) { 606 - pr_err("%s:dma_request_channel FAILS(Tx)\n", __func__); 568 + dev_err(priv->port.dev, "%s:dma_request_channel FAILS(Tx)\n", 569 + __func__); 607 570 return; 608 571 } 609 572 priv->chan_tx = chan; ··· 613 572 /* Set Rx DMA */ 614 573 param = &priv->param_rx; 615 574 param->dma_dev = &dma_dev->dev; 616 - param->chan_id = priv->port.line + 1; /* Rx = Tx + 1 */ 575 + param->chan_id = priv->port.line * 2 + 1; /* Rx = Tx + 1 */ 576 + 617 577 param->rx_reg = port->mapbase + UART_RX; 618 578 chan = dma_request_channel(mask, filter, param); 619 579 if (!chan) { 620 - pr_err("%s:dma_request_channel FAILS(Rx)\n", __func__); 580 + dev_err(priv->port.dev, "%s:dma_request_channel FAILS(Rx)\n", 581 + __func__); 621 582 dma_release_channel(priv->chan_tx); 622 583 return; 623 584 } ··· 635 592 struct eg20t_port *priv = arg; 636 593 struct uart_port *port = &priv->port; 637 594 struct tty_struct *tty = tty_port_tty_get(&port->state->port); 595 + int count; 638 596 639 597 if (!tty) { 640 - pr_debug("%s:tty is busy now", __func__); 598 + dev_dbg(priv->port.dev, "%s:tty is busy now", __func__); 641 599 return; 642 600 } 643 601 644 - if (dma_push_rx(priv, priv->trigger_level)) 602 + dma_sync_sg_for_cpu(port->dev, &priv->sg_rx, 1, DMA_FROM_DEVICE); 603 + count = dma_push_rx(priv, priv->trigger_level); 604 + if (count) 645 605 tty_flip_buffer_push(tty); 646 - 647 606 tty_kref_put(tty); 607 + async_tx_ack(priv->desc_rx); 608 + pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_RX_INT); 648 609 } 649 610 650 611 static void pch_dma_tx_complete(void *arg) ··· 656 609 struct eg20t_port *priv = arg; 657 610 struct uart_port *port = &priv->port; 658 611 struct circ_buf *xmit = &port->state->xmit; 612 + struct scatterlist *sg = priv->sg_tx_p; 613 + int i; 659 614 660 - xmit->tail += sg_dma_len(&priv->sg_tx); 615 + for (i = 0; i < priv->nent; i++, sg++) { 616 + xmit->tail += sg_dma_len(sg); 617 + port->icount.tx += sg_dma_len(sg); 618 + } 661 619 xmit->tail &= UART_XMIT_SIZE - 1; 662 - port->icount.tx += sg_dma_len(&priv->sg_tx); 663 - 664 620 async_tx_ack(priv->desc_tx); 621 + dma_unmap_sg(port->dev, sg, priv->nent, DMA_TO_DEVICE); 665 622 priv->tx_dma_use = 0; 623 + priv->nent = 0; 624 + kfree(priv->sg_tx_p); 625 + pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_TX_INT); 666 626 } 667 627 668 - static int pop_tx(struct eg20t_port *priv, unsigned char *buf, int size) 628 + static int pop_tx(struct eg20t_port *priv, int size) 669 629 { 670 630 int count = 0; 671 631 struct uart_port *port = &priv->port; ··· 685 631 int cnt_to_end = 686 632 CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); 687 633 int sz = min(size - count, cnt_to_end); 688 - memcpy(&buf[count], &xmit->buf[xmit->tail], sz); 634 + pch_uart_hal_write(priv, &xmit->buf[xmit->tail], sz); 689 635 xmit->tail = (xmit->tail + sz) & (UART_XMIT_SIZE - 1); 690 636 count += sz; 691 637 } while (!uart_circ_empty(xmit) && count < size); 692 638 693 639 pop_tx_end: 694 - pr_debug("%d characters. Remained %d characters. (%lu)\n", 640 + dev_dbg(priv->port.dev, "%d characters. Remained %d characters.(%lu)\n", 695 641 count, size - count, jiffies); 696 642 697 643 return count; ··· 733 679 734 680 sg_init_table(&priv->sg_rx, 1); /* Initialize SG table */ 735 681 736 - sg_dma_len(sg) = priv->fifo_size; 682 + sg_dma_len(sg) = priv->trigger_level; 737 683 738 684 sg_set_page(&priv->sg_rx, virt_to_page(priv->rx_buf_virt), 739 685 sg_dma_len(sg), (unsigned long)priv->rx_buf_virt & ··· 743 689 744 690 desc = priv->chan_rx->device->device_prep_slave_sg(priv->chan_rx, 745 691 sg, 1, DMA_FROM_DEVICE, 746 - DMA_PREP_INTERRUPT); 692 + DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 693 + 747 694 if (!desc) 748 695 return 0; 749 696 ··· 761 706 { 762 707 struct uart_port *port = &priv->port; 763 708 struct circ_buf *xmit = &port->state->xmit; 764 - int ret; 765 709 int fifo_size; 766 710 int tx_size; 767 711 int size; 768 712 int tx_empty; 769 713 770 714 if (!priv->start_tx) { 771 - pr_info("%s:Tx isn't started. (%lu)\n", __func__, jiffies); 715 + dev_info(priv->port.dev, "%s:Tx isn't started. (%lu)\n", 716 + __func__, jiffies); 772 717 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT); 773 718 priv->tx_empty = 1; 774 719 return 0; ··· 783 728 fifo_size--; 784 729 } 785 730 size = min(xmit->head - xmit->tail, fifo_size); 786 - tx_size = pop_tx(priv, xmit->buf, size); 731 + if (size < 0) 732 + size = fifo_size; 733 + 734 + tx_size = pop_tx(priv, size); 787 735 if (tx_size > 0) { 788 - ret = pch_uart_hal_write(priv, xmit->buf, tx_size); 789 - port->icount.tx += ret; 736 + port->icount.tx += tx_size; 790 737 tx_empty = 0; 791 738 } 792 739 793 740 priv->tx_empty = tx_empty; 794 741 795 - if (tx_empty) 742 + if (tx_empty) { 796 743 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT); 744 + uart_write_wakeup(port); 745 + } 797 746 798 747 return PCH_UART_HANDLED_TX_INT; 799 748 } ··· 806 747 { 807 748 struct uart_port *port = &priv->port; 808 749 struct circ_buf *xmit = &port->state->xmit; 809 - struct scatterlist *sg = &priv->sg_tx; 750 + struct scatterlist *sg; 810 751 int nent; 811 752 int fifo_size; 812 753 int tx_empty; 813 754 struct dma_async_tx_descriptor *desc; 755 + int num; 756 + int i; 757 + int bytes; 758 + int size; 759 + int rem; 814 760 815 761 if (!priv->start_tx) { 816 - pr_info("%s:Tx isn't started. (%lu)\n", __func__, jiffies); 762 + dev_info(priv->port.dev, "%s:Tx isn't started. (%lu)\n", 763 + __func__, jiffies); 764 + pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT); 765 + priv->tx_empty = 1; 766 + return 0; 767 + } 768 + 769 + if (priv->tx_dma_use) { 770 + dev_dbg(priv->port.dev, "%s:Tx is not completed. (%lu)\n", 771 + __func__, jiffies); 817 772 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT); 818 773 priv->tx_empty = 1; 819 774 return 0; ··· 842 769 fifo_size--; 843 770 } 844 771 845 - pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT); 772 + bytes = min((int)CIRC_CNT(xmit->head, xmit->tail, 773 + UART_XMIT_SIZE), CIRC_CNT_TO_END(xmit->head, 774 + xmit->tail, UART_XMIT_SIZE)); 775 + if (!bytes) { 776 + dev_dbg(priv->port.dev, "%s 0 bytes return\n", __func__); 777 + pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_TX_INT); 778 + uart_write_wakeup(port); 779 + return 0; 780 + } 781 + 782 + if (bytes > fifo_size) { 783 + num = bytes / fifo_size + 1; 784 + size = fifo_size; 785 + rem = bytes % fifo_size; 786 + } else { 787 + num = 1; 788 + size = bytes; 789 + rem = bytes; 790 + } 791 + 792 + dev_dbg(priv->port.dev, "%s num=%d size=%d rem=%d\n", 793 + __func__, num, size, rem); 846 794 847 795 priv->tx_dma_use = 1; 848 796 849 - sg_init_table(&priv->sg_tx, 1); /* Initialize SG table */ 797 + priv->sg_tx_p = kzalloc(sizeof(struct scatterlist)*num, GFP_ATOMIC); 850 798 851 - sg_set_page(&priv->sg_tx, virt_to_page(xmit->buf), 852 - UART_XMIT_SIZE, (int)xmit->buf & ~PAGE_MASK); 799 + sg_init_table(priv->sg_tx_p, num); /* Initialize SG table */ 800 + sg = priv->sg_tx_p; 853 801 854 - nent = dma_map_sg(port->dev, &priv->sg_tx, 1, DMA_TO_DEVICE); 855 - if (!nent) { 856 - pr_err("%s:dma_map_sg Failed\n", __func__); 857 - return 0; 802 + for (i = 0; i < num; i++, sg++) { 803 + if (i == (num - 1)) 804 + sg_set_page(sg, virt_to_page(xmit->buf), 805 + rem, fifo_size * i); 806 + else 807 + sg_set_page(sg, virt_to_page(xmit->buf), 808 + size, fifo_size * i); 858 809 } 859 810 860 - sg->offset = xmit->tail & (UART_XMIT_SIZE - 1); 861 - sg_dma_address(sg) = (sg_dma_address(sg) & ~(UART_XMIT_SIZE - 1)) + 862 - sg->offset; 863 - sg_dma_len(sg) = min((int)CIRC_CNT(xmit->head, xmit->tail, 864 - UART_XMIT_SIZE), CIRC_CNT_TO_END(xmit->head, 865 - xmit->tail, UART_XMIT_SIZE)); 811 + sg = priv->sg_tx_p; 812 + nent = dma_map_sg(port->dev, sg, num, DMA_TO_DEVICE); 813 + if (!nent) { 814 + dev_err(priv->port.dev, "%s:dma_map_sg Failed\n", __func__); 815 + return 0; 816 + } 817 + priv->nent = nent; 818 + 819 + for (i = 0; i < nent; i++, sg++) { 820 + sg->offset = (xmit->tail & (UART_XMIT_SIZE - 1)) + 821 + fifo_size * i; 822 + sg_dma_address(sg) = (sg_dma_address(sg) & 823 + ~(UART_XMIT_SIZE - 1)) + sg->offset; 824 + if (i == (nent - 1)) 825 + sg_dma_len(sg) = rem; 826 + else 827 + sg_dma_len(sg) = size; 828 + } 866 829 867 830 desc = priv->chan_tx->device->device_prep_slave_sg(priv->chan_tx, 868 - sg, nent, DMA_TO_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 831 + priv->sg_tx_p, nent, DMA_TO_DEVICE, 832 + DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 869 833 if (!desc) { 870 - pr_err("%s:device_prep_slave_sg Failed\n", __func__); 834 + dev_err(priv->port.dev, "%s:device_prep_slave_sg Failed\n", 835 + __func__); 871 836 return 0; 872 837 } 873 - 874 - dma_sync_sg_for_device(port->dev, sg, 1, DMA_TO_DEVICE); 875 - 838 + dma_sync_sg_for_device(port->dev, priv->sg_tx_p, nent, DMA_TO_DEVICE); 876 839 priv->desc_tx = desc; 877 840 desc->callback = pch_dma_tx_complete; 878 841 desc->callback_param = priv; ··· 963 854 } 964 855 break; 965 856 case PCH_UART_IID_RDR: /* Received Data Ready */ 966 - if (priv->use_dma) 857 + if (priv->use_dma) { 858 + pch_uart_hal_disable_interrupt(priv, 859 + PCH_UART_HAL_RX_INT); 967 860 ret = dma_handle_rx(priv); 968 - else 861 + if (!ret) 862 + pch_uart_hal_enable_interrupt(priv, 863 + PCH_UART_HAL_RX_INT); 864 + } else { 969 865 ret = handle_rx(priv); 866 + } 970 867 break; 971 868 case PCH_UART_IID_RDR_TO: /* Received Data Ready 972 869 (FIFO Timeout) */ ··· 989 874 ret = PCH_UART_HANDLED_MS_INT; 990 875 break; 991 876 default: /* Never junp to this label */ 992 - pr_err("%s:iid=%d (%lu)\n", __func__, iid, jiffies); 877 + dev_err(priv->port.dev, "%s:iid=%d (%lu)\n", __func__, 878 + iid, jiffies); 993 879 ret = -1; 994 880 break; 995 881 } ··· 1048 932 static void pch_uart_set_mctrl(struct uart_port *port, unsigned int mctrl) 1049 933 { 1050 934 u32 mcr = 0; 1051 - unsigned int dat; 1052 935 struct eg20t_port *priv = container_of(port, struct eg20t_port, port); 1053 936 1054 937 if (mctrl & TIOCM_DTR) ··· 1057 942 if (mctrl & TIOCM_LOOP) 1058 943 mcr |= UART_MCR_LOOP; 1059 944 1060 - if (mctrl) { 1061 - dat = pch_uart_get_mctrl(port); 1062 - dat |= mcr; 1063 - iowrite8(dat, priv->membase + UART_MCR); 1064 - } 945 + if (priv->mcr & UART_MCR_AFE) 946 + mcr |= UART_MCR_AFE; 947 + 948 + if (mctrl) 949 + iowrite8(mcr, priv->membase + UART_MCR); 1065 950 } 1066 951 1067 952 static void pch_uart_stop_tx(struct uart_port *port) ··· 1078 963 1079 964 priv = container_of(port, struct eg20t_port, port); 1080 965 1081 - if (priv->use_dma) 1082 - if (priv->tx_dma_use) 966 + if (priv->use_dma) { 967 + if (priv->tx_dma_use) { 968 + dev_dbg(priv->port.dev, "%s : Tx DMA is NOT empty.\n", 969 + __func__); 1083 970 return; 971 + } 972 + } 1084 973 1085 974 priv->start_tx = 1; 1086 975 pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_TX_INT); ··· 1129 1010 1130 1011 priv = container_of(port, struct eg20t_port, port); 1131 1012 priv->tx_empty = 1; 1132 - port->uartclk = priv->base_baud; 1013 + 1014 + if (port->uartclk) 1015 + priv->base_baud = port->uartclk; 1016 + else 1017 + port->uartclk = priv->base_baud; 1018 + 1133 1019 pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_ALL_INT); 1134 1020 ret = pch_uart_hal_set_line(priv, default_baud, 1135 1021 PCH_UART_HAL_PARITY_NONE, PCH_UART_HAL_8BIT, ··· 1205 1081 ret = pch_uart_hal_set_fifo(priv, PCH_UART_HAL_DMA_MODE0, 1206 1082 PCH_UART_HAL_FIFO_DIS, PCH_UART_HAL_TRIGGER1); 1207 1083 if (ret) 1208 - pr_err("pch_uart_hal_set_fifo Failed(ret=%d)\n", ret); 1084 + dev_err(priv->port.dev, 1085 + "pch_uart_hal_set_fifo Failed(ret=%d)\n", ret); 1209 1086 1210 1087 if (priv->use_dma_flag) 1211 1088 pch_free_dma(port); ··· 1255 1130 } else { 1256 1131 parity = PCH_UART_HAL_PARITY_NONE; 1257 1132 } 1133 + 1134 + /* Only UART0 has auto hardware flow function */ 1135 + if ((termios->c_cflag & CRTSCTS) && (priv->fifo_size == 256)) 1136 + priv->mcr |= UART_MCR_AFE; 1137 + else 1138 + priv->mcr &= ~UART_MCR_AFE; 1139 + 1258 1140 termios->c_cflag &= ~CMSPAR; /* Mark/Space parity is not supported */ 1259 1141 1260 1142 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); ··· 1334 1202 1335 1203 priv = container_of(port, struct eg20t_port, port); 1336 1204 if (serinfo->flags & UPF_LOW_LATENCY) { 1337 - pr_info("PCH UART : Use PIO Mode (without DMA)\n"); 1205 + dev_info(priv->port.dev, 1206 + "PCH UART : Use PIO Mode (without DMA)\n"); 1338 1207 priv->use_dma = 0; 1339 1208 serinfo->flags &= ~UPF_LOW_LATENCY; 1340 1209 } else { 1341 1210 #ifndef CONFIG_PCH_DMA 1342 - pr_err("%s : PCH DMA is not Loaded.\n", __func__); 1211 + dev_err(priv->port.dev, "%s : PCH DMA is not Loaded.\n", 1212 + __func__); 1343 1213 return -EOPNOTSUPP; 1344 1214 #endif 1345 1215 priv->use_dma = 1; 1346 1216 priv->use_dma_flag = 1; 1347 - pr_info("PCH UART : Use DMA Mode\n"); 1217 + dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n"); 1348 1218 } 1349 1219 1350 1220 return 0; ··· 1383 1249 }; 1384 1250 1385 1251 static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, 1386 - int port_type) 1252 + const struct pci_device_id *id) 1387 1253 { 1388 1254 struct eg20t_port *priv; 1389 1255 int ret; ··· 1391 1257 unsigned int mapbase; 1392 1258 unsigned char *rxbuf; 1393 1259 int fifosize, base_baud; 1394 - static int num; 1260 + int port_type; 1261 + struct pch_uart_driver_data *board; 1262 + 1263 + board = &drv_dat[id->driver_data]; 1264 + port_type = board->port_type; 1395 1265 1396 1266 priv = kzalloc(sizeof(struct eg20t_port), GFP_KERNEL); 1397 1267 if (priv == NULL) ··· 1405 1267 if (!rxbuf) 1406 1268 goto init_port_free_txbuf; 1407 1269 1270 + base_baud = 1843200; /* 1.8432MHz */ 1271 + 1272 + /* quirk for CM-iTC board */ 1273 + if (strstr(dmi_get_system_info(DMI_BOARD_NAME), "CM-iTC")) 1274 + base_baud = 192000000; /* 192.0MHz */ 1275 + 1408 1276 switch (port_type) { 1409 1277 case PORT_UNKNOWN: 1410 - fifosize = 256; /* UART0 */ 1411 - base_baud = 1843200; /* 1.8432MHz */ 1278 + fifosize = 256; /* EG20T/ML7213: UART0 */ 1412 1279 break; 1413 1280 case PORT_8250: 1414 - fifosize = 64; /* UART1~3 */ 1415 - base_baud = 1843200; /* 1.8432MHz */ 1281 + fifosize = 64; /* EG20T:UART1~3 ML7213: UART1~2*/ 1416 1282 break; 1417 1283 default: 1418 1284 dev_err(&pdev->dev, "Invalid Port Type(=%d)\n", port_type); ··· 1444 1302 priv->port.ops = &pch_uart_ops; 1445 1303 priv->port.flags = UPF_BOOT_AUTOCONF; 1446 1304 priv->port.fifosize = fifosize; 1447 - priv->port.line = num++; 1305 + priv->port.line = board->line_no; 1448 1306 priv->trigger = PCH_UART_HAL_TRIGGER_M; 1307 + 1308 + spin_lock_init(&priv->port.lock); 1449 1309 1450 1310 pci_set_drvdata(pdev, priv); 1451 1311 pch_uart_hal_request(pdev, fifosize, base_baud); 1312 + 1452 1313 ret = uart_add_one_port(&pch_uart_driver, &priv->port); 1453 1314 if (ret < 0) 1454 1315 goto init_port_hal_free; ··· 1522 1377 1523 1378 static DEFINE_PCI_DEVICE_TABLE(pch_uart_pci_id) = { 1524 1379 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8811), 1525 - .driver_data = PCH_UART_8LINE}, 1380 + .driver_data = pch_et20t_uart0}, 1526 1381 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8812), 1527 - .driver_data = PCH_UART_2LINE}, 1382 + .driver_data = pch_et20t_uart1}, 1528 1383 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8813), 1529 - .driver_data = PCH_UART_2LINE}, 1384 + .driver_data = pch_et20t_uart2}, 1530 1385 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8814), 1531 - .driver_data = PCH_UART_2LINE}, 1386 + .driver_data = pch_et20t_uart3}, 1387 + {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8027), 1388 + .driver_data = pch_ml7213_uart0}, 1389 + {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8028), 1390 + .driver_data = pch_ml7213_uart1}, 1391 + {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8029), 1392 + .driver_data = pch_ml7213_uart2}, 1532 1393 {0,}, 1533 1394 }; 1534 1395 ··· 1548 1397 if (ret < 0) 1549 1398 goto probe_error; 1550 1399 1551 - priv = pch_uart_init_port(pdev, id->driver_data); 1400 + priv = pch_uart_init_port(pdev, id); 1552 1401 if (!priv) { 1553 1402 ret = -EBUSY; 1554 1403 goto probe_disable_device;
+9 -13
drivers/tty/serial/serial_core.c
··· 905 905 return put_user(result, value); 906 906 } 907 907 908 - static int uart_tiocmget(struct tty_struct *tty, struct file *file) 908 + static int uart_tiocmget(struct tty_struct *tty) 909 909 { 910 910 struct uart_state *state = tty->driver_data; 911 911 struct tty_port *port = &state->port; ··· 913 913 int result = -EIO; 914 914 915 915 mutex_lock(&port->mutex); 916 - if ((!file || !tty_hung_up_p(file)) && 917 - !(tty->flags & (1 << TTY_IO_ERROR))) { 916 + if (!(tty->flags & (1 << TTY_IO_ERROR))) { 918 917 result = uport->mctrl; 919 - 920 918 spin_lock_irq(&uport->lock); 921 919 result |= uport->ops->get_mctrl(uport); 922 920 spin_unlock_irq(&uport->lock); ··· 925 927 } 926 928 927 929 static int 928 - uart_tiocmset(struct tty_struct *tty, struct file *file, 929 - unsigned int set, unsigned int clear) 930 + uart_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) 930 931 { 931 932 struct uart_state *state = tty->driver_data; 932 933 struct uart_port *uport = state->uart_port; ··· 933 936 int ret = -EIO; 934 937 935 938 mutex_lock(&port->mutex); 936 - if ((!file || !tty_hung_up_p(file)) && 937 - !(tty->flags & (1 << TTY_IO_ERROR))) { 939 + if (!(tty->flags & (1 << TTY_IO_ERROR))) { 938 940 uart_update_mctrl(uport, set, clear); 939 941 ret = 0; 940 942 } ··· 1099 1103 * Called via sys_ioctl. We can use spin_lock_irq() here. 1100 1104 */ 1101 1105 static int 1102 - uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, 1106 + uart_ioctl(struct tty_struct *tty, unsigned int cmd, 1103 1107 unsigned long arg) 1104 1108 { 1105 1109 struct uart_state *state = tty->driver_data; ··· 1152 1156 1153 1157 mutex_lock(&port->mutex); 1154 1158 1155 - if (tty_hung_up_p(filp)) { 1159 + if (tty->flags & (1 << TTY_IO_ERROR)) { 1156 1160 ret = -EIO; 1157 1161 goto out_up; 1158 1162 } ··· 2060 2064 /* 2061 2065 * Re-enable the console device after suspending. 2062 2066 */ 2063 - if (console_suspend_enabled && uart_console(uport)) { 2067 + if (uart_console(uport)) { 2064 2068 /* 2065 2069 * First try to use the console cflag setting. 2066 2070 */ ··· 2073 2077 if (port->tty && port->tty->termios && termios.c_cflag == 0) 2074 2078 termios = *(port->tty->termios); 2075 2079 2076 - uart_change_pm(state, 0); 2077 2080 uport->ops->set_termios(uport, &termios, NULL); 2078 - console_start(uport->cons); 2081 + if (console_suspend_enabled) 2082 + console_start(uport->cons); 2079 2083 } 2080 2084 2081 2085 if (port->flags & ASYNC_SUSPENDED) {
+3 -1
drivers/tty/tty_audit.c
··· 95 95 { 96 96 if (buf->valid == 0) 97 97 return; 98 - if (audit_enabled == 0) 98 + if (audit_enabled == 0) { 99 + buf->valid = 0; 99 100 return; 101 + } 100 102 tty_audit_log("tty", tsk, loginuid, sessionid, buf->major, buf->minor, 101 103 buf->data, buf->valid); 102 104 buf->valid = 0;
+13 -9
drivers/tty/tty_io.c
··· 2465 2465 * Locking: none (up to the driver) 2466 2466 */ 2467 2467 2468 - static int tty_tiocmget(struct tty_struct *tty, struct file *file, int __user *p) 2468 + static int tty_tiocmget(struct tty_struct *tty, int __user *p) 2469 2469 { 2470 2470 int retval = -EINVAL; 2471 2471 2472 2472 if (tty->ops->tiocmget) { 2473 - retval = tty->ops->tiocmget(tty, file); 2473 + retval = tty->ops->tiocmget(tty); 2474 2474 2475 2475 if (retval >= 0) 2476 2476 retval = put_user(retval, p); ··· 2481 2481 /** 2482 2482 * tty_tiocmset - set modem status 2483 2483 * @tty: tty device 2484 - * @file: user file pointer 2485 2484 * @cmd: command - clear bits, set bits or set all 2486 2485 * @p: pointer to desired bits 2487 2486 * ··· 2490 2491 * Locking: none (up to the driver) 2491 2492 */ 2492 2493 2493 - static int tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int cmd, 2494 + static int tty_tiocmset(struct tty_struct *tty, unsigned int cmd, 2494 2495 unsigned __user *p) 2495 2496 { 2496 2497 int retval; ··· 2517 2518 } 2518 2519 set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP; 2519 2520 clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP; 2520 - return tty->ops->tiocmset(tty, file, set, clear); 2521 + return tty->ops->tiocmset(tty, set, clear); 2521 2522 } 2522 2523 2523 2524 static int tty_tiocgicount(struct tty_struct *tty, void __user *arg) ··· 2626 2627 return put_user(tty->ldisc->ops->num, (int __user *)p); 2627 2628 case TIOCSETD: 2628 2629 return tiocsetd(tty, p); 2630 + case TIOCVHANGUP: 2631 + if (!capable(CAP_SYS_ADMIN)) 2632 + return -EPERM; 2633 + tty_vhangup(tty); 2634 + return 0; 2629 2635 case TIOCGDEV: 2630 2636 { 2631 2637 unsigned int ret = new_encode_dev(tty_devnum(real_tty)); ··· 2659 2655 return send_break(tty, arg ? arg*100 : 250); 2660 2656 2661 2657 case TIOCMGET: 2662 - return tty_tiocmget(tty, file, p); 2658 + return tty_tiocmget(tty, p); 2663 2659 case TIOCMSET: 2664 2660 case TIOCMBIC: 2665 2661 case TIOCMBIS: 2666 - return tty_tiocmset(tty, file, cmd, p); 2662 + return tty_tiocmset(tty, cmd, p); 2667 2663 case TIOCGICOUNT: 2668 2664 retval = tty_tiocgicount(tty, p); 2669 2665 /* For the moment allow fall through to the old method */ ··· 2681 2677 break; 2682 2678 } 2683 2679 if (tty->ops->ioctl) { 2684 - retval = (tty->ops->ioctl)(tty, file, cmd, arg); 2680 + retval = (tty->ops->ioctl)(tty, cmd, arg); 2685 2681 if (retval != -ENOIOCTLCMD) 2686 2682 return retval; 2687 2683 } ··· 2709 2705 return -EINVAL; 2710 2706 2711 2707 if (tty->ops->compat_ioctl) { 2712 - retval = (tty->ops->compat_ioctl)(tty, file, cmd, arg); 2708 + retval = (tty->ops->compat_ioctl)(tty, cmd, arg); 2713 2709 if (retval != -ENOIOCTLCMD) 2714 2710 return retval; 2715 2711 }
+9 -5
drivers/tty/tty_ioctl.c
··· 486 486 EXPORT_SYMBOL(tty_termios_hw_change); 487 487 488 488 /** 489 - * change_termios - update termios values 489 + * tty_set_termios - update termios values 490 490 * @tty: tty to update 491 491 * @new_termios: desired new value 492 492 * ··· 497 497 * Locking: termios_mutex 498 498 */ 499 499 500 - static void change_termios(struct tty_struct *tty, struct ktermios *new_termios) 500 + int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios) 501 501 { 502 502 struct ktermios old_termios; 503 503 struct tty_ldisc *ld; ··· 553 553 tty_ldisc_deref(ld); 554 554 } 555 555 mutex_unlock(&tty->termios_mutex); 556 + return 0; 556 557 } 558 + EXPORT_SYMBOL_GPL(tty_set_termios); 557 559 558 560 /** 559 561 * set_termios - set termios values for a tty ··· 564 562 * @opt: option information 565 563 * 566 564 * Helper function to prepare termios data and run necessary other 567 - * functions before using change_termios to do the actual changes. 565 + * functions before using tty_set_termios to do the actual changes. 568 566 * 569 567 * Locking: 570 568 * Called functions take ldisc and termios_mutex locks ··· 622 620 return -EINTR; 623 621 } 624 622 625 - change_termios(tty, &tmp_termios); 623 + tty_set_termios(tty, &tmp_termios); 626 624 627 625 /* FIXME: Arguably if tmp_termios == tty->termios AND the 628 626 actual requested termios was not tmp_termios then we may ··· 799 797 termios.c_ospeed); 800 798 #endif 801 799 mutex_unlock(&tty->termios_mutex); 802 - change_termios(tty, &termios); 800 + tty_set_termios(tty, &termios); 803 801 return 0; 804 802 } 805 803 #endif ··· 952 950 void __user *p = (void __user *)arg; 953 951 int ret = 0; 954 952 struct ktermios kterm; 953 + 954 + BUG_ON(file == NULL); 955 955 956 956 if (tty->driver->type == TTY_DRIVER_TYPE_PTY && 957 957 tty->driver->subtype == PTY_TYPE_MASTER)
+15 -2
drivers/tty/tty_ldisc.c
··· 535 535 } 536 536 537 537 /** 538 + * tty_ldisc_flush_works - flush all works of a tty 539 + * @tty: tty device to flush works for 540 + * 541 + * Sync flush all works belonging to @tty. 542 + */ 543 + static void tty_ldisc_flush_works(struct tty_struct *tty) 544 + { 545 + flush_work_sync(&tty->hangup_work); 546 + flush_work_sync(&tty->SAK_work); 547 + flush_delayed_work_sync(&tty->buf.work); 548 + } 549 + 550 + /** 538 551 * tty_ldisc_wait_idle - wait for the ldisc to become idle 539 552 * @tty: tty to wait for 540 553 * ··· 666 653 667 654 mutex_unlock(&tty->ldisc_mutex); 668 655 669 - flush_scheduled_work(); 656 + tty_ldisc_flush_works(tty); 670 657 671 658 retval = tty_ldisc_wait_idle(tty); 672 659 ··· 918 905 919 906 tty_unlock(); 920 907 tty_ldisc_halt(tty); 921 - flush_scheduled_work(); 908 + tty_ldisc_flush_works(tty); 922 909 tty_lock(); 923 910 924 911 mutex_lock(&tty->ldisc_mutex);
+3 -2
drivers/tty/vt/keyboard.c
··· 654 654 if (value >= ARRAY_SIZE(fn_handler)) 655 655 return; 656 656 if ((kbd->kbdmode == VC_RAW || 657 - kbd->kbdmode == VC_MEDIUMRAW) && 657 + kbd->kbdmode == VC_MEDIUMRAW || 658 + kbd->kbdmode == VC_OFF) && 658 659 value != KVAL(K_SAK)) 659 660 return; /* SAK is allowed even in raw mode */ 660 661 fn_handler[value](vc); ··· 1296 1295 if (rc == NOTIFY_STOP) 1297 1296 return; 1298 1297 1299 - if (raw_mode && type != KT_SPEC && type != KT_SHIFT) 1298 + if ((raw_mode || kbd->kbdmode == VC_OFF) && type != KT_SPEC && type != KT_SHIFT) 1300 1299 return; 1301 1300 1302 1301 (*k_handler[type])(vc, keysym & 0xff, !down);
+67 -43
drivers/tty/vt/vc_screen.c
··· 28 28 #include <linux/interrupt.h> 29 29 #include <linux/mm.h> 30 30 #include <linux/init.h> 31 - #include <linux/mutex.h> 32 31 #include <linux/vt_kern.h> 33 32 #include <linux/selection.h> 34 33 #include <linux/kbd_kern.h> ··· 49 50 #undef org 50 51 #undef addr 51 52 #define HEADER_SIZE 4 53 + 54 + #define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) 52 55 53 56 struct vcs_poll_data { 54 57 struct notifier_block notifier; ··· 132 131 return poll; 133 132 } 134 133 134 + /* 135 + * Returns VC for inode. 136 + * Must be called with console_lock. 137 + */ 138 + static struct vc_data* 139 + vcs_vc(struct inode *inode, int *viewed) 140 + { 141 + unsigned int currcons = iminor(inode) & 127; 142 + 143 + WARN_CONSOLE_UNLOCKED(); 144 + 145 + if (currcons == 0) { 146 + currcons = fg_console; 147 + if (viewed) 148 + *viewed = 1; 149 + } else { 150 + currcons--; 151 + if (viewed) 152 + *viewed = 0; 153 + } 154 + return vc_cons[currcons].d; 155 + } 156 + 157 + /* 158 + * Returns size for VC carried by inode. 159 + * Must be called with console_lock. 160 + */ 135 161 static int 136 162 vcs_size(struct inode *inode) 137 163 { 138 164 int size; 139 165 int minor = iminor(inode); 140 - int currcons = minor & 127; 141 166 struct vc_data *vc; 142 167 143 - if (currcons == 0) 144 - currcons = fg_console; 145 - else 146 - currcons--; 147 - if (!vc_cons_allocated(currcons)) 168 + WARN_CONSOLE_UNLOCKED(); 169 + 170 + vc = vcs_vc(inode, NULL); 171 + if (!vc) 148 172 return -ENXIO; 149 - vc = vc_cons[currcons].d; 150 173 151 174 size = vc->vc_rows * vc->vc_cols; 152 175 ··· 183 158 { 184 159 int size; 185 160 186 - mutex_lock(&con_buf_mtx); 161 + console_lock(); 187 162 size = vcs_size(file->f_path.dentry->d_inode); 163 + console_unlock(); 164 + if (size < 0) 165 + return size; 188 166 switch (orig) { 189 167 default: 190 - mutex_unlock(&con_buf_mtx); 191 168 return -EINVAL; 192 169 case 2: 193 170 offset += size; ··· 200 173 break; 201 174 } 202 175 if (offset < 0 || offset > size) { 203 - mutex_unlock(&con_buf_mtx); 204 176 return -EINVAL; 205 177 } 206 178 file->f_pos = offset; 207 - mutex_unlock(&con_buf_mtx); 208 179 return file->f_pos; 209 180 } 210 181 ··· 215 190 struct vc_data *vc; 216 191 struct vcs_poll_data *poll; 217 192 long pos; 218 - long viewed, attr, read; 219 - int col, maxcol; 193 + long attr, read; 194 + int col, maxcol, viewed; 220 195 unsigned short *org = NULL; 221 196 ssize_t ret; 197 + char *con_buf; 222 198 223 - mutex_lock(&con_buf_mtx); 199 + con_buf = (char *) __get_free_page(GFP_KERNEL); 200 + if (!con_buf) 201 + return -ENOMEM; 224 202 225 203 pos = *ppos; 226 204 ··· 233 205 console_lock(); 234 206 235 207 attr = (currcons & 128); 236 - currcons = (currcons & 127); 237 - if (currcons == 0) { 238 - currcons = fg_console; 239 - viewed = 1; 240 - } else { 241 - currcons--; 242 - viewed = 0; 243 - } 244 208 ret = -ENXIO; 245 - if (!vc_cons_allocated(currcons)) 209 + vc = vcs_vc(inode, &viewed); 210 + if (!vc) 246 211 goto unlock_out; 247 - vc = vc_cons[currcons].d; 248 212 249 213 ret = -EINVAL; 250 214 if (pos < 0) ··· 257 237 * could sleep. 258 238 */ 259 239 size = vcs_size(inode); 240 + if (size < 0) { 241 + if (read) 242 + break; 243 + ret = size; 244 + goto unlock_out; 245 + } 260 246 if (pos >= size) 261 247 break; 262 248 if (count > size - pos) ··· 381 355 ret = read; 382 356 unlock_out: 383 357 console_unlock(); 384 - mutex_unlock(&con_buf_mtx); 358 + free_page((unsigned long) con_buf); 385 359 return ret; 386 360 } 387 361 ··· 392 366 unsigned int currcons = iminor(inode); 393 367 struct vc_data *vc; 394 368 long pos; 395 - long viewed, attr, size, written; 369 + long attr, size, written; 396 370 char *con_buf0; 397 - int col, maxcol; 371 + int col, maxcol, viewed; 398 372 u16 *org0 = NULL, *org = NULL; 399 373 size_t ret; 374 + char *con_buf; 400 375 401 - mutex_lock(&con_buf_mtx); 376 + con_buf = (char *) __get_free_page(GFP_KERNEL); 377 + if (!con_buf) 378 + return -ENOMEM; 402 379 403 380 pos = *ppos; 404 381 ··· 411 382 console_lock(); 412 383 413 384 attr = (currcons & 128); 414 - currcons = (currcons & 127); 415 - 416 - if (currcons == 0) { 417 - currcons = fg_console; 418 - viewed = 1; 419 - } else { 420 - currcons--; 421 - viewed = 0; 422 - } 423 385 ret = -ENXIO; 424 - if (!vc_cons_allocated(currcons)) 386 + vc = vcs_vc(inode, &viewed); 387 + if (!vc) 425 388 goto unlock_out; 426 - vc = vc_cons[currcons].d; 427 389 428 390 size = vcs_size(inode); 429 391 ret = -EINVAL; ··· 456 436 * Return data written up to now on failure. 457 437 */ 458 438 size = vcs_size(inode); 439 + if (size < 0) { 440 + if (written) 441 + break; 442 + ret = size; 443 + goto unlock_out; 444 + } 459 445 if (pos >= size) 460 446 break; 461 447 if (this_round > size - pos) ··· 569 543 570 544 unlock_out: 571 545 console_unlock(); 572 - 573 - mutex_unlock(&con_buf_mtx); 574 - 546 + free_page((unsigned long) con_buf); 575 547 return ret; 576 548 } 577 549
+8 -19
drivers/tty/vt/vt.c
··· 2068 2068 } 2069 2069 } 2070 2070 2071 - /* This is a temporary buffer used to prepare a tty console write 2072 - * so that we can easily avoid touching user space while holding the 2073 - * console spinlock. It is allocated in con_init and is shared by 2074 - * this code and the vc_screen read/write tty calls. 2075 - * 2076 - * We have to allocate this statically in the kernel data section 2077 - * since console_init (and thus con_init) are called before any 2078 - * kernel memory allocation is available. 2079 - */ 2080 - char con_buf[CON_BUF_SIZE]; 2081 - DEFINE_MUTEX(con_buf_mtx); 2082 - 2083 2071 /* is_double_width() is based on the wcwidth() implementation by 2084 2072 * Markus Kuhn -- 2007-05-26 (Unicode 5.0) 2085 2073 * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c ··· 2145 2157 2146 2158 currcons = vc->vc_num; 2147 2159 if (!vc_cons_allocated(currcons)) { 2148 - /* could this happen? */ 2149 - printk_once("con_write: tty %d not allocated\n", currcons+1); 2150 - console_unlock(); 2151 - return 0; 2160 + /* could this happen? */ 2161 + pr_warn_once("con_write: tty %d not allocated\n", currcons+1); 2162 + console_unlock(); 2163 + return 0; 2152 2164 } 2153 2165 2154 2166 himask = vc->vc_hi_font_mask; ··· 2928 2940 gotoxy(vc, vc->vc_x, vc->vc_y); 2929 2941 csi_J(vc, 0); 2930 2942 update_screen(vc); 2931 - printk("Console: %s %s %dx%d", 2943 + pr_info("Console: %s %s %dx%d", 2932 2944 vc->vc_can_do_color ? "colour" : "mono", 2933 2945 display_desc, vc->vc_cols, vc->vc_rows); 2934 2946 printable = 1; ··· 3091 3103 clear_buffer_attributes(vc); 3092 3104 } 3093 3105 3094 - printk("Console: switching "); 3106 + pr_info("Console: switching "); 3095 3107 if (!deflt) 3096 3108 printk("consoles %d-%d ", first+1, last+1); 3097 3109 if (j >= 0) { ··· 3797 3809 return; 3798 3810 if (!vc_cons_allocated(fg_console)) { 3799 3811 /* impossible */ 3800 - printk("unblank_screen: tty %d not allocated ??\n", fg_console+1); 3812 + pr_warning("unblank_screen: tty %d not allocated ??\n", 3813 + fg_console+1); 3801 3814 return; 3802 3815 } 3803 3816 vc = vc_cons[fg_console].d;
+8 -4
drivers/tty/vt/vt_ioctl.c
··· 495 495 * We handle the console-specific ioctl's here. We allow the 496 496 * capability to modify any console, not just the fg_console. 497 497 */ 498 - int vt_ioctl(struct tty_struct *tty, struct file * file, 498 + int vt_ioctl(struct tty_struct *tty, 499 499 unsigned int cmd, unsigned long arg) 500 500 { 501 501 struct vc_data *vc = tty->driver_data; ··· 687 687 case K_UNICODE: 688 688 kbd->kbdmode = VC_UNICODE; 689 689 compute_shiftstate(); 690 + break; 691 + case K_OFF: 692 + kbd->kbdmode = VC_OFF; 690 693 break; 691 694 default: 692 695 ret = -EINVAL; ··· 1010 1007 if (ret) 1011 1008 break; 1012 1009 /* Commence switch and lock */ 1013 - set_console(arg); 1010 + set_console(vsa.console); 1014 1011 } 1012 + break; 1015 1013 } 1016 1014 1017 1015 /* ··· 1495 1491 return 0; 1496 1492 } 1497 1493 1498 - long vt_compat_ioctl(struct tty_struct *tty, struct file * file, 1494 + long vt_compat_ioctl(struct tty_struct *tty, 1499 1495 unsigned int cmd, unsigned long arg) 1500 1496 { 1501 1497 struct vc_data *vc = tty->driver_data; ··· 1581 1577 1582 1578 fallback: 1583 1579 tty_unlock(); 1584 - return vt_ioctl(tty, file, cmd, arg); 1580 + return vt_ioctl(tty, cmd, arg); 1585 1581 } 1586 1582 1587 1583
+3 -3
drivers/usb/class/cdc-acm.c
··· 776 776 return retval; 777 777 } 778 778 779 - static int acm_tty_tiocmget(struct tty_struct *tty, struct file *file) 779 + static int acm_tty_tiocmget(struct tty_struct *tty) 780 780 { 781 781 struct acm *acm = tty->driver_data; 782 782 ··· 791 791 TIOCM_CTS; 792 792 } 793 793 794 - static int acm_tty_tiocmset(struct tty_struct *tty, struct file *file, 794 + static int acm_tty_tiocmset(struct tty_struct *tty, 795 795 unsigned int set, unsigned int clear) 796 796 { 797 797 struct acm *acm = tty->driver_data; ··· 813 813 return acm_set_control(acm, acm->ctrlout = newctrl); 814 814 } 815 815 816 - static int acm_tty_ioctl(struct tty_struct *tty, struct file *file, 816 + static int acm_tty_ioctl(struct tty_struct *tty, 817 817 unsigned int cmd, unsigned long arg) 818 818 { 819 819 struct acm *acm = tty->driver_data;
+3 -3
drivers/usb/serial/ark3116.c
··· 431 431 return 0; 432 432 } 433 433 434 - static int ark3116_ioctl(struct tty_struct *tty, struct file *file, 434 + static int ark3116_ioctl(struct tty_struct *tty, 435 435 unsigned int cmd, unsigned long arg) 436 436 { 437 437 struct usb_serial_port *port = tty->driver_data; ··· 485 485 return -ENOIOCTLCMD; 486 486 } 487 487 488 - static int ark3116_tiocmget(struct tty_struct *tty, struct file *file) 488 + static int ark3116_tiocmget(struct tty_struct *tty) 489 489 { 490 490 struct usb_serial_port *port = tty->driver_data; 491 491 struct ark3116_private *priv = usb_get_serial_port_data(port); ··· 511 511 (ctrl & UART_MCR_OUT2 ? TIOCM_OUT2 : 0); 512 512 } 513 513 514 - static int ark3116_tiocmset(struct tty_struct *tty, struct file *file, 514 + static int ark3116_tiocmset(struct tty_struct *tty, 515 515 unsigned set, unsigned clr) 516 516 { 517 517 struct usb_serial_port *port = tty->driver_data;
+4 -4
drivers/usb/serial/belkin_sa.c
··· 100 100 static void belkin_sa_set_termios(struct tty_struct *tty, 101 101 struct usb_serial_port *port, struct ktermios * old); 102 102 static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state); 103 - static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file); 104 - static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file, 103 + static int belkin_sa_tiocmget(struct tty_struct *tty); 104 + static int belkin_sa_tiocmset(struct tty_struct *tty, 105 105 unsigned int set, unsigned int clear); 106 106 107 107 ··· 497 497 dev_err(&port->dev, "Set break_ctl %d\n", break_state); 498 498 } 499 499 500 - static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file) 500 + static int belkin_sa_tiocmget(struct tty_struct *tty) 501 501 { 502 502 struct usb_serial_port *port = tty->driver_data; 503 503 struct belkin_sa_private *priv = usb_get_serial_port_data(port); ··· 513 513 return control_state; 514 514 } 515 515 516 - static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file, 516 + static int belkin_sa_tiocmset(struct tty_struct *tty, 517 517 unsigned int set, unsigned int clear) 518 518 { 519 519 struct usb_serial_port *port = tty->driver_data;
+3 -4
drivers/usb/serial/ch341.c
··· 432 432 kfree(break_reg); 433 433 } 434 434 435 - static int ch341_tiocmset(struct tty_struct *tty, struct file *file, 435 + static int ch341_tiocmset(struct tty_struct *tty, 436 436 unsigned int set, unsigned int clear) 437 437 { 438 438 struct usb_serial_port *port = tty->driver_data; ··· 553 553 return 0; 554 554 } 555 555 556 - /*static int ch341_ioctl(struct usb_serial_port *port, struct file *file,*/ 557 - static int ch341_ioctl(struct tty_struct *tty, struct file *file, 556 + static int ch341_ioctl(struct tty_struct *tty, 558 557 unsigned int cmd, unsigned long arg) 559 558 { 560 559 struct usb_serial_port *port = tty->driver_data; ··· 572 573 return -ENOIOCTLCMD; 573 574 } 574 575 575 - static int ch341_tiocmget(struct tty_struct *tty, struct file *file) 576 + static int ch341_tiocmget(struct tty_struct *tty) 576 577 { 577 578 struct usb_serial_port *port = tty->driver_data; 578 579 struct ch341_private *priv = usb_get_serial_port_data(port);
+9 -10
drivers/usb/serial/cp210x.c
··· 41 41 unsigned int *cflagp, unsigned int *baudp); 42 42 static void cp210x_set_termios(struct tty_struct *, struct usb_serial_port *, 43 43 struct ktermios*); 44 - static int cp210x_tiocmget(struct tty_struct *, struct file *); 45 - static int cp210x_tiocmset(struct tty_struct *, struct file *, 46 - unsigned int, unsigned int); 47 - static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *, 44 + static int cp210x_tiocmget(struct tty_struct *); 45 + static int cp210x_tiocmset(struct tty_struct *, unsigned int, unsigned int); 46 + static int cp210x_tiocmset_port(struct usb_serial_port *port, 48 47 unsigned int, unsigned int); 49 48 static void cp210x_break_ctl(struct tty_struct *, int); 50 49 static int cp210x_startup(struct usb_serial *); ··· 697 698 698 699 } 699 700 700 - static int cp210x_tiocmset (struct tty_struct *tty, struct file *file, 701 + static int cp210x_tiocmset (struct tty_struct *tty, 701 702 unsigned int set, unsigned int clear) 702 703 { 703 704 struct usb_serial_port *port = tty->driver_data; 704 - return cp210x_tiocmset_port(port, file, set, clear); 705 + return cp210x_tiocmset_port(port, set, clear); 705 706 } 706 707 707 - static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *file, 708 + static int cp210x_tiocmset_port(struct usb_serial_port *port, 708 709 unsigned int set, unsigned int clear) 709 710 { 710 711 unsigned int control = 0; ··· 736 737 static void cp210x_dtr_rts(struct usb_serial_port *p, int on) 737 738 { 738 739 if (on) 739 - cp210x_tiocmset_port(p, NULL, TIOCM_DTR|TIOCM_RTS, 0); 740 + cp210x_tiocmset_port(p, TIOCM_DTR|TIOCM_RTS, 0); 740 741 else 741 - cp210x_tiocmset_port(p, NULL, 0, TIOCM_DTR|TIOCM_RTS); 742 + cp210x_tiocmset_port(p, 0, TIOCM_DTR|TIOCM_RTS); 742 743 } 743 744 744 - static int cp210x_tiocmget (struct tty_struct *tty, struct file *file) 745 + static int cp210x_tiocmget (struct tty_struct *tty) 745 746 { 746 747 struct usb_serial_port *port = tty->driver_data; 747 748 unsigned int control;
+6 -6
drivers/usb/serial/cypress_m8.c
··· 169 169 const unsigned char *buf, int count); 170 170 static void cypress_send(struct usb_serial_port *port); 171 171 static int cypress_write_room(struct tty_struct *tty); 172 - static int cypress_ioctl(struct tty_struct *tty, struct file *file, 172 + static int cypress_ioctl(struct tty_struct *tty, 173 173 unsigned int cmd, unsigned long arg); 174 174 static void cypress_set_termios(struct tty_struct *tty, 175 175 struct usb_serial_port *port, struct ktermios *old); 176 - static int cypress_tiocmget(struct tty_struct *tty, struct file *file); 177 - static int cypress_tiocmset(struct tty_struct *tty, struct file *file, 176 + static int cypress_tiocmget(struct tty_struct *tty); 177 + static int cypress_tiocmset(struct tty_struct *tty, 178 178 unsigned int set, unsigned int clear); 179 179 static int cypress_chars_in_buffer(struct tty_struct *tty); 180 180 static void cypress_throttle(struct tty_struct *tty); ··· 864 864 } 865 865 866 866 867 - static int cypress_tiocmget(struct tty_struct *tty, struct file *file) 867 + static int cypress_tiocmget(struct tty_struct *tty) 868 868 { 869 869 struct usb_serial_port *port = tty->driver_data; 870 870 struct cypress_private *priv = usb_get_serial_port_data(port); ··· 892 892 } 893 893 894 894 895 - static int cypress_tiocmset(struct tty_struct *tty, struct file *file, 895 + static int cypress_tiocmset(struct tty_struct *tty, 896 896 unsigned int set, unsigned int clear) 897 897 { 898 898 struct usb_serial_port *port = tty->driver_data; ··· 917 917 } 918 918 919 919 920 - static int cypress_ioctl(struct tty_struct *tty, struct file *file, 920 + static int cypress_ioctl(struct tty_struct *tty, 921 921 unsigned int cmd, unsigned long arg) 922 922 { 923 923 struct usb_serial_port *port = tty->driver_data;
+7 -7
drivers/usb/serial/digi_acceleport.c
··· 445 445 static void digi_set_termios(struct tty_struct *tty, 446 446 struct usb_serial_port *port, struct ktermios *old_termios); 447 447 static void digi_break_ctl(struct tty_struct *tty, int break_state); 448 - static int digi_tiocmget(struct tty_struct *tty, struct file *file); 449 - static int digi_tiocmset(struct tty_struct *tty, struct file *file, 450 - unsigned int set, unsigned int clear); 448 + static int digi_tiocmget(struct tty_struct *tty); 449 + static int digi_tiocmset(struct tty_struct *tty, unsigned int set, 450 + unsigned int clear); 451 451 static int digi_write(struct tty_struct *tty, struct usb_serial_port *port, 452 - const unsigned char *buf, int count); 452 + const unsigned char *buf, int count); 453 453 static void digi_write_bulk_callback(struct urb *urb); 454 454 static int digi_write_room(struct tty_struct *tty); 455 455 static int digi_chars_in_buffer(struct tty_struct *tty); ··· 1118 1118 } 1119 1119 1120 1120 1121 - static int digi_tiocmget(struct tty_struct *tty, struct file *file) 1121 + static int digi_tiocmget(struct tty_struct *tty) 1122 1122 { 1123 1123 struct usb_serial_port *port = tty->driver_data; 1124 1124 struct digi_port *priv = usb_get_serial_port_data(port); ··· 1134 1134 } 1135 1135 1136 1136 1137 - static int digi_tiocmset(struct tty_struct *tty, struct file *file, 1138 - unsigned int set, unsigned int clear) 1137 + static int digi_tiocmset(struct tty_struct *tty, 1138 + unsigned int set, unsigned int clear) 1139 1139 { 1140 1140 struct usb_serial_port *port = tty->driver_data; 1141 1141 struct digi_port *priv = usb_get_serial_port_data(port);
+6 -6
drivers/usb/serial/ftdi_sio.c
··· 866 866 void *dest, size_t size); 867 867 static void ftdi_set_termios(struct tty_struct *tty, 868 868 struct usb_serial_port *port, struct ktermios *old); 869 - static int ftdi_tiocmget(struct tty_struct *tty, struct file *file); 870 - static int ftdi_tiocmset(struct tty_struct *tty, struct file *file, 869 + static int ftdi_tiocmget(struct tty_struct *tty); 870 + static int ftdi_tiocmset(struct tty_struct *tty, 871 871 unsigned int set, unsigned int clear); 872 - static int ftdi_ioctl(struct tty_struct *tty, struct file *file, 872 + static int ftdi_ioctl(struct tty_struct *tty, 873 873 unsigned int cmd, unsigned long arg); 874 874 static void ftdi_break_ctl(struct tty_struct *tty, int break_state); 875 875 ··· 2178 2178 } 2179 2179 } 2180 2180 2181 - static int ftdi_tiocmget(struct tty_struct *tty, struct file *file) 2181 + static int ftdi_tiocmget(struct tty_struct *tty) 2182 2182 { 2183 2183 struct usb_serial_port *port = tty->driver_data; 2184 2184 struct ftdi_private *priv = usb_get_serial_port_data(port); ··· 2231 2231 return ret; 2232 2232 } 2233 2233 2234 - static int ftdi_tiocmset(struct tty_struct *tty, struct file *file, 2234 + static int ftdi_tiocmset(struct tty_struct *tty, 2235 2235 unsigned int set, unsigned int clear) 2236 2236 { 2237 2237 struct usb_serial_port *port = tty->driver_data; ··· 2239 2239 return update_mctrl(port, set, clear); 2240 2240 } 2241 2241 2242 - static int ftdi_ioctl(struct tty_struct *tty, struct file *file, 2242 + static int ftdi_ioctl(struct tty_struct *tty, 2243 2243 unsigned int cmd, unsigned long arg) 2244 2244 { 2245 2245 struct usb_serial_port *port = tty->driver_data;
+6 -6
drivers/usb/serial/io_edgeport.c
··· 216 216 static void edge_set_termios(struct tty_struct *tty, 217 217 struct usb_serial_port *port, 218 218 struct ktermios *old_termios); 219 - static int edge_ioctl(struct tty_struct *tty, struct file *file, 219 + static int edge_ioctl(struct tty_struct *tty, 220 220 unsigned int cmd, unsigned long arg); 221 221 static void edge_break(struct tty_struct *tty, int break_state); 222 - static int edge_tiocmget(struct tty_struct *tty, struct file *file); 223 - static int edge_tiocmset(struct tty_struct *tty, struct file *file, 222 + static int edge_tiocmget(struct tty_struct *tty); 223 + static int edge_tiocmset(struct tty_struct *tty, 224 224 unsigned int set, unsigned int clear); 225 225 static int edge_get_icount(struct tty_struct *tty, 226 226 struct serial_icounter_struct *icount); ··· 1568 1568 return 0; 1569 1569 } 1570 1570 1571 - static int edge_tiocmset(struct tty_struct *tty, struct file *file, 1571 + static int edge_tiocmset(struct tty_struct *tty, 1572 1572 unsigned int set, unsigned int clear) 1573 1573 { 1574 1574 struct usb_serial_port *port = tty->driver_data; ··· 1599 1599 return 0; 1600 1600 } 1601 1601 1602 - static int edge_tiocmget(struct tty_struct *tty, struct file *file) 1602 + static int edge_tiocmget(struct tty_struct *tty) 1603 1603 { 1604 1604 struct usb_serial_port *port = tty->driver_data; 1605 1605 struct edgeport_port *edge_port = usb_get_serial_port_data(port); ··· 1679 1679 * SerialIoctl 1680 1680 * this function handles any ioctl calls to the driver 1681 1681 *****************************************************************************/ 1682 - static int edge_ioctl(struct tty_struct *tty, struct file *file, 1682 + static int edge_ioctl(struct tty_struct *tty, 1683 1683 unsigned int cmd, unsigned long arg) 1684 1684 { 1685 1685 struct usb_serial_port *port = tty->driver_data;
+3 -3
drivers/usb/serial/io_ti.c
··· 2444 2444 change_port_settings(tty, edge_port, old_termios); 2445 2445 } 2446 2446 2447 - static int edge_tiocmset(struct tty_struct *tty, struct file *file, 2447 + static int edge_tiocmset(struct tty_struct *tty, 2448 2448 unsigned int set, unsigned int clear) 2449 2449 { 2450 2450 struct usb_serial_port *port = tty->driver_data; ··· 2477 2477 return 0; 2478 2478 } 2479 2479 2480 - static int edge_tiocmget(struct tty_struct *tty, struct file *file) 2480 + static int edge_tiocmget(struct tty_struct *tty) 2481 2481 { 2482 2482 struct usb_serial_port *port = tty->driver_data; 2483 2483 struct edgeport_port *edge_port = usb_get_serial_port_data(port); ··· 2552 2552 return 0; 2553 2553 } 2554 2554 2555 - static int edge_ioctl(struct tty_struct *tty, struct file *file, 2555 + static int edge_ioctl(struct tty_struct *tty, 2556 2556 unsigned int cmd, unsigned long arg) 2557 2557 { 2558 2558 struct usb_serial_port *port = tty->driver_data;
+2 -2
drivers/usb/serial/iuu_phoenix.c
··· 150 150 } 151 151 } 152 152 153 - static int iuu_tiocmset(struct tty_struct *tty, struct file *file, 153 + static int iuu_tiocmset(struct tty_struct *tty, 154 154 unsigned int set, unsigned int clear) 155 155 { 156 156 struct usb_serial_port *port = tty->driver_data; ··· 179 179 * When no card , the reader respond with TIOCM_CD 180 180 * This is known as CD autodetect mechanism 181 181 */ 182 - static int iuu_tiocmget(struct tty_struct *tty, struct file *file) 182 + static int iuu_tiocmget(struct tty_struct *tty) 183 183 { 184 184 struct usb_serial_port *port = tty->driver_data; 185 185 struct iuu_private *priv = usb_get_serial_port_data(port);
+2 -2
drivers/usb/serial/keyspan.c
··· 301 301 keyspan_send_setup(port, 0); 302 302 } 303 303 304 - static int keyspan_tiocmget(struct tty_struct *tty, struct file *file) 304 + static int keyspan_tiocmget(struct tty_struct *tty) 305 305 { 306 306 struct usb_serial_port *port = tty->driver_data; 307 307 struct keyspan_port_private *p_priv = usb_get_serial_port_data(port); ··· 317 317 return value; 318 318 } 319 319 320 - static int keyspan_tiocmset(struct tty_struct *tty, struct file *file, 320 + static int keyspan_tiocmset(struct tty_struct *tty, 321 321 unsigned int set, unsigned int clear) 322 322 { 323 323 struct usb_serial_port *port = tty->driver_data;
+2 -3
drivers/usb/serial/keyspan.h
··· 58 58 struct ktermios *old); 59 59 static void keyspan_break_ctl (struct tty_struct *tty, 60 60 int break_state); 61 - static int keyspan_tiocmget (struct tty_struct *tty, 62 - struct file *file); 61 + static int keyspan_tiocmget (struct tty_struct *tty); 63 62 static int keyspan_tiocmset (struct tty_struct *tty, 64 - struct file *file, unsigned int set, 63 + unsigned int set, 65 64 unsigned int clear); 66 65 static int keyspan_fake_startup (struct usb_serial *serial); 67 66
+2 -2
drivers/usb/serial/keyspan_pda.c
··· 458 458 return rc; 459 459 } 460 460 461 - static int keyspan_pda_tiocmget(struct tty_struct *tty, struct file *file) 461 + static int keyspan_pda_tiocmget(struct tty_struct *tty) 462 462 { 463 463 struct usb_serial_port *port = tty->driver_data; 464 464 struct usb_serial *serial = port->serial; ··· 479 479 return value; 480 480 } 481 481 482 - static int keyspan_pda_tiocmset(struct tty_struct *tty, struct file *file, 482 + static int keyspan_pda_tiocmset(struct tty_struct *tty, 483 483 unsigned int set, unsigned int clear) 484 484 { 485 485 struct usb_serial_port *port = tty->driver_data;
+4 -4
drivers/usb/serial/kl5kusb105.c
··· 68 68 static void klsi_105_close(struct usb_serial_port *port); 69 69 static void klsi_105_set_termios(struct tty_struct *tty, 70 70 struct usb_serial_port *port, struct ktermios *old); 71 - static int klsi_105_tiocmget(struct tty_struct *tty, struct file *file); 72 - static int klsi_105_tiocmset(struct tty_struct *tty, struct file *file, 71 + static int klsi_105_tiocmget(struct tty_struct *tty); 72 + static int klsi_105_tiocmset(struct tty_struct *tty, 73 73 unsigned int set, unsigned int clear); 74 74 static void klsi_105_process_read_urb(struct urb *urb); 75 75 static int klsi_105_prepare_write_buffer(struct usb_serial_port *port, ··· 637 637 } 638 638 #endif 639 639 640 - static int klsi_105_tiocmget(struct tty_struct *tty, struct file *file) 640 + static int klsi_105_tiocmget(struct tty_struct *tty) 641 641 { 642 642 struct usb_serial_port *port = tty->driver_data; 643 643 struct klsi_105_private *priv = usb_get_serial_port_data(port); ··· 661 661 return (int)line_state; 662 662 } 663 663 664 - static int klsi_105_tiocmset(struct tty_struct *tty, struct file *file, 664 + static int klsi_105_tiocmset(struct tty_struct *tty, 665 665 unsigned int set, unsigned int clear) 666 666 { 667 667 int retval = -EINVAL;
+6 -6
drivers/usb/serial/kobil_sct.c
··· 75 75 static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port, 76 76 const unsigned char *buf, int count); 77 77 static int kobil_write_room(struct tty_struct *tty); 78 - static int kobil_ioctl(struct tty_struct *tty, struct file *file, 78 + static int kobil_ioctl(struct tty_struct *tty, 79 79 unsigned int cmd, unsigned long arg); 80 - static int kobil_tiocmget(struct tty_struct *tty, struct file *file); 81 - static int kobil_tiocmset(struct tty_struct *tty, struct file *file, 80 + static int kobil_tiocmget(struct tty_struct *tty); 81 + static int kobil_tiocmset(struct tty_struct *tty, 82 82 unsigned int set, unsigned int clear); 83 83 static void kobil_read_int_callback(struct urb *urb); 84 84 static void kobil_write_callback(struct urb *purb); ··· 504 504 } 505 505 506 506 507 - static int kobil_tiocmget(struct tty_struct *tty, struct file *file) 507 + static int kobil_tiocmget(struct tty_struct *tty) 508 508 { 509 509 struct usb_serial_port *port = tty->driver_data; 510 510 struct kobil_private *priv; ··· 544 544 return result; 545 545 } 546 546 547 - static int kobil_tiocmset(struct tty_struct *tty, struct file *file, 547 + static int kobil_tiocmset(struct tty_struct *tty, 548 548 unsigned int set, unsigned int clear) 549 549 { 550 550 struct usb_serial_port *port = tty->driver_data; ··· 668 668 ); 669 669 } 670 670 671 - static int kobil_ioctl(struct tty_struct *tty, struct file *file, 671 + static int kobil_ioctl(struct tty_struct *tty, 672 672 unsigned int cmd, unsigned long arg) 673 673 { 674 674 struct usb_serial_port *port = tty->driver_data;
+4 -4
drivers/usb/serial/mct_u232.c
··· 103 103 static void mct_u232_set_termios(struct tty_struct *tty, 104 104 struct usb_serial_port *port, struct ktermios *old); 105 105 static void mct_u232_break_ctl(struct tty_struct *tty, int break_state); 106 - static int mct_u232_tiocmget(struct tty_struct *tty, struct file *file); 107 - static int mct_u232_tiocmset(struct tty_struct *tty, struct file *file, 106 + static int mct_u232_tiocmget(struct tty_struct *tty); 107 + static int mct_u232_tiocmset(struct tty_struct *tty, 108 108 unsigned int set, unsigned int clear); 109 109 static int mct_u232_ioctl(struct tty_struct *tty, struct file *file, 110 110 unsigned int cmd, unsigned long arg); ··· 790 790 } /* mct_u232_break_ctl */ 791 791 792 792 793 - static int mct_u232_tiocmget(struct tty_struct *tty, struct file *file) 793 + static int mct_u232_tiocmget(struct tty_struct *tty) 794 794 { 795 795 struct usb_serial_port *port = tty->driver_data; 796 796 struct mct_u232_private *priv = usb_get_serial_port_data(port); ··· 806 806 return control_state; 807 807 } 808 808 809 - static int mct_u232_tiocmset(struct tty_struct *tty, struct file *file, 809 + static int mct_u232_tiocmset(struct tty_struct *tty, 810 810 unsigned int set, unsigned int clear) 811 811 { 812 812 struct usb_serial_port *port = tty->driver_data;
+4 -4
drivers/usb/serial/mos7720.c
··· 1833 1833 return 0; 1834 1834 } 1835 1835 1836 - static int mos7720_tiocmget(struct tty_struct *tty, struct file *file) 1836 + static int mos7720_tiocmget(struct tty_struct *tty) 1837 1837 { 1838 1838 struct usb_serial_port *port = tty->driver_data; 1839 1839 struct moschip_port *mos7720_port = usb_get_serial_port_data(port); ··· 1858 1858 return result; 1859 1859 } 1860 1860 1861 - static int mos7720_tiocmset(struct tty_struct *tty, struct file *file, 1861 + static int mos7720_tiocmset(struct tty_struct *tty, 1862 1862 unsigned int set, unsigned int clear) 1863 1863 { 1864 1864 struct usb_serial_port *port = tty->driver_data; 1865 1865 struct moschip_port *mos7720_port = usb_get_serial_port_data(port); 1866 1866 unsigned int mcr ; 1867 1867 dbg("%s - port %d", __func__, port->number); 1868 - dbg("he was at tiocmget"); 1868 + dbg("he was at tiocmset"); 1869 1869 1870 1870 mcr = mos7720_port->shadowMCR; 1871 1871 ··· 1987 1987 return 0; 1988 1988 } 1989 1989 1990 - static int mos7720_ioctl(struct tty_struct *tty, struct file *file, 1990 + static int mos7720_ioctl(struct tty_struct *tty, 1991 1991 unsigned int cmd, unsigned long arg) 1992 1992 { 1993 1993 struct usb_serial_port *port = tty->driver_data;
+3 -3
drivers/usb/serial/mos7840.c
··· 1644 1644 } 1645 1645 } 1646 1646 1647 - static int mos7840_tiocmget(struct tty_struct *tty, struct file *file) 1647 + static int mos7840_tiocmget(struct tty_struct *tty) 1648 1648 { 1649 1649 struct usb_serial_port *port = tty->driver_data; 1650 1650 struct moschip_port *mos7840_port; ··· 1674 1674 return result; 1675 1675 } 1676 1676 1677 - static int mos7840_tiocmset(struct tty_struct *tty, struct file *file, 1677 + static int mos7840_tiocmset(struct tty_struct *tty, 1678 1678 unsigned int set, unsigned int clear) 1679 1679 { 1680 1680 struct usb_serial_port *port = tty->driver_data; ··· 2235 2235 * this function handles any ioctl calls to the driver 2236 2236 *****************************************************************************/ 2237 2237 2238 - static int mos7840_ioctl(struct tty_struct *tty, struct file *file, 2238 + static int mos7840_ioctl(struct tty_struct *tty, 2239 2239 unsigned int cmd, unsigned long arg) 2240 2240 { 2241 2241 struct usb_serial_port *port = tty->driver_data;
+2 -2
drivers/usb/serial/opticon.c
··· 391 391 } 392 392 } 393 393 394 - static int opticon_tiocmget(struct tty_struct *tty, struct file *file) 394 + static int opticon_tiocmget(struct tty_struct *tty) 395 395 { 396 396 struct usb_serial_port *port = tty->driver_data; 397 397 struct opticon_private *priv = usb_get_serial_data(port->serial); ··· 468 468 return 0; 469 469 } 470 470 471 - static int opticon_ioctl(struct tty_struct *tty, struct file *file, 471 + static int opticon_ioctl(struct tty_struct *tty, 472 472 unsigned int cmd, unsigned long arg) 473 473 { 474 474 struct usb_serial_port *port = tty->driver_data;
+6 -6
drivers/usb/serial/oti6858.c
··· 135 135 static void oti6858_set_termios(struct tty_struct *tty, 136 136 struct usb_serial_port *port, struct ktermios *old); 137 137 static void oti6858_init_termios(struct tty_struct *tty); 138 - static int oti6858_ioctl(struct tty_struct *tty, struct file *file, 138 + static int oti6858_ioctl(struct tty_struct *tty, 139 139 unsigned int cmd, unsigned long arg); 140 140 static void oti6858_read_int_callback(struct urb *urb); 141 141 static void oti6858_read_bulk_callback(struct urb *urb); ··· 144 144 const unsigned char *buf, int count); 145 145 static int oti6858_write_room(struct tty_struct *tty); 146 146 static int oti6858_chars_in_buffer(struct tty_struct *tty); 147 - static int oti6858_tiocmget(struct tty_struct *tty, struct file *file); 148 - static int oti6858_tiocmset(struct tty_struct *tty, struct file *file, 147 + static int oti6858_tiocmget(struct tty_struct *tty); 148 + static int oti6858_tiocmset(struct tty_struct *tty, 149 149 unsigned int set, unsigned int clear); 150 150 static int oti6858_startup(struct usb_serial *serial); 151 151 static void oti6858_release(struct usb_serial *serial); ··· 624 624 usb_kill_urb(port->interrupt_in_urb); 625 625 } 626 626 627 - static int oti6858_tiocmset(struct tty_struct *tty, struct file *file, 627 + static int oti6858_tiocmset(struct tty_struct *tty, 628 628 unsigned int set, unsigned int clear) 629 629 { 630 630 struct usb_serial_port *port = tty->driver_data; ··· 657 657 return 0; 658 658 } 659 659 660 - static int oti6858_tiocmget(struct tty_struct *tty, struct file *file) 660 + static int oti6858_tiocmget(struct tty_struct *tty) 661 661 { 662 662 struct usb_serial_port *port = tty->driver_data; 663 663 struct oti6858_private *priv = usb_get_serial_port_data(port); ··· 728 728 return 0; 729 729 } 730 730 731 - static int oti6858_ioctl(struct tty_struct *tty, struct file *file, 731 + static int oti6858_ioctl(struct tty_struct *tty, 732 732 unsigned int cmd, unsigned long arg) 733 733 { 734 734 struct usb_serial_port *port = tty->driver_data;
+3 -3
drivers/usb/serial/pl2303.c
··· 505 505 return 0; 506 506 } 507 507 508 - static int pl2303_tiocmset(struct tty_struct *tty, struct file *file, 508 + static int pl2303_tiocmset(struct tty_struct *tty, 509 509 unsigned int set, unsigned int clear) 510 510 { 511 511 struct usb_serial_port *port = tty->driver_data; ··· 531 531 return set_control_lines(port->serial->dev, control); 532 532 } 533 533 534 - static int pl2303_tiocmget(struct tty_struct *tty, struct file *file) 534 + static int pl2303_tiocmget(struct tty_struct *tty) 535 535 { 536 536 struct usb_serial_port *port = tty->driver_data; 537 537 struct pl2303_private *priv = usb_get_serial_port_data(port); ··· 606 606 return 0; 607 607 } 608 608 609 - static int pl2303_ioctl(struct tty_struct *tty, struct file *file, 609 + static int pl2303_ioctl(struct tty_struct *tty, 610 610 unsigned int cmd, unsigned long arg) 611 611 { 612 612 struct serial_struct ser;
+2 -2
drivers/usb/serial/sierra.c
··· 395 395 sierra_send_setup(port); 396 396 } 397 397 398 - static int sierra_tiocmget(struct tty_struct *tty, struct file *file) 398 + static int sierra_tiocmget(struct tty_struct *tty) 399 399 { 400 400 struct usb_serial_port *port = tty->driver_data; 401 401 unsigned int value; ··· 414 414 return value; 415 415 } 416 416 417 - static int sierra_tiocmset(struct tty_struct *tty, struct file *file, 417 + static int sierra_tiocmset(struct tty_struct *tty, 418 418 unsigned int set, unsigned int clear) 419 419 { 420 420 struct usb_serial_port *port = tty->driver_data;
+3 -3
drivers/usb/serial/spcp8x5.c
··· 576 576 return 0; 577 577 } 578 578 579 - static int spcp8x5_ioctl(struct tty_struct *tty, struct file *file, 579 + static int spcp8x5_ioctl(struct tty_struct *tty, 580 580 unsigned int cmd, unsigned long arg) 581 581 { 582 582 struct usb_serial_port *port = tty->driver_data; ··· 595 595 return -ENOIOCTLCMD; 596 596 } 597 597 598 - static int spcp8x5_tiocmset(struct tty_struct *tty, struct file *file, 598 + static int spcp8x5_tiocmset(struct tty_struct *tty, 599 599 unsigned int set, unsigned int clear) 600 600 { 601 601 struct usb_serial_port *port = tty->driver_data; ··· 618 618 return spcp8x5_set_ctrlLine(port->serial->dev, control , priv->type); 619 619 } 620 620 621 - static int spcp8x5_tiocmget(struct tty_struct *tty, struct file *file) 621 + static int spcp8x5_tiocmget(struct tty_struct *tty) 622 622 { 623 623 struct usb_serial_port *port = tty->driver_data; 624 624 struct spcp8x5_private *priv = usb_get_serial_port_data(port);
+3 -3
drivers/usb/serial/ssu100.c
··· 439 439 440 440 441 441 442 - static int ssu100_ioctl(struct tty_struct *tty, struct file *file, 442 + static int ssu100_ioctl(struct tty_struct *tty, 443 443 unsigned int cmd, unsigned long arg) 444 444 { 445 445 struct usb_serial_port *port = tty->driver_data; ··· 484 484 return ssu100_initdevice(serial->dev); 485 485 } 486 486 487 - static int ssu100_tiocmget(struct tty_struct *tty, struct file *file) 487 + static int ssu100_tiocmget(struct tty_struct *tty) 488 488 { 489 489 struct usb_serial_port *port = tty->driver_data; 490 490 struct usb_device *dev = port->serial->dev; ··· 517 517 return r; 518 518 } 519 519 520 - static int ssu100_tiocmset(struct tty_struct *tty, struct file *file, 520 + static int ssu100_tiocmset(struct tty_struct *tty, 521 521 unsigned int set, unsigned int clear) 522 522 { 523 523 struct usb_serial_port *port = tty->driver_data;
+7 -7
drivers/usb/serial/ti_usb_3410_5052.c
··· 106 106 static int ti_chars_in_buffer(struct tty_struct *tty); 107 107 static void ti_throttle(struct tty_struct *tty); 108 108 static void ti_unthrottle(struct tty_struct *tty); 109 - static int ti_ioctl(struct tty_struct *tty, struct file *file, 109 + static int ti_ioctl(struct tty_struct *tty, 110 110 unsigned int cmd, unsigned long arg); 111 111 static int ti_get_icount(struct tty_struct *tty, 112 112 struct serial_icounter_struct *icount); 113 113 static void ti_set_termios(struct tty_struct *tty, 114 114 struct usb_serial_port *port, struct ktermios *old_termios); 115 - static int ti_tiocmget(struct tty_struct *tty, struct file *file); 116 - static int ti_tiocmset(struct tty_struct *tty, struct file *file, 115 + static int ti_tiocmget(struct tty_struct *tty); 116 + static int ti_tiocmset(struct tty_struct *tty, 117 117 unsigned int set, unsigned int clear); 118 118 static void ti_break(struct tty_struct *tty, int break_state); 119 119 static void ti_interrupt_callback(struct urb *urb); ··· 818 818 return 0; 819 819 } 820 820 821 - static int ti_ioctl(struct tty_struct *tty, struct file *file, 821 + static int ti_ioctl(struct tty_struct *tty, 822 822 unsigned int cmd, unsigned long arg) 823 823 { 824 824 struct usb_serial_port *port = tty->driver_data; ··· 1000 1000 } 1001 1001 1002 1002 1003 - static int ti_tiocmget(struct tty_struct *tty, struct file *file) 1003 + static int ti_tiocmget(struct tty_struct *tty) 1004 1004 { 1005 1005 struct usb_serial_port *port = tty->driver_data; 1006 1006 struct ti_port *tport = usb_get_serial_port_data(port); ··· 1033 1033 } 1034 1034 1035 1035 1036 - static int ti_tiocmset(struct tty_struct *tty, struct file *file, 1037 - unsigned int set, unsigned int clear) 1036 + static int ti_tiocmset(struct tty_struct *tty, 1037 + unsigned int set, unsigned int clear) 1038 1038 { 1039 1039 struct usb_serial_port *port = tty->driver_data; 1040 1040 struct ti_port *tport = usb_get_serial_port_data(port);
+6 -6
drivers/usb/serial/usb-serial.c
··· 406 406 port->serial->type->unthrottle(tty); 407 407 } 408 408 409 - static int serial_ioctl(struct tty_struct *tty, struct file *file, 409 + static int serial_ioctl(struct tty_struct *tty, 410 410 unsigned int cmd, unsigned long arg) 411 411 { 412 412 struct usb_serial_port *port = tty->driver_data; ··· 417 417 /* pass on to the driver specific version of this function 418 418 if it is available */ 419 419 if (port->serial->type->ioctl) { 420 - retval = port->serial->type->ioctl(tty, file, cmd, arg); 420 + retval = port->serial->type->ioctl(tty, cmd, arg); 421 421 } else 422 422 retval = -ENOIOCTLCMD; 423 423 return retval; ··· 496 496 .release = single_release, 497 497 }; 498 498 499 - static int serial_tiocmget(struct tty_struct *tty, struct file *file) 499 + static int serial_tiocmget(struct tty_struct *tty) 500 500 { 501 501 struct usb_serial_port *port = tty->driver_data; 502 502 503 503 dbg("%s - port %d", __func__, port->number); 504 504 505 505 if (port->serial->type->tiocmget) 506 - return port->serial->type->tiocmget(tty, file); 506 + return port->serial->type->tiocmget(tty); 507 507 return -EINVAL; 508 508 } 509 509 510 - static int serial_tiocmset(struct tty_struct *tty, struct file *file, 510 + static int serial_tiocmset(struct tty_struct *tty, 511 511 unsigned int set, unsigned int clear) 512 512 { 513 513 struct usb_serial_port *port = tty->driver_data; ··· 515 515 dbg("%s - port %d", __func__, port->number); 516 516 517 517 if (port->serial->type->tiocmset) 518 - return port->serial->type->tiocmset(tty, file, set, clear); 518 + return port->serial->type->tiocmset(tty, set, clear); 519 519 return -EINVAL; 520 520 } 521 521
+3 -3
drivers/usb/serial/usb-wwan.h
··· 15 15 extern void usb_wwan_set_termios(struct tty_struct *tty, 16 16 struct usb_serial_port *port, 17 17 struct ktermios *old); 18 - extern int usb_wwan_tiocmget(struct tty_struct *tty, struct file *file); 19 - extern int usb_wwan_tiocmset(struct tty_struct *tty, struct file *file, 18 + extern int usb_wwan_tiocmget(struct tty_struct *tty); 19 + extern int usb_wwan_tiocmset(struct tty_struct *tty, 20 20 unsigned int set, unsigned int clear); 21 - extern int usb_wwan_ioctl(struct tty_struct *tty, struct file *file, 21 + extern int usb_wwan_ioctl(struct tty_struct *tty, 22 22 unsigned int cmd, unsigned long arg); 23 23 extern int usb_wwan_send_setup(struct usb_serial_port *port); 24 24 extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
+3 -3
drivers/usb/serial/usb_wwan.c
··· 79 79 } 80 80 EXPORT_SYMBOL(usb_wwan_set_termios); 81 81 82 - int usb_wwan_tiocmget(struct tty_struct *tty, struct file *file) 82 + int usb_wwan_tiocmget(struct tty_struct *tty) 83 83 { 84 84 struct usb_serial_port *port = tty->driver_data; 85 85 unsigned int value; ··· 98 98 } 99 99 EXPORT_SYMBOL(usb_wwan_tiocmget); 100 100 101 - int usb_wwan_tiocmset(struct tty_struct *tty, struct file *file, 101 + int usb_wwan_tiocmset(struct tty_struct *tty, 102 102 unsigned int set, unsigned int clear) 103 103 { 104 104 struct usb_serial_port *port = tty->driver_data; ··· 178 178 return retval; 179 179 } 180 180 181 - int usb_wwan_ioctl(struct tty_struct *tty, struct file *file, 181 + int usb_wwan_ioctl(struct tty_struct *tty, 182 182 unsigned int cmd, unsigned long arg) 183 183 { 184 184 struct usb_serial_port *port = tty->driver_data;
+6 -6
drivers/usb/serial/whiteheat.c
··· 152 152 struct usb_serial_port *port, 153 153 const unsigned char *buf, int count); 154 154 static int whiteheat_write_room(struct tty_struct *tty); 155 - static int whiteheat_ioctl(struct tty_struct *tty, struct file *file, 155 + static int whiteheat_ioctl(struct tty_struct *tty, 156 156 unsigned int cmd, unsigned long arg); 157 157 static void whiteheat_set_termios(struct tty_struct *tty, 158 158 struct usb_serial_port *port, struct ktermios *old); 159 - static int whiteheat_tiocmget(struct tty_struct *tty, struct file *file); 160 - static int whiteheat_tiocmset(struct tty_struct *tty, struct file *file, 159 + static int whiteheat_tiocmget(struct tty_struct *tty); 160 + static int whiteheat_tiocmset(struct tty_struct *tty, 161 161 unsigned int set, unsigned int clear); 162 162 static void whiteheat_break_ctl(struct tty_struct *tty, int break_state); 163 163 static int whiteheat_chars_in_buffer(struct tty_struct *tty); ··· 833 833 return (room); 834 834 } 835 835 836 - static int whiteheat_tiocmget(struct tty_struct *tty, struct file *file) 836 + static int whiteheat_tiocmget(struct tty_struct *tty) 837 837 { 838 838 struct usb_serial_port *port = tty->driver_data; 839 839 struct whiteheat_private *info = usb_get_serial_port_data(port); ··· 850 850 return modem_signals; 851 851 } 852 852 853 - static int whiteheat_tiocmset(struct tty_struct *tty, struct file *file, 853 + static int whiteheat_tiocmset(struct tty_struct *tty, 854 854 unsigned int set, unsigned int clear) 855 855 { 856 856 struct usb_serial_port *port = tty->driver_data; ··· 874 874 } 875 875 876 876 877 - static int whiteheat_ioctl(struct tty_struct *tty, struct file *file, 877 + static int whiteheat_ioctl(struct tty_struct *tty, 878 878 unsigned int cmd, unsigned long arg) 879 879 { 880 880 struct usb_serial_port *port = tty->driver_data;
+1
include/asm-generic/ioctls.h
··· 73 73 #define TCSETXF 0x5434 74 74 #define TCSETXW 0x5435 75 75 #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ 76 + #define TIOCVHANGUP 0x5437 76 77 77 78 #define FIONCLEX 0x5450 78 79 #define FIOCLEX 0x5451
+2 -1
include/linux/kbd_kern.h
··· 50 50 #define VC_CAPSLOCK 2 /* capslock mode */ 51 51 #define VC_KANALOCK 3 /* kanalock mode */ 52 52 53 - unsigned char kbdmode:2; /* one 2-bit value */ 53 + unsigned char kbdmode:3; /* one 3-bit value */ 54 54 #define VC_XLATE 0 /* translate keycodes using keymap */ 55 55 #define VC_MEDIUMRAW 1 /* medium raw (keycode) mode */ 56 56 #define VC_RAW 2 /* raw (scancode) mode */ 57 57 #define VC_UNICODE 3 /* Unicode mode */ 58 + #define VC_OFF 4 /* disabled mode */ 58 59 59 60 unsigned char modeflags:5; 60 61 #define VC_APPLIC 0 /* application key mode */
+1
include/linux/kd.h
··· 81 81 #define K_XLATE 0x01 82 82 #define K_MEDIUMRAW 0x02 83 83 #define K_UNICODE 0x03 84 + #define K_OFF 0x04 84 85 #define KDGKBMODE 0x4B44 /* gets current keyboard mode */ 85 86 #define KDSKBMODE 0x4B45 /* sets current keyboard mode */ 86 87
+49
include/linux/platform_data/msm_serial_hs.h
··· 1 + /* 2 + * Copyright (C) 2008 Google, Inc. 3 + * Author: Nick Pelly <npelly@google.com> 4 + * 5 + * This software is licensed under the terms of the GNU General Public 6 + * License version 2, as published by the Free Software Foundation, and 7 + * may be copied, distributed, and modified under those terms. 8 + * 9 + * This program is distributed in the hope that it will be useful, 10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 + * GNU General Public License for more details. 13 + */ 14 + 15 + #ifndef __ASM_ARCH_MSM_SERIAL_HS_H 16 + #define __ASM_ARCH_MSM_SERIAL_HS_H 17 + 18 + #include <linux/serial_core.h> 19 + 20 + /* API to request the uart clock off or on for low power management 21 + * Clients should call request_clock_off() when no uart data is expected, 22 + * and must call request_clock_on() before any further uart data can be 23 + * received. */ 24 + extern void msm_hs_request_clock_off(struct uart_port *uport); 25 + extern void msm_hs_request_clock_on(struct uart_port *uport); 26 + 27 + /** 28 + * struct msm_serial_hs_platform_data 29 + * @rx_wakeup_irq: Rx activity irq 30 + * @rx_to_inject: extra character to be inserted to Rx tty on wakeup 31 + * @inject_rx: 1 = insert rx_to_inject. 0 = do not insert extra character 32 + * @exit_lpm_cb: function called before every Tx transaction 33 + * 34 + * This is an optional structure required for UART Rx GPIO IRQ based 35 + * wakeup from low power state. UART wakeup can be triggered by RX activity 36 + * (using a wakeup GPIO on the UART RX pin). This should only be used if 37 + * there is not a wakeup GPIO on the UART CTS, and the first RX byte is 38 + * known (eg., with the Bluetooth Texas Instruments HCILL protocol), 39 + * since the first RX byte will always be lost. RTS will be asserted even 40 + * while the UART is clocked off in this mode of operation. 41 + */ 42 + struct msm_serial_hs_platform_data { 43 + int rx_wakeup_irq; 44 + unsigned char inject_rx_on_wakeup; 45 + char rx_to_inject; 46 + void (*exit_lpm_cb)(struct uart_port *); 47 + }; 48 + 49 + #endif
+12 -7
include/linux/spi/ifx_modem.h
··· 2 2 #define LINUX_IFX_MODEM_H 3 3 4 4 struct ifx_modem_platform_data { 5 - unsigned short rst_out; /* modem reset out */ 6 - unsigned short pwr_on; /* power on */ 7 - unsigned short rst_pmu; /* reset modem */ 8 - unsigned short tx_pwr; /* modem power threshold */ 9 - unsigned short srdy; /* SRDY */ 10 - unsigned short mrdy; /* MRDY */ 11 - unsigned short is_6160; /* Modem type */ 5 + unsigned short rst_out; /* modem reset out */ 6 + unsigned short pwr_on; /* power on */ 7 + unsigned short rst_pmu; /* reset modem */ 8 + unsigned short tx_pwr; /* modem power threshold */ 9 + unsigned short srdy; /* SRDY */ 10 + unsigned short mrdy; /* MRDY */ 11 + unsigned char modem_type; /* Modem type */ 12 + unsigned long max_hz; /* max SPI frequency */ 13 + unsigned short use_dma:1; /* spi protocol driver supplies 14 + dma-able addrs */ 12 15 }; 16 + #define IFX_MODEM_6160 1 17 + #define IFX_MODEM_6260 2 13 18 14 19 #endif
+3 -2
include/linux/tty.h
··· 448 448 speed_t ibaud, speed_t obaud); 449 449 extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); 450 450 extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); 451 + extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); 451 452 452 453 extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); 453 454 extern void tty_ldisc_deref(struct tty_ldisc *); ··· 585 584 586 585 /* vt.c */ 587 586 588 - extern int vt_ioctl(struct tty_struct *tty, struct file *file, 587 + extern int vt_ioctl(struct tty_struct *tty, 589 588 unsigned int cmd, unsigned long arg); 590 589 591 - extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file, 590 + extern long vt_compat_ioctl(struct tty_struct *tty, 592 591 unsigned int cmd, unsigned long arg); 593 592 594 593 /* tty_mutex.c */
+6 -7
include/linux/tty_driver.h
··· 98 98 * 99 99 * Note: Do not call this function directly, call tty_write_room 100 100 * 101 - * int (*ioctl)(struct tty_struct *tty, struct file * file, 102 - * unsigned int cmd, unsigned long arg); 101 + * int (*ioctl)(struct tty_struct *tty, unsigned int cmd, unsigned long arg); 103 102 * 104 103 * This routine allows the tty driver to implement 105 104 * device-specific ioctls. If the ioctl number passed in cmd ··· 106 107 * 107 108 * Optional 108 109 * 109 - * long (*compat_ioctl)(struct tty_struct *tty, struct file * file, 110 + * long (*compat_ioctl)(struct tty_struct *tty,, 110 111 * unsigned int cmd, unsigned long arg); 111 112 * 112 113 * implement ioctl processing for 32 bit process on 64 bit system ··· 255 256 void (*flush_chars)(struct tty_struct *tty); 256 257 int (*write_room)(struct tty_struct *tty); 257 258 int (*chars_in_buffer)(struct tty_struct *tty); 258 - int (*ioctl)(struct tty_struct *tty, struct file * file, 259 + int (*ioctl)(struct tty_struct *tty, 259 260 unsigned int cmd, unsigned long arg); 260 - long (*compat_ioctl)(struct tty_struct *tty, struct file * file, 261 + long (*compat_ioctl)(struct tty_struct *tty, 261 262 unsigned int cmd, unsigned long arg); 262 263 void (*set_termios)(struct tty_struct *tty, struct ktermios * old); 263 264 void (*throttle)(struct tty_struct * tty); ··· 270 271 void (*set_ldisc)(struct tty_struct *tty); 271 272 void (*wait_until_sent)(struct tty_struct *tty, int timeout); 272 273 void (*send_xchar)(struct tty_struct *tty, char ch); 273 - int (*tiocmget)(struct tty_struct *tty, struct file *file); 274 - int (*tiocmset)(struct tty_struct *tty, struct file *file, 274 + int (*tiocmget)(struct tty_struct *tty); 275 + int (*tiocmset)(struct tty_struct *tty, 275 276 unsigned int set, unsigned int clear); 276 277 int (*resize)(struct tty_struct *tty, struct winsize *ws); 277 278 int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
+3 -3
include/linux/usb/serial.h
··· 261 261 const unsigned char *buf, int count); 262 262 /* Called only by the tty layer */ 263 263 int (*write_room)(struct tty_struct *tty); 264 - int (*ioctl)(struct tty_struct *tty, struct file *file, 264 + int (*ioctl)(struct tty_struct *tty, 265 265 unsigned int cmd, unsigned long arg); 266 266 void (*set_termios)(struct tty_struct *tty, 267 267 struct usb_serial_port *port, struct ktermios *old); ··· 269 269 int (*chars_in_buffer)(struct tty_struct *tty); 270 270 void (*throttle)(struct tty_struct *tty); 271 271 void (*unthrottle)(struct tty_struct *tty); 272 - int (*tiocmget)(struct tty_struct *tty, struct file *file); 273 - int (*tiocmset)(struct tty_struct *tty, struct file *file, 272 + int (*tiocmget)(struct tty_struct *tty); 273 + int (*tiocmset)(struct tty_struct *tty, 274 274 unsigned int set, unsigned int clear); 275 275 int (*get_icount)(struct tty_struct *tty, 276 276 struct serial_icounter_struct *icount);
-8
include/linux/vt_kern.h
··· 142 142 return false; 143 143 } 144 144 145 - /* 146 - * vc_screen.c shares this temporary buffer with the console write code so that 147 - * we can easily avoid touching user space while holding the console spinlock. 148 - */ 149 - 150 - #define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) 151 - extern char con_buf[CON_BUF_SIZE]; 152 - extern struct mutex con_buf_mtx; 153 145 extern char vt_dont_switch; 154 146 extern int default_utf8; 155 147 extern int global_cursor_default;
+3 -3
include/net/irda/ircomm_tty.h
··· 120 120 void ircomm_tty_start(struct tty_struct *tty); 121 121 void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self); 122 122 123 - extern int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file); 124 - extern int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file, 123 + extern int ircomm_tty_tiocmget(struct tty_struct *tty); 124 + extern int ircomm_tty_tiocmset(struct tty_struct *tty, 125 125 unsigned int set, unsigned int clear); 126 - extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, 126 + extern int ircomm_tty_ioctl(struct tty_struct *tty, 127 127 unsigned int cmd, unsigned long arg); 128 128 extern void ircomm_tty_set_termios(struct tty_struct *tty, 129 129 struct ktermios *old_termios);
+3 -3
net/bluetooth/rfcomm/tty.c
··· 832 832 return room; 833 833 } 834 834 835 - static int rfcomm_tty_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, unsigned long arg) 835 + static int rfcomm_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) 836 836 { 837 837 BT_DBG("tty %p cmd 0x%02x", tty, cmd); 838 838 ··· 1091 1091 } 1092 1092 } 1093 1093 1094 - static int rfcomm_tty_tiocmget(struct tty_struct *tty, struct file *filp) 1094 + static int rfcomm_tty_tiocmget(struct tty_struct *tty) 1095 1095 { 1096 1096 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; 1097 1097 ··· 1100 1100 return dev->modem_status; 1101 1101 } 1102 1102 1103 - static int rfcomm_tty_tiocmset(struct tty_struct *tty, struct file *filp, unsigned int set, unsigned int clear) 1103 + static int rfcomm_tty_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) 1104 1104 { 1105 1105 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; 1106 1106 struct rfcomm_dlc *dlc = dev->dlc;
+6 -6
net/irda/ircomm/ircomm_tty_ioctl.c
··· 189 189 } 190 190 191 191 /* 192 - * Function ircomm_tty_tiocmget (tty, file) 192 + * Function ircomm_tty_tiocmget (tty) 193 193 * 194 194 * 195 195 * 196 196 */ 197 - int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file) 197 + int ircomm_tty_tiocmget(struct tty_struct *tty) 198 198 { 199 199 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; 200 200 unsigned int result; ··· 214 214 } 215 215 216 216 /* 217 - * Function ircomm_tty_tiocmset (tty, file, set, clear) 217 + * Function ircomm_tty_tiocmset (tty, set, clear) 218 218 * 219 219 * 220 220 * 221 221 */ 222 - int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file, 222 + int ircomm_tty_tiocmset(struct tty_struct *tty, 223 223 unsigned int set, unsigned int clear) 224 224 { 225 225 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; ··· 365 365 } 366 366 367 367 /* 368 - * Function ircomm_tty_ioctl (tty, file, cmd, arg) 368 + * Function ircomm_tty_ioctl (tty, cmd, arg) 369 369 * 370 370 * 371 371 * 372 372 */ 373 - int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, 373 + int ircomm_tty_ioctl(struct tty_struct *tty, 374 374 unsigned int cmd, unsigned long arg) 375 375 { 376 376 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;