Skip to content

Commit 8c87093

Browse files
ozbenhLinus Torvalds
authored and
Linus Torvalds
committed
[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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent fcd16cc commit 8c87093

File tree

20 files changed

+193
-221
lines changed

20 files changed

+193
-221
lines changed

arch/ppc/platforms/pmac_sleep.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
.section .text
4747
.align 5
4848

49-
#if defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_CPU_FREQ_PMAC)
49+
#if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC)
5050

5151
/* This gets called by via-pmu.c late during the sleep process.
5252
* The PMU was already send the sleep command and will shut us down
@@ -382,7 +382,7 @@ turn_on_mmu:
382382
isync
383383
rfi
384384

385-
#endif /* defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_CPU_FREQ) */
385+
#endif /* defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ) */
386386

387387
.section .data
388388
.balign L1_CACHE_LINE_SIZE

arch/ppc/platforms/pmac_time.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ via_calibrate_decr(void)
206206
return 1;
207207
}
208208

209-
#ifdef CONFIG_PMAC_PBOOK
209+
#ifdef CONFIG_PM
210210
/*
211211
* Reset the time after a sleep.
212212
*/
@@ -238,7 +238,7 @@ time_sleep_notify(struct pmu_sleep_notifier *self, int when)
238238
static struct pmu_sleep_notifier time_sleep_notifier __pmacdata = {
239239
time_sleep_notify, SLEEP_LEVEL_MISC,
240240
};
241-
#endif /* CONFIG_PMAC_PBOOK */
241+
#endif /* CONFIG_PM */
242242

243243
/*
244244
* Query the OF and get the decr frequency.
@@ -251,9 +251,9 @@ pmac_calibrate_decr(void)
251251
struct device_node *cpu;
252252
unsigned int freq, *fp;
253253

254-
#ifdef CONFIG_PMAC_PBOOK
254+
#ifdef CONFIG_PM
255255
pmu_register_sleep_notifier(&time_sleep_notifier);
256-
#endif /* CONFIG_PMAC_PBOOK */
256+
#endif /* CONFIG_PM */
257257

258258
/* We assume MacRISC2 machines have correct device-tree
259259
* calibration. That's better since the VIA itself seems

drivers/block/swim3.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static int floppy_revalidate(struct gendisk *disk);
253253
static int swim3_add_device(struct device_node *swims);
254254
int swim3_init(void);
255255

256-
#ifndef CONFIG_PMAC_PBOOK
256+
#ifndef CONFIG_PMAC_MEDIABAY
257257
#define check_media_bay(which, what) 1
258258
#endif
259259

@@ -297,9 +297,11 @@ static void do_fd_request(request_queue_t * q)
297297
int i;
298298
for(i=0;i<floppy_count;i++)
299299
{
300+
#ifdef CONFIG_PMAC_MEDIABAY
300301
if (floppy_states[i].media_bay &&
301302
check_media_bay(floppy_states[i].media_bay, MB_FD))
302303
continue;
304+
#endif /* CONFIG_PMAC_MEDIABAY */
303305
start_request(&floppy_states[i]);
304306
}
305307
sti();
@@ -856,8 +858,10 @@ static int floppy_ioctl(struct inode *inode, struct file *filp,
856858
if ((cmd & 0x80) && !capable(CAP_SYS_ADMIN))
857859
return -EPERM;
858860

861+
#ifdef CONFIG_PMAC_MEDIABAY
859862
if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD))
860863
return -ENXIO;
864+
#endif
861865

862866
switch (cmd) {
863867
case FDEJECT:
@@ -881,8 +885,10 @@ static int floppy_open(struct inode *inode, struct file *filp)
881885
int n, err = 0;
882886

883887
if (fs->ref_count == 0) {
888+
#ifdef CONFIG_PMAC_MEDIABAY
884889
if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD))
885890
return -ENXIO;
891+
#endif
886892
out_8(&sw->setup, S_IBM_DRIVE | S_FCLK_DIV2);
887893
out_8(&sw->control_bic, 0xff);
888894
out_8(&sw->mode, 0x95);
@@ -967,8 +973,10 @@ static int floppy_revalidate(struct gendisk *disk)
967973
struct swim3 __iomem *sw;
968974
int ret, n;
969975

976+
#ifdef CONFIG_PMAC_MEDIABAY
970977
if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD))
971978
return -ENXIO;
979+
#endif
972980

973981
sw = fs->swim3;
974982
grab_drive(fs, revalidating, 0);

drivers/char/misc.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,6 @@ static int __init misc_init(void)
308308
#endif
309309
#ifdef CONFIG_BVME6000
310310
rtc_DP8570A_init();
311-
#endif
312-
#ifdef CONFIG_PMAC_PBOOK
313-
pmu_device_init();
314311
#endif
315312
if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
316313
printk("unable to get major %d for misc devices\n",

drivers/ide/ppc/pmac.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,9 +1324,9 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
13241324
/* XXX FIXME: Media bay stuff need re-organizing */
13251325
if (np->parent && np->parent->name
13261326
&& strcasecmp(np->parent->name, "media-bay") == 0) {
1327-
#ifdef CONFIG_PMAC_PBOOK
1327+
#ifdef CONFIG_PMAC_MEDIABAY
13281328
media_bay_set_ide_infos(np->parent, pmif->regbase, pmif->irq, hwif->index);
1329-
#endif /* CONFIG_PMAC_PBOOK */
1329+
#endif /* CONFIG_PMAC_MEDIABAY */
13301330
pmif->mediabay = 1;
13311331
if (!bidp)
13321332
pmif->aapl_bus_id = 1;
@@ -1382,10 +1382,10 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
13821382
hwif->index, model_name[pmif->kind], pmif->aapl_bus_id,
13831383
pmif->mediabay ? " (mediabay)" : "", hwif->irq);
13841384

1385-
#ifdef CONFIG_PMAC_PBOOK
1385+
#ifdef CONFIG_PMAC_MEDIABAY
13861386
if (pmif->mediabay && check_media_bay_by_base(pmif->regbase, MB_CD) == 0)
13871387
hwif->noprobe = 0;
1388-
#endif /* CONFIG_PMAC_PBOOK */
1388+
#endif /* CONFIG_PMAC_MEDIABAY */
13891389

13901390
hwif->sg_max_nents = MAX_DCMDS;
13911391

drivers/ieee1394/ohci1394.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,16 +3538,16 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)
35383538

35393539
static int ohci1394_pci_resume (struct pci_dev *pdev)
35403540
{
3541-
#ifdef CONFIG_PMAC_PBOOK
3542-
{
3541+
#ifdef CONFIG_PPC_PMAC
3542+
if (_machine == _MACH_Pmac) {
35433543
struct device_node *of_node;
35443544

35453545
/* Re-enable 1394 */
35463546
of_node = pci_device_to_OF_node (pdev);
35473547
if (of_node)
35483548
pmac_call_feature (PMAC_FTR_1394_ENABLE, of_node, 0, 1);
35493549
}
3550-
#endif
3550+
#endif /* CONFIG_PPC_PMAC */
35513551

35523552
pci_enable_device(pdev);
35533553

@@ -3557,8 +3557,8 @@ static int ohci1394_pci_resume (struct pci_dev *pdev)
35573557

35583558
static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state)
35593559
{
3560-
#ifdef CONFIG_PMAC_PBOOK
3561-
{
3560+
#ifdef CONFIG_PPC_PMAC
3561+
if (_machine == _MACH_Pmac) {
35623562
struct device_node *of_node;
35633563

35643564
/* Disable 1394 */

drivers/macintosh/Kconfig

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -86,33 +86,18 @@ config PMAC_SMU
8686
on the "SMU" system control chip which replaces the old PMU.
8787
If you don't know, say Y.
8888

89-
config 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-
108-
config PM
109-
bool
110-
depends on PPC_PMAC && ADB_PMU && PMAC_PBOOK
111-
default y
112-
11389
config PMAC_APM_EMU
11490
tristate "APM emulation"
115-
depends on PMAC_PBOOK
91+
depends on PPC_PMAC && PPC32 && PM
92+
93+
config 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
116101

117102
# made a separate option since backlight may end up beeing used
118103
# on non-powerbook machines (but only on PMU based ones AFAIK)

drivers/macintosh/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
obj-$(CONFIG_PPC_PMAC) += macio_asic.o
88

9-
obj-$(CONFIG_PMAC_PBOOK) += mediabay.o
9+
obj-$(CONFIG_PMAC_MEDIABAY) += mediabay.o
1010
obj-$(CONFIG_MAC_EMUMOUSEBTN) += mac_hid.o
1111
obj-$(CONFIG_INPUT_ADBHID) += adbhid.o
1212
obj-$(CONFIG_ANSLCD) += ans-lcd.o

drivers/macintosh/adb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int sleepy_trackpad;
9090
static int autopoll_devs;
9191
int __adb_probe_sync;
9292

93-
#ifdef CONFIG_PMAC_PBOOK
93+
#ifdef CONFIG_PM
9494
static int adb_notify_sleep(struct pmu_sleep_notifier *self, int when);
9595
static struct pmu_sleep_notifier adb_sleep_notifier = {
9696
adb_notify_sleep,
@@ -320,9 +320,9 @@ int __init adb_init(void)
320320
printk(KERN_WARNING "Warning: no ADB interface detected\n");
321321
adb_controller = NULL;
322322
} else {
323-
#ifdef CONFIG_PMAC_PBOOK
323+
#ifdef CONFIG_PM
324324
pmu_register_sleep_notifier(&adb_sleep_notifier);
325-
#endif /* CONFIG_PMAC_PBOOK */
325+
#endif /* CONFIG_PM */
326326
#ifdef CONFIG_PPC
327327
if (machine_is_compatible("AAPL,PowerBook1998") ||
328328
machine_is_compatible("PowerBook1,1"))
@@ -337,7 +337,7 @@ int __init adb_init(void)
337337

338338
__initcall(adb_init);
339339

340-
#ifdef CONFIG_PMAC_PBOOK
340+
#ifdef CONFIG_PM
341341
/*
342342
* notify clients before sleep and reset bus afterwards
343343
*/
@@ -378,7 +378,7 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when)
378378
}
379379
return PBOOK_SLEEP_OK;
380380
}
381-
#endif /* CONFIG_PMAC_PBOOK */
381+
#endif /* CONFIG_PM */
382382

383383
static int
384384
do_adb_reset_bus(void)

0 commit comments

Comments
 (0)