mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 00:20:52 -05:00
c43278f073
When building with W=1: arch/m68k/mac/iop.c:235:13: warning: no previous prototype for ‘iop_init’ [-Wmissing-prototypes] 235 | void __init iop_init(void) | ^~~~~~~~ arch/m68k/mac/via.c:112:13: warning: no previous prototype for ‘via_init’ [-Wmissing-prototypes] 111 | void __init via_init(void) | ^~~~~~~~ arch/m68k/mac/via.c:623:13: warning: no previous prototype for ‘via_init_clock’ [-Wmissing-prototypes] 593 | void __init via_init_clock(void) | ^~~~~~~~~~~~~~ arch/m68k/mac/oss.c:37:13: warning: no previous prototype for ‘oss_init’ [-Wmissing-prototypes] 37 | void __init oss_init(void) | ^~~~~~~~ arch/m68k/mac/psc.c:76:13: warning: no previous prototype for ‘psc_init’ [-Wmissing-prototypes] 76 | void __init psc_init(void) | ^~~~~~~~ arch/m68k/mac/baboon.c:25:13: warning: no previous prototype for ‘baboon_init’ [-Wmissing-prototypes] 25 | void __init baboon_init(void) | ^~~~~~~~~~~ arch/m68k/mac/macboing.c:155:6: warning: no previous prototype for ‘mac_mksound’ [-Wmissing-prototypes] 155 | void mac_mksound( unsigned int freq, unsigned int length ) | ^~~~~~~~~~~ arch/m68k/mac/misc.c:608:5: warning: no previous prototype for ‘mac_hwclk’ [-Wmissing-prototypes] 608 | int mac_hwclk(int op, struct rtc_time *t) | ^~~~~~~~~ Fix this by introducing a new header file "mac.h" for holding the prototypes of functions implemented in arch/m68k/mac/. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/d1fe0014a9e472a305333de4fa17f335c93d73af.1694613528.git.geert@linux-m68k.org
90 lines
1.9 KiB
C
90 lines
1.9 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Baboon Custom IC Management
|
|
*
|
|
* The Baboon custom IC controls the IDE, PCMCIA and media bay on the
|
|
* PowerBook 190. It multiplexes multiple interrupt sources onto the
|
|
* Nubus slot $C interrupt.
|
|
*/
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/irq.h>
|
|
|
|
#include <asm/macintosh.h>
|
|
#include <asm/macints.h>
|
|
#include <asm/mac_baboon.h>
|
|
|
|
#include "mac.h"
|
|
|
|
int baboon_present;
|
|
static volatile struct baboon *baboon;
|
|
|
|
/*
|
|
* Baboon initialization.
|
|
*/
|
|
|
|
void __init baboon_init(void)
|
|
{
|
|
if (macintosh_config->ident != MAC_MODEL_PB190) {
|
|
baboon = NULL;
|
|
baboon_present = 0;
|
|
return;
|
|
}
|
|
|
|
baboon = (struct baboon *) BABOON_BASE;
|
|
baboon_present = 1;
|
|
|
|
pr_debug("Baboon detected at %p\n", baboon);
|
|
}
|
|
|
|
/*
|
|
* Baboon interrupt handler.
|
|
* XXX how do you clear a pending IRQ? is it even necessary?
|
|
*/
|
|
|
|
static void baboon_irq(struct irq_desc *desc)
|
|
{
|
|
short events, irq_bit;
|
|
int irq_num;
|
|
|
|
events = baboon->mb_ifr & 0x07;
|
|
irq_num = IRQ_BABOON_0;
|
|
irq_bit = 1;
|
|
do {
|
|
if (events & irq_bit) {
|
|
events &= ~irq_bit;
|
|
generic_handle_irq(irq_num);
|
|
}
|
|
++irq_num;
|
|
irq_bit <<= 1;
|
|
} while (events);
|
|
}
|
|
|
|
/*
|
|
* Register the Baboon interrupt dispatcher on nubus slot $C.
|
|
*/
|
|
|
|
void __init baboon_register_interrupts(void)
|
|
{
|
|
irq_set_chained_handler(IRQ_NUBUS_C, baboon_irq);
|
|
}
|
|
|
|
/*
|
|
* The means for masking individual Baboon interrupts remains a mystery.
|
|
* However, since we only use the IDE IRQ, we can just enable/disable all
|
|
* Baboon interrupts. If/when we handle more than one Baboon IRQ, we must
|
|
* either figure out how to mask them individually or else implement the
|
|
* same workaround that's used for NuBus slots (see nubus_disabled and
|
|
* via_nubus_irq_shutdown).
|
|
*/
|
|
|
|
void baboon_irq_enable(int irq)
|
|
{
|
|
mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C));
|
|
}
|
|
|
|
void baboon_irq_disable(int irq)
|
|
{
|
|
mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C));
|
|
}
|