Merge tag 'tty-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull TTY/serial patches from Greg KH:
 "tty and serial merge for 3.4-rc1

  Here's the big serial and tty merge for the 3.4-rc1 tree.

  There's loads of fixes and reworks in here from Jiri for the tty
  layer, and a number of patches from Alan to help try to wrestle the vt
  layer into a sane model.

  Other than that, lots of driver updates and fixes, and other minor
  stuff, all detailed in the shortlog."

* tag 'tty-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (132 commits)
  serial: pxa: add clk_prepare/clk_unprepare calls
  TTY: Wrong unicode value copied in con_set_unimap()
  serial: PL011: clear pending interrupts
  serial: bfin-uart: Don't access tty circular buffer in TX DMA interrupt after it is reset.
  vt: NULL dereference in vt_do_kdsk_ioctl()
  tty: serial: vt8500: fix annotations for probe/remove
  serial: remove back and forth conversions in serial_out_sync
  serial: use serial_port_in/out vs serial_in/out in 8250
  serial: introduce generic port in/out helpers
  serial: reduce number of indirections in 8250 code
  serial: delete useless void casts in 8250.c
  serial: make 8250's serial_in shareable to other drivers.
  serial: delete last unused traces of pausing I/O in 8250
  pch_uart: Add module parameter descriptions
  pch_uart: Use existing default_baud in setup_console
  pch_uart: Add user_uartclk parameter
  pch_uart: Add Fish River Island II uart clock quirks
  pch_uart: Use uartclk instead of base_baud
  mpc5200b/uart: select more tolerant uart prescaler on low baudrates
  tty: moxa: fix bit test in moxa_start()
  ...
This commit is contained in:
Linus Torvalds
2012-03-20 11:24:39 -07:00
117 changed files with 3206 additions and 3138 deletions
@@ -0,0 +1,14 @@
* Energymicro efm32 UART
Required properties:
- compatible : Should be "efm32,uart"
- reg : Address and length of the register set
- interrupts : Should contain uart interrupt
Example:
uart@0x4000c400 {
compatible = "efm32,uart";
reg = <0x4000c400 0x400>;
interrupts = <15>;
};
+1 -1
View File
@@ -6212,8 +6212,8 @@ L: sparclinux@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
S: Maintained S: Maintained
F: include/linux/sunserialcore.h
F: drivers/tty/serial/suncore.c F: drivers/tty/serial/suncore.c
F: drivers/tty/serial/suncore.h
F: drivers/tty/serial/sunhv.c F: drivers/tty/serial/sunhv.c
F: drivers/tty/serial/sunsab.c F: drivers/tty/serial/sunsab.c
F: drivers/tty/serial/sunsab.h F: drivers/tty/serial/sunsab.h
+23 -55
View File
@@ -30,10 +30,9 @@ static int srm_is_registered_console = 0;
#define MAX_SRM_CONSOLE_DEVICES 1 /* only support 1 console device */ #define MAX_SRM_CONSOLE_DEVICES 1 /* only support 1 console device */
struct srmcons_private { struct srmcons_private {
struct tty_struct *tty; struct tty_port port;
struct timer_list timer; struct timer_list timer;
spinlock_t lock; } srmcons_singleton;
};
typedef union _srmcons_result { typedef union _srmcons_result {
struct { struct {
@@ -68,22 +67,21 @@ static void
srmcons_receive_chars(unsigned long data) srmcons_receive_chars(unsigned long data)
{ {
struct srmcons_private *srmconsp = (struct srmcons_private *)data; struct srmcons_private *srmconsp = (struct srmcons_private *)data;
struct tty_port *port = &srmconsp->port;
unsigned long flags; unsigned long flags;
int incr = 10; int incr = 10;
local_irq_save(flags); local_irq_save(flags);
if (spin_trylock(&srmcons_callback_lock)) { if (spin_trylock(&srmcons_callback_lock)) {
if (!srmcons_do_receive_chars(srmconsp->tty)) if (!srmcons_do_receive_chars(port->tty))
incr = 100; incr = 100;
spin_unlock(&srmcons_callback_lock); spin_unlock(&srmcons_callback_lock);
} }
spin_lock(&srmconsp->lock); spin_lock(&port->lock);
if (srmconsp->tty) { if (port->tty)
srmconsp->timer.expires = jiffies + incr; mod_timer(&srmconsp->timer, jiffies + incr);
add_timer(&srmconsp->timer); spin_unlock(&port->lock);
}
spin_unlock(&srmconsp->lock);
local_irq_restore(flags); local_irq_restore(flags);
} }
@@ -155,57 +153,23 @@ srmcons_chars_in_buffer(struct tty_struct *tty)
return 0; return 0;
} }
static int
srmcons_get_private_struct(struct srmcons_private **ps)
{
static struct srmcons_private *srmconsp = NULL;
static DEFINE_SPINLOCK(srmconsp_lock);
unsigned long flags;
int retval = 0;
if (srmconsp == NULL) {
srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL);
spin_lock_irqsave(&srmconsp_lock, flags);
if (srmconsp == NULL)
retval = -ENOMEM;
else {
srmconsp->tty = NULL;
spin_lock_init(&srmconsp->lock);
init_timer(&srmconsp->timer);
}
spin_unlock_irqrestore(&srmconsp_lock, flags);
}
*ps = srmconsp;
return retval;
}
static int static int
srmcons_open(struct tty_struct *tty, struct file *filp) srmcons_open(struct tty_struct *tty, struct file *filp)
{ {
struct srmcons_private *srmconsp; struct srmcons_private *srmconsp = &srmcons_singleton;
struct tty_port *port = &srmconsp->port;
unsigned long flags; unsigned long flags;
int retval;
retval = srmcons_get_private_struct(&srmconsp); spin_lock_irqsave(&port->lock, flags);
if (retval)
return retval;
spin_lock_irqsave(&srmconsp->lock, flags); if (!port->tty) {
if (!srmconsp->tty) {
tty->driver_data = srmconsp; tty->driver_data = srmconsp;
tty->port = port;
srmconsp->tty = tty; port->tty = tty; /* XXX proper refcounting */
srmconsp->timer.function = srmcons_receive_chars; mod_timer(&srmconsp->timer, jiffies + 10);
srmconsp->timer.data = (unsigned long)srmconsp;
srmconsp->timer.expires = jiffies + 10;
add_timer(&srmconsp->timer);
} }
spin_unlock_irqrestore(&srmconsp->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
return 0; return 0;
} }
@@ -214,16 +178,17 @@ static void
srmcons_close(struct tty_struct *tty, struct file *filp) srmcons_close(struct tty_struct *tty, struct file *filp)
{ {
struct srmcons_private *srmconsp = tty->driver_data; struct srmcons_private *srmconsp = tty->driver_data;
struct tty_port *port = &srmconsp->port;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&srmconsp->lock, flags); spin_lock_irqsave(&port->lock, flags);
if (tty->count == 1) { if (tty->count == 1) {
srmconsp->tty = NULL; port->tty = NULL;
del_timer(&srmconsp->timer); del_timer(&srmconsp->timer);
} }
spin_unlock_irqrestore(&srmconsp->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
} }
@@ -240,6 +205,9 @@ static const struct tty_operations srmcons_ops = {
static int __init static int __init
srmcons_init(void) srmcons_init(void)
{ {
tty_port_init(&srmcons_singleton.port);
setup_timer(&srmcons_singleton.timer, srmcons_receive_chars,
(unsigned long)&srmcons_singleton);
if (srm_is_registered_console) { if (srm_is_registered_console) {
struct tty_driver *driver; struct tty_driver *driver;
int err; int err;
+4 -13
View File
@@ -160,28 +160,19 @@ sal_emulator (long index, unsigned long in1, unsigned long in2,
*/ */
status = 0; status = 0;
if (index == SAL_FREQ_BASE) { if (index == SAL_FREQ_BASE) {
switch (in1) { if (in1 == SAL_FREQ_BASE_PLATFORM)
case SAL_FREQ_BASE_PLATFORM:
r9 = 200000000; r9 = 200000000;
break; else if (in1 == SAL_FREQ_BASE_INTERVAL_TIMER) {
case SAL_FREQ_BASE_INTERVAL_TIMER:
/* /*
* Is this supposed to be the cr.itc frequency * Is this supposed to be the cr.itc frequency
* or something platform specific? The SAL * or something platform specific? The SAL
* doc ain't exactly clear on this... * doc ain't exactly clear on this...
*/ */
r9 = 700000000; r9 = 700000000;
break; } else if (in1 == SAL_FREQ_BASE_REALTIME_CLOCK)
case SAL_FREQ_BASE_REALTIME_CLOCK:
r9 = 1; r9 = 1;
break; else
default:
status = -1; status = -1;
break;
}
} else if (index == SAL_SET_VECTORS) { } else if (index == SAL_SET_VECTORS) {
; ;
} else if (index == SAL_GET_STATE_INFO) { } else if (index == SAL_GET_STATE_INFO) {
+30 -6
View File
@@ -10,6 +10,8 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/irq.h> #include <linux/irq.h>
#include "hpsim_ssc.h"
static unsigned int static unsigned int
hpsim_irq_startup(struct irq_data *data) hpsim_irq_startup(struct irq_data *data)
{ {
@@ -37,15 +39,37 @@ static struct irq_chip irq_type_hp_sim = {
.irq_set_affinity = hpsim_set_affinity_noop, .irq_set_affinity = hpsim_set_affinity_noop,
}; };
static void hpsim_irq_set_chip(int irq)
{
struct irq_chip *chip = irq_get_chip(irq);
if (chip == &no_irq_chip)
irq_set_chip(irq, &irq_type_hp_sim);
}
static void hpsim_connect_irq(int intr, int irq)
{
ia64_ssc(intr, irq, 0, 0, SSC_CONNECT_INTERRUPT);
}
int hpsim_get_irq(int intr)
{
int irq = assign_irq_vector(AUTO_ASSIGN);
if (irq >= 0) {
hpsim_irq_set_chip(irq);
irq_set_handler(irq, handle_simple_irq);
hpsim_connect_irq(intr, irq);
}
return irq;
}
void __init void __init
hpsim_irq_init (void) hpsim_irq_init (void)
{ {
int i; int i;
for_each_active_irq(i) { for_each_active_irq(i)
struct irq_chip *chip = irq_get_chip(i); hpsim_irq_set_chip(i);
if (chip == &no_irq_chip)
irq_set_chip(i, &irq_type_hp_sim);
}
} }
-6
View File
@@ -25,12 +25,6 @@
#include "hpsim_ssc.h" #include "hpsim_ssc.h"
void
ia64_ssc_connect_irq (long intr, long irq)
{
ia64_ssc(intr, irq, 0, 0, SSC_CONNECT_INTERRUPT);
}
void void
ia64_ctl_trace (long on) ia64_ctl_trace (long on)
{ {
+3 -16
View File
@@ -128,17 +128,6 @@ netdev_probe(char *name, unsigned char *ether)
} }
static inline int
netdev_connect(int irq)
{
/* XXX Fix me
* this does not support multiple cards
* also no return value
*/
ia64_ssc_connect_irq(NETWORK_INTR, irq);
return 0;
}
static inline int static inline int
netdev_attach(int fd, int irq, unsigned int ipaddr) netdev_attach(int fd, int irq, unsigned int ipaddr)
{ {
@@ -226,15 +215,13 @@ simeth_probe1(void)
return err; return err;
} }
if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
panic("%s: out of interrupt vectors!\n", __func__);
dev->irq = rc;
/* /*
* attach the interrupt in the simulator, this does enable interrupts * attach the interrupt in the simulator, this does enable interrupts
* until a netdev_attach() is called * until a netdev_attach() is called
*/ */
netdev_connect(dev->irq); if ((rc = hpsim_get_irq(NETWORK_INTR)) < 0)
panic("%s: out of interrupt vectors!\n", __func__);
dev->irq = rc;
printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr", printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr",
dev->name, simeth_device, local->simfd); dev->name, simeth_device, local->simfd);
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -10,7 +10,7 @@ int simcons_register(void);
struct tty_driver; struct tty_driver;
extern struct tty_driver *hp_simserial_driver; extern struct tty_driver *hp_simserial_driver;
void ia64_ssc_connect_irq(long intr, long irq); extern int hpsim_get_irq(int intr);
void ia64_ctl_trace(long on); void ia64_ctl_trace(long on);
#endif #endif
-1
View File
@@ -127,7 +127,6 @@ static int __init nfcon_init(void)
if (!nfcon_tty_driver) if (!nfcon_tty_driver)
return -ENOMEM; return -ENOMEM;
nfcon_tty_driver->owner = THIS_MODULE;
nfcon_tty_driver->driver_name = "nfcon"; nfcon_tty_driver->driver_name = "nfcon";
nfcon_tty_driver->name = "nfcon"; nfcon_tty_driver->name = "nfcon";
nfcon_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM; nfcon_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
+28 -29
View File
@@ -90,11 +90,13 @@ static int pdc_console_setup(struct console *co, char *options)
#define PDC_CONS_POLL_DELAY (30 * HZ / 1000) #define PDC_CONS_POLL_DELAY (30 * HZ / 1000)
static struct timer_list pdc_console_timer; static void pdc_console_poll(unsigned long unused);
static DEFINE_TIMER(pdc_console_timer, pdc_console_poll, 0, 0);
static struct tty_port tty_port;
static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp) static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
{ {
tty_port_tty_set(&tty_port, tty);
mod_timer(&pdc_console_timer, jiffies + PDC_CONS_POLL_DELAY); mod_timer(&pdc_console_timer, jiffies + PDC_CONS_POLL_DELAY);
return 0; return 0;
@@ -102,8 +104,10 @@ static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
static void pdc_console_tty_close(struct tty_struct *tty, struct file *filp) static void pdc_console_tty_close(struct tty_struct *tty, struct file *filp)
{ {
if (!tty->count) if (!tty->count) {
del_timer(&pdc_console_timer); del_timer_sync(&pdc_console_timer);
tty_port_tty_set(&tty_port, NULL);
}
} }
static int pdc_console_tty_write(struct tty_struct *tty, const unsigned char *buf, int count) static int pdc_console_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
@@ -122,8 +126,6 @@ static int pdc_console_tty_chars_in_buffer(struct tty_struct *tty)
return 0; /* no buffer */ return 0; /* no buffer */
} }
static struct tty_driver *pdc_console_tty_driver;
static const struct tty_operations pdc_console_tty_ops = { static const struct tty_operations pdc_console_tty_ops = {
.open = pdc_console_tty_open, .open = pdc_console_tty_open,
.close = pdc_console_tty_close, .close = pdc_console_tty_close,
@@ -134,10 +136,8 @@ static const struct tty_operations pdc_console_tty_ops = {
static void pdc_console_poll(unsigned long unused) static void pdc_console_poll(unsigned long unused)
{ {
int data, count = 0; int data, count = 0;
struct tty_struct *tty = tty_port_tty_get(&tty_port);
struct tty_struct *tty = pdc_console_tty_driver->ttys[0];
if (!tty) if (!tty)
return; return;
@@ -153,15 +153,17 @@ static void pdc_console_poll(unsigned long unused)
if (count) if (count)
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
if (tty->count && (pdc_cons.flags & CON_ENABLED)) tty_kref_put(tty);
if (pdc_cons.flags & CON_ENABLED)
mod_timer(&pdc_console_timer, jiffies + PDC_CONS_POLL_DELAY); mod_timer(&pdc_console_timer, jiffies + PDC_CONS_POLL_DELAY);
} }
static struct tty_driver *pdc_console_tty_driver;
static int __init pdc_console_tty_driver_init(void) static int __init pdc_console_tty_driver_init(void)
{ {
int err; int err;
struct tty_driver *drv;
/* Check if the console driver is still registered. /* Check if the console driver is still registered.
* It is unregistered if the pdc console was not selected as the * It is unregistered if the pdc console was not selected as the
@@ -183,32 +185,29 @@ static int __init pdc_console_tty_driver_init(void)
printk(KERN_INFO "The PDC console driver is still registered, removing CON_BOOT flag\n"); printk(KERN_INFO "The PDC console driver is still registered, removing CON_BOOT flag\n");
pdc_cons.flags &= ~CON_BOOT; pdc_cons.flags &= ~CON_BOOT;
drv = alloc_tty_driver(1); tty_port_init(&tty_port);
if (!drv) pdc_console_tty_driver = alloc_tty_driver(1);
if (!pdc_console_tty_driver)
return -ENOMEM; return -ENOMEM;
drv->driver_name = "pdc_cons"; pdc_console_tty_driver->driver_name = "pdc_cons";
drv->name = "ttyB"; pdc_console_tty_driver->name = "ttyB";
drv->major = MUX_MAJOR; pdc_console_tty_driver->major = MUX_MAJOR;
drv->minor_start = 0; pdc_console_tty_driver->minor_start = 0;
drv->type = TTY_DRIVER_TYPE_SYSTEM; pdc_console_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
drv->init_termios = tty_std_termios; pdc_console_tty_driver->init_termios = tty_std_termios;
drv->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS; pdc_console_tty_driver->flags = TTY_DRIVER_REAL_RAW |
tty_set_operations(drv, &pdc_console_tty_ops); TTY_DRIVER_RESET_TERMIOS;
tty_set_operations(pdc_console_tty_driver, &pdc_console_tty_ops);
err = tty_register_driver(drv); err = tty_register_driver(pdc_console_tty_driver);
if (err) { if (err) {
printk(KERN_ERR "Unable to register the PDC console TTY driver\n"); printk(KERN_ERR "Unable to register the PDC console TTY driver\n");
return err; return err;
} }
pdc_console_tty_driver = drv;
/* No need to initialize the pdc_console_timer if tty isn't allocated */
init_timer(&pdc_console_timer);
pdc_console_timer.function = pdc_console_poll;
return 0; return 0;
} }
+8 -14
View File
@@ -19,7 +19,6 @@
#include <linux/param.h> #include <linux/param.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serialP.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/irq.h> #include <asm/irq.h>
@@ -37,6 +36,7 @@
#define SERIAL_TIMER_VALUE (20 * HZ) #define SERIAL_TIMER_VALUE (20 * HZ)
static struct tty_driver *serial_driver; static struct tty_driver *serial_driver;
static struct tty_port serial_port;
static struct timer_list serial_timer; static struct timer_list serial_timer;
static DEFINE_SPINLOCK(timer_lock); static DEFINE_SPINLOCK(timer_lock);
@@ -68,17 +68,10 @@ static void rs_poll(unsigned long);
static int rs_open(struct tty_struct *tty, struct file * filp) static int rs_open(struct tty_struct *tty, struct file * filp)
{ {
int line = tty->index; tty->port = &serial_port;
if ((line < 0) || (line >= SERIAL_MAX_NUM_LINES))
return -ENODEV;
spin_lock(&timer_lock); spin_lock(&timer_lock);
if (tty->count == 1) { if (tty->count == 1) {
init_timer(&serial_timer); setup_timer(&serial_timer, rs_poll, (unsigned long)tty);
serial_timer.data = (unsigned long) tty;
serial_timer.function = rs_poll;
mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE); mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE);
} }
spin_unlock(&timer_lock); spin_unlock(&timer_lock);
@@ -99,10 +92,10 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
*/ */
static void rs_close(struct tty_struct *tty, struct file * filp) static void rs_close(struct tty_struct *tty, struct file * filp)
{ {
spin_lock(&timer_lock); spin_lock_bh(&timer_lock);
if (tty->count == 1) if (tty->count == 1)
del_timer_sync(&serial_timer); del_timer_sync(&serial_timer);
spin_unlock(&timer_lock); spin_unlock_bh(&timer_lock);
} }
@@ -210,13 +203,14 @@ static const struct tty_operations serial_ops = {
int __init rs_init(void) int __init rs_init(void)
{ {
serial_driver = alloc_tty_driver(1); tty_port_init(&serial_port);
serial_driver = alloc_tty_driver(SERIAL_MAX_NUM_LINES);
printk ("%s %s\n", serial_name, serial_version); printk ("%s %s\n", serial_name, serial_version);
/* Initialize the tty_driver structure */ /* Initialize the tty_driver structure */
serial_driver->owner = THIS_MODULE;
serial_driver->driver_name = "iss_serial"; serial_driver->driver_name = "iss_serial";
serial_driver->name = "ttyS"; serial_driver->name = "ttyS";
serial_driver->major = TTY_MAJOR; serial_driver->major = TTY_MAJOR;
@@ -244,16 +244,13 @@ static int keyboard_notifier_call(struct notifier_block *blk,
switch (val) { switch (val) {
case KVAL(K_CAPS): case KVAL(K_CAPS):
on_off = vc_kbd_led(kbd_table + fg_console, on_off = vt_get_leds(fg_console, VC_CAPSLOCK);
VC_CAPSLOCK);
break; break;
case KVAL(K_NUM): case KVAL(K_NUM):
on_off = vc_kbd_led(kbd_table + fg_console, on_off = vt_get_leds(fg_console, VC_NUMLOCK);
VC_NUMLOCK);
break; break;
case KVAL(K_HOLD): case KVAL(K_HOLD):
on_off = vc_kbd_led(kbd_table + fg_console, on_off = vt_get_leds(fg_console, VC_SCROLLOCK);
VC_SCROLLOCK);
break; break;
} }
if (on_off == 1) if (on_off == 1)
-15
View File
@@ -66,21 +66,6 @@ config TTY_PRINTK
If unsure, say N. If unsure, say N.
config BRIQ_PANEL
tristate 'Total Impact briQ front panel driver'
depends on PPC_CHRP
---help---
The briQ is a small footprint CHRP computer with a frontpanel VFD, a
tristate led and two switches. It is the size of a CDROM drive.
If you have such one and want anything showing on the VFD then you
must answer Y here.
To compile this driver as a module, choose M here: the
module will be called briq_panel.
It's safe to say N here.
config BFIN_OTP config BFIN_OTP
tristate "Blackfin On-Chip OTP Memory Support" tristate "Blackfin On-Chip OTP Memory Support"
depends on BLACKFIN && (BF51x || BF52x || BF54x) depends on BLACKFIN && (BF51x || BF52x || BF54x)
-1
View File
@@ -16,7 +16,6 @@ obj-$(CONFIG_UV_MMTIMER) += uv_mmtimer.o
obj-$(CONFIG_VIOTAPE) += viotape.o obj-$(CONFIG_VIOTAPE) += viotape.o
obj-$(CONFIG_IBM_BSR) += bsr.o obj-$(CONFIG_IBM_BSR) += bsr.o
obj-$(CONFIG_SGI_MBCS) += mbcs.o obj-$(CONFIG_SGI_MBCS) += mbcs.o
obj-$(CONFIG_BRIQ_PANEL) += briq_panel.o
obj-$(CONFIG_BFIN_OTP) += bfin-otp.o obj-$(CONFIG_BFIN_OTP) += bfin-otp.o
obj-$(CONFIG_PRINTER) += lp.o obj-$(CONFIG_PRINTER) += lp.o
-266
View File
@@ -1,266 +0,0 @@
/*
* Drivers for the Total Impact PPC based computer "BRIQ"
* by Dr. Karsten Jeppesen
*
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/tty.h>
#include <linux/timer.h>
#include <linux/kernel.h>
#include <linux/wait.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/miscdevice.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/prom.h>
#define BRIQ_PANEL_MINOR 156
#define BRIQ_PANEL_VFD_IOPORT 0x0390
#define BRIQ_PANEL_LED_IOPORT 0x0398
#define BRIQ_PANEL_VER "1.1 (04/20/2002)"
#define BRIQ_PANEL_MSG0 "Loading Linux"
static int vfd_is_open;
static unsigned char vfd[40];
static int vfd_cursor;
static unsigned char ledpb, led;
static void update_vfd(void)
{
int i;
/* cursor home */
outb(0x02, BRIQ_PANEL_VFD_IOPORT);
for (i=0; i<20; i++)
outb(vfd[i], BRIQ_PANEL_VFD_IOPORT + 1);
/* cursor to next line */
outb(0xc0, BRIQ_PANEL_VFD_IOPORT);
for (i=20; i<40; i++)
outb(vfd[i], BRIQ_PANEL_VFD_IOPORT + 1);
}
static void set_led(char state)
{
if (state == 'R')
led = 0x01;
else if (state == 'G')
led = 0x02;
else if (state == 'Y')
led = 0x03;
else if (state == 'X')
led = 0x00;
outb(led, BRIQ_PANEL_LED_IOPORT);
}
static int briq_panel_open(struct inode *ino, struct file *filep)
{
tty_lock();
/* enforce single access, vfd_is_open is protected by BKL */
if (vfd_is_open) {
tty_unlock();
return -EBUSY;
}
vfd_is_open = 1;
tty_unlock();
return 0;
}
static int briq_panel_release(struct inode *ino, struct file *filep)
{
if (!vfd_is_open)
return -ENODEV;
vfd_is_open = 0;
return 0;
}
static ssize_t briq_panel_read(struct file *file, char __user *buf, size_t count,
loff_t *ppos)
{
unsigned short c;
unsigned char cp;
if (!vfd_is_open)
return -ENODEV;
c = (inb(BRIQ_PANEL_LED_IOPORT) & 0x000c) | (ledpb & 0x0003);
set_led(' ');
/* upper button released */
if ((!(ledpb & 0x0004)) && (c & 0x0004)) {
cp = ' ';
ledpb = c;
if (copy_to_user(buf, &cp, 1))
return -EFAULT;
return 1;
}
/* lower button released */
else if ((!(ledpb & 0x0008)) && (c & 0x0008)) {
cp = '\r';
ledpb = c;
if (copy_to_user(buf, &cp, 1))
return -EFAULT;
return 1;
} else {
ledpb = c;
return 0;
}
}
static void scroll_vfd( void )
{
int i;
for (i=0; i<20; i++) {
vfd[i] = vfd[i+20];
vfd[i+20] = ' ';
}
vfd_cursor = 20;
}
static ssize_t briq_panel_write(struct file *file, const char __user *buf, size_t len,
loff_t *ppos)
{
size_t indx = len;
int i, esc = 0;
if (!vfd_is_open)
return -EBUSY;
for (;;) {
char c;
if (!indx)
break;
if (get_user(c, buf))
return -EFAULT;
if (esc) {
set_led(c);
esc = 0;
} else if (c == 27) {
esc = 1;
} else if (c == 12) {
/* do a form feed */
for (i=0; i<40; i++)
vfd[i] = ' ';
vfd_cursor = 0;
} else if (c == 10) {
if (vfd_cursor < 20)
vfd_cursor = 20;
else if (vfd_cursor < 40)
vfd_cursor = 40;
else if (vfd_cursor < 60)
vfd_cursor = 60;
if (vfd_cursor > 59)
scroll_vfd();
} else {
/* just a character */
if (vfd_cursor > 39)
scroll_vfd();
vfd[vfd_cursor++] = c;
}
indx--;
buf++;
}
update_vfd();
return len;
}
static const struct file_operations briq_panel_fops = {
.owner = THIS_MODULE,
.read = briq_panel_read,
.write = briq_panel_write,
.open = briq_panel_open,
.release = briq_panel_release,
.llseek = noop_llseek,
};
static struct miscdevice briq_panel_miscdev = {
BRIQ_PANEL_MINOR,
"briq_panel",
&briq_panel_fops
};
static int __init briq_panel_init(void)
{
struct device_node *root = of_find_node_by_path("/");
const char *machine;
int i;
machine = of_get_property(root, "model", NULL);
if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0) {
of_node_put(root);
return -ENODEV;
}
of_node_put(root);
printk(KERN_INFO
"briq_panel: v%s Dr. Karsten Jeppesen (kj@totalimpact.com)\n",
BRIQ_PANEL_VER);
if (!request_region(BRIQ_PANEL_VFD_IOPORT, 4, "BRIQ Front Panel"))
return -EBUSY;
if (!request_region(BRIQ_PANEL_LED_IOPORT, 2, "BRIQ Front Panel")) {
release_region(BRIQ_PANEL_VFD_IOPORT, 4);
return -EBUSY;
}
ledpb = inb(BRIQ_PANEL_LED_IOPORT) & 0x000c;
if (misc_register(&briq_panel_miscdev) < 0) {
release_region(BRIQ_PANEL_VFD_IOPORT, 4);
release_region(BRIQ_PANEL_LED_IOPORT, 2);
return -EBUSY;
}
outb(0x38, BRIQ_PANEL_VFD_IOPORT); /* Function set */
outb(0x01, BRIQ_PANEL_VFD_IOPORT); /* Clear display */
outb(0x0c, BRIQ_PANEL_VFD_IOPORT); /* Display on */
outb(0x06, BRIQ_PANEL_VFD_IOPORT); /* Entry normal */
for (i=0; i<40; i++)
vfd[i]=' ';
#ifndef MODULE
vfd[0] = 'L';
vfd[1] = 'o';
vfd[2] = 'a';
vfd[3] = 'd';
vfd[4] = 'i';
vfd[5] = 'n';
vfd[6] = 'g';
vfd[7] = ' ';
vfd[8] = '.';
vfd[9] = '.';
vfd[10] = '.';
#endif /* !MODULE */
update_vfd();
return 0;
}
static void __exit briq_panel_exit(void)
{
misc_deregister(&briq_panel_miscdev);
release_region(BRIQ_PANEL_VFD_IOPORT, 4);
release_region(BRIQ_PANEL_LED_IOPORT, 2);
}
module_init(briq_panel_init);
module_exit(briq_panel_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Karsten Jeppesen <karsten@jeppesens.com>");
MODULE_DESCRIPTION("Driver for the Total Impact briQ front panel");
+1 -2
View File
@@ -2484,7 +2484,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
/* verify range of specified line number */ /* verify range of specified line number */
line = tty->index; line = tty->index;
if ((line < 0) || (line >= mgslpc_device_count)) { if (line >= mgslpc_device_count) {
printk("%s(%d):mgslpc_open with invalid line #%d.\n", printk("%s(%d):mgslpc_open with invalid line #%d.\n",
__FILE__,__LINE__,line); __FILE__,__LINE__,line);
return -ENODEV; return -ENODEV;
@@ -2836,7 +2836,6 @@ static int __init synclink_cs_init(void)
/* Initialize the tty_driver structure */ /* Initialize the tty_driver structure */
serial_driver->owner = THIS_MODULE;
serial_driver->driver_name = "synclink_cs"; serial_driver->driver_name = "synclink_cs";
serial_driver->name = "ttySLP"; serial_driver->name = "ttySLP";
serial_driver->major = ttymajor; serial_driver->major = ttymajor;
-2
View File
@@ -184,12 +184,10 @@ static int __init ttyprintk_init(void)
if (!ttyprintk_driver) if (!ttyprintk_driver)
return ret; return ret;
ttyprintk_driver->owner = THIS_MODULE;
ttyprintk_driver->driver_name = "ttyprintk"; ttyprintk_driver->driver_name = "ttyprintk";
ttyprintk_driver->name = "ttyprintk"; ttyprintk_driver->name = "ttyprintk";
ttyprintk_driver->major = TTYAUX_MAJOR; ttyprintk_driver->major = TTYAUX_MAJOR;
ttyprintk_driver->minor_start = 3; ttyprintk_driver->minor_start = 3;
ttyprintk_driver->num = 1;
ttyprintk_driver->type = TTY_DRIVER_TYPE_CONSOLE; ttyprintk_driver->type = TTY_DRIVER_TYPE_CONSOLE;
ttyprintk_driver->init_termios = tty_std_termios; ttyprintk_driver->init_termios = tty_std_termios;
ttyprintk_driver->init_termios.c_oflag = OPOST | OCRNL | ONOCR | ONLRET; ttyprintk_driver->init_termios.c_oflag = OPOST | OCRNL | ONOCR | ONLRET;
+4 -9
View File
@@ -1013,16 +1013,12 @@ static const struct file_operations capi_fops =
static int static int
capinc_tty_install(struct tty_driver *driver, struct tty_struct *tty) capinc_tty_install(struct tty_driver *driver, struct tty_struct *tty)
{ {
int idx = tty->index; struct capiminor *mp = capiminor_get(tty->index);
struct capiminor *mp = capiminor_get(idx); int ret = tty_standard_install(driver, tty);
int ret = tty_init_termios(tty);
if (ret == 0) { if (ret == 0)
tty_driver_kref_get(driver);
tty->count++;
tty->driver_data = mp; tty->driver_data = mp;
driver->ttys[idx] = tty; else
} else
capiminor_put(mp); capiminor_put(mp);
return ret; return ret;
} }
@@ -1290,7 +1286,6 @@ static int __init capinc_tty_init(void)
kfree(capiminors); kfree(capiminors);
return -ENOMEM; return -ENOMEM;
} }
drv->owner = THIS_MODULE;
drv->driver_name = "capi_nc"; drv->driver_name = "capi_nc";
drv->name = "capi"; drv->name = "capi";
drv->major = 0; drv->major = 0;
+1 -4
View File
@@ -720,12 +720,11 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
tasklet_init(&cs->event_tasklet, gigaset_handle_event, tasklet_init(&cs->event_tasklet, gigaset_handle_event,
(unsigned long) cs); (unsigned long) cs);
tty_port_init(&cs->port);
cs->commands_pending = 0; cs->commands_pending = 0;
cs->cur_at_seq = 0; cs->cur_at_seq = 0;
cs->gotfwver = -1; cs->gotfwver = -1;
cs->open_count = 0;
cs->dev = NULL; cs->dev = NULL;
cs->tty = NULL;
cs->tty_dev = NULL; cs->tty_dev = NULL;
cs->cidmode = cidmode != 0; cs->cidmode = cidmode != 0;
cs->tabnocid = gigaset_tab_nocid; cs->tabnocid = gigaset_tab_nocid;
@@ -1051,8 +1050,6 @@ static struct cardstate *gigaset_get_cs_by_minor(unsigned minor)
struct cardstate *gigaset_get_cs_by_tty(struct tty_struct *tty) struct cardstate *gigaset_get_cs_by_tty(struct tty_struct *tty)
{ {
if (tty->index < 0 || tty->index >= tty->driver->num)
return NULL;
return gigaset_get_cs_by_minor(tty->index + tty->driver->minor_start); return gigaset_get_cs_by_minor(tty->index + tty->driver->minor_start);
} }

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