diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/ans-lcd.c | 10 | ||||
-rw-r--r-- | drivers/macintosh/apm_emu.c | 8 | ||||
-rw-r--r-- | drivers/macintosh/macio_asic.c | 2 | ||||
-rw-r--r-- | drivers/macintosh/macio_sysfs.c | 26 | ||||
-rw-r--r-- | drivers/macintosh/mediabay.c | 56 | ||||
-rw-r--r-- | drivers/macintosh/smu.c | 4 | ||||
-rw-r--r-- | drivers/macintosh/via-cuda.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu.c | 142 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu68k.c | 15 |
9 files changed, 141 insertions, 123 deletions
diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c index 5e0811dc6536..2b8a6e821d44 100644 --- a/drivers/macintosh/ans-lcd.c +++ b/drivers/macintosh/ans-lcd.c | |||
@@ -27,7 +27,7 @@ static volatile unsigned char __iomem *anslcd_ptr; | |||
27 | 27 | ||
28 | #undef DEBUG | 28 | #undef DEBUG |
29 | 29 | ||
30 | static void __pmac | 30 | static void |
31 | anslcd_write_byte_ctrl ( unsigned char c ) | 31 | anslcd_write_byte_ctrl ( unsigned char c ) |
32 | { | 32 | { |
33 | #ifdef DEBUG | 33 | #ifdef DEBUG |
@@ -43,14 +43,14 @@ anslcd_write_byte_ctrl ( unsigned char c ) | |||
43 | } | 43 | } |
44 | } | 44 | } |
45 | 45 | ||
46 | static void __pmac | 46 | static void |
47 | anslcd_write_byte_data ( unsigned char c ) | 47 | anslcd_write_byte_data ( unsigned char c ) |
48 | { | 48 | { |
49 | out_8(anslcd_ptr + ANSLCD_DATA_IX, c); | 49 | out_8(anslcd_ptr + ANSLCD_DATA_IX, c); |
50 | udelay(anslcd_short_delay); | 50 | udelay(anslcd_short_delay); |
51 | } | 51 | } |
52 | 52 | ||
53 | static ssize_t __pmac | 53 | static ssize_t |
54 | anslcd_write( struct file * file, const char __user * buf, | 54 | anslcd_write( struct file * file, const char __user * buf, |
55 | size_t count, loff_t *ppos ) | 55 | size_t count, loff_t *ppos ) |
56 | { | 56 | { |
@@ -73,7 +73,7 @@ anslcd_write( struct file * file, const char __user * buf, | |||
73 | return p - buf; | 73 | return p - buf; |
74 | } | 74 | } |
75 | 75 | ||
76 | static int __pmac | 76 | static int |
77 | anslcd_ioctl( struct inode * inode, struct file * file, | 77 | anslcd_ioctl( struct inode * inode, struct file * file, |
78 | unsigned int cmd, unsigned long arg ) | 78 | unsigned int cmd, unsigned long arg ) |
79 | { | 79 | { |
@@ -115,7 +115,7 @@ anslcd_ioctl( struct inode * inode, struct file * file, | |||
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
118 | static int __pmac | 118 | static int |
119 | anslcd_open( struct inode * inode, struct file * file ) | 119 | anslcd_open( struct inode * inode, struct file * file ) |
120 | { | 120 | { |
121 | return 0; | 121 | return 0; |
diff --git a/drivers/macintosh/apm_emu.c b/drivers/macintosh/apm_emu.c index 19d3e05d6825..e5a2bbf99399 100644 --- a/drivers/macintosh/apm_emu.c +++ b/drivers/macintosh/apm_emu.c | |||
@@ -430,8 +430,8 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length) | |||
430 | -1: Unknown | 430 | -1: Unknown |
431 | 8) min = minutes; sec = seconds */ | 431 | 8) min = minutes; sec = seconds */ |
432 | 432 | ||
433 | unsigned short ac_line_status = 0xff; | 433 | unsigned short ac_line_status; |
434 | unsigned short battery_status = 0xff; | 434 | unsigned short battery_status = 0; |
435 | unsigned short battery_flag = 0xff; | 435 | unsigned short battery_flag = 0xff; |
436 | int percentage = -1; | 436 | int percentage = -1; |
437 | int time_units = -1; | 437 | int time_units = -1; |
@@ -446,6 +446,7 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length) | |||
446 | ac_line_status = ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0); | 446 | ac_line_status = ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0); |
447 | for (i=0; i<pmu_battery_count; i++) { | 447 | for (i=0; i<pmu_battery_count; i++) { |
448 | if (pmu_batteries[i].flags & PMU_BATT_PRESENT) { | 448 | if (pmu_batteries[i].flags & PMU_BATT_PRESENT) { |
449 | battery_status++; | ||
449 | if (percentage < 0) | 450 | if (percentage < 0) |
450 | percentage = 0; | 451 | percentage = 0; |
451 | if (charge < 0) | 452 | if (charge < 0) |
@@ -461,6 +462,9 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length) | |||
461 | charging++; | 462 | charging++; |
462 | } | 463 | } |
463 | } | 464 | } |
465 | if (0 == battery_status) | ||
466 | ac_line_status = 1; | ||
467 | battery_status = 0xff; | ||
464 | if (real_count) { | 468 | if (real_count) { |
465 | if (amperage < 0) { | 469 | if (amperage < 0) { |
466 | if (btype == PMU_BATT_TYPE_SMART) | 470 | if (btype == PMU_BATT_TYPE_SMART) |
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index 1ee003346923..c34c96d18907 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/pci_ids.h> | 17 | #include <linux/pci_ids.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/slab.h> | ||
21 | |||
20 | #include <asm/machdep.h> | 22 | #include <asm/machdep.h> |
21 | #include <asm/macio.h> | 23 | #include <asm/macio.h> |
22 | #include <asm/pmac_feature.h> | 24 | #include <asm/pmac_feature.h> |
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c index 97d22bb4516a..7f7d4eaca870 100644 --- a/drivers/macintosh/macio_sysfs.c +++ b/drivers/macintosh/macio_sysfs.c | |||
@@ -39,6 +39,31 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf) | |||
39 | return length; | 39 | return length; |
40 | } | 40 | } |
41 | 41 | ||
42 | static ssize_t modalias_show (struct device *dev, struct device_attribute *attr, | ||
43 | char *buf) | ||
44 | { | ||
45 | struct of_device *of; | ||
46 | char *compat; | ||
47 | int cplen; | ||
48 | int length; | ||
49 | |||
50 | of = &to_macio_device (dev)->ofdev; | ||
51 | compat = (char *) get_property (of->node, "compatible", &cplen); | ||
52 | if (!compat) compat = "", cplen = 1; | ||
53 | length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type); | ||
54 | buf += length; | ||
55 | while (cplen > 0) { | ||
56 | int l; | ||
57 | length += sprintf (buf, "C%s", compat); | ||
58 | buf += length; | ||
59 | l = strlen (compat) + 1; | ||
60 | compat += l; | ||
61 | cplen -= l; | ||
62 | } | ||
63 | |||
64 | return length; | ||
65 | } | ||
66 | |||
42 | macio_config_of_attr (name, "%s\n"); | 67 | macio_config_of_attr (name, "%s\n"); |
43 | macio_config_of_attr (type, "%s\n"); | 68 | macio_config_of_attr (type, "%s\n"); |
44 | 69 | ||
@@ -46,5 +71,6 @@ struct device_attribute macio_dev_attrs[] = { | |||
46 | __ATTR_RO(name), | 71 | __ATTR_RO(name), |
47 | __ATTR_RO(type), | 72 | __ATTR_RO(type), |
48 | __ATTR_RO(compatible), | 73 | __ATTR_RO(compatible), |
74 | __ATTR_RO(modalias), | ||
49 | __ATTR_NULL | 75 | __ATTR_NULL |
50 | }; | 76 | }; |
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index c0712a1ea5af..b856bb67169c 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c | |||
@@ -167,19 +167,19 @@ enum { | |||
167 | * Functions for polling content of media bay | 167 | * Functions for polling content of media bay |
168 | */ | 168 | */ |
169 | 169 | ||
170 | static u8 __pmac | 170 | static u8 |
171 | ohare_mb_content(struct media_bay_info *bay) | 171 | ohare_mb_content(struct media_bay_info *bay) |
172 | { | 172 | { |
173 | return (MB_IN32(bay, OHARE_MBCR) >> 12) & 7; | 173 | return (MB_IN32(bay, OHARE_MBCR) >> 12) & 7; |
174 | } | 174 | } |
175 | 175 | ||
176 | static u8 __pmac | 176 | static u8 |
177 | heathrow_mb_content(struct media_bay_info *bay) | 177 | heathrow_mb_content(struct media_bay_info *bay) |
178 | { | 178 | { |
179 | return (MB_IN32(bay, HEATHROW_MBCR) >> 12) & 7; | 179 | return (MB_IN32(bay, HEATHROW_MBCR) >> 12) & 7; |
180 | } | 180 | } |
181 | 181 | ||
182 | static u8 __pmac | 182 | static u8 |
183 | keylargo_mb_content(struct media_bay_info *bay) | 183 | keylargo_mb_content(struct media_bay_info *bay) |
184 | { | 184 | { |
185 | int new_gpio; | 185 | int new_gpio; |
@@ -205,7 +205,7 @@ keylargo_mb_content(struct media_bay_info *bay) | |||
205 | * into reset state as well | 205 | * into reset state as well |
206 | */ | 206 | */ |
207 | 207 | ||
208 | static void __pmac | 208 | static void |
209 | ohare_mb_power(struct media_bay_info* bay, int on_off) | 209 | ohare_mb_power(struct media_bay_info* bay, int on_off) |
210 | { | 210 | { |
211 | if (on_off) { | 211 | if (on_off) { |
@@ -224,7 +224,7 @@ ohare_mb_power(struct media_bay_info* bay, int on_off) | |||
224 | MB_BIC(bay, OHARE_MBCR, 0x00000F00); | 224 | MB_BIC(bay, OHARE_MBCR, 0x00000F00); |
225 | } | 225 | } |
226 | 226 | ||
227 | static void __pmac | 227 | static void |
228 | heathrow_mb_power(struct media_bay_info* bay, int on_off) | 228 | heathrow_mb_power(struct media_bay_info* bay, int on_off) |
229 | { | 229 | { |
230 | if (on_off) { | 230 | if (on_off) { |
@@ -243,7 +243,7 @@ heathrow_mb_power(struct media_bay_info* bay, int on_off) | |||
243 | MB_BIC(bay, HEATHROW_MBCR, 0x00000F00); | 243 | MB_BIC(bay, HEATHROW_MBCR, 0x00000F00); |
244 | } | 244 | } |
245 | 245 | ||
246 | static void __pmac | 246 | static void |
247 | keylargo_mb_power(struct media_bay_info* bay, int on_off) | 247 | keylargo_mb_power(struct media_bay_info* bay, int on_off) |
248 | { | 248 | { |
249 | if (on_off) { | 249 | if (on_off) { |
@@ -267,7 +267,7 @@ keylargo_mb_power(struct media_bay_info* bay, int on_off) | |||
267 | * enable the related busses | 267 | * enable the related busses |
268 | */ | 268 | */ |
269 | 269 | ||
270 | static int __pmac | 270 | static int |
271 | ohare_mb_setup_bus(struct media_bay_info* bay, u8 device_id) | 271 | ohare_mb_setup_bus(struct media_bay_info* bay, u8 device_id) |
272 | { | 272 | { |
273 | switch(device_id) { | 273 | switch(device_id) { |
@@ -287,7 +287,7 @@ ohare_mb_setup_bus(struct media_bay_info* bay, u8 device_id) | |||
287 | return -ENODEV; | 287 | return -ENODEV; |
288 | } | 288 | } |
289 | 289 | ||
290 | static int __pmac | 290 | static int |
291 | heathrow_mb_setup_bus(struct media_bay_info* bay, u8 device_id) | 291 | heathrow_mb_setup_bus(struct media_bay_info* bay, u8 device_id) |
292 | { | 292 | { |
293 | switch(device_id) { | 293 | switch(device_id) { |
@@ -307,7 +307,7 @@ heathrow_mb_setup_bus(struct media_bay_info* bay, u8 device_id) | |||
307 | return -ENODEV; | 307 | return -ENODEV; |
308 | } | 308 | } |
309 | 309 | ||
310 | static int __pmac | 310 | static int |
311 | keylargo_mb_setup_bus(struct media_bay_info* bay, u8 device_id) | 311 | keylargo_mb_setup_bus(struct media_bay_info* bay, u8 device_id) |
312 | { | 312 | { |
313 | switch(device_id) { | 313 | switch(device_id) { |
@@ -330,43 +330,43 @@ keylargo_mb_setup_bus(struct media_bay_info* bay, u8 device_id) | |||
330 | * Functions for tweaking resets | 330 | * Functions for tweaking resets |
331 | */ | 331 | */ |
332 | 332 | ||
333 | static void __pmac | 333 | static void |
334 | ohare_mb_un_reset(struct media_bay_info* bay) | 334 | ohare_mb_un_reset(struct media_bay_info* bay) |
335 | { | 335 | { |
336 | MB_BIS(bay, OHARE_FCR, OH_BAY_RESET_N); | 336 | MB_BIS(bay, OHARE_FCR, OH_BAY_RESET_N); |
337 | } | 337 | } |
338 | 338 | ||
339 | static void __pmac keylargo_mb_init(struct media_bay_info *bay) | 339 | static void keylargo_mb_init(struct media_bay_info *bay) |
340 | { | 340 | { |
341 | MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_ENABLE); | 341 | MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_ENABLE); |
342 | } | 342 | } |
343 | 343 | ||
344 | static void __pmac heathrow_mb_un_reset(struct media_bay_info* bay) | 344 | static void heathrow_mb_un_reset(struct media_bay_info* bay) |
345 | { | 345 | { |
346 | MB_BIS(bay, HEATHROW_FCR, HRW_BAY_RESET_N); | 346 | MB_BIS(bay, HEATHROW_FCR, HRW_BAY_RESET_N); |
347 | } | 347 | } |
348 | 348 | ||
349 | static void __pmac keylargo_mb_un_reset(struct media_bay_info* bay) | 349 | static void keylargo_mb_un_reset(struct media_bay_info* bay) |
350 | { | 350 | { |
351 | MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_DEV_RESET); | 351 | MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_DEV_RESET); |
352 | } | 352 | } |
353 | 353 | ||
354 | static void __pmac ohare_mb_un_reset_ide(struct media_bay_info* bay) | 354 | static void ohare_mb_un_reset_ide(struct media_bay_info* bay) |
355 | { | 355 | { |
356 | MB_BIS(bay, OHARE_FCR, OH_IDE1_RESET_N); | 356 | MB_BIS(bay, OHARE_FCR, OH_IDE1_RESET_N); |
357 | } | 357 | } |
358 | 358 | ||
359 | static void __pmac heathrow_mb_un_reset_ide(struct media_bay_info* bay) | 359 | static void heathrow_mb_un_reset_ide(struct media_bay_info* bay) |
360 | { | 360 | { |
361 | MB_BIS(bay, HEATHROW_FCR, HRW_IDE1_RESET_N); | 361 | MB_BIS(bay, HEATHROW_FCR, HRW_IDE1_RESET_N); |
362 | } | 362 | } |
363 | 363 | ||
364 | static void __pmac keylargo_mb_un_reset_ide(struct media_bay_info* bay) | 364 | static void keylargo_mb_un_reset_ide(struct media_bay_info* bay) |
365 | { | 365 | { |
366 | MB_BIS(bay, KEYLARGO_FCR1, KL1_EIDE0_RESET_N); | 366 | MB_BIS(bay, KEYLARGO_FCR1, KL1_EIDE0_RESET_N); |
367 | } | 367 | } |
368 | 368 | ||
369 | static inline void __pmac set_mb_power(struct media_bay_info* bay, int onoff) | 369 | static inline void set_mb_power(struct media_bay_info* bay, int onoff) |
370 | { | 370 | { |
371 | /* Power up up and assert the bay reset line */ | 371 | /* Power up up and assert the bay reset line */ |
372 | if (onoff) { | 372 | if (onoff) { |
@@ -382,7 +382,7 @@ static inline void __pmac set_mb_power(struct media_bay_info* bay, int onoff) | |||
382 | bay->timer = msecs_to_jiffies(MB_POWER_DELAY); | 382 | bay->timer = msecs_to_jiffies(MB_POWER_DELAY); |
383 | } | 383 | } |
384 | 384 | ||
385 | static void __pmac poll_media_bay(struct media_bay_info* bay) | 385 | static void poll_media_bay(struct media_bay_info* bay) |
386 | { | 386 | { |
387 | int id = bay->ops->content(bay); | 387 | int id = bay->ops->content(bay); |
388 | 388 | ||
@@ -415,7 +415,7 @@ static void __pmac poll_media_bay(struct media_bay_info* bay) | |||
415 | } | 415 | } |
416 | } | 416 | } |
417 | 417 | ||
418 | int __pmac check_media_bay(struct device_node *which_bay, int what) | 418 | int check_media_bay(struct device_node *which_bay, int what) |
419 | { | 419 | { |
420 | #ifdef CONFIG_BLK_DEV_IDE | 420 | #ifdef CONFIG_BLK_DEV_IDE |
421 | int i; | 421 | int i; |
@@ -432,7 +432,7 @@ int __pmac check_media_bay(struct device_node *which_bay, int what) | |||
432 | } | 432 | } |
433 | EXPORT_SYMBOL(check_media_bay); | 433 | EXPORT_SYMBOL(check_media_bay); |
434 | 434 | ||
435 | int __pmac check_media_bay_by_base(unsigned long base, int what) | 435 | int check_media_bay_by_base(unsigned long base, int what) |
436 | { | 436 | { |
437 | #ifdef CONFIG_BLK_DEV_IDE | 437 | #ifdef CONFIG_BLK_DEV_IDE |
438 | int i; | 438 | int i; |
@@ -449,7 +449,7 @@ int __pmac check_media_bay_by_base(unsigned long base, int what) | |||
449 | return -ENODEV; | 449 | return -ENODEV; |
450 | } | 450 | } |
451 | 451 | ||
452 | int __pmac media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base, | 452 | int media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base, |
453 | int irq, int index) | 453 | int irq, int index) |
454 | { | 454 | { |
455 | #ifdef CONFIG_BLK_DEV_IDE | 455 | #ifdef CONFIG_BLK_DEV_IDE |
@@ -489,7 +489,7 @@ int __pmac media_bay_set_ide_infos(struct device_node* which_bay, unsigned long | |||
489 | return -ENODEV; | 489 | return -ENODEV; |
490 | } | 490 | } |
491 | 491 | ||
492 | static void __pmac media_bay_step(int i) | 492 | static void media_bay_step(int i) |
493 | { | 493 | { |
494 | struct media_bay_info* bay = &media_bays[i]; | 494 | struct media_bay_info* bay = &media_bays[i]; |
495 | 495 | ||
@@ -619,7 +619,7 @@ static void __pmac media_bay_step(int i) | |||
619 | * with the IDE driver. It needs to be a thread because | 619 | * with the IDE driver. It needs to be a thread because |
620 | * ide_register can't be called from interrupt context. | 620 | * ide_register can't be called from interrupt context. |
621 | */ | 621 | */ |
622 | static int __pmac media_bay_task(void *x) | 622 | static int media_bay_task(void *x) |
623 | { | 623 | { |
624 | int i; | 624 | int i; |
625 | 625 | ||
@@ -704,7 +704,7 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_de | |||
704 | 704 | ||
705 | } | 705 | } |
706 | 706 | ||
707 | static int __pmac media_bay_suspend(struct macio_dev *mdev, pm_message_t state) | 707 | static int media_bay_suspend(struct macio_dev *mdev, pm_message_t state) |
708 | { | 708 | { |
709 | struct media_bay_info *bay = macio_get_drvdata(mdev); | 709 | struct media_bay_info *bay = macio_get_drvdata(mdev); |
710 | 710 | ||
@@ -719,7 +719,7 @@ static int __pmac media_bay_suspend(struct macio_dev *mdev, pm_message_t state) | |||
719 | return 0; | 719 | return 0; |
720 | } | 720 | } |
721 | 721 | ||
722 | static int __pmac media_bay_resume(struct macio_dev *mdev) | 722 | static int media_bay_resume(struct macio_dev *mdev) |
723 | { | 723 | { |
724 | struct media_bay_info *bay = macio_get_drvdata(mdev); | 724 | struct media_bay_info *bay = macio_get_drvdata(mdev); |
725 | 725 | ||
@@ -760,7 +760,7 @@ static int __pmac media_bay_resume(struct macio_dev *mdev) | |||
760 | 760 | ||
761 | /* Definitions of "ops" structures. | 761 | /* Definitions of "ops" structures. |
762 | */ | 762 | */ |
763 | static struct mb_ops ohare_mb_ops __pmacdata = { | 763 | static struct mb_ops ohare_mb_ops = { |
764 | .name = "Ohare", | 764 | .name = "Ohare", |
765 | .content = ohare_mb_content, | 765 | .content = ohare_mb_content, |
766 | .power = ohare_mb_power, | 766 | .power = ohare_mb_power, |
@@ -769,7 +769,7 @@ static struct mb_ops ohare_mb_ops __pmacdata = { | |||
769 | .un_reset_ide = ohare_mb_un_reset_ide, | 769 | .un_reset_ide = ohare_mb_un_reset_ide, |
770 | }; | 770 | }; |
771 | 771 | ||
772 | static struct mb_ops heathrow_mb_ops __pmacdata = { | 772 | static struct mb_ops heathrow_mb_ops = { |
773 | .name = "Heathrow", | 773 | .name = "Heathrow", |
774 | .content = heathrow_mb_content, | 774 | .content = heathrow_mb_content, |
775 | .power = heathrow_mb_power, | 775 | .power = heathrow_mb_power, |
@@ -778,7 +778,7 @@ static struct mb_ops heathrow_mb_ops __pmacdata = { | |||
778 | .un_reset_ide = heathrow_mb_un_reset_ide, | 778 | .un_reset_ide = heathrow_mb_un_reset_ide, |
779 | }; | 779 | }; |
780 | 780 | ||
781 | static struct mb_ops keylargo_mb_ops __pmacdata = { | 781 | static struct mb_ops keylargo_mb_ops = { |
782 | .name = "KeyLargo", | 782 | .name = "KeyLargo", |
783 | .init = keylargo_mb_init, | 783 | .init = keylargo_mb_init, |
784 | .content = keylargo_mb_content, | 784 | .content = keylargo_mb_content, |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 9b38674fbf75..34f3c7e2d832 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -1094,7 +1094,7 @@ static int smu_release(struct inode *inode, struct file *file) | |||
1094 | } | 1094 | } |
1095 | 1095 | ||
1096 | 1096 | ||
1097 | static struct file_operations smu_device_fops __pmacdata = { | 1097 | static struct file_operations smu_device_fops = { |
1098 | .llseek = no_llseek, | 1098 | .llseek = no_llseek, |
1099 | .read = smu_read, | 1099 | .read = smu_read, |
1100 | .write = smu_write, | 1100 | .write = smu_write, |
@@ -1103,7 +1103,7 @@ static struct file_operations smu_device_fops __pmacdata = { | |||
1103 | .release = smu_release, | 1103 | .release = smu_release, |
1104 | }; | 1104 | }; |
1105 | 1105 | ||
1106 | static struct miscdevice pmu_device __pmacdata = { | 1106 | static struct miscdevice pmu_device = { |
1107 | MISC_DYNAMIC_MINOR, "smu", &smu_device_fops | 1107 | MISC_DYNAMIC_MINOR, "smu", &smu_device_fops |
1108 | }; | 1108 | }; |
1109 | 1109 | ||
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c index 417deb5de108..d843a6c9c6df 100644 --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c | |||
@@ -37,7 +37,6 @@ static DEFINE_SPINLOCK(cuda_lock); | |||
37 | 37 | ||
38 | #ifdef CONFIG_MAC | 38 | #ifdef CONFIG_MAC |
39 | #define CUDA_IRQ IRQ_MAC_ADB | 39 | #define CUDA_IRQ IRQ_MAC_ADB |
40 | #define __openfirmware | ||
41 | #define eieio() | 40 | #define eieio() |
42 | #else | 41 | #else |
43 | #define CUDA_IRQ vias->intrs[0].line | 42 | #define CUDA_IRQ vias->intrs[0].line |
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 645a2e5c70ab..91920a1140fa 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -244,7 +244,7 @@ int pmu_wink(struct adb_request *req); | |||
244 | * - the number of response bytes which the PMU will return, or | 244 | * - the number of response bytes which the PMU will return, or |
245 | * -1 if it will send a length byte. | 245 | * -1 if it will send a length byte. |
246 | */ | 246 | */ |
247 | static const s8 pmu_data_len[256][2] __openfirmwaredata = { | 247 | static const s8 pmu_data_len[256][2] = { |
248 | /* 0 1 2 3 4 5 6 7 */ | 248 | /* 0 1 2 3 4 5 6 7 */ |
249 | /*00*/ {-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0}, | 249 | /*00*/ {-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0}, |
250 | /*08*/ {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, | 250 | /*08*/ {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, |
@@ -295,7 +295,7 @@ static struct backlight_controller pmu_backlight_controller = { | |||
295 | }; | 295 | }; |
296 | #endif /* CONFIG_PMAC_BACKLIGHT */ | 296 | #endif /* CONFIG_PMAC_BACKLIGHT */ |
297 | 297 | ||
298 | int __openfirmware | 298 | int |
299 | find_via_pmu(void) | 299 | find_via_pmu(void) |
300 | { | 300 | { |
301 | if (via != 0) | 301 | if (via != 0) |
@@ -374,7 +374,7 @@ find_via_pmu(void) | |||
374 | } | 374 | } |
375 | 375 | ||
376 | #ifdef CONFIG_ADB | 376 | #ifdef CONFIG_ADB |
377 | static int __openfirmware | 377 | static int |
378 | pmu_probe(void) | 378 | pmu_probe(void) |
379 | { | 379 | { |
380 | return vias == NULL? -ENODEV: 0; | 380 | return vias == NULL? -ENODEV: 0; |
@@ -405,7 +405,7 @@ static int __init via_pmu_start(void) | |||
405 | bright_req_2.complete = 1; | 405 | bright_req_2.complete = 1; |
406 | batt_req.complete = 1; | 406 | batt_req.complete = 1; |
407 | 407 | ||
408 | #ifdef CONFIG_PPC32 | 408 | #if defined(CONFIG_PPC32) && !defined(CONFIG_PPC_MERGE) |
409 | if (pmu_kind == PMU_KEYLARGO_BASED) | 409 | if (pmu_kind == PMU_KEYLARGO_BASED) |
410 | openpic_set_irq_priority(vias->intrs[0].line, | 410 | openpic_set_irq_priority(vias->intrs[0].line, |
411 | OPENPIC_PRIORITY_DEFAULT + 1); | 411 | OPENPIC_PRIORITY_DEFAULT + 1); |
@@ -520,7 +520,7 @@ static int __init via_pmu_dev_init(void) | |||
520 | 520 | ||
521 | device_initcall(via_pmu_dev_init); | 521 | device_initcall(via_pmu_dev_init); |
522 | 522 | ||
523 | static int __openfirmware | 523 | static int |
524 | init_pmu(void) | 524 | init_pmu(void) |
525 | { | 525 | { |
526 | int timeout; | 526 | int timeout; |
@@ -588,17 +588,6 @@ pmu_get_model(void) | |||
588 | return pmu_kind; | 588 | return pmu_kind; |
589 | } | 589 | } |
590 | 590 | ||
591 | #ifndef CONFIG_PPC64 | ||
592 | static inline void wakeup_decrementer(void) | ||
593 | { | ||
594 | set_dec(tb_ticks_per_jiffy); | ||
595 | /* No currently-supported powerbook has a 601, | ||
596 | * so use get_tbl, not native | ||
597 | */ | ||
598 | last_jiffy_stamp(0) = tb_last_stamp = get_tbl(); | ||
599 | } | ||
600 | #endif | ||
601 | |||
602 | static void pmu_set_server_mode(int server_mode) | 591 | static void pmu_set_server_mode(int server_mode) |
603 | { | 592 | { |
604 | struct adb_request req; | 593 | struct adb_request req; |
@@ -625,7 +614,7 @@ static void pmu_set_server_mode(int server_mode) | |||
625 | /* This new version of the code for 2400/3400/3500 powerbooks | 614 | /* This new version of the code for 2400/3400/3500 powerbooks |
626 | * is inspired from the implementation in gkrellm-pmu | 615 | * is inspired from the implementation in gkrellm-pmu |
627 | */ | 616 | */ |
628 | static void __pmac | 617 | static void |
629 | done_battery_state_ohare(struct adb_request* req) | 618 | done_battery_state_ohare(struct adb_request* req) |
630 | { | 619 | { |
631 | /* format: | 620 | /* format: |
@@ -713,7 +702,7 @@ done_battery_state_ohare(struct adb_request* req) | |||
713 | clear_bit(0, &async_req_locks); | 702 | clear_bit(0, &async_req_locks); |
714 | } | 703 | } |
715 | 704 | ||
716 | static void __pmac | 705 | static void |
717 | done_battery_state_smart(struct adb_request* req) | 706 | done_battery_state_smart(struct adb_request* req) |
718 | { | 707 | { |
719 | /* format: | 708 | /* format: |
@@ -791,7 +780,7 @@ done_battery_state_smart(struct adb_request* req) | |||
791 | clear_bit(0, &async_req_locks); | 780 | clear_bit(0, &async_req_locks); |
792 | } | 781 | } |
793 | 782 | ||
794 | static void __pmac | 783 | static void |
795 | query_battery_state(void) | 784 | query_battery_state(void) |
796 | { | 785 | { |
797 | if (test_and_set_bit(0, &async_req_locks)) | 786 | if (test_and_set_bit(0, &async_req_locks)) |
@@ -804,7 +793,7 @@ query_battery_state(void) | |||
804 | 2, PMU_SMART_BATTERY_STATE, pmu_cur_battery+1); | 793 | 2, PMU_SMART_BATTERY_STATE, pmu_cur_battery+1); |
805 | } | 794 | } |
806 | 795 | ||
807 | static int __pmac | 796 | static int |
808 | proc_get_info(char *page, char **start, off_t off, | 797 | proc_get_info(char *page, char **start, off_t off, |
809 | int count, int *eof, void *data) | 798 | int count, int *eof, void *data) |
810 | { | 799 | { |
@@ -819,7 +808,7 @@ proc_get_info(char *page, char **start, off_t off, | |||
819 | return p - page; | 808 | return p - page; |
820 | } | 809 | } |
821 | 810 | ||
822 | static int __pmac | 811 | static int |
823 | proc_get_irqstats(char *page, char **start, off_t off, | 812 | proc_get_irqstats(char *page, char **start, off_t off, |
824 | int count, int *eof, void *data) | 813 | int count, int *eof, void *data) |
825 | { | 814 | { |
@@ -846,7 +835,7 @@ proc_get_irqstats(char *page, char **start, off_t off, | |||
846 | return p - page; | 835 | return p - page; |
847 | } | 836 | } |
848 | 837 | ||
849 | static int __pmac | 838 | static int |
850 | proc_get_batt(char *page, char **start, off_t off, | 839 | proc_get_batt(char *page, char **start, off_t off, |
851 | int count, int *eof, void *data) | 840 | int count, int *eof, void *data) |
852 | { | 841 | { |
@@ -870,7 +859,7 @@ proc_get_batt(char *page, char **start, off_t off, | |||
870 | return p - page; | 859 | return p - page; |
871 | } | 860 | } |
872 | 861 | ||
873 | static int __pmac | 862 | static int |
874 | proc_read_options(char *page, char **start, off_t off, | 863 | proc_read_options(char *page, char **start, off_t off, |
875 | int count, int *eof, void *data) | 864 | int count, int *eof, void *data) |
876 | { | 865 | { |
@@ -887,7 +876,7 @@ proc_read_options(char *page, char **start, off_t off, | |||
887 | return p - page; | 876 | return p - page; |
888 | } | 877 | } |
889 | 878 | ||
890 | static int __pmac | 879 | static int |
891 | proc_write_options(struct file *file, const char __user *buffer, | 880 | proc_write_options(struct file *file, const char __user *buffer, |
892 | unsigned long count, void *data) | 881 | unsigned long count, void *data) |
893 | { | 882 | { |
@@ -934,7 +923,7 @@ proc_write_options(struct file *file, const char __user *buffer, | |||
934 | 923 | ||
935 | #ifdef CONFIG_ADB | 924 | #ifdef CONFIG_ADB |
936 | /* Send an ADB command */ | 925 | /* Send an ADB command */ |
937 | static int __pmac | 926 | static int |
938 | pmu_send_request(struct adb_request *req, int sync) | 927 | pmu_send_request(struct adb_request *req, int sync) |
939 | { | 928 | { |
940 | int i, ret; | 929 | int i, ret; |
@@ -1014,7 +1003,7 @@ pmu_send_request(struct adb_request *req, int sync) | |||
1014 | } | 1003 | } |
1015 | 1004 | ||
1016 | /* Enable/disable autopolling */ | 1005 | /* Enable/disable autopolling */ |
1017 | static int __pmac | 1006 | static int |
1018 | pmu_adb_autopoll(int devs) | 1007 | pmu_adb_autopoll(int devs) |
1019 | { | 1008 | { |
1020 | struct adb_request req; | 1009 | struct adb_request req; |
@@ -1037,7 +1026,7 @@ pmu_adb_autopoll(int devs) | |||
1037 | } | 1026 | } |
1038 | 1027 | ||
1039 | /* Reset the ADB bus */ | 1028 | /* Reset the ADB bus */ |
1040 | static int __pmac | 1029 | static int |
1041 | pmu_adb_reset_bus(void) | 1030 | pmu_adb_reset_bus(void) |
1042 | { | 1031 | { |
1043 | struct adb_request req; | 1032 | struct adb_request req; |
@@ -1072,7 +1061,7 @@ pmu_adb_reset_bus(void) | |||
1072 | #endif /* CONFIG_ADB */ | 1061 | #endif /* CONFIG_ADB */ |
1073 | 1062 | ||
1074 | /* Construct and send a pmu request */ | 1063 | /* Construct and send a pmu request */ |
1075 | int __openfirmware | 1064 | int |
1076 | pmu_request(struct adb_request *req, void (*done)(struct adb_request *), | 1065 | pmu_request(struct adb_request *req, void (*done)(struct adb_request *), |
1077 | int nbytes, ...) | 1066 | int nbytes, ...) |
1078 | { | 1067 | { |
@@ -1098,7 +1087,7 @@ pmu_request(struct adb_request *req, void (*done)(struct adb_request *), | |||
1098 | return pmu_queue_request(req); | 1087 | return pmu_queue_request(req); |
1099 | } | 1088 | } |
1100 | 1089 | ||
1101 | int __pmac | 1090 | int |
1102 | pmu_queue_request(struct adb_request *req) | 1091 | pmu_queue_request(struct adb_request *req) |
1103 | { | 1092 | { |
1104 | unsigned long flags; | 1093 | unsigned long flags; |
@@ -1190,7 +1179,7 @@ pmu_done(struct adb_request *req) | |||
1190 | (*done)(req); | 1179 | (*done)(req); |
1191 | } | 1180 | } |
1192 | 1181 | ||
1193 | static void __pmac | 1182 | static void |
1194 | pmu_start(void) | 1183 | pmu_start(void) |
1195 | { | 1184 | { |
1196 | struct adb_request *req; | 1185 | struct adb_request *req; |
@@ -1214,7 +1203,7 @@ pmu_start(void) | |||
1214 | send_byte(req->data[0]); | 1203 | send_byte(req->data[0]); |
1215 | } | 1204 | } |
1216 | 1205 | ||
1217 | void __openfirmware | 1206 | void |
1218 | pmu_poll(void) | 1207 | pmu_poll(void) |
1219 | { | 1208 | { |
1220 | if (!via) | 1209 | if (!via) |
@@ -1224,7 +1213,7 @@ pmu_poll(void) | |||
1224 | via_pmu_interrupt(0, NULL, NULL); | 1213 | via_pmu_interrupt(0, NULL, NULL); |
1225 | } | 1214 | } |
1226 | 1215 | ||
1227 | void __openfirmware | 1216 | void |
1228 | pmu_poll_adb(void) | 1217 | pmu_poll_adb(void) |
1229 | { | 1218 | { |
1230 | if (!via) | 1219 | if (!via) |
@@ -1239,7 +1228,7 @@ pmu_poll_adb(void) | |||
1239 | || req_awaiting_reply)); | 1228 | || req_awaiting_reply)); |
1240 | } | 1229 | } |
1241 | 1230 | ||
1242 | void __openfirmware | 1231 | void |
1243 | pmu_wait_complete(struct adb_request *req) | 1232 | pmu_wait_complete(struct adb_request *req) |
1244 | { | 1233 | { |
1245 | if (!via) | 1234 | if (!via) |
@@ -1253,7 +1242,7 @@ pmu_wait_complete(struct adb_request *req) | |||
1253 | * This is done to avoid spurrious shutdowns when we know we'll have | 1242 | * This is done to avoid spurrious shutdowns when we know we'll have |
1254 | * interrupts switched off for a long time | 1243 | * interrupts switched off for a long time |
1255 | */ | 1244 | */ |
1256 | void __openfirmware | 1245 | void |
1257 | pmu_suspend(void) | 1246 | pmu_suspend(void) |
1258 | { | 1247 | { |
1259 | unsigned long flags; | 1248 | unsigned long flags; |
@@ -1293,7 +1282,7 @@ pmu_suspend(void) | |||
1293 | } while (1); | 1282 | } while (1); |
1294 | } | 1283 | } |
1295 | 1284 | ||
1296 | void __openfirmware | 1285 | void |
1297 | pmu_resume(void) | 1286 | pmu_resume(void) |
1298 | { | 1287 | { |
1299 | unsigned long flags; | 1288 | unsigned long flags; |
@@ -1323,7 +1312,7 @@ pmu_resume(void) | |||
1323 | } | 1312 | } |
1324 | 1313 | ||
1325 | /* Interrupt data could be the result data from an ADB cmd */ | 1314 | /* Interrupt data could be the result data from an ADB cmd */ |
1326 | static void __pmac | 1315 | static void |
1327 | pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs) | 1316 | pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs) |
1328 | { | 1317 | { |
1329 | unsigned char ints, pirq; | 1318 | unsigned char ints, pirq; |
@@ -1435,7 +1424,7 @@ next: | |||
1435 | goto next; | 1424 | goto next; |
1436 | } | 1425 | } |
1437 | 1426 | ||
1438 | static struct adb_request* __pmac | 1427 | static struct adb_request* |
1439 | pmu_sr_intr(struct pt_regs *regs) | 1428 | pmu_sr_intr(struct pt_regs *regs) |
1440 | { | 1429 | { |
1441 | struct adb_request *req; | 1430 | struct adb_request *req; |
@@ -1541,7 +1530,7 @@ pmu_sr_intr(struct pt_regs *regs) | |||
1541 | return NULL; | 1530 | return NULL; |
1542 | } | 1531 | } |
1543 | 1532 | ||
1544 | static irqreturn_t __pmac | 1533 | static irqreturn_t |
1545 | via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs) | 1534 | via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs) |
1546 | { | 1535 | { |
1547 | unsigned long flags; | 1536 | unsigned long flags; |
@@ -1629,7 +1618,7 @@ no_free_slot: | |||
1629 | return IRQ_RETVAL(handled); | 1618 | return IRQ_RETVAL(handled); |
1630 | } | 1619 | } |
1631 | 1620 | ||
1632 | void __pmac | 1621 | void |
1633 | pmu_unlock(void) | 1622 | pmu_unlock(void) |
1634 | { | 1623 | { |
1635 | unsigned long flags; | 1624 | unsigned long flags; |
@@ -1642,7 +1631,7 @@ pmu_unlock(void) | |||
1642 | } | 1631 | } |
1643 | 1632 | ||
1644 | 1633 | ||
1645 | static irqreturn_t __pmac | 1634 | static irqreturn_t |
1646 | gpio1_interrupt(int irq, void *arg, struct pt_regs *regs) | 1635 | gpio1_interrupt(int irq, void *arg, struct pt_regs *regs) |
1647 | { | 1636 | { |
1648 | unsigned long flags; | 1637 | unsigned long flags; |
@@ -1663,12 +1652,12 @@ gpio1_interrupt(int irq, void *arg, struct pt_regs *regs) | |||
1663 | } | 1652 | } |
1664 | 1653 | ||
1665 | #ifdef CONFIG_PMAC_BACKLIGHT | 1654 | #ifdef CONFIG_PMAC_BACKLIGHT |
1666 | static int backlight_to_bright[] __pmacdata = { | 1655 | static int backlight_to_bright[] = { |
1667 | 0x7f, 0x46, 0x42, 0x3e, 0x3a, 0x36, 0x32, 0x2e, | 1656 | 0x7f, 0x46, 0x42, 0x3e, 0x3a, 0x36, 0x32, 0x2e, |
1668 | 0x2a, 0x26, 0x22, 0x1e, 0x1a, 0x16, 0x12, 0x0e | 1657 | 0x2a, 0x26, 0x22, 0x1e, 0x1a, 0x16, 0x12, 0x0e |
1669 | }; | 1658 | }; |
1670 | 1659 | ||
1671 | static int __openfirmware | 1660 | static int |
1672 | pmu_set_backlight_enable(int on, int level, void* data) | 1661 | pmu_set_backlight_enable(int on, int level, void* data) |
1673 | { | 1662 | { |
1674 | struct adb_request req; | 1663 | struct adb_request req; |
@@ -1688,7 +1677,7 @@ pmu_set_backlight_enable(int on, int level, void* data) | |||
1688 | return 0; | 1677 | return 0; |
1689 | } | 1678 | } |
1690 | 1679 | ||
1691 | static void __openfirmware | 1680 | static void |
1692 | pmu_bright_complete(struct adb_request *req) | 1681 | pmu_bright_complete(struct adb_request *req) |
1693 | { | 1682 | { |
1694 | if (req == &bright_req_1) | 1683 | if (req == &bright_req_1) |
@@ -1697,7 +1686,7 @@ pmu_bright_complete(struct adb_request *req) | |||
1697 | clear_bit(2, &async_req_locks); | 1686 | clear_bit(2, &async_req_locks); |
1698 | } | 1687 | } |
1699 | 1688 | ||
1700 | static int __openfirmware | 1689 | static int |
1701 | pmu_set_backlight_level(int level, void* data) | 1690 | pmu_set_backlight_level(int level, void* data) |
1702 | { | 1691 | { |
1703 | if (vias == NULL) | 1692 | if (vias == NULL) |
@@ -1717,7 +1706,7 @@ pmu_set_backlight_level(int level, void* data) | |||
1717 | } | 1706 | } |
1718 | #endif /* CONFIG_PMAC_BACKLIGHT */ | 1707 | #endif /* CONFIG_PMAC_BACKLIGHT */ |
1719 | 1708 | ||
1720 | void __pmac | 1709 | void |
1721 | pmu_enable_irled(int on) | 1710 | pmu_enable_irled(int on) |
1722 | { | 1711 | { |
1723 | struct adb_request req; | 1712 | struct adb_request req; |
@@ -1732,7 +1721,7 @@ pmu_enable_irled(int on) | |||
1732 | pmu_wait_complete(&req); | 1721 | pmu_wait_complete(&req); |
1733 | } | 1722 | } |
1734 | 1723 | ||
1735 | void __pmac | 1724 | void |
1736 | pmu_restart(void) | 1725 | pmu_restart(void) |
1737 | { | 1726 | { |
1738 | struct adb_request req; | 1727 | struct adb_request req; |
@@ -1757,7 +1746,7 @@ pmu_restart(void) | |||
1757 | ; | 1746 | ; |
1758 | } | 1747 | } |
1759 | 1748 | ||
1760 | void __pmac | 1749 | void |
1761 | pmu_shutdown(void) | 1750 | pmu_shutdown(void) |
1762 | { | 1751 | { |
1763 | struct adb_request req; | 1752 | struct adb_request req; |
@@ -2076,7 +2065,7 @@ pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* n) | |||
2076 | } | 2065 | } |
2077 | 2066 | ||
2078 | /* Sleep is broadcast last-to-first */ | 2067 | /* Sleep is broadcast last-to-first */ |
2079 | static int __pmac | 2068 | static int |
2080 | broadcast_sleep(int when, int fallback) | 2069 | broadcast_sleep(int when, int fallback) |
2081 | { | 2070 | { |
2082 | int ret = PBOOK_SLEEP_OK; | 2071 | int ret = PBOOK_SLEEP_OK; |
@@ -2101,7 +2090,7 @@ broadcast_sleep(int when, int fallback) | |||
2101 | } | 2090 | } |
2102 | 2091 | ||
2103 | /* Wake is broadcast first-to-last */ | 2092 | /* Wake is broadcast first-to-last */ |
2104 | static int __pmac | 2093 | static int |
2105 | broadcast_wake(void) | 2094 | broadcast_wake(void) |
2106 | { | 2095 | { |
2107 | int ret = PBOOK_SLEEP_OK; | 2096 | int ret = PBOOK_SLEEP_OK; |
@@ -2132,7 +2121,7 @@ static struct pci_save { | |||
2132 | } *pbook_pci_saves; | 2121 | } *pbook_pci_saves; |
2133 | static int pbook_npci_saves; | 2122 | static int pbook_npci_saves; |
2134 | 2123 | ||
2135 | static void __pmac | 2124 | static void |
2136 | pbook_alloc_pci_save(void) | 2125 | pbook_alloc_pci_save(void) |
2137 | { | 2126 | { |
2138 | int npci; | 2127 | int npci; |
@@ -2149,7 +2138,7 @@ pbook_alloc_pci_save(void) | |||
2149 | pbook_npci_saves = npci; | 2138 | pbook_npci_saves = npci; |
2150 | } | 2139 | } |
2151 | 2140 | ||
2152 | static void __pmac | 2141 | static void |
2153 | pbook_free_pci_save(void) | 2142 | pbook_free_pci_save(void) |
2154 | { | 2143 | { |
2155 | if (pbook_pci_saves == NULL) | 2144 | if (pbook_pci_saves == NULL) |
@@ -2159,7 +2148,7 @@ pbook_free_pci_save(void) | |||
2159 | pbook_npci_saves = 0; | 2148 | pbook_npci_saves = 0; |
2160 | } | 2149 | } |
2161 | 2150 | ||
2162 | static void __pmac | 2151 | static void |
2163 | pbook_pci_save(void) | 2152 | pbook_pci_save(void) |
2164 | { | 2153 | { |
2165 | struct pci_save *ps = pbook_pci_saves; | 2154 | struct pci_save *ps = pbook_pci_saves; |
@@ -2190,7 +2179,7 @@ pbook_pci_save(void) | |||
2190 | * during boot, it will be in the pci dev list. If it's disabled at this point | 2179 | * during boot, it will be in the pci dev list. If it's disabled at this point |
2191 | * (and it will probably be), then you can't access it's config space. | 2180 | * (and it will probably be), then you can't access it's config space. |
2192 | */ | 2181 | */ |
2193 | static void __pmac | 2182 | static void |
2194 | pbook_pci_restore(void) | 2183 | pbook_pci_restore(void) |
2195 | { | 2184 | { |
2196 | u16 cmd; | 2185 | u16 cmd; |
@@ -2238,7 +2227,7 @@ pbook_pci_restore(void) | |||
2238 | 2227 | ||
2239 | #ifdef DEBUG_SLEEP | 2228 | #ifdef DEBUG_SLEEP |
2240 | /* N.B. This doesn't work on the 3400 */ | 2229 | /* N.B. This doesn't work on the 3400 */ |
2241 | void __pmac | 2230 | void |
2242 | pmu_blink(int n) | 2231 | pmu_blink(int n) |
2243 | { | 2232 | { |
2244 | struct adb_request req; | 2233 | struct adb_request req; |
@@ -2277,9 +2266,9 @@ pmu_blink(int n) | |||
2277 | * Put the powerbook to sleep. | 2266 | * Put the powerbook to sleep. |
2278 | */ | 2267 | */ |
2279 | 2268 | ||
2280 | static u32 save_via[8] __pmacdata; | 2269 | static u32 save_via[8]; |
2281 | 2270 | ||
2282 | static void __pmac | 2271 | static void |
2283 | save_via_state(void) | 2272 | save_via_state(void) |
2284 | { | 2273 | { |
2285 | save_via[0] = in_8(&via[ANH]); | 2274 | save_via[0] = in_8(&via[ANH]); |
@@ -2291,7 +2280,7 @@ save_via_state(void) | |||
2291 | save_via[6] = in_8(&via[T1CL]); | 2280 | save_via[6] = in_8(&via[T1CL]); |
2292 | save_via[7] = in_8(&via[T1CH]); | 2281 | save_via[7] = in_8(&via[T1CH]); |
2293 | } | 2282 | } |
2294 | static void __pmac | 2283 | static void |
2295 | restore_via_state(void) | 2284 | restore_via_state(void) |
2296 | { | 2285 | { |
2297 | out_8(&via[ANH], save_via[0]); | 2286 | out_8(&via[ANH], save_via[0]); |
@@ -2307,7 +2296,7 @@ restore_via_state(void) | |||
2307 | out_8(&via[IER], IER_SET | SR_INT | CB1_INT); | 2296 | out_8(&via[IER], IER_SET | SR_INT | CB1_INT); |
2308 | } | 2297 | } |
2309 | 2298 | ||
2310 | static int __pmac | 2299 | static int |
2311 | pmac_suspend_devices(void) | 2300 | pmac_suspend_devices(void) |
2312 | { | 2301 | { |
2313 | int ret; | 2302 | int ret; |
@@ -2397,7 +2386,7 @@ pmac_suspend_devices(void) | |||
2397 | return 0; | 2386 | return 0; |
2398 | } | 2387 | } |
2399 | 2388 | ||
2400 | static int __pmac | 2389 | static int |
2401 | pmac_wakeup_devices(void) | 2390 | pmac_wakeup_devices(void) |
2402 | { | 2391 | { |
2403 | mdelay(100); | 2392 | mdelay(100); |
@@ -2436,7 +2425,7 @@ pmac_wakeup_devices(void) | |||
2436 | #define GRACKLE_NAP (1<<4) | 2425 | #define GRACKLE_NAP (1<<4) |
2437 | #define GRACKLE_SLEEP (1<<3) | 2426 | #define GRACKLE_SLEEP (1<<3) |
2438 | 2427 | ||
2439 | int __pmac | 2428 | int |
2440 | powerbook_sleep_grackle(void) | 2429 | powerbook_sleep_grackle(void) |
2441 | { | 2430 | { |
2442 | unsigned long save_l2cr; | 2431 | unsigned long save_l2cr; |
@@ -2520,7 +2509,7 @@ powerbook_sleep_grackle(void) | |||
2520 | return 0; | 2509 | return 0; |
2521 | } | 2510 | } |
2522 | 2511 | ||
2523 | static int __pmac | 2512 | static int |
2524 | powerbook_sleep_Core99(void) | 2513 | powerbook_sleep_Core99(void) |
2525 | { | 2514 | { |
2526 | unsigned long save_l2cr; | 2515 | unsigned long save_l2cr; |
@@ -2620,7 +2609,7 @@ powerbook_sleep_Core99(void) | |||
2620 | #define PB3400_MEM_CTRL 0xf8000000 | 2609 | #define PB3400_MEM_CTRL 0xf8000000 |
2621 | #define PB3400_MEM_CTRL_SLEEP 0x70 | 2610 | #define PB3400_MEM_CTRL_SLEEP 0x70 |
2622 | 2611 | ||
2623 | static int __pmac | 2612 | static int |
2624 | powerbook_sleep_3400(void) | 2613 | powerbook_sleep_3400(void) |
2625 | { | 2614 | { |
2626 | int ret, i, x; | 2615 | int ret, i, x; |
@@ -2720,9 +2709,9 @@ struct pmu_private { | |||
2720 | }; | 2709 | }; |
2721 | 2710 | ||
2722 | static LIST_HEAD(all_pmu_pvt); | 2711 | static LIST_HEAD(all_pmu_pvt); |
2723 | static DEFINE_SPINLOCK(all_pvt_lock __pmacdata); | 2712 | static DEFINE_SPINLOCK(all_pvt_lock); |
2724 | 2713 | ||
2725 | static void __pmac | 2714 | static void |
2726 | pmu_pass_intr(unsigned char *data, int len) | 2715 | pmu_pass_intr(unsigned char *data, int len) |
2727 | { | 2716 | { |
2728 | struct pmu_private *pp; | 2717 | struct pmu_private *pp; |
@@ -2751,7 +2740,7 @@ pmu_pass_intr(unsigned char *data, int len) | |||
2751 | spin_unlock_irqrestore(&all_pvt_lock, flags); | 2740 | spin_unlock_irqrestore(&all_pvt_lock, flags); |
2752 | } | 2741 | } |
2753 | 2742 | ||
2754 | static int __pmac | 2743 | static int |
2755 | pmu_open(struct inode *inode, struct file *file) | 2744 | pmu_open(struct inode *inode, struct file *file) |
2756 | { | 2745 | { |
2757 | struct pmu_private *pp; | 2746 | struct pmu_private *pp; |
@@ -2773,7 +2762,7 @@ pmu_open(struct inode *inode, struct file *file) | |||
2773 | return 0; | 2762 | return 0; |
2774 | } | 2763 | } |
2775 | 2764 | ||
2776 | static ssize_t __pmac | 2765 | static ssize_t |
2777 | pmu_read(struct file *file, char __user *buf, | 2766 | pmu_read(struct file *file, char __user *buf, |
2778 | size_t count, loff_t *ppos) | 2767 | size_t count, loff_t *ppos) |
2779 | { | 2768 | { |
@@ -2825,14 +2814,14 @@ pmu_read(struct file *file, char __user *buf, | |||
2825 | return ret; | 2814 | return ret; |
2826 | } | 2815 | } |
2827 | 2816 | ||
2828 | static ssize_t __pmac | 2817 | static ssize_t |
2829 | pmu_write(struct file *file, const char __user *buf, | 2818 | pmu_write(struct file *file, const char __user *buf, |
2830 | size_t count, loff_t *ppos) | 2819 | size_t count, loff_t *ppos) |
2831 | { | 2820 | { |
2832 | return 0; | 2821 | return 0; |
2833 | } | 2822 | } |
2834 | 2823 | ||
2835 | static unsigned int __pmac | 2824 | static unsigned int |
2836 | pmu_fpoll(struct file *filp, poll_table *wait) | 2825 | pmu_fpoll(struct file *filp, poll_table *wait) |
2837 | { | 2826 | { |
2838 | struct pmu_private *pp = filp->private_data; | 2827 | struct pmu_private *pp = filp->private_data; |
@@ -2849,7 +2838,7 @@ pmu_fpoll(struct file *filp, poll_table *wait) | |||
2849 | return mask; | 2838 | return mask; |
2850 | } | 2839 | } |
2851 | 2840 | ||
2852 | static int __pmac | 2841 | static int |
2853 | pmu_release(struct inode *inode, struct file *file) | 2842 | pmu_release(struct inode *inode, struct file *file) |
2854 | { | 2843 | { |
2855 | struct pmu_private *pp = file->private_data; | 2844 | struct pmu_private *pp = file->private_data; |
@@ -2874,8 +2863,7 @@ pmu_release(struct inode *inode, struct file *file) | |||
2874 | return 0; | 2863 | return 0; |
2875 | } | 2864 | } |
2876 | 2865 | ||
2877 | /* Note: removed __openfirmware here since it causes link errors */ | 2866 | static int |
2878 | static int __pmac | ||
2879 | pmu_ioctl(struct inode * inode, struct file *filp, | 2867 | pmu_ioctl(struct inode * inode, struct file *filp, |
2880 | u_int cmd, u_long arg) | 2868 | u_int cmd, u_long arg) |
2881 | { | 2869 | { |
@@ -2957,7 +2945,7 @@ pmu_ioctl(struct inode * inode, struct file *filp, | |||
2957 | return error; | 2945 | return error; |
2958 | } | 2946 | } |
2959 | 2947 | ||
2960 | static struct file_operations pmu_device_fops __pmacdata = { | 2948 | static struct file_operations pmu_device_fops = { |
2961 | .read = pmu_read, | 2949 | .read = pmu_read, |
2962 | .write = pmu_write, | 2950 | .write = pmu_write, |
2963 | .poll = pmu_fpoll, | 2951 | .poll = pmu_fpoll, |
@@ -2966,7 +2954,7 @@ static struct file_operations pmu_device_fops __pmacdata = { | |||
2966 | .release = pmu_release, | 2954 | .release = pmu_release, |
2967 | }; | 2955 | }; |
2968 | 2956 | ||
2969 | static struct miscdevice pmu_device __pmacdata = { | 2957 | static struct miscdevice pmu_device = { |
2970 | PMU_MINOR, "pmu", &pmu_device_fops | 2958 | PMU_MINOR, "pmu", &pmu_device_fops |
2971 | }; | 2959 | }; |
2972 | 2960 | ||
@@ -2982,7 +2970,7 @@ device_initcall(pmu_device_init); | |||
2982 | 2970 | ||
2983 | 2971 | ||
2984 | #ifdef DEBUG_SLEEP | 2972 | #ifdef DEBUG_SLEEP |
2985 | static inline void __pmac | 2973 | static inline void |
2986 | polled_handshake(volatile unsigned char __iomem *via) | 2974 | polled_handshake(volatile unsigned char __iomem *via) |
2987 | { | 2975 | { |
2988 | via[B] &= ~TREQ; eieio(); | 2976 | via[B] &= ~TREQ; eieio(); |
@@ -2993,7 +2981,7 @@ polled_handshake(volatile unsigned char __iomem *via) | |||
2993 | ; | 2981 | ; |
2994 | } | 2982 | } |
2995 | 2983 | ||
2996 | static inline void __pmac | 2984 | static inline void |
2997 | polled_send_byte(volatile unsigned char __iomem *via, int x) | 2985 | polled_send_byte(volatile unsigned char __iomem *via, int x) |
2998 | { | 2986 | { |
2999 | via[ACR] |= SR_OUT | SR_EXT; eieio(); | 2987 | via[ACR] |= SR_OUT | SR_EXT; eieio(); |
@@ -3001,7 +2989,7 @@ polled_send_byte(volatile unsigned char __iomem *via, int x) | |||
3001 | polled_handshake(via); | 2989 | polled_handshake(via); |
3002 | } | 2990 | } |
3003 | 2991 | ||
3004 | static inline int __pmac | 2992 | static inline int |
3005 | polled_recv_byte(volatile unsigned char __iomem *via) | 2993 | polled_recv_byte(volatile unsigned char __iomem *via) |
3006 | { | 2994 | { |
3007 | int x; | 2995 | int x; |
@@ -3013,7 +3001,7 @@ polled_recv_byte(volatile unsigned char __iomem *via) | |||
3013 | return x; | 3001 | return x; |
3014 | } | 3002 | } |
3015 | 3003 | ||
3016 | int __pmac | 3004 | int |
3017 | pmu_polled_request(struct adb_request *req) | 3005 | pmu_polled_request(struct adb_request *req) |
3018 | { | 3006 | { |
3019 | unsigned long flags; | 3007 | unsigned long flags; |
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c index 820dc52e30bc..6f80d76ac17c 100644 --- a/drivers/macintosh/via-pmu68k.c +++ b/drivers/macintosh/via-pmu68k.c | |||
@@ -835,7 +835,7 @@ static struct pci_save { | |||
835 | } *pbook_pci_saves; | 835 | } *pbook_pci_saves; |
836 | static int n_pbook_pci_saves; | 836 | static int n_pbook_pci_saves; |
837 | 837 | ||
838 | static inline void __openfirmware | 838 | static inline void |
839 | pbook_pci_save(void) | 839 | pbook_pci_save(void) |
840 | { | 840 | { |
841 | int npci; | 841 | int npci; |
@@ -863,7 +863,7 @@ pbook_pci_save(void) | |||
863 | } | 863 | } |
864 | } | 864 | } |
865 | 865 | ||
866 | static inline void __openfirmware | 866 | static inline void |
867 | pbook_pci_restore(void) | 867 | pbook_pci_restore(void) |
868 | { | 868 | { |
869 | u16 cmd; | 869 | u16 cmd; |
@@ -902,7 +902,7 @@ pbook_pci_restore(void) | |||
902 | #define IRQ_ENABLE ((unsigned int *)0xf3000024) | 902 | #define IRQ_ENABLE ((unsigned int *)0xf3000024) |
903 | #define MEM_CTRL ((unsigned int *)0xf8000070) | 903 | #define MEM_CTRL ((unsigned int *)0xf8000070) |
904 | 904 | ||
905 | int __openfirmware powerbook_sleep(void) | 905 | int powerbook_sleep(void) |
906 | { | 906 | { |
907 | int ret, i, x; | 907 | int ret, i, x; |
908 | static int save_backlight; | 908 | static int save_backlight; |
@@ -1001,25 +1001,24 @@ int __openfirmware powerbook_sleep(void) | |||
1001 | /* | 1001 | /* |
1002 | * Support for /dev/pmu device | 1002 | * Support for /dev/pmu device |
1003 | */ | 1003 | */ |
1004 | static int __openfirmware pmu_open(struct inode *inode, struct file *file) | 1004 | static int pmu_open(struct inode *inode, struct file *file) |
1005 | { | 1005 | { |
1006 | return 0; | 1006 | return 0; |
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | static ssize_t __openfirmware pmu_read(struct file *file, char *buf, | 1009 | static ssize_t pmu_read(struct file *file, char *buf, |
1010 | size_t count, loff_t *ppos) | 1010 | size_t count, loff_t *ppos) |
1011 | { | 1011 | { |
1012 | return 0; | 1012 | return 0; |
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | static ssize_t __openfirmware pmu_write(struct file *file, const char *buf, | 1015 | static ssize_t pmu_write(struct file *file, const char *buf, |
1016 | size_t count, loff_t *ppos) | 1016 | size_t count, loff_t *ppos) |
1017 | { | 1017 | { |
1018 | return 0; | 1018 | return 0; |
1019 | } | 1019 | } |
1020 | 1020 | ||
1021 | /* Note: removed __openfirmware here since it causes link errors */ | 1021 | static int pmu_ioctl(struct inode * inode, struct file *filp, |
1022 | static int /*__openfirmware*/ pmu_ioctl(struct inode * inode, struct file *filp, | ||
1023 | u_int cmd, u_long arg) | 1022 | u_int cmd, u_long arg) |
1024 | { | 1023 | { |
1025 | int error; | 1024 | int error; |