aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/briq_panel.c7
-rw-r--r--drivers/char/hvc_console.c49
-rw-r--r--drivers/char/hvc_iseries.c2
-rw-r--r--drivers/char/hvc_vio.c2
-rw-r--r--drivers/char/hvsi.c4
-rw-r--r--drivers/char/sonypi.c53
-rw-r--r--drivers/char/tpm/tpm_atmel.h4
-rw-r--r--drivers/char/watchdog/Kconfig2
8 files changed, 89 insertions, 34 deletions
diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c
index 8dcf9d20f449..c70d52ace8b2 100644
--- a/drivers/char/briq_panel.c
+++ b/drivers/char/briq_panel.c
@@ -202,13 +202,16 @@ static struct miscdevice briq_panel_miscdev = {
202 202
203static int __init briq_panel_init(void) 203static int __init briq_panel_init(void)
204{ 204{
205 struct device_node *root = find_path_device("/"); 205 struct device_node *root = of_find_node_by_path("/");
206 const char *machine; 206 const char *machine;
207 int i; 207 int i;
208 208
209 machine = get_property(root, "model", NULL); 209 machine = get_property(root, "model", NULL);
210 if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0) 210 if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0) {
211 of_node_put(root);
211 return -ENODEV; 212 return -ENODEV;
213 }
214 of_node_put(root);
212 215
213 printk(KERN_INFO 216 printk(KERN_INFO
214 "briq_panel: v%s Dr. Karsten Jeppesen (kj@totalimpact.com)\n", 217 "briq_panel: v%s Dr. Karsten Jeppesen (kj@totalimpact.com)\n",
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index a0a88aa23f5b..0f9ed7b46a6d 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -47,8 +47,6 @@
47#define HVC_MAJOR 229 47#define HVC_MAJOR 229
48#define HVC_MINOR 0 48#define HVC_MINOR 0
49 49
50#define TIMEOUT (10)
51
52/* 50/*
53 * Wait this long per iteration while trying to push buffered data to the 51 * Wait this long per iteration while trying to push buffered data to the
54 * hypervisor before allowing the tty to complete a close operation. 52 * hypervisor before allowing the tty to complete a close operation.
@@ -104,12 +102,12 @@ static DEFINE_SPINLOCK(hvc_structs_lock);
104/* 102/*
105 * This value is used to assign a tty->index value to a hvc_struct based 103 * This value is used to assign a tty->index value to a hvc_struct based
106 * upon order of exposure via hvc_probe(), when we can not match it to 104 * upon order of exposure via hvc_probe(), when we can not match it to
107 * a console canidate registered with hvc_instantiate(). 105 * a console candidate registered with hvc_instantiate().
108 */ 106 */
109static int last_hvc = -1; 107static int last_hvc = -1;
110 108
111/* 109/*
112 * Do not call this function with either the hvc_strucst_lock or the hvc_struct 110 * Do not call this function with either the hvc_structs_lock or the hvc_struct
113 * lock held. If successful, this function increments the kobject reference 111 * lock held. If successful, this function increments the kobject reference
114 * count against the target hvc_struct so it should be released when finished. 112 * count against the target hvc_struct so it should be released when finished.
115 */ 113 */
@@ -162,7 +160,7 @@ void hvc_console_print(struct console *co, const char *b, unsigned count)
162 if (index >= MAX_NR_HVC_CONSOLES) 160 if (index >= MAX_NR_HVC_CONSOLES)
163 return; 161 return;
164 162
165 /* This console adapter was removed so it is not useable. */ 163 /* This console adapter was removed so it is not usable. */
166 if (vtermnos[index] < 0) 164 if (vtermnos[index] < 0)
167 return; 165 return;
168 166
@@ -220,7 +218,7 @@ struct console hvc_con_driver = {
220}; 218};
221 219
222/* 220/*
223 * Early console initialization. Preceeds driver initialization. 221 * Early console initialization. Precedes driver initialization.
224 * 222 *
225 * (1) we are first, and the user specified another driver 223 * (1) we are first, and the user specified another driver
226 * -- index will remain -1 224 * -- index will remain -1
@@ -257,7 +255,7 @@ int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops)
257 if (vtermnos[index] != -1) 255 if (vtermnos[index] != -1)
258 return -1; 256 return -1;
259 257
260 /* make sure no no tty has been registerd in this index */ 258 /* make sure no no tty has been registered in this index */
261 hp = hvc_get_by_index(index); 259 hp = hvc_get_by_index(index);
262 if (hp) { 260 if (hp) {
263 kobject_put(&hp->kobj); 261 kobject_put(&hp->kobj);
@@ -267,7 +265,7 @@ int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops)
267 vtermnos[index] = vtermno; 265 vtermnos[index] = vtermno;
268 cons_ops[index] = ops; 266 cons_ops[index] = ops;
269 267
270 /* reserve all indices upto and including this index */ 268 /* reserve all indices up to and including this index */
271 if (last_hvc < index) 269 if (last_hvc < index)
272 last_hvc = index; 270 last_hvc = index;
273 271
@@ -528,7 +526,7 @@ static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count
528 526
529/* 527/*
530 * This is actually a contract between the driver and the tty layer outlining 528 * This is actually a contract between the driver and the tty layer outlining
531 * how much write room the driver can guarentee will be sent OR BUFFERED. This 529 * how much write room the driver can guarantee will be sent OR BUFFERED. This
532 * driver MUST honor the return value. 530 * driver MUST honor the return value.
533 */ 531 */
534static int hvc_write_room(struct tty_struct *tty) 532static int hvc_write_room(struct tty_struct *tty)
@@ -550,6 +548,18 @@ static int hvc_chars_in_buffer(struct tty_struct *tty)
550 return hp->n_outbuf; 548 return hp->n_outbuf;
551} 549}
552 550
551/*
552 * timeout will vary between the MIN and MAX values defined here. By default
553 * and during console activity we will use a default MIN_TIMEOUT of 10. When
554 * the console is idle, we increase the timeout value on each pass through
555 * msleep until we reach the max. This may be noticeable as a brief (average
556 * one second) delay on the console before the console responds to input when
557 * there has been no input for some time.
558 */
559#define MIN_TIMEOUT (10)
560#define MAX_TIMEOUT (2000)
561static u32 timeout = MIN_TIMEOUT;
562
553#define HVC_POLL_READ 0x00000001 563#define HVC_POLL_READ 0x00000001
554#define HVC_POLL_WRITE 0x00000002 564#define HVC_POLL_WRITE 0x00000002
555 565
@@ -642,9 +652,14 @@ static int hvc_poll(struct hvc_struct *hp)
642 bail: 652 bail:
643 spin_unlock_irqrestore(&hp->lock, flags); 653 spin_unlock_irqrestore(&hp->lock, flags);
644 654
645 if (read_total) 655 if (read_total) {
656 /* Activity is occurring, so reset the polling backoff value to
657 a minimum for performance. */
658 timeout = MIN_TIMEOUT;
659
646 tty_flip_buffer_push(tty); 660 tty_flip_buffer_push(tty);
647 661 }
662
648 return poll_mask; 663 return poll_mask;
649} 664}
650 665
@@ -688,8 +703,12 @@ int khvcd(void *unused)
688 if (!hvc_kicked) { 703 if (!hvc_kicked) {
689 if (poll_mask == 0) 704 if (poll_mask == 0)
690 schedule(); 705 schedule();
691 else 706 else {
692 msleep_interruptible(TIMEOUT); 707 if (timeout < MAX_TIMEOUT)
708 timeout += (timeout >> 6) + 1;
709
710 msleep_interruptible(timeout);
711 }
693 } 712 }
694 __set_current_state(TASK_RUNNING); 713 __set_current_state(TASK_RUNNING);
695 } while (!kthread_should_stop()); 714 } while (!kthread_should_stop());
@@ -794,7 +813,7 @@ int __devexit hvc_remove(struct hvc_struct *hp)
794 813
795 /* 814 /*
796 * We 'put' the instance that was grabbed when the kobject instance 815 * We 'put' the instance that was grabbed when the kobject instance
797 * was intialized using kobject_init(). Let the last holder of this 816 * was initialized using kobject_init(). Let the last holder of this
798 * kobject cause it to be removed, which will probably be the tty_hangup 817 * kobject cause it to be removed, which will probably be the tty_hangup
799 * below. 818 * below.
800 */ 819 */
@@ -850,7 +869,7 @@ int __init hvc_init(void)
850} 869}
851module_init(hvc_init); 870module_init(hvc_init);
852 871
853/* This isn't particularily necessary due to this being a console driver 872/* This isn't particularly necessary due to this being a console driver
854 * but it is nice to be thorough. 873 * but it is nice to be thorough.
855 */ 874 */
856static void __exit hvc_exit(void) 875static void __exit hvc_exit(void)
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index f144a947bd17..ec420fe8a908 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -575,7 +575,7 @@ static int hvc_find_vtys(void)
575 (num_found >= VTTY_PORTS)) 575 (num_found >= VTTY_PORTS))
576 break; 576 break;
577 577
578 vtermno = get_property(vty, "reg", NULL); 578 vtermno = of_get_property(vty, "reg", NULL);
579 if (!vtermno) 579 if (!vtermno)
580 continue; 580 continue;
581 581
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index f9c00844d2bf..94a542e20efb 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -153,7 +153,7 @@ static int hvc_find_vtys(void)
153 if (num_found >= MAX_NR_HVC_CONSOLES) 153 if (num_found >= MAX_NR_HVC_CONSOLES)
154 break; 154 break;
155 155
156 vtermno = get_property(vty, "reg", NULL); 156 vtermno = of_get_property(vty, "reg", NULL);
157 if (!vtermno) 157 if (!vtermno)
158 continue; 158 continue;
159 159
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c
index 50315d6364fd..d5a752da322f 100644
--- a/drivers/char/hvsi.c
+++ b/drivers/char/hvsi.c
@@ -1279,8 +1279,8 @@ static int __init hvsi_console_init(void)
1279 struct hvsi_struct *hp; 1279 struct hvsi_struct *hp;
1280 const uint32_t *vtermno, *irq; 1280 const uint32_t *vtermno, *irq;
1281 1281
1282 vtermno = get_property(vty, "reg", NULL); 1282 vtermno = of_get_property(vty, "reg", NULL);
1283 irq = get_property(vty, "interrupts", NULL); 1283 irq = of_get_property(vty, "interrupts", NULL);
1284 if (!vtermno || !irq) 1284 if (!vtermno || !irq)
1285 continue; 1285 continue;
1286 1286
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 78237577b05a..3ef593a9015f 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -1,6 +1,8 @@
1/* 1/*
2 * Sony Programmable I/O Control Device driver for VAIO 2 * Sony Programmable I/O Control Device driver for VAIO
3 * 3 *
4 * Copyright (C) 2007 Mattia Dongili <malattia@linux.it>
5 *
4 * Copyright (C) 2001-2005 Stelian Pop <stelian@popies.net> 6 * Copyright (C) 2001-2005 Stelian Pop <stelian@popies.net>
5 * 7 *
6 * Copyright (C) 2005 Narayanan R S <nars@kadamba.org> 8 * Copyright (C) 2005 Narayanan R S <nars@kadamba.org>
@@ -95,6 +97,11 @@ module_param(useinput, int, 0444);
95MODULE_PARM_DESC(useinput, 97MODULE_PARM_DESC(useinput,
96 "set this if you would like sonypi to feed events to the input subsystem"); 98 "set this if you would like sonypi to feed events to the input subsystem");
97 99
100static int check_ioport = 1;
101module_param(check_ioport, int, 0444);
102MODULE_PARM_DESC(check_ioport,
103 "set this to 0 if you think the automatic ioport check for sony-laptop is wrong");
104
98#define SONYPI_DEVICE_MODEL_TYPE1 1 105#define SONYPI_DEVICE_MODEL_TYPE1 1
99#define SONYPI_DEVICE_MODEL_TYPE2 2 106#define SONYPI_DEVICE_MODEL_TYPE2 2
100#define SONYPI_DEVICE_MODEL_TYPE3 3 107#define SONYPI_DEVICE_MODEL_TYPE3 3
@@ -477,7 +484,7 @@ static struct sonypi_device {
477 u16 evtype_offset; 484 u16 evtype_offset;
478 int camera_power; 485 int camera_power;
479 int bluetooth_power; 486 int bluetooth_power;
480 struct semaphore lock; 487 struct mutex lock;
481 struct kfifo *fifo; 488 struct kfifo *fifo;
482 spinlock_t fifo_lock; 489 spinlock_t fifo_lock;
483 wait_queue_head_t fifo_proc_list; 490 wait_queue_head_t fifo_proc_list;
@@ -884,7 +891,7 @@ int sonypi_camera_command(int command, u8 value)
884 if (!camera) 891 if (!camera)
885 return -EIO; 892 return -EIO;
886 893
887 down(&sonypi_device.lock); 894 mutex_lock(&sonypi_device.lock);
888 895
889 switch (command) { 896 switch (command) {
890 case SONYPI_COMMAND_SETCAMERA: 897 case SONYPI_COMMAND_SETCAMERA:
@@ -919,7 +926,7 @@ int sonypi_camera_command(int command, u8 value)
919 command); 926 command);
920 break; 927 break;
921 } 928 }
922 up(&sonypi_device.lock); 929 mutex_unlock(&sonypi_device.lock);
923 return 0; 930 return 0;
924} 931}
925 932
@@ -938,20 +945,20 @@ static int sonypi_misc_fasync(int fd, struct file *filp, int on)
938static int sonypi_misc_release(struct inode *inode, struct file *file) 945static int sonypi_misc_release(struct inode *inode, struct file *file)
939{ 946{
940 sonypi_misc_fasync(-1, file, 0); 947 sonypi_misc_fasync(-1, file, 0);
941 down(&sonypi_device.lock); 948 mutex_lock(&sonypi_device.lock);
942 sonypi_device.open_count--; 949 sonypi_device.open_count--;
943 up(&sonypi_device.lock); 950 mutex_unlock(&sonypi_device.lock);
944 return 0; 951 return 0;
945} 952}
946 953
947static int sonypi_misc_open(struct inode *inode, struct file *file) 954static int sonypi_misc_open(struct inode *inode, struct file *file)
948{ 955{
949 down(&sonypi_device.lock); 956 mutex_lock(&sonypi_device.lock);
950 /* Flush input queue on first open */ 957 /* Flush input queue on first open */
951 if (!sonypi_device.open_count) 958 if (!sonypi_device.open_count)
952 kfifo_reset(sonypi_device.fifo); 959 kfifo_reset(sonypi_device.fifo);
953 sonypi_device.open_count++; 960 sonypi_device.open_count++;
954 up(&sonypi_device.lock); 961 mutex_unlock(&sonypi_device.lock);
955 return 0; 962 return 0;
956} 963}
957 964
@@ -1001,7 +1008,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
1001 u8 val8; 1008 u8 val8;
1002 u16 val16; 1009 u16 val16;
1003 1010
1004 down(&sonypi_device.lock); 1011 mutex_lock(&sonypi_device.lock);
1005 switch (cmd) { 1012 switch (cmd) {
1006 case SONYPI_IOCGBRT: 1013 case SONYPI_IOCGBRT:
1007 if (sonypi_ec_read(SONYPI_LCD_LIGHT, &val8)) { 1014 if (sonypi_ec_read(SONYPI_LCD_LIGHT, &val8)) {
@@ -1101,7 +1108,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
1101 default: 1108 default:
1102 ret = -EINVAL; 1109 ret = -EINVAL;
1103 } 1110 }
1104 up(&sonypi_device.lock); 1111 mutex_unlock(&sonypi_device.lock);
1105 return ret; 1112 return ret;
1106} 1113}
1107 1114
@@ -1260,6 +1267,28 @@ static int __devinit sonypi_create_input_devices(void)
1260static int __devinit sonypi_setup_ioports(struct sonypi_device *dev, 1267static int __devinit sonypi_setup_ioports(struct sonypi_device *dev,
1261 const struct sonypi_ioport_list *ioport_list) 1268 const struct sonypi_ioport_list *ioport_list)
1262{ 1269{
1270 /* try to detect if sony-laptop is being used and thus
1271 * has already requested one of the known ioports.
1272 * As in the deprecated check_region this is racy has we have
1273 * multiple ioports available and one of them can be requested
1274 * between this check and the subsequent request. Anyway, as an
1275 * attempt to be some more user-friendly as we currently are,
1276 * this is enough.
1277 */
1278 const struct sonypi_ioport_list *check = ioport_list;
1279 while (check_ioport && check->port1) {
1280 if (!request_region(check->port1,
1281 sonypi_device.region_size,
1282 "Sony Programable I/O Device Check")) {
1283 printk(KERN_ERR "sonypi: ioport 0x%.4x busy, using sony-laptop? "
1284 "if not use check_ioport=0\n",
1285 check->port1);
1286 return -EBUSY;
1287 }
1288 release_region(check->port1, sonypi_device.region_size);
1289 check++;
1290 }
1291
1263 while (ioport_list->port1) { 1292 while (ioport_list->port1) {
1264 1293
1265 if (request_region(ioport_list->port1, 1294 if (request_region(ioport_list->port1,
@@ -1321,6 +1350,10 @@ static int __devinit sonypi_probe(struct platform_device *dev)
1321 struct pci_dev *pcidev; 1350 struct pci_dev *pcidev;
1322 int error; 1351 int error;
1323 1352
1353 printk(KERN_WARNING "sonypi: please try the sony-laptop module instead "
1354 "and report failures, see also "
1355 "http://www.linux.it/~malattia/wiki/index.php/Sony_drivers\n");
1356
1324 spin_lock_init(&sonypi_device.fifo_lock); 1357 spin_lock_init(&sonypi_device.fifo_lock);
1325 sonypi_device.fifo = kfifo_alloc(SONYPI_BUF_SIZE, GFP_KERNEL, 1358 sonypi_device.fifo = kfifo_alloc(SONYPI_BUF_SIZE, GFP_KERNEL,
1326 &sonypi_device.fifo_lock); 1359 &sonypi_device.fifo_lock);
@@ -1330,7 +1363,7 @@ static int __devinit sonypi_probe(struct platform_device *dev)
1330 } 1363 }
1331 1364
1332 init_waitqueue_head(&sonypi_device.fifo_proc_list); 1365 init_waitqueue_head(&sonypi_device.fifo_proc_list);
1333 init_MUTEX(&sonypi_device.lock); 1366 mutex_init(&sonypi_device.lock);
1334 sonypi_device.bluetooth_power = -1; 1367 sonypi_device.bluetooth_power = -1;
1335 1368
1336 if ((pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, 1369 if ((pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index aefd683c60b7..3c852009196e 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -53,8 +53,8 @@ static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
53 } 53 }
54 54
55 reg = get_property(dn, "reg", &reglen); 55 reg = get_property(dn, "reg", &reglen);
56 naddrc = prom_n_addr_cells(dn); 56 naddrc = of_n_addr_cells(dn);
57 nsizec = prom_n_size_cells(dn); 57 nsizec = of_n_size_cells(dn);
58 58
59 of_node_put(dn); 59 of_node_put(dn);
60 60
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
index e812aa129e28..60198a78974c 100644
--- a/drivers/char/watchdog/Kconfig
+++ b/drivers/char/watchdog/Kconfig
@@ -548,7 +548,7 @@ config MV64X60_WDT
548 depends on WATCHDOG && MV64X60 548 depends on WATCHDOG && MV64X60
549 549
550config BOOKE_WDT 550config BOOKE_WDT
551 tristate "PowerPC Book-E Watchdog Timer" 551 bool "PowerPC Book-E Watchdog Timer"
552 depends on WATCHDOG && (BOOKE || 4xx) 552 depends on WATCHDOG && (BOOKE || 4xx)
553 ---help--- 553 ---help---
554 Please see Documentation/watchdog/watchdog-api.txt for 554 Please see Documentation/watchdog/watchdog-api.txt for