aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/via-pmu.c
diff options
context:
space:
mode:
authorJon Loeliger <linuxppc@jdl.com>2005-09-17 11:36:54 -0400
committerPaul Mackerras <paulus@samba.org>2005-09-18 19:38:49 -0400
commitaacaf9bd9646f6f611a08fca976411b6e5ddefe2 (patch)
tree604853646cc176c0a0908db39f254285121fa50c /drivers/macintosh/via-pmu.c
parentf495a8bfd6a52cf32859f93d5320bb234d8a9560 (diff)
[PATCH] powerpc: Remove sections use from ppc64 and drivers
Here is a new patch that removes all notion of the pmac, prep, chrp and openfirmware initialization sections, and then unifies the sections.h files without those __pmac, etc, sections identifiers cluttering things up. Signed-off-by: Jon Loeliger <jdl@freescale.com> Signed-off-by: Kumar Gala <kumar.gala@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/macintosh/via-pmu.c')
-rw-r--r--drivers/macintosh/via-pmu.c129
1 files changed, 64 insertions, 65 deletions
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 645a2e5c70ab..76719451e384 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 */
247static const s8 pmu_data_len[256][2] __openfirmwaredata = { 247static 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
298int __openfirmware 298int
299find_via_pmu(void) 299find_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
377static int __openfirmware 377static int
378pmu_probe(void) 378pmu_probe(void)
379{ 379{
380 return vias == NULL? -ENODEV: 0; 380 return vias == NULL? -ENODEV: 0;
@@ -520,7 +520,7 @@ static int __init via_pmu_dev_init(void)
520 520
521device_initcall(via_pmu_dev_init); 521device_initcall(via_pmu_dev_init);
522 522
523static int __openfirmware 523static int
524init_pmu(void) 524init_pmu(void)
525{ 525{
526 int timeout; 526 int timeout;
@@ -625,7 +625,7 @@ static void pmu_set_server_mode(int server_mode)
625/* This new version of the code for 2400/3400/3500 powerbooks 625/* This new version of the code for 2400/3400/3500 powerbooks
626 * is inspired from the implementation in gkrellm-pmu 626 * is inspired from the implementation in gkrellm-pmu
627 */ 627 */
628static void __pmac 628static void
629done_battery_state_ohare(struct adb_request* req) 629done_battery_state_ohare(struct adb_request* req)
630{ 630{
631 /* format: 631 /* format:
@@ -713,7 +713,7 @@ done_battery_state_ohare(struct adb_request* req)
713 clear_bit(0, &async_req_locks); 713 clear_bit(0, &async_req_locks);
714} 714}
715 715
716static void __pmac 716static void
717done_battery_state_smart(struct adb_request* req) 717done_battery_state_smart(struct adb_request* req)
718{ 718{
719 /* format: 719 /* format:
@@ -791,7 +791,7 @@ done_battery_state_smart(struct adb_request* req)
791 clear_bit(0, &async_req_locks); 791 clear_bit(0, &async_req_locks);
792} 792}
793 793
794static void __pmac 794static void
795query_battery_state(void) 795query_battery_state(void)
796{ 796{
797 if (test_and_set_bit(0, &async_req_locks)) 797 if (test_and_set_bit(0, &async_req_locks))
@@ -804,7 +804,7 @@ query_battery_state(void)
804 2, PMU_SMART_BATTERY_STATE, pmu_cur_battery+1); 804 2, PMU_SMART_BATTERY_STATE, pmu_cur_battery+1);
805} 805}
806 806
807static int __pmac 807static int
808proc_get_info(char *page, char **start, off_t off, 808proc_get_info(char *page, char **start, off_t off,
809 int count, int *eof, void *data) 809 int count, int *eof, void *data)
810{ 810{
@@ -819,7 +819,7 @@ proc_get_info(char *page, char **start, off_t off,
819 return p - page; 819 return p - page;
820} 820}
821 821
822static int __pmac 822static int
823proc_get_irqstats(char *page, char **start, off_t off, 823proc_get_irqstats(char *page, char **start, off_t off,
824 int count, int *eof, void *data) 824 int count, int *eof, void *data)
825{ 825{
@@ -846,7 +846,7 @@ proc_get_irqstats(char *page, char **start, off_t off,
846 return p - page; 846 return p - page;
847} 847}
848 848
849static int __pmac 849static int
850proc_get_batt(char *page, char **start, off_t off, 850proc_get_batt(char *page, char **start, off_t off,
851 int count, int *eof, void *data) 851 int count, int *eof, void *data)
852{ 852{
@@ -870,7 +870,7 @@ proc_get_batt(char *page, char **start, off_t off,
870 return p - page; 870 return p - page;
871} 871}
872 872
873static int __pmac 873static int
874proc_read_options(char *page, char **start, off_t off, 874proc_read_options(char *page, char **start, off_t off,
875 int count, int *eof, void *data) 875 int count, int *eof, void *data)
876{ 876{
@@ -887,7 +887,7 @@ proc_read_options(char *page, char **start, off_t off,
887 return p - page; 887 return p - page;
888} 888}
889 889
890static int __pmac 890static int
891proc_write_options(struct file *file, const char __user *buffer, 891proc_write_options(struct file *file, const char __user *buffer,
892 unsigned long count, void *data) 892 unsigned long count, void *data)
893{ 893{
@@ -934,7 +934,7 @@ proc_write_options(struct file *file, const char __user *buffer,
934 934
935#ifdef CONFIG_ADB 935#ifdef CONFIG_ADB
936/* Send an ADB command */ 936/* Send an ADB command */
937static int __pmac 937static int
938pmu_send_request(struct adb_request *req, int sync) 938pmu_send_request(struct adb_request *req, int sync)
939{ 939{
940 int i, ret; 940 int i, ret;
@@ -1014,7 +1014,7 @@ pmu_send_request(struct adb_request *req, int sync)
1014} 1014}
1015 1015
1016/* Enable/disable autopolling */ 1016/* Enable/disable autopolling */
1017static int __pmac 1017static int
1018pmu_adb_autopoll(int devs) 1018pmu_adb_autopoll(int devs)
1019{ 1019{
1020 struct adb_request req; 1020 struct adb_request req;
@@ -1037,7 +1037,7 @@ pmu_adb_autopoll(int devs)
1037} 1037}
1038 1038
1039/* Reset the ADB bus */ 1039/* Reset the ADB bus */
1040static int __pmac 1040static int
1041pmu_adb_reset_bus(void) 1041pmu_adb_reset_bus(void)
1042{ 1042{
1043 struct adb_request req; 1043 struct adb_request req;
@@ -1072,7 +1072,7 @@ pmu_adb_reset_bus(void)
1072#endif /* CONFIG_ADB */ 1072#endif /* CONFIG_ADB */
1073 1073
1074/* Construct and send a pmu request */ 1074/* Construct and send a pmu request */
1075int __openfirmware 1075int
1076pmu_request(struct adb_request *req, void (*done)(struct adb_request *), 1076pmu_request(struct adb_request *req, void (*done)(struct adb_request *),
1077 int nbytes, ...) 1077 int nbytes, ...)
1078{ 1078{
@@ -1098,7 +1098,7 @@ pmu_request(struct adb_request *req, void (*done)(struct adb_request *),
1098 return pmu_queue_request(req); 1098 return pmu_queue_request(req);
1099} 1099}
1100 1100
1101int __pmac 1101int
1102pmu_queue_request(struct adb_request *req) 1102pmu_queue_request(struct adb_request *req)
1103{ 1103{
1104 unsigned long flags; 1104 unsigned long flags;
@@ -1190,7 +1190,7 @@ pmu_done(struct adb_request *req)
1190 (*done)(req); 1190 (*done)(req);
1191} 1191}
1192 1192
1193static void __pmac 1193static void
1194pmu_start(void) 1194pmu_start(void)
1195{ 1195{
1196 struct adb_request *req; 1196 struct adb_request *req;
@@ -1214,7 +1214,7 @@ pmu_start(void)
1214 send_byte(req->data[0]); 1214 send_byte(req->data[0]);
1215} 1215}
1216 1216
1217void __openfirmware 1217void
1218pmu_poll(void) 1218pmu_poll(void)
1219{ 1219{
1220 if (!via) 1220 if (!via)
@@ -1224,7 +1224,7 @@ pmu_poll(void)
1224 via_pmu_interrupt(0, NULL, NULL); 1224 via_pmu_interrupt(0, NULL, NULL);
1225} 1225}
1226 1226
1227void __openfirmware 1227void
1228pmu_poll_adb(void) 1228pmu_poll_adb(void)
1229{ 1229{
1230 if (!via) 1230 if (!via)
@@ -1239,7 +1239,7 @@ pmu_poll_adb(void)
1239 || req_awaiting_reply)); 1239 || req_awaiting_reply));
1240} 1240}
1241 1241
1242void __openfirmware 1242void
1243pmu_wait_complete(struct adb_request *req) 1243pmu_wait_complete(struct adb_request *req)
1244{ 1244{
1245 if (!via) 1245 if (!via)
@@ -1253,7 +1253,7 @@ pmu_wait_complete(struct adb_request *req)
1253 * This is done to avoid spurrious shutdowns when we know we'll have 1253 * This is done to avoid spurrious shutdowns when we know we'll have
1254 * interrupts switched off for a long time 1254 * interrupts switched off for a long time
1255 */ 1255 */
1256void __openfirmware 1256void
1257pmu_suspend(void) 1257pmu_suspend(void)
1258{ 1258{
1259 unsigned long flags; 1259 unsigned long flags;
@@ -1293,7 +1293,7 @@ pmu_suspend(void)
1293 } while (1); 1293 } while (1);
1294} 1294}
1295 1295
1296void __openfirmware 1296void
1297pmu_resume(void) 1297pmu_resume(void)
1298{ 1298{
1299 unsigned long flags; 1299 unsigned long flags;
@@ -1323,7 +1323,7 @@ pmu_resume(void)
1323} 1323}
1324 1324
1325/* Interrupt data could be the result data from an ADB cmd */ 1325/* Interrupt data could be the result data from an ADB cmd */
1326static void __pmac 1326static void
1327pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs) 1327pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs)
1328{ 1328{
1329 unsigned char ints, pirq; 1329 unsigned char ints, pirq;
@@ -1435,7 +1435,7 @@ next:
1435 goto next; 1435 goto next;
1436} 1436}
1437 1437
1438static struct adb_request* __pmac 1438static struct adb_request*
1439pmu_sr_intr(struct pt_regs *regs) 1439pmu_sr_intr(struct pt_regs *regs)
1440{ 1440{
1441 struct adb_request *req; 1441 struct adb_request *req;
@@ -1541,7 +1541,7 @@ pmu_sr_intr(struct pt_regs *regs)
1541 return NULL; 1541 return NULL;
1542} 1542}
1543 1543
1544static irqreturn_t __pmac 1544static irqreturn_t
1545via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs) 1545via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs)
1546{ 1546{
1547 unsigned long flags; 1547 unsigned long flags;
@@ -1629,7 +1629,7 @@ no_free_slot:
1629 return IRQ_RETVAL(handled); 1629 return IRQ_RETVAL(handled);
1630} 1630}
1631 1631
1632void __pmac 1632void
1633pmu_unlock(void) 1633pmu_unlock(void)
1634{ 1634{
1635 unsigned long flags; 1635 unsigned long flags;
@@ -1642,7 +1642,7 @@ pmu_unlock(void)
1642} 1642}
1643 1643
1644 1644
1645static irqreturn_t __pmac 1645static irqreturn_t
1646gpio1_interrupt(int irq, void *arg, struct pt_regs *regs) 1646gpio1_interrupt(int irq, void *arg, struct pt_regs *regs)
1647{ 1647{
1648 unsigned long flags; 1648 unsigned long flags;
@@ -1663,12 +1663,12 @@ gpio1_interrupt(int irq, void *arg, struct pt_regs *regs)
1663} 1663}
1664 1664
1665#ifdef CONFIG_PMAC_BACKLIGHT 1665#ifdef CONFIG_PMAC_BACKLIGHT
1666static int backlight_to_bright[] __pmacdata = { 1666static int backlight_to_bright[] = {
1667 0x7f, 0x46, 0x42, 0x3e, 0x3a, 0x36, 0x32, 0x2e, 1667 0x7f, 0x46, 0x42, 0x3e, 0x3a, 0x36, 0x32, 0x2e,
1668 0x2a, 0x26, 0x22, 0x1e, 0x1a, 0x16, 0x12, 0x0e 1668 0x2a, 0x26, 0x22, 0x1e, 0x1a, 0x16, 0x12, 0x0e
1669}; 1669};
1670 1670
1671static int __openfirmware 1671static int
1672pmu_set_backlight_enable(int on, int level, void* data) 1672pmu_set_backlight_enable(int on, int level, void* data)
1673{ 1673{
1674 struct adb_request req; 1674 struct adb_request req;
@@ -1688,7 +1688,7 @@ pmu_set_backlight_enable(int on, int level, void* data)
1688 return 0; 1688 return 0;
1689} 1689}
1690 1690
1691static void __openfirmware 1691static void
1692pmu_bright_complete(struct adb_request *req) 1692pmu_bright_complete(struct adb_request *req)
1693{ 1693{
1694 if (req == &bright_req_1) 1694 if (req == &bright_req_1)
@@ -1697,7 +1697,7 @@ pmu_bright_complete(struct adb_request *req)
1697 clear_bit(2, &async_req_locks); 1697 clear_bit(2, &async_req_locks);
1698} 1698}
1699 1699
1700static int __openfirmware 1700static int
1701pmu_set_backlight_level(int level, void* data) 1701pmu_set_backlight_level(int level, void* data)
1702{ 1702{
1703 if (vias == NULL) 1703 if (vias == NULL)
@@ -1717,7 +1717,7 @@ pmu_set_backlight_level(int level, void* data)
1717} 1717}
1718#endif /* CONFIG_PMAC_BACKLIGHT */ 1718#endif /* CONFIG_PMAC_BACKLIGHT */
1719 1719
1720void __pmac 1720void
1721pmu_enable_irled(int on) 1721pmu_enable_irled(int on)
1722{ 1722{
1723 struct adb_request req; 1723 struct adb_request req;
@@ -1732,7 +1732,7 @@ pmu_enable_irled(int on)
1732 pmu_wait_complete(&req); 1732 pmu_wait_complete(&req);
1733} 1733}
1734 1734
1735void __pmac 1735void
1736pmu_restart(void) 1736pmu_restart(void)
1737{ 1737{
1738 struct adb_request req; 1738 struct adb_request req;
@@ -1757,7 +1757,7 @@ pmu_restart(void)
1757 ; 1757 ;
1758} 1758}
1759 1759
1760void __pmac 1760void
1761pmu_shutdown(void) 1761pmu_shutdown(void)
1762{ 1762{
1763 struct adb_request req; 1763 struct adb_request req;
@@ -2076,7 +2076,7 @@ pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* n)
2076} 2076}
2077 2077
2078/* Sleep is broadcast last-to-first */ 2078/* Sleep is broadcast last-to-first */
2079static int __pmac 2079static int
2080broadcast_sleep(int when, int fallback) 2080broadcast_sleep(int when, int fallback)
2081{ 2081{
2082 int ret = PBOOK_SLEEP_OK; 2082 int ret = PBOOK_SLEEP_OK;
@@ -2101,7 +2101,7 @@ broadcast_sleep(int when, int fallback)
2101} 2101}
2102 2102
2103/* Wake is broadcast first-to-last */ 2103/* Wake is broadcast first-to-last */
2104static int __pmac 2104static int
2105broadcast_wake(void) 2105broadcast_wake(void)
2106{ 2106{
2107 int ret = PBOOK_SLEEP_OK; 2107 int ret = PBOOK_SLEEP_OK;
@@ -2132,7 +2132,7 @@ static struct pci_save {
2132} *pbook_pci_saves; 2132} *pbook_pci_saves;
2133static int pbook_npci_saves; 2133static int pbook_npci_saves;
2134 2134
2135static void __pmac 2135static void
2136pbook_alloc_pci_save(void) 2136pbook_alloc_pci_save(void)
2137{ 2137{
2138 int npci; 2138 int npci;
@@ -2149,7 +2149,7 @@ pbook_alloc_pci_save(void)
2149 pbook_npci_saves = npci; 2149 pbook_npci_saves = npci;
2150} 2150}
2151 2151
2152static void __pmac 2152static void
2153pbook_free_pci_save(void) 2153pbook_free_pci_save(void)
2154{ 2154{
2155 if (pbook_pci_saves == NULL) 2155 if (pbook_pci_saves == NULL)
@@ -2159,7 +2159,7 @@ pbook_free_pci_save(void)
2159 pbook_npci_saves = 0; 2159 pbook_npci_saves = 0;
2160} 2160}
2161 2161
2162static void __pmac 2162static void
2163pbook_pci_save(void) 2163pbook_pci_save(void)
2164{ 2164{
2165 struct pci_save *ps = pbook_pci_saves; 2165 struct pci_save *ps = pbook_pci_saves;
@@ -2190,7 +2190,7 @@ pbook_pci_save(void)
2190 * during boot, it will be in the pci dev list. If it's disabled at this point 2190 * 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. 2191 * (and it will probably be), then you can't access it's config space.
2192 */ 2192 */
2193static void __pmac 2193static void
2194pbook_pci_restore(void) 2194pbook_pci_restore(void)
2195{ 2195{
2196 u16 cmd; 2196 u16 cmd;
@@ -2238,7 +2238,7 @@ pbook_pci_restore(void)
2238 2238
2239#ifdef DEBUG_SLEEP 2239#ifdef DEBUG_SLEEP
2240/* N.B. This doesn't work on the 3400 */ 2240/* N.B. This doesn't work on the 3400 */
2241void __pmac 2241void
2242pmu_blink(int n) 2242pmu_blink(int n)
2243{ 2243{
2244 struct adb_request req; 2244 struct adb_request req;
@@ -2277,9 +2277,9 @@ pmu_blink(int n)
2277 * Put the powerbook to sleep. 2277 * Put the powerbook to sleep.
2278 */ 2278 */
2279 2279
2280static u32 save_via[8] __pmacdata; 2280static u32 save_via[8];
2281 2281
2282static void __pmac 2282static void
2283save_via_state(void) 2283save_via_state(void)
2284{ 2284{
2285 save_via[0] = in_8(&via[ANH]); 2285 save_via[0] = in_8(&via[ANH]);
@@ -2291,7 +2291,7 @@ save_via_state(void)
2291 save_via[6] = in_8(&via[T1CL]); 2291 save_via[6] = in_8(&via[T1CL]);
2292 save_via[7] = in_8(&via[T1CH]); 2292 save_via[7] = in_8(&via[T1CH]);
2293} 2293}
2294static void __pmac 2294static void
2295restore_via_state(void) 2295restore_via_state(void)
2296{ 2296{
2297 out_8(&via[ANH], save_via[0]); 2297 out_8(&via[ANH], save_via[0]);
@@ -2307,7 +2307,7 @@ restore_via_state(void)
2307 out_8(&via[IER], IER_SET | SR_INT | CB1_INT); 2307 out_8(&via[IER], IER_SET | SR_INT | CB1_INT);
2308} 2308}
2309 2309
2310static int __pmac 2310static int
2311pmac_suspend_devices(void) 2311pmac_suspend_devices(void)
2312{ 2312{
2313 int ret; 2313 int ret;
@@ -2397,7 +2397,7 @@ pmac_suspend_devices(void)
2397 return 0; 2397 return 0;
2398} 2398}
2399 2399
2400static int __pmac 2400static int
2401pmac_wakeup_devices(void) 2401pmac_wakeup_devices(void)
2402{ 2402{
2403 mdelay(100); 2403 mdelay(100);
@@ -2436,7 +2436,7 @@ pmac_wakeup_devices(void)
2436#define GRACKLE_NAP (1<<4) 2436#define GRACKLE_NAP (1<<4)
2437#define GRACKLE_SLEEP (1<<3) 2437#define GRACKLE_SLEEP (1<<3)
2438 2438
2439int __pmac 2439int
2440powerbook_sleep_grackle(void) 2440powerbook_sleep_grackle(void)
2441{ 2441{
2442 unsigned long save_l2cr; 2442 unsigned long save_l2cr;
@@ -2520,7 +2520,7 @@ powerbook_sleep_grackle(void)
2520 return 0; 2520 return 0;
2521} 2521}
2522 2522
2523static int __pmac 2523static int
2524powerbook_sleep_Core99(void) 2524powerbook_sleep_Core99(void)
2525{ 2525{
2526 unsigned long save_l2cr; 2526 unsigned long save_l2cr;
@@ -2620,7 +2620,7 @@ powerbook_sleep_Core99(void)
2620#define PB3400_MEM_CTRL 0xf8000000 2620#define PB3400_MEM_CTRL 0xf8000000
2621#define PB3400_MEM_CTRL_SLEEP 0x70 2621#define PB3400_MEM_CTRL_SLEEP 0x70
2622 2622
2623static int __pmac 2623static int
2624powerbook_sleep_3400(void) 2624powerbook_sleep_3400(void)
2625{ 2625{
2626 int ret, i, x; 2626 int ret, i, x;
@@ -2720,9 +2720,9 @@ struct pmu_private {
2720}; 2720};
2721 2721
2722static LIST_HEAD(all_pmu_pvt); 2722static LIST_HEAD(all_pmu_pvt);
2723static DEFINE_SPINLOCK(all_pvt_lock __pmacdata); 2723static DEFINE_SPINLOCK(all_pvt_lock);
2724 2724
2725static void __pmac 2725static void
2726pmu_pass_intr(unsigned char *data, int len) 2726pmu_pass_intr(unsigned char *data, int len)
2727{ 2727{
2728 struct pmu_private *pp; 2728 struct pmu_private *pp;
@@ -2751,7 +2751,7 @@ pmu_pass_intr(unsigned char *data, int len)
2751 spin_unlock_irqrestore(&all_pvt_lock, flags); 2751 spin_unlock_irqrestore(&all_pvt_lock, flags);
2752} 2752}
2753 2753
2754static int __pmac 2754static int
2755pmu_open(struct inode *inode, struct file *file) 2755pmu_open(struct inode *inode, struct file *file)
2756{ 2756{
2757 struct pmu_private *pp; 2757 struct pmu_private *pp;
@@ -2773,7 +2773,7 @@ pmu_open(struct inode *inode, struct file *file)
2773 return 0; 2773 return 0;
2774} 2774}
2775 2775
2776static ssize_t __pmac 2776static ssize_t
2777pmu_read(struct file *file, char __user *buf, 2777pmu_read(struct file *file, char __user *buf,
2778 size_t count, loff_t *ppos) 2778 size_t count, loff_t *ppos)
2779{ 2779{
@@ -2825,14 +2825,14 @@ pmu_read(struct file *file, char __user *buf,
2825 return ret; 2825 return ret;
2826} 2826}
2827 2827
2828static ssize_t __pmac 2828static ssize_t
2829pmu_write(struct file *file, const char __user *buf, 2829pmu_write(struct file *file, const char __user *buf,
2830 size_t count, loff_t *ppos) 2830 size_t count, loff_t *ppos)
2831{ 2831{
2832 return 0; 2832 return 0;
2833} 2833}
2834 2834
2835static unsigned int __pmac 2835static unsigned int
2836pmu_fpoll(struct file *filp, poll_table *wait) 2836pmu_fpoll(struct file *filp, poll_table *wait)
2837{ 2837{
2838 struct pmu_private *pp = filp->private_data; 2838 struct pmu_private *pp = filp->private_data;
@@ -2849,7 +2849,7 @@ pmu_fpoll(struct file *filp, poll_table *wait)
2849 return mask; 2849 return mask;
2850} 2850}
2851 2851
2852static int __pmac 2852static int
2853pmu_release(struct inode *inode, struct file *file) 2853pmu_release(struct inode *inode, struct file *file)
2854{ 2854{
2855 struct pmu_private *pp = file->private_data; 2855 struct pmu_private *pp = file->private_data;
@@ -2874,8 +2874,7 @@ pmu_release(struct inode *inode, struct file *file)
2874 return 0; 2874 return 0;
2875} 2875}
2876 2876
2877/* Note: removed __openfirmware here since it causes link errors */ 2877static int
2878static int __pmac
2879pmu_ioctl(struct inode * inode, struct file *filp, 2878pmu_ioctl(struct inode * inode, struct file *filp,
2880 u_int cmd, u_long arg) 2879 u_int cmd, u_long arg)
2881{ 2880{
@@ -2957,7 +2956,7 @@ pmu_ioctl(struct inode * inode, struct file *filp,
2957 return error; 2956 return error;
2958} 2957}
2959 2958
2960static struct file_operations pmu_device_fops __pmacdata = { 2959static struct file_operations pmu_device_fops = {
2961 .read = pmu_read, 2960 .read = pmu_read,
2962 .write = pmu_write, 2961 .write = pmu_write,
2963 .poll = pmu_fpoll, 2962 .poll = pmu_fpoll,
@@ -2966,7 +2965,7 @@ static struct file_operations pmu_device_fops __pmacdata = {
2966 .release = pmu_release, 2965 .release = pmu_release,
2967}; 2966};
2968 2967
2969static struct miscdevice pmu_device __pmacdata = { 2968static struct miscdevice pmu_device = {
2970 PMU_MINOR, "pmu", &pmu_device_fops 2969 PMU_MINOR, "pmu", &pmu_device_fops
2971}; 2970};
2972 2971
@@ -2982,7 +2981,7 @@ device_initcall(pmu_device_init);
2982 2981
2983 2982
2984#ifdef DEBUG_SLEEP 2983#ifdef DEBUG_SLEEP
2985static inline void __pmac 2984static inline void
2986polled_handshake(volatile unsigned char __iomem *via) 2985polled_handshake(volatile unsigned char __iomem *via)
2987{ 2986{
2988 via[B] &= ~TREQ; eieio(); 2987 via[B] &= ~TREQ; eieio();
@@ -2993,7 +2992,7 @@ polled_handshake(volatile unsigned char __iomem *via)
2993 ; 2992 ;
2994} 2993}
2995 2994
2996static inline void __pmac 2995static inline void
2997polled_send_byte(volatile unsigned char __iomem *via, int x) 2996polled_send_byte(volatile unsigned char __iomem *via, int x)
2998{ 2997{
2999 via[ACR] |= SR_OUT | SR_EXT; eieio(); 2998 via[ACR] |= SR_OUT | SR_EXT; eieio();
@@ -3001,7 +3000,7 @@ polled_send_byte(volatile unsigned char __iomem *via, int x)
3001 polled_handshake(via); 3000 polled_handshake(via);
3002} 3001}
3003 3002
3004static inline int __pmac 3003static inline int
3005polled_recv_byte(volatile unsigned char __iomem *via) 3004polled_recv_byte(volatile unsigned char __iomem *via)
3006{ 3005{
3007 int x; 3006 int x;
@@ -3013,7 +3012,7 @@ polled_recv_byte(volatile unsigned char __iomem *via)
3013 return x; 3012 return x;
3014} 3013}
3015 3014
3016int __pmac 3015int
3017pmu_polled_request(struct adb_request *req) 3016pmu_polled_request(struct adb_request *req)
3018{ 3017{
3019 unsigned long flags; 3018 unsigned long flags;