aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-06-27 17:36:34 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 18:11:43 -0400
commit8c8709334cec803368a432a33e0f2e116d48fe07 (patch)
treef3298ae6d844e548c36df9fc3bfb5a3662d4e45d /drivers/macintosh
parentfcd16cc084f2b98ab64d27721abdb941f3d9c4cb (diff)
[PATCH] ppc32: Remove CONFIG_PMAC_PBOOK
This patch removes CONFIG_PMAC_PBOOK (PowerBook support). This is now split into CONFIG_PMAC_MEDIABAY for the actual hotswap bay that some powerbooks have, CONFIG_PM for power management related code, and just left out of any CONFIG_* option for some generally useful stuff that can be used on non-laptops as well. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/Kconfig35
-rw-r--r--drivers/macintosh/Makefile2
-rw-r--r--drivers/macintosh/adb.c10
-rw-r--r--drivers/macintosh/via-pmu.c70
4 files changed, 46 insertions, 71 deletions
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index b0ace5bc950c..91691a6c004e 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -86,33 +86,18 @@ config PMAC_SMU
86 on the "SMU" system control chip which replaces the old PMU. 86 on the "SMU" system control chip which replaces the old PMU.
87 If you don't know, say Y. 87 If you don't know, say Y.
88 88
89config PMAC_PBOOK
90 bool "Power management support for PowerBooks"
91 depends on ADB_PMU
92 ---help---
93 This provides support for putting a PowerBook to sleep; it also
94 enables media bay support. Power management works on the
95 PB2400/3400/3500, Wallstreet, Lombard, and Bronze PowerBook G3 and
96 the Titanium Powerbook G4, as well as the iBooks. You should get
97 the power management daemon, pmud, to make it work and you must have
98 the /dev/pmu device (see the pmud README).
99
100 Get pmud from <ftp://ftp.samba.org/pub/ppclinux/pmud/>.
101
102 If you have a PowerBook, you should say Y here.
103
104 You may also want to compile the dma sound driver as a module and
105 have it autoloaded. The act of removing the module shuts down the
106 sound hardware for more power savings.
107
108config PM
109 bool
110 depends on PPC_PMAC && ADB_PMU && PMAC_PBOOK
111 default y
112
113config PMAC_APM_EMU 89config PMAC_APM_EMU
114 tristate "APM emulation" 90 tristate "APM emulation"
115 depends on PMAC_PBOOK 91 depends on PPC_PMAC && PPC32 && PM
92
93config PMAC_MEDIABAY
94 bool "Support PowerBook hotswap media bay"
95 depends on PPC_PMAC && PPC32
96 help
97 This option adds support for older PowerBook's hotswap media bay
98 that can contains batteries, floppy drives, or IDE devices. PCI
99 devices are not fully supported in the bay as I never had one to
100 try with
116 101
117# made a separate option since backlight may end up beeing used 102# made a separate option since backlight may end up beeing used
118# on non-powerbook machines (but only on PMU based ones AFAIK) 103# on non-powerbook machines (but only on PMU based ones AFAIK)
diff --git a/drivers/macintosh/Makefile b/drivers/macintosh/Makefile
index b3f88a4fcef7..f5ae171dbfef 100644
--- a/drivers/macintosh/Makefile
+++ b/drivers/macintosh/Makefile
@@ -6,7 +6,7 @@
6 6
7obj-$(CONFIG_PPC_PMAC) += macio_asic.o 7obj-$(CONFIG_PPC_PMAC) += macio_asic.o
8 8
9obj-$(CONFIG_PMAC_PBOOK) += mediabay.o 9obj-$(CONFIG_PMAC_MEDIABAY) += mediabay.o
10obj-$(CONFIG_MAC_EMUMOUSEBTN) += mac_hid.o 10obj-$(CONFIG_MAC_EMUMOUSEBTN) += mac_hid.o
11obj-$(CONFIG_INPUT_ADBHID) += adbhid.o 11obj-$(CONFIG_INPUT_ADBHID) += adbhid.o
12obj-$(CONFIG_ANSLCD) += ans-lcd.o 12obj-$(CONFIG_ANSLCD) += ans-lcd.o
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 493e2afa191c..c0dc1e3fa58b 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -90,7 +90,7 @@ static int sleepy_trackpad;
90static int autopoll_devs; 90static int autopoll_devs;
91int __adb_probe_sync; 91int __adb_probe_sync;
92 92
93#ifdef CONFIG_PMAC_PBOOK 93#ifdef CONFIG_PM
94static int adb_notify_sleep(struct pmu_sleep_notifier *self, int when); 94static int adb_notify_sleep(struct pmu_sleep_notifier *self, int when);
95static struct pmu_sleep_notifier adb_sleep_notifier = { 95static struct pmu_sleep_notifier adb_sleep_notifier = {
96 adb_notify_sleep, 96 adb_notify_sleep,
@@ -320,9 +320,9 @@ int __init adb_init(void)
320 printk(KERN_WARNING "Warning: no ADB interface detected\n"); 320 printk(KERN_WARNING "Warning: no ADB interface detected\n");
321 adb_controller = NULL; 321 adb_controller = NULL;
322 } else { 322 } else {
323#ifdef CONFIG_PMAC_PBOOK 323#ifdef CONFIG_PM
324 pmu_register_sleep_notifier(&adb_sleep_notifier); 324 pmu_register_sleep_notifier(&adb_sleep_notifier);
325#endif /* CONFIG_PMAC_PBOOK */ 325#endif /* CONFIG_PM */
326#ifdef CONFIG_PPC 326#ifdef CONFIG_PPC
327 if (machine_is_compatible("AAPL,PowerBook1998") || 327 if (machine_is_compatible("AAPL,PowerBook1998") ||
328 machine_is_compatible("PowerBook1,1")) 328 machine_is_compatible("PowerBook1,1"))
@@ -337,7 +337,7 @@ int __init adb_init(void)
337 337
338__initcall(adb_init); 338__initcall(adb_init);
339 339
340#ifdef CONFIG_PMAC_PBOOK 340#ifdef CONFIG_PM
341/* 341/*
342 * notify clients before sleep and reset bus afterwards 342 * notify clients before sleep and reset bus afterwards
343 */ 343 */
@@ -378,7 +378,7 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when)
378 } 378 }
379 return PBOOK_SLEEP_OK; 379 return PBOOK_SLEEP_OK;
380} 380}
381#endif /* CONFIG_PMAC_PBOOK */ 381#endif /* CONFIG_PM */
382 382
383static int 383static int
384do_adb_reset_bus(void) 384do_adb_reset_bus(void)
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 5375df03c6f3..4a0a0ad2d03c 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -155,10 +155,10 @@ static spinlock_t pmu_lock;
155static u8 pmu_intr_mask; 155static u8 pmu_intr_mask;
156static int pmu_version; 156static int pmu_version;
157static int drop_interrupts; 157static int drop_interrupts;
158#ifdef CONFIG_PMAC_PBOOK 158#ifdef CONFIG_PM
159static int option_lid_wakeup = 1; 159static int option_lid_wakeup = 1;
160static int sleep_in_progress; 160static int sleep_in_progress;
161#endif /* CONFIG_PMAC_PBOOK */ 161#endif /* CONFIG_PM */
162static unsigned long async_req_locks; 162static unsigned long async_req_locks;
163static unsigned int pmu_irq_stats[11]; 163static unsigned int pmu_irq_stats[11];
164 164
@@ -168,7 +168,6 @@ static struct proc_dir_entry *proc_pmu_irqstats;
168static struct proc_dir_entry *proc_pmu_options; 168static struct proc_dir_entry *proc_pmu_options;
169static int option_server_mode; 169static int option_server_mode;
170 170
171#ifdef CONFIG_PMAC_PBOOK
172int pmu_battery_count; 171int pmu_battery_count;
173int pmu_cur_battery; 172int pmu_cur_battery;
174unsigned int pmu_power_flags; 173unsigned int pmu_power_flags;
@@ -176,7 +175,6 @@ struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES];
176static int query_batt_timer = BATTERY_POLLING_COUNT; 175static int query_batt_timer = BATTERY_POLLING_COUNT;
177static struct adb_request batt_req; 176static struct adb_request batt_req;
178static struct proc_dir_entry *proc_pmu_batt[PMU_MAX_BATTERIES]; 177static struct proc_dir_entry *proc_pmu_batt[PMU_MAX_BATTERIES];
179#endif /* CONFIG_PMAC_PBOOK */
180 178
181#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) 179#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
182extern int disable_kernel_backlight; 180extern int disable_kernel_backlight;
@@ -210,11 +208,9 @@ static int proc_get_irqstats(char *page, char **start, off_t off,
210static int pmu_set_backlight_level(int level, void* data); 208static int pmu_set_backlight_level(int level, void* data);
211static int pmu_set_backlight_enable(int on, int level, void* data); 209static int pmu_set_backlight_enable(int on, int level, void* data);
212#endif /* CONFIG_PMAC_BACKLIGHT */ 210#endif /* CONFIG_PMAC_BACKLIGHT */
213#ifdef CONFIG_PMAC_PBOOK
214static void pmu_pass_intr(unsigned char *data, int len); 211static void pmu_pass_intr(unsigned char *data, int len);
215static int proc_get_batt(char *page, char **start, off_t off, 212static int proc_get_batt(char *page, char **start, off_t off,
216 int count, int *eof, void *data); 213 int count, int *eof, void *data);
217#endif /* CONFIG_PMAC_PBOOK */
218static int proc_read_options(char *page, char **start, off_t off, 214static int proc_read_options(char *page, char **start, off_t off,
219 int count, int *eof, void *data); 215 int count, int *eof, void *data);
220static int proc_write_options(struct file *file, const char __user *buffer, 216static int proc_write_options(struct file *file, const char __user *buffer,
@@ -407,9 +403,7 @@ static int __init via_pmu_start(void)
407 403
408 bright_req_1.complete = 1; 404 bright_req_1.complete = 1;
409 bright_req_2.complete = 1; 405 bright_req_2.complete = 1;
410#ifdef CONFIG_PMAC_PBOOK
411 batt_req.complete = 1; 406 batt_req.complete = 1;
412#endif
413 407
414#ifdef CONFIG_PPC32 408#ifdef CONFIG_PPC32
415 if (pmu_kind == PMU_KEYLARGO_BASED) 409 if (pmu_kind == PMU_KEYLARGO_BASED)
@@ -468,7 +462,7 @@ static int __init via_pmu_dev_init(void)
468 register_backlight_controller(&pmu_backlight_controller, NULL, "pmu"); 462 register_backlight_controller(&pmu_backlight_controller, NULL, "pmu");
469#endif /* CONFIG_PMAC_BACKLIGHT */ 463#endif /* CONFIG_PMAC_BACKLIGHT */
470 464
471#ifdef CONFIG_PMAC_PBOOK 465#ifdef CONFIG_PPC32
472 if (machine_is_compatible("AAPL,3400/2400") || 466 if (machine_is_compatible("AAPL,3400/2400") ||
473 machine_is_compatible("AAPL,3500")) { 467 machine_is_compatible("AAPL,3500")) {
474 int mb = pmac_call_feature(PMAC_FTR_GET_MB_INFO, 468 int mb = pmac_call_feature(PMAC_FTR_GET_MB_INFO,
@@ -496,20 +490,19 @@ static int __init via_pmu_dev_init(void)
496 pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART; 490 pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART;
497 } 491 }
498 } 492 }
499#endif /* CONFIG_PMAC_PBOOK */ 493#endif /* CONFIG_PPC32 */
494
500 /* Create /proc/pmu */ 495 /* Create /proc/pmu */
501 proc_pmu_root = proc_mkdir("pmu", NULL); 496 proc_pmu_root = proc_mkdir("pmu", NULL);
502 if (proc_pmu_root) { 497 if (proc_pmu_root) {
503#ifdef CONFIG_PMAC_PBOOK 498 long i;
504 int i;
505 499
506 for (i=0; i<pmu_battery_count; i++) { 500 for (i=0; i<pmu_battery_count; i++) {
507 char title[16]; 501 char title[16];
508 sprintf(title, "battery_%d", i); 502 sprintf(title, "battery_%ld", i);
509 proc_pmu_batt[i] = create_proc_read_entry(title, 0, proc_pmu_root, 503 proc_pmu_batt[i] = create_proc_read_entry(title, 0, proc_pmu_root,
510 proc_get_batt, (void *)i); 504 proc_get_batt, (void *)i);
511 } 505 }
512#endif /* CONFIG_PMAC_PBOOK */
513 506
514 proc_pmu_info = create_proc_read_entry("info", 0, proc_pmu_root, 507 proc_pmu_info = create_proc_read_entry("info", 0, proc_pmu_root,
515 proc_get_info, NULL); 508 proc_get_info, NULL);
@@ -629,8 +622,6 @@ static void pmu_set_server_mode(int server_mode)
629 pmu_wait_complete(&req); 622 pmu_wait_complete(&req);
630} 623}
631 624
632#ifdef CONFIG_PMAC_PBOOK
633
634/* This new version of the code for 2400/3400/3500 powerbooks 625/* This new version of the code for 2400/3400/3500 powerbooks
635 * is inspired from the implementation in gkrellm-pmu 626 * is inspired from the implementation in gkrellm-pmu
636 */ 627 */
@@ -813,8 +804,6 @@ query_battery_state(void)
813 2, PMU_SMART_BATTERY_STATE, pmu_cur_battery+1); 804 2, PMU_SMART_BATTERY_STATE, pmu_cur_battery+1);
814} 805}
815 806
816#endif /* CONFIG_PMAC_PBOOK */
817
818static int __pmac 807static int __pmac
819proc_get_info(char *page, char **start, off_t off, 808proc_get_info(char *page, char **start, off_t off,
820 int count, int *eof, void *data) 809 int count, int *eof, void *data)
@@ -823,11 +812,9 @@ proc_get_info(char *page, char **start, off_t off,
823 812
824 p += sprintf(p, "PMU driver version : %d\n", PMU_DRIVER_VERSION); 813 p += sprintf(p, "PMU driver version : %d\n", PMU_DRIVER_VERSION);
825 p += sprintf(p, "PMU firmware version : %02x\n", pmu_version); 814 p += sprintf(p, "PMU firmware version : %02x\n", pmu_version);
826#ifdef CONFIG_PMAC_PBOOK
827 p += sprintf(p, "AC Power : %d\n", 815 p += sprintf(p, "AC Power : %d\n",
828 ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0)); 816 ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0));
829 p += sprintf(p, "Battery count : %d\n", pmu_battery_count); 817 p += sprintf(p, "Battery count : %d\n", pmu_battery_count);
830#endif /* CONFIG_PMAC_PBOOK */
831 818
832 return p - page; 819 return p - page;
833} 820}
@@ -859,12 +846,11 @@ proc_get_irqstats(char *page, char **start, off_t off,
859 return p - page; 846 return p - page;
860} 847}
861 848
862#ifdef CONFIG_PMAC_PBOOK
863static int __pmac 849static int __pmac
864proc_get_batt(char *page, char **start, off_t off, 850proc_get_batt(char *page, char **start, off_t off,
865 int count, int *eof, void *data) 851 int count, int *eof, void *data)
866{ 852{
867 int batnum = (int)data; 853 long batnum = (long)data;
868 char *p = page; 854 char *p = page;
869 855
870 p += sprintf(p, "\n"); 856 p += sprintf(p, "\n");
@@ -883,7 +869,6 @@ proc_get_batt(char *page, char **start, off_t off,
883 869
884 return p - page; 870 return p - page;
885} 871}
886#endif /* CONFIG_PMAC_PBOOK */
887 872
888static int __pmac 873static int __pmac
889proc_read_options(char *page, char **start, off_t off, 874proc_read_options(char *page, char **start, off_t off,
@@ -891,11 +876,11 @@ proc_read_options(char *page, char **start, off_t off,
891{ 876{
892 char *p = page; 877 char *p = page;
893 878
894#ifdef CONFIG_PMAC_PBOOK 879#ifdef CONFIG_PM
895 if (pmu_kind == PMU_KEYLARGO_BASED && 880 if (pmu_kind == PMU_KEYLARGO_BASED &&
896 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0) 881 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
897 p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup); 882 p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup);
898#endif /* CONFIG_PMAC_PBOOK */ 883#endif
899 if (pmu_kind == PMU_KEYLARGO_BASED) 884 if (pmu_kind == PMU_KEYLARGO_BASED)
900 p += sprintf(p, "server_mode=%d\n", option_server_mode); 885 p += sprintf(p, "server_mode=%d\n", option_server_mode);
901 886
@@ -932,12 +917,12 @@ proc_write_options(struct file *file, const char __user *buffer,
932 *(val++) = 0; 917 *(val++) = 0;
933 while(*val == ' ') 918 while(*val == ' ')
934 val++; 919 val++;
935#ifdef CONFIG_PMAC_PBOOK 920#ifdef CONFIG_PM
936 if (pmu_kind == PMU_KEYLARGO_BASED && 921 if (pmu_kind == PMU_KEYLARGO_BASED &&
937 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0) 922 pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
938 if (!strcmp(label, "lid_wakeup")) 923 if (!strcmp(label, "lid_wakeup"))
939 option_lid_wakeup = ((*val) == '1'); 924 option_lid_wakeup = ((*val) == '1');
940#endif /* CONFIG_PMAC_PBOOK */ 925#endif
941 if (pmu_kind == PMU_KEYLARGO_BASED && !strcmp(label, "server_mode")) { 926 if (pmu_kind == PMU_KEYLARGO_BASED && !strcmp(label, "server_mode")) {
942 int new_value; 927 int new_value;
943 new_value = ((*val) == '1'); 928 new_value = ((*val) == '1');
@@ -1432,7 +1417,6 @@ next:
1432 } 1417 }
1433 /* Tick interrupt */ 1418 /* Tick interrupt */
1434 else if ((1 << pirq) & PMU_INT_TICK) { 1419 else if ((1 << pirq) & PMU_INT_TICK) {
1435#ifdef CONFIG_PMAC_PBOOK
1436 /* Environement or tick interrupt, query batteries */ 1420 /* Environement or tick interrupt, query batteries */
1437 if (pmu_battery_count) { 1421 if (pmu_battery_count) {
1438 if ((--query_batt_timer) == 0) { 1422 if ((--query_batt_timer) == 0) {
@@ -1447,7 +1431,6 @@ next:
1447 pmu_pass_intr(data, len); 1431 pmu_pass_intr(data, len);
1448 } else { 1432 } else {
1449 pmu_pass_intr(data, len); 1433 pmu_pass_intr(data, len);
1450#endif /* CONFIG_PMAC_PBOOK */
1451 } 1434 }
1452 goto next; 1435 goto next;
1453} 1436}
@@ -2062,7 +2045,7 @@ pmu_i2c_simple_write(int bus, int addr, u8* data, int len)
2062 return -1; 2045 return -1;
2063} 2046}
2064 2047
2065#ifdef CONFIG_PMAC_PBOOK 2048#ifdef CONFIG_PM
2066 2049
2067static LIST_HEAD(sleep_notifiers); 2050static LIST_HEAD(sleep_notifiers);
2068 2051
@@ -2715,6 +2698,8 @@ powerbook_sleep_3400(void)
2715 return 0; 2698 return 0;
2716} 2699}
2717 2700
2701#endif /* CONFIG_PM */
2702
2718/* 2703/*
2719 * Support for /dev/pmu device 2704 * Support for /dev/pmu device
2720 */ 2705 */
@@ -2894,11 +2879,11 @@ static int __pmac
2894pmu_ioctl(struct inode * inode, struct file *filp, 2879pmu_ioctl(struct inode * inode, struct file *filp,
2895 u_int cmd, u_long arg) 2880 u_int cmd, u_long arg)
2896{ 2881{
2897 struct pmu_private *pp = filp->private_data;
2898 __u32 __user *argp = (__u32 __user *)arg; 2882 __u32 __user *argp = (__u32 __user *)arg;
2899 int error; 2883 int error = -EINVAL;
2900 2884
2901 switch (cmd) { 2885 switch (cmd) {
2886#ifdef CONFIG_PM
2902 case PMU_IOC_SLEEP: 2887 case PMU_IOC_SLEEP:
2903 if (!capable(CAP_SYS_ADMIN)) 2888 if (!capable(CAP_SYS_ADMIN))
2904 return -EACCES; 2889 return -EACCES;
@@ -2920,12 +2905,13 @@ pmu_ioctl(struct inode * inode, struct file *filp,
2920 error = -ENOSYS; 2905 error = -ENOSYS;
2921 } 2906 }
2922 sleep_in_progress = 0; 2907 sleep_in_progress = 0;
2923 return error; 2908 break;
2924 case PMU_IOC_CAN_SLEEP: 2909 case PMU_IOC_CAN_SLEEP:
2925 if (pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) < 0) 2910 if (pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) < 0)
2926 return put_user(0, argp); 2911 return put_user(0, argp);
2927 else 2912 else
2928 return put_user(1, argp); 2913 return put_user(1, argp);
2914#endif /* CONFIG_PM */
2929 2915
2930#ifdef CONFIG_PMAC_BACKLIGHT 2916#ifdef CONFIG_PMAC_BACKLIGHT
2931 /* Backlight should have its own device or go via 2917 /* Backlight should have its own device or go via
@@ -2946,11 +2932,13 @@ pmu_ioctl(struct inode * inode, struct file *filp,
2946 error = get_user(value, argp); 2932 error = get_user(value, argp);
2947 if (!error) 2933 if (!error)
2948 error = set_backlight_level(value); 2934 error = set_backlight_level(value);
2949 return error; 2935 break;
2950 } 2936 }
2951#ifdef CONFIG_INPUT_ADBHID 2937#ifdef CONFIG_INPUT_ADBHID
2952 case PMU_IOC_GRAB_BACKLIGHT: { 2938 case PMU_IOC_GRAB_BACKLIGHT: {
2939 struct pmu_private *pp = filp->private_data;
2953 unsigned long flags; 2940 unsigned long flags;
2941
2954 if (pp->backlight_locker) 2942 if (pp->backlight_locker)
2955 return 0; 2943 return 0;
2956 pp->backlight_locker = 1; 2944 pp->backlight_locker = 1;
@@ -2966,7 +2954,7 @@ pmu_ioctl(struct inode * inode, struct file *filp,
2966 case PMU_IOC_HAS_ADB: 2954 case PMU_IOC_HAS_ADB:
2967 return put_user(pmu_has_adb, argp); 2955 return put_user(pmu_has_adb, argp);
2968 } 2956 }
2969 return -EINVAL; 2957 return error;
2970} 2958}
2971 2959
2972static struct file_operations pmu_device_fops __pmacdata = { 2960static struct file_operations pmu_device_fops __pmacdata = {
@@ -2982,14 +2970,16 @@ static struct miscdevice pmu_device __pmacdata = {
2982 PMU_MINOR, "pmu", &pmu_device_fops 2970 PMU_MINOR, "pmu", &pmu_device_fops
2983}; 2971};
2984 2972
2985void pmu_device_init(void) 2973static int pmu_device_init(void)
2986{ 2974{
2987 if (!via) 2975 if (!via)
2988 return; 2976 return 0;
2989 if (misc_register(&pmu_device) < 0) 2977 if (misc_register(&pmu_device) < 0)
2990 printk(KERN_ERR "via-pmu: cannot register misc device.\n"); 2978 printk(KERN_ERR "via-pmu: cannot register misc device.\n");
2979 return 0;
2991} 2980}
2992#endif /* CONFIG_PMAC_PBOOK */ 2981device_initcall(pmu_device_init);
2982
2993 2983
2994#ifdef DEBUG_SLEEP 2984#ifdef DEBUG_SLEEP
2995static inline void __pmac 2985static inline void __pmac
@@ -3157,12 +3147,12 @@ EXPORT_SYMBOL(pmu_i2c_combined_read);
3157EXPORT_SYMBOL(pmu_i2c_stdsub_write); 3147EXPORT_SYMBOL(pmu_i2c_stdsub_write);
3158EXPORT_SYMBOL(pmu_i2c_simple_read); 3148EXPORT_SYMBOL(pmu_i2c_simple_read);
3159EXPORT_SYMBOL(pmu_i2c_simple_write); 3149EXPORT_SYMBOL(pmu_i2c_simple_write);
3160#ifdef CONFIG_PMAC_PBOOK 3150#ifdef CONFIG_PM
3161EXPORT_SYMBOL(pmu_register_sleep_notifier); 3151EXPORT_SYMBOL(pmu_register_sleep_notifier);
3162EXPORT_SYMBOL(pmu_unregister_sleep_notifier); 3152EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
3163EXPORT_SYMBOL(pmu_enable_irled); 3153EXPORT_SYMBOL(pmu_enable_irled);
3164EXPORT_SYMBOL(pmu_battery_count); 3154EXPORT_SYMBOL(pmu_battery_count);
3165EXPORT_SYMBOL(pmu_batteries); 3155EXPORT_SYMBOL(pmu_batteries);
3166EXPORT_SYMBOL(pmu_power_flags); 3156EXPORT_SYMBOL(pmu_power_flags);
3167#endif /* CONFIG_PMAC_PBOOK */ 3157#endif /* CONFIG_PM */
3168 3158