aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-13 20:34:23 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-13 20:34:23 -0500
commitf90203e0cf0d5a8b027d511af318bb3db4758fe2 (patch)
treed2d9157331857b4220198e053e30ce3427c5140e /drivers
parent33e563c1190c26b6bf61990c505cdcb5cdbba7e4 (diff)
parent719c91ccadd3ed26570dbb29d54166914832eee9 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc
* master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc: (61 commits) [POWERPC] Use udbg_early_init() on ppc32 [POWERPC] Open Firmware serial port driver [POWERPC] Move MPIC smp routines into mpic.c [POWERPC] Cleanup pseries kexec code [POWERPC] Cleanup pseries smp initialisation code [POWERPC] Consolidate pseries platform header files into pseries.h [POWERPC] 85xx: Drop use of SYNC macro in head_fsl_booke.S [POWERPC] cell: pm_rtas_activat_signals routine cleanup [POWERPC] cell: PPU Oprofile cleanup patch [POWERPC] spufs: avoid accessing kernel memory through mmapped /mem node [POWERPC] spu sched: static timeslicing for SCHED_RR contexts [POWERPC] spu sched: use DECLARE_BITMAP [POWERPC] spu sched: forced preemption at execution [POWERPC] spu sched: update some comments [POWERPC] spu sched: simplity spu_remove_from_active_list [POWERPC] spufs: optimize spu_run [POWERPC] spufs: runqueue simplification [POWERPC] spufs: move prio to spu_context [POWERPC] spufs: state_mutex cleanup [POWERPC] spufs: simplify state_mutex ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/pata_mpc52xx.c6
-rw-r--r--drivers/macintosh/adbhid.c4
-rw-r--r--drivers/macintosh/apm_emu.c2
-rw-r--r--drivers/macintosh/mac_hid.c4
-rw-r--r--drivers/macintosh/therm_adt746x.c6
-rw-r--r--drivers/macintosh/via-cuda.c2
-rw-r--r--drivers/macintosh/via-macii.c10
-rw-r--r--drivers/macintosh/via-maciisi.c6
-rw-r--r--drivers/macintosh/via-pmu.c13
-rw-r--r--drivers/macintosh/via-pmu68k.c4
-rw-r--r--drivers/serial/Kconfig10
-rw-r--r--drivers/serial/Makefile1
-rw-r--r--drivers/serial/mpc52xx_uart.c5
-rw-r--r--drivers/serial/of_serial.c143
14 files changed, 183 insertions, 33 deletions
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index d7378df44970..29e1809e5ecf 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -484,10 +484,8 @@ mpc52xx_ata_resume(struct of_device *op)
484 484
485static struct of_device_id mpc52xx_ata_of_match[] = { 485static struct of_device_id mpc52xx_ata_of_match[] = {
486 { 486 {
487 .compatible = "mpc5200-ata", 487 .type = "ata",
488 }, 488 .compatible = "mpc5200-ata",
489 {
490 .compatible = "mpc52xx-ata",
491 }, 489 },
492 {}, 490 {},
493}; 491};
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index 1c7d6f221b55..b77ef5187d6d 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -574,8 +574,8 @@ static struct adb_request led_request;
574static int leds_pending[16]; 574static int leds_pending[16];
575static int leds_req_pending; 575static int leds_req_pending;
576static int pending_devs[16]; 576static int pending_devs[16];
577static int pending_led_start=0; 577static int pending_led_start;
578static int pending_led_end=0; 578static int pending_led_end;
579static DEFINE_SPINLOCK(leds_lock); 579static DEFINE_SPINLOCK(leds_lock);
580 580
581static void leds_done(struct adb_request *req) 581static void leds_done(struct adb_request *req)
diff --git a/drivers/macintosh/apm_emu.c b/drivers/macintosh/apm_emu.c
index a6d50f4fabd7..c5e4d43f97fc 100644
--- a/drivers/macintosh/apm_emu.c
+++ b/drivers/macintosh/apm_emu.c
@@ -102,7 +102,7 @@ static struct pmu_sleep_notifier apm_sleep_notifier = {
102 SLEEP_LEVEL_USERLAND, 102 SLEEP_LEVEL_USERLAND,
103}; 103};
104 104
105static char driver_version[] = "0.5"; /* no spaces */ 105static const char driver_version[] = "0.5"; /* no spaces */
106 106
107#ifdef DEBUG 107#ifdef DEBUG
108static char * apm_event_name[] = { 108static char * apm_event_name[] = {
diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c
index ee6b4ca69130..f632cec9ce45 100644
--- a/drivers/macintosh/mac_hid.c
+++ b/drivers/macintosh/mac_hid.c
@@ -17,10 +17,10 @@
17 17
18static struct input_dev *emumousebtn; 18static struct input_dev *emumousebtn;
19static int emumousebtn_input_register(void); 19static int emumousebtn_input_register(void);
20static int mouse_emulate_buttons = 0; 20static int mouse_emulate_buttons;
21static int mouse_button2_keycode = KEY_RIGHTCTRL; /* right control key */ 21static int mouse_button2_keycode = KEY_RIGHTCTRL; /* right control key */
22static int mouse_button3_keycode = KEY_RIGHTALT; /* right option key */ 22static int mouse_button3_keycode = KEY_RIGHTALT; /* right option key */
23static int mouse_last_keycode = 0; 23static int mouse_last_keycode;
24 24
25#if defined(CONFIG_SYSCTL) 25#if defined(CONFIG_SYSCTL)
26/* file(s) in /proc/sys/dev/mac_hid */ 26/* file(s) in /proc/sys/dev/mac_hid */
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 3d3bf1643e73..a7ce55926638 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -48,11 +48,11 @@ static u8 FAN_SPD_SET[2] = {0x30, 0x31};
48 48
49static u8 default_limits_local[3] = {70, 50, 70}; /* local, sensor1, sensor2 */ 49static u8 default_limits_local[3] = {70, 50, 70}; /* local, sensor1, sensor2 */
50static u8 default_limits_chip[3] = {80, 65, 80}; /* local, sensor1, sensor2 */ 50static u8 default_limits_chip[3] = {80, 65, 80}; /* local, sensor1, sensor2 */
51static const char *sensor_location[3] = {NULL, NULL, NULL}; 51static const char *sensor_location[3];
52 52
53static int limit_adjust = 0; 53static int limit_adjust;
54static int fan_speed = -1; 54static int fan_speed = -1;
55static int verbose = 0; 55static int verbose;
56 56
57MODULE_AUTHOR("Colin Leroy <colin@colino.net>"); 57MODULE_AUTHOR("Colin Leroy <colin@colino.net>");
58MODULE_DESCRIPTION("Driver for ADT746x thermostat in iBook G4 and " 58MODULE_DESCRIPTION("Driver for ADT746x thermostat in iBook G4 and "
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index df66291b1322..3797f503cd6c 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -86,7 +86,7 @@ static int data_index;
86#ifdef CONFIG_PPC 86#ifdef CONFIG_PPC
87static struct device_node *vias; 87static struct device_node *vias;
88#endif 88#endif
89static int cuda_fully_inited = 0; 89static int cuda_fully_inited;
90 90
91#ifdef CONFIG_ADB 91#ifdef CONFIG_ADB
92static int cuda_probe(void); 92static int cuda_probe(void);
diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c
index 5d88d5b0ad99..175b3e56e375 100644
--- a/drivers/macintosh/via-macii.c
+++ b/drivers/macintosh/via-macii.c
@@ -107,10 +107,10 @@ static enum macii_state {
107 awaiting_reply 107 awaiting_reply
108} macii_state; 108} macii_state;
109 109
110static int need_poll = 0; 110static int need_poll;
111static int command_byte = 0; 111static int command_byte;
112static int last_reply = 0; 112static int last_reply;
113static int last_active = 0; 113static int last_active;
114 114
115static struct adb_request *current_req; 115static struct adb_request *current_req;
116static struct adb_request *last_req; 116static struct adb_request *last_req;
@@ -124,7 +124,7 @@ static int first_byte;
124static int prefix_len; 124static int prefix_len;
125static int status = ST_IDLE|TREQ; 125static int status = ST_IDLE|TREQ;
126static int last_status; 126static int last_status;
127static int driver_running = 0; 127static int driver_running;
128 128
129/* debug level 10 required for ADB logging (should be && debug_adb, ideally) */ 129/* debug level 10 required for ADB logging (should be && debug_adb, ideally) */
130 130
diff --git a/drivers/macintosh/via-maciisi.c b/drivers/macintosh/via-maciisi.c
index 1f0aa5dc9aa5..10051db48d23 100644
--- a/drivers/macintosh/via-maciisi.c
+++ b/drivers/macintosh/via-maciisi.c
@@ -63,10 +63,10 @@ static volatile unsigned char *via;
63 63
64#undef DEBUG_MACIISI_ADB 64#undef DEBUG_MACIISI_ADB
65 65
66static struct adb_request* current_req = NULL; 66static struct adb_request* current_req;
67static struct adb_request* last_req = NULL; 67static struct adb_request* last_req;
68static unsigned char maciisi_rbuf[16]; 68static unsigned char maciisi_rbuf[16];
69static unsigned char *reply_ptr = NULL; 69static unsigned char *reply_ptr;
70static int data_index; 70static int data_index;
71static int reading_reply; 71static int reading_reply;
72static int reply_len; 72static int reply_len;
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 96bea4b62c43..b6073bdb50c3 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -141,13 +141,13 @@ static volatile int adb_int_pending;
141static volatile int disable_poll; 141static volatile int disable_poll;
142static struct device_node *vias; 142static struct device_node *vias;
143static int pmu_kind = PMU_UNKNOWN; 143static int pmu_kind = PMU_UNKNOWN;
144static int pmu_fully_inited = 0; 144static int pmu_fully_inited;
145static int pmu_has_adb; 145static int pmu_has_adb;
146static struct device_node *gpio_node; 146static struct device_node *gpio_node;
147static unsigned char __iomem *gpio_reg = NULL; 147static unsigned char __iomem *gpio_reg;
148static int gpio_irq = NO_IRQ; 148static int gpio_irq = NO_IRQ;
149static int gpio_irq_enabled = -1; 149static int gpio_irq_enabled = -1;
150static volatile int pmu_suspended = 0; 150static volatile int pmu_suspended;
151static spinlock_t pmu_lock; 151static spinlock_t pmu_lock;
152static u8 pmu_intr_mask; 152static u8 pmu_intr_mask;
153static int pmu_version; 153static int pmu_version;
@@ -169,7 +169,7 @@ static int option_server_mode;
169 169
170int pmu_battery_count; 170int pmu_battery_count;
171int pmu_cur_battery; 171int pmu_cur_battery;
172unsigned int pmu_power_flags; 172unsigned int pmu_power_flags = PMU_PWR_AC_PRESENT;
173struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES]; 173struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES];
174static int query_batt_timer = BATTERY_POLLING_COUNT; 174static int query_batt_timer = BATTERY_POLLING_COUNT;
175static struct adb_request batt_req; 175static struct adb_request batt_req;
@@ -180,7 +180,7 @@ int asleep;
180BLOCKING_NOTIFIER_HEAD(sleep_notifier_list); 180BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
181 181
182#ifdef CONFIG_ADB 182#ifdef CONFIG_ADB
183static int adb_dev_map = 0; 183static int adb_dev_map;
184static int pmu_adb_flags; 184static int pmu_adb_flags;
185 185
186static int pmu_probe(void); 186static int pmu_probe(void);
@@ -2776,7 +2776,7 @@ pmu_polled_request(struct adb_request *req)
2776 2776
2777#if defined(CONFIG_PM) && defined(CONFIG_PPC32) 2777#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
2778 2778
2779static int pmu_sys_suspended = 0; 2779static int pmu_sys_suspended;
2780 2780
2781static int pmu_sys_suspend(struct sys_device *sysdev, pm_message_t state) 2781static int pmu_sys_suspend(struct sys_device *sysdev, pm_message_t state)
2782{ 2782{
@@ -2816,7 +2816,6 @@ static struct sysdev_class pmu_sysclass = {
2816}; 2816};
2817 2817
2818static struct sys_device device_pmu = { 2818static struct sys_device device_pmu = {
2819 .id = 0,
2820 .cls = &pmu_sysclass, 2819 .cls = &pmu_sysclass,
2821}; 2820};
2822 2821
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c
index 4f5b6fa196c5..54baee57d2f8 100644
--- a/drivers/macintosh/via-pmu68k.c
+++ b/drivers/macintosh/via-pmu68k.c
@@ -96,10 +96,10 @@ static int data_index;
96static int data_len; 96static int data_len;
97static int adb_int_pending; 97static int adb_int_pending;
98static int pmu_adb_flags; 98static int pmu_adb_flags;
99static int adb_dev_map = 0; 99static int adb_dev_map;
100static struct adb_request bright_req_1, bright_req_2, bright_req_3; 100static struct adb_request bright_req_1, bright_req_2, bright_req_3;
101static int pmu_kind = PMU_UNKNOWN; 101static int pmu_kind = PMU_UNKNOWN;
102static int pmu_fully_inited = 0; 102static int pmu_fully_inited;
103 103
104int asleep; 104int asleep;
105BLOCKING_NOTIFIER_HEAD(sleep_notifier_list); 105BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 5cc6b91f8408..d0edbaacb1f7 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -999,4 +999,14 @@ config SERIAL_NETX_CONSOLE
999 If you have enabled the serial port on the Motorola IMX 999 If you have enabled the serial port on the Motorola IMX
1000 CPU you can make it the console by answering Y to this option. 1000 CPU you can make it the console by answering Y to this option.
1001 1001
1002config SERIAL_OF_PLATFORM
1003 tristate "Serial port on Open Firmware platform bus"
1004 depends on PPC_OF
1005 depends on SERIAL_8250
1006 help
1007 If you have a PowerPC based system that has serial ports
1008 on a platform specific bus, you should enable this option.
1009 Currently, only 8250 compatible ports are supported, but
1010 others can easily be added.
1011
1002endmenu 1012endmenu
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index df3632cd7df9..f3f82587b5fa 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -58,3 +58,4 @@ obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
58obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o 58obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o
59obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o 59obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o
60obj-$(CONFIG_SERIAL_NETX) += netx-serial.o 60obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
61obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 3c4b6c243712..955bbd653e22 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -127,8 +127,7 @@ static irqreturn_t mpc52xx_uart_int(int irq,void *dev_id);
127 127
128#if defined(CONFIG_PPC_MERGE) 128#if defined(CONFIG_PPC_MERGE)
129static struct of_device_id mpc52xx_uart_of_match[] = { 129static struct of_device_id mpc52xx_uart_of_match[] = {
130 { .type = "serial", .compatible = "mpc52xx-psc-uart", }, 130 { .type = "serial", .compatible = "mpc5200-psc-uart", },
131 { .type = "serial", .compatible = "mpc5200-psc", }, /* Efika only! */
132 {}, 131 {},
133}; 132};
134#endif 133#endif
@@ -1068,7 +1067,7 @@ mpc52xx_uart_of_enumerate(void)
1068 continue; 1067 continue;
1069 1068
1070 /* Is a particular device number requested? */ 1069 /* Is a particular device number requested? */
1071 devno = get_property(np, "device_no", NULL); 1070 devno = get_property(np, "port-number", NULL);
1072 mpc52xx_uart_of_assign(of_node_get(np), devno ? *devno : -1); 1071 mpc52xx_uart_of_assign(of_node_get(np), devno ? *devno : -1);
1073 } 1072 }
1074 1073
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c
new file mode 100644
index 000000000000..09b0b736a751
--- /dev/null
+++ b/drivers/serial/of_serial.c
@@ -0,0 +1,143 @@
1/*
2 * Serial Port driver for Open Firmware platform devices
3 *
4 * Copyright (C) 2006 Arnd Bergmann <arnd@arndb.de>, IBM Corp.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12#include <linux/init.h>
13#include <linux/module.h>
14#include <linux/serial_core.h>
15#include <linux/serial_8250.h>
16
17#include <asm/of_platform.h>
18#include <asm/prom.h>
19
20/*
21 * Fill a struct uart_port for a given device node
22 */
23static int __devinit of_platform_serial_setup(struct of_device *ofdev,
24 int type, struct uart_port *port)
25{
26 struct resource resource;
27 struct device_node *np = ofdev->node;
28 const unsigned int *clk, *spd;
29 int ret;
30
31 memset(port, 0, sizeof *port);
32 spd = get_property(np, "current-speed", NULL);
33 clk = get_property(np, "clock-frequency", NULL);
34 if (!clk) {
35 dev_warn(&ofdev->dev, "no clock-frequency property set\n");
36 return -ENODEV;
37 }
38
39 ret = of_address_to_resource(np, 0, &resource);
40 if (ret) {
41 dev_warn(&ofdev->dev, "invalid address\n");
42 return ret;
43 }
44
45 spin_lock_init(&port->lock);
46 port->mapbase = resource.start;
47 port->irq = irq_of_parse_and_map(np, 0);
48 port->iotype = UPIO_MEM;
49 port->type = type;
50 port->uartclk = *clk;
51 port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP;
52 port->dev = &ofdev->dev;
53 port->custom_divisor = *clk / (16 * (*spd));
54
55 return 0;
56}
57
58/*
59 * Try to register a serial port
60 */
61static int __devinit of_platform_serial_probe(struct of_device *ofdev,
62 const struct of_device_id *id)
63{
64 struct uart_port port;
65 int port_type;
66 int ret;
67
68 if (of_find_property(ofdev->node, "used-by-rtas", NULL))
69 return -EBUSY;
70
71 port_type = (unsigned long)id->data;
72 ret = of_platform_serial_setup(ofdev, port_type, &port);
73 if (ret)
74 goto out;
75
76 switch (port_type) {
77 case PORT_UNKNOWN:
78 dev_info(&ofdev->dev, "Unknown serial port found, "
79 "attempting to use 8250 driver\n");
80 /* fallthrough */
81 case PORT_8250 ... PORT_MAX_8250:
82 ret = serial8250_register_port(&port);
83 break;
84 default:
85 /* need to add code for these */
86 ret = -ENODEV;
87 break;
88 }
89 if (ret < 0)
90 goto out;
91
92 ofdev->dev.driver_data = (void *)(unsigned long)ret;
93 return 0;
94out:
95 irq_dispose_mapping(port.irq);
96 return ret;
97}
98
99/*
100 * Release a line
101 */
102static int of_platform_serial_remove(struct of_device *ofdev)
103{
104 int line = (unsigned long)ofdev->dev.driver_data;
105 serial8250_unregister_port(line);
106 return 0;
107}
108
109/*
110 * A few common types, add more as needed.
111 */
112static struct of_device_id __devinitdata of_platform_serial_table[] = {
113 { .type = "serial", .compatible = "ns8250", .data = (void *)PORT_8250, },
114 { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, },
115 { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, },
116 { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, },
117 { .type = "serial", .data = (void *)PORT_UNKNOWN, },
118 { /* end of list */ },
119};
120
121static struct of_platform_driver __devinitdata of_platform_serial_driver = {
122 .owner = THIS_MODULE,
123 .name = "of_serial",
124 .probe = of_platform_serial_probe,
125 .remove = of_platform_serial_remove,
126 .match_table = of_platform_serial_table,
127};
128
129static int __init of_platform_serial_init(void)
130{
131 return of_register_platform_driver(&of_platform_serial_driver);
132}
133module_init(of_platform_serial_init);
134
135static void __exit of_platform_serial_exit(void)
136{
137 return of_unregister_platform_driver(&of_platform_serial_driver);
138};
139module_exit(of_platform_serial_exit);
140
141MODULE_AUTHOR("Arnd Bergmann <arnd@arndb.de>");
142MODULE_LICENSE("GPL");
143MODULE_DESCRIPTION("Serial Port driver for Open Firmware platform devices");