Skip to content

Commit

Permalink
[PATCH] ppc32: Remove CONFIG_PMAC_PBOOK
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ozbenh authored and Linus Torvalds committed Jun 27, 2005
1 parent fcd16cc commit 8c87093
Show file tree
Hide file tree
Showing 20 changed files with 193 additions and 221 deletions.
4 changes: 2 additions & 2 deletions arch/ppc/platforms/pmac_sleep.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
.section .text
.align 5

#if defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_CPU_FREQ_PMAC)
#if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC)

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

#endif /* defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_CPU_FREQ) */
#endif /* defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ) */

.section .data
.balign L1_CACHE_LINE_SIZE
Expand Down
8 changes: 4 additions & 4 deletions arch/ppc/platforms/pmac_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ via_calibrate_decr(void)
return 1;
}

#ifdef CONFIG_PMAC_PBOOK
#ifdef CONFIG_PM
/*
* Reset the time after a sleep.
*/
Expand Down Expand Up @@ -238,7 +238,7 @@ time_sleep_notify(struct pmu_sleep_notifier *self, int when)
static struct pmu_sleep_notifier time_sleep_notifier __pmacdata = {
time_sleep_notify, SLEEP_LEVEL_MISC,
};
#endif /* CONFIG_PMAC_PBOOK */
#endif /* CONFIG_PM */

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

#ifdef CONFIG_PMAC_PBOOK
#ifdef CONFIG_PM
pmu_register_sleep_notifier(&time_sleep_notifier);
#endif /* CONFIG_PMAC_PBOOK */
#endif /* CONFIG_PM */

/* We assume MacRISC2 machines have correct device-tree
* calibration. That's better since the VIA itself seems
Expand Down
10 changes: 9 additions & 1 deletion drivers/block/swim3.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static int floppy_revalidate(struct gendisk *disk);
static int swim3_add_device(struct device_node *swims);
int swim3_init(void);

#ifndef CONFIG_PMAC_PBOOK
#ifndef CONFIG_PMAC_MEDIABAY
#define check_media_bay(which, what) 1
#endif

Expand Down Expand Up @@ -297,9 +297,11 @@ static void do_fd_request(request_queue_t * q)
int i;
for(i=0;i<floppy_count;i++)
{
#ifdef CONFIG_PMAC_MEDIABAY
if (floppy_states[i].media_bay &&
check_media_bay(floppy_states[i].media_bay, MB_FD))
continue;
#endif /* CONFIG_PMAC_MEDIABAY */
start_request(&floppy_states[i]);
}
sti();
Expand Down Expand Up @@ -856,8 +858,10 @@ static int floppy_ioctl(struct inode *inode, struct file *filp,
if ((cmd & 0x80) && !capable(CAP_SYS_ADMIN))
return -EPERM;

#ifdef CONFIG_PMAC_MEDIABAY
if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD))
return -ENXIO;
#endif

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

if (fs->ref_count == 0) {
#ifdef CONFIG_PMAC_MEDIABAY
if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD))
return -ENXIO;
#endif
out_8(&sw->setup, S_IBM_DRIVE | S_FCLK_DIV2);
out_8(&sw->control_bic, 0xff);
out_8(&sw->mode, 0x95);
Expand Down Expand Up @@ -967,8 +973,10 @@ static int floppy_revalidate(struct gendisk *disk)
struct swim3 __iomem *sw;
int ret, n;

#ifdef CONFIG_PMAC_MEDIABAY
if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD))
return -ENXIO;
#endif

sw = fs->swim3;
grab_drive(fs, revalidating, 0);
Expand Down
3 changes: 0 additions & 3 deletions drivers/char/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,6 @@ static int __init misc_init(void)
#endif
#ifdef CONFIG_BVME6000
rtc_DP8570A_init();
#endif
#ifdef CONFIG_PMAC_PBOOK
pmu_device_init();
#endif
if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
printk("unable to get major %d for misc devices\n",
Expand Down
8 changes: 4 additions & 4 deletions drivers/ide/ppc/pmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1324,9 +1324,9 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
/* XXX FIXME: Media bay stuff need re-organizing */
if (np->parent && np->parent->name
&& strcasecmp(np->parent->name, "media-bay") == 0) {
#ifdef CONFIG_PMAC_PBOOK
#ifdef CONFIG_PMAC_MEDIABAY
media_bay_set_ide_infos(np->parent, pmif->regbase, pmif->irq, hwif->index);
#endif /* CONFIG_PMAC_PBOOK */
#endif /* CONFIG_PMAC_MEDIABAY */
pmif->mediabay = 1;
if (!bidp)
pmif->aapl_bus_id = 1;
Expand Down Expand Up @@ -1382,10 +1382,10 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
hwif->index, model_name[pmif->kind], pmif->aapl_bus_id,
pmif->mediabay ? " (mediabay)" : "", hwif->irq);

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

hwif->sg_max_nents = MAX_DCMDS;

Expand Down
10 changes: 5 additions & 5 deletions drivers/ieee1394/ohci1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -3538,16 +3538,16 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)

static int ohci1394_pci_resume (struct pci_dev *pdev)
{
#ifdef CONFIG_PMAC_PBOOK
{
#ifdef CONFIG_PPC_PMAC
if (_machine == _MACH_Pmac) {
struct device_node *of_node;

/* Re-enable 1394 */
of_node = pci_device_to_OF_node (pdev);
if (of_node)
pmac_call_feature (PMAC_FTR_1394_ENABLE, of_node, 0, 1);
}
#endif
#endif /* CONFIG_PPC_PMAC */

pci_enable_device(pdev);

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

static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state)
{
#ifdef CONFIG_PMAC_PBOOK
{
#ifdef CONFIG_PPC_PMAC
if (_machine == _MACH_Pmac) {
struct device_node *of_node;

/* Disable 1394 */
Expand Down
35 changes: 10 additions & 25 deletions drivers/macintosh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -86,33 +86,18 @@ config PMAC_SMU
on the "SMU" system control chip which replaces the old PMU.
If you don't know, say Y.

config PMAC_PBOOK
bool "Power management support for PowerBooks"
depends on ADB_PMU
---help---
This provides support for putting a PowerBook to sleep; it also
enables media bay support. Power management works on the
PB2400/3400/3500, Wallstreet, Lombard, and Bronze PowerBook G3 and
the Titanium Powerbook G4, as well as the iBooks. You should get
the power management daemon, pmud, to make it work and you must have
the /dev/pmu device (see the pmud README).

Get pmud from <ftp://ftp.samba.org/pub/ppclinux/pmud/>.

If you have a PowerBook, you should say Y here.

You may also want to compile the dma sound driver as a module and
have it autoloaded. The act of removing the module shuts down the
sound hardware for more power savings.

config PM
bool
depends on PPC_PMAC && ADB_PMU && PMAC_PBOOK
default y

config PMAC_APM_EMU
tristate "APM emulation"
depends on PMAC_PBOOK
depends on PPC_PMAC && PPC32 && PM

config PMAC_MEDIABAY
bool "Support PowerBook hotswap media bay"
depends on PPC_PMAC && PPC32
help
This option adds support for older PowerBook's hotswap media bay
that can contains batteries, floppy drives, or IDE devices. PCI
devices are not fully supported in the bay as I never had one to
try with

# made a separate option since backlight may end up beeing used
# on non-powerbook machines (but only on PMU based ones AFAIK)
Expand Down
2 changes: 1 addition & 1 deletion drivers/macintosh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

obj-$(CONFIG_PPC_PMAC) += macio_asic.o

obj-$(CONFIG_PMAC_PBOOK) += mediabay.o
obj-$(CONFIG_PMAC_MEDIABAY) += mediabay.o
obj-$(CONFIG_MAC_EMUMOUSEBTN) += mac_hid.o
obj-$(CONFIG_INPUT_ADBHID) += adbhid.o
obj-$(CONFIG_ANSLCD) += ans-lcd.o
Expand Down
10 changes: 5 additions & 5 deletions drivers/macintosh/adb.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static int sleepy_trackpad;
static int autopoll_devs;
int __adb_probe_sync;

#ifdef CONFIG_PMAC_PBOOK
#ifdef CONFIG_PM
static int adb_notify_sleep(struct pmu_sleep_notifier *self, int when);
static struct pmu_sleep_notifier adb_sleep_notifier = {
adb_notify_sleep,
Expand Down Expand Up @@ -320,9 +320,9 @@ int __init adb_init(void)
printk(KERN_WARNING "Warning: no ADB interface detected\n");
adb_controller = NULL;
} else {
#ifdef CONFIG_PMAC_PBOOK
#ifdef CONFIG_PM
pmu_register_sleep_notifier(&adb_sleep_notifier);
#endif /* CONFIG_PMAC_PBOOK */
#endif /* CONFIG_PM */
#ifdef CONFIG_PPC
if (machine_is_compatible("AAPL,PowerBook1998") ||
machine_is_compatible("PowerBook1,1"))
Expand All @@ -337,7 +337,7 @@ int __init adb_init(void)

__initcall(adb_init);

#ifdef CONFIG_PMAC_PBOOK
#ifdef CONFIG_PM
/*
* notify clients before sleep and reset bus afterwards
*/
Expand Down Expand Up @@ -378,7 +378,7 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when)
}
return PBOOK_SLEEP_OK;
}
#endif /* CONFIG_PMAC_PBOOK */
#endif /* CONFIG_PM */

static int
do_adb_reset_bus(void)
Expand Down

0 comments on commit 8c87093

Please sign in to comment.