Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[pandora-kernel.git] / arch / m68k / mac / config.c
index 562b38d..01b468b 100644 (file)
@@ -49,6 +49,7 @@ struct mac_booter_data mac_bi_data;
 int mac_bisize = sizeof mac_bi_data;
 
 struct mac_hw_present mac_hw_present;
+EXPORT_SYMBOL(mac_hw_present);
 
 /* New m68k bootinfo stuff and videobase */
 
@@ -59,15 +60,15 @@ extern struct mem_info m68k_ramdisk;
 
 extern char m68k_command_line[CL_SIZE];
 
-void *mac_env;         /* Loaded by the boot asm */
+void *mac_env;                                 /* Loaded by the boot asm */
 
 /* The phys. video addr. - might be bogus on some machines */
 unsigned long mac_orig_videoaddr;
 
 /* Mac specific timer functions */
-extern unsigned long mac_gettimeoffset (void);
-extern int mac_hwclk (int, struct rtc_time *);
-extern int mac_set_clock_mmss (unsigned long);
+extern unsigned long mac_gettimeoffset(void);
+extern int mac_hwclk(int, struct rtc_time *);
+extern int mac_set_clock_mmss(unsigned long);
 extern int show_mac_interrupts(struct seq_file *, void *);
 extern void iop_preinit(void);
 extern void iop_init(void);
@@ -82,13 +83,9 @@ extern void mac_mksound(unsigned int, unsigned int);
 
 extern void nubus_sweep_video(void);
 
-/* Mac specific debug functions (in debug.c) */
-extern void mac_debug_init(void);
-extern void mac_debugging_long(int, long);
-
 static void mac_get_model(char *str);
 
-static void mac_sched_init(irq_handler_t vector)
+static void __init mac_sched_init(irq_handler_t vector)
 {
        via_init_clock(vector);
 }
@@ -99,51 +96,52 @@ static void mac_sched_init(irq_handler_t vector)
 
 int __init mac_parse_bootinfo(const struct bi_record *record)
 {
-    int unknown = 0;
-    const u_long *data = record->data;
+       int unknown = 0;
+       const u_long *data = record->data;
 
-    switch (record->tag) {
+       switch (record->tag) {
        case BI_MAC_MODEL:
-           mac_bi_data.id = *data;
-           break;
+               mac_bi_data.id = *data;
+               break;
        case BI_MAC_VADDR:
-           mac_bi_data.videoaddr = *data;
-           break;
+               mac_bi_data.videoaddr = *data;
+               break;
        case BI_MAC_VDEPTH:
-           mac_bi_data.videodepth = *data;
-           break;
+               mac_bi_data.videodepth = *data;
+               break;
        case BI_MAC_VROW:
-           mac_bi_data.videorow = *data;
-           break;
+               mac_bi_data.videorow = *data;
+               break;
        case BI_MAC_VDIM:
-           mac_bi_data.dimensions = *data;
-           break;
+               mac_bi_data.dimensions = *data;
+               break;
        case BI_MAC_VLOGICAL:
-           mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
-           mac_orig_videoaddr = *data;
-           break;
+               mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
+               mac_orig_videoaddr = *data;
+               break;
        case BI_MAC_SCCBASE:
-           mac_bi_data.sccbase = *data;
-           break;
+               mac_bi_data.sccbase = *data;
+               break;
        case BI_MAC_BTIME:
-           mac_bi_data.boottime = *data;
-           break;
+               mac_bi_data.boottime = *data;
+               break;
        case BI_MAC_GMTBIAS:
-           mac_bi_data.gmtbias = *data;
-           break;
+               mac_bi_data.gmtbias = *data;
+               break;
        case BI_MAC_MEMSIZE:
-           mac_bi_data.memsize = *data;
-           break;
+               mac_bi_data.memsize = *data;
+               break;
        case BI_MAC_CPUID:
-           mac_bi_data.cpuid = *data;
-           break;
-        case BI_MAC_ROMBASE:
-           mac_bi_data.rombase = *data;
-           break;
+               mac_bi_data.cpuid = *data;
+               break;
+       case BI_MAC_ROMBASE:
+               mac_bi_data.rombase = *data;
+               break;
        default:
-           unknown = 1;
-    }
-    return(unknown);
+               unknown = 1;
+               break;
+       }
+       return unknown;
 }
 
 /*
@@ -155,6 +153,7 @@ int __init mac_parse_bootinfo(const struct bi_record *record)
 static void mac_cache_card_flush(int writeback)
 {
        unsigned long flags;
+
        local_irq_save(flags);
        via_flush_cache();
        local_irq_restore(flags);
@@ -162,28 +161,24 @@ static void mac_cache_card_flush(int writeback)
 
 void __init config_mac(void)
 {
-       if (!MACH_IS_MAC) {
-         printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
-       }
+       if (!MACH_IS_MAC)
+               printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
 
-       mach_sched_init      = mac_sched_init;
-       mach_init_IRQ        = mac_init_IRQ;
-       mach_get_model   = mac_get_model;
-       mach_gettimeoffset   = mac_gettimeoffset;
+       mach_sched_init = mac_sched_init;
+       mach_init_IRQ = mac_init_IRQ;
+       mach_get_model = mac_get_model;
+       mach_gettimeoffset = mac_gettimeoffset;
 #warning move to adb/via init
 #if 0
-       mach_hwclk           = mac_hwclk;
+       mach_hwclk = mac_hwclk;
 #endif
-       mach_set_clock_mmss      = mac_set_clock_mmss;
-       mach_reset           = mac_reset;
-       mach_halt            = mac_poweroff;
-       mach_power_off       = mac_poweroff;
+       mach_set_clock_mmss = mac_set_clock_mmss;
+       mach_reset = mac_reset;
+       mach_halt = mac_poweroff;
+       mach_power_off = mac_poweroff;
        mach_max_dma_address = 0xffffffff;
-#if 0
-       mach_debug_init  = mac_debug_init;
-#endif
 #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
-        mach_beep            = mac_mksound;
+       mach_beep = mac_mksound;
 #endif
 #ifdef CONFIG_HEARTBEAT
 #if 0
@@ -199,21 +194,22 @@ void __init config_mac(void)
        mac_identify();
        mac_report_hardware();
 
-       /* AFAIK only the IIci takes a cache card.  The IIfx has onboard
-          cache ... someone needs to figure out how to tell if it's on or
-          not. */
+       /*
+        * AFAIK only the IIci takes a cache card.  The IIfx has onboard
+        * cache ... someone needs to figure out how to tell if it's on or
+        * not.
+        */
 
        if (macintosh_config->ident == MAC_MODEL_IICI
-           || macintosh_config->ident == MAC_MODEL_IIFX) {
+           || macintosh_config->ident == MAC_MODEL_IIFX)
                mach_l2_flush = mac_cache_card_flush;
-       }
 
        /*
         * Check for machine specific fixups.
         */
 
 #ifdef OLD_NUBUS_CODE
-        nubus_sweep_video();
+       nubus_sweep_video();
 #endif
 }
 
@@ -233,8 +229,7 @@ void __init config_mac(void)
 struct mac_model *macintosh_config;
 EXPORT_SYMBOL(macintosh_config);
 
-static struct mac_model mac_data_table[]=
-{
+static struct mac_model mac_data_table[] = {
        /*
         *      We'll pretend to be a Macintosh II, that's pretty safe.
         */
@@ -289,7 +284,7 @@ static struct mac_model mac_data_table[]=
        },
 
        /*
-        *      Weirdified MacII hardware - all subtley different. Gee thanks
+        *      Weirdified MacII hardware - all subtly different. Gee thanks
         *      Apple. All these boxes seem to have VIA2 in a different place to
         *      the MacII (+1A000 rather than +4000)
         * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
@@ -712,7 +707,7 @@ static struct mac_model mac_data_table[]=
         * All of these probably have onboard SONIC in the Dock which
         * means we'll have to probe for it eventually.
         *
-        * Are these reallly MAC_VIA_IIci? The developer notes for the
+        * Are these really MAC_VIA_IIci? The developer notes for the
         * Duos show pretty much the same custom parts as in most of
         * the other PowerBooks which would imply MAC_VIA_QUADRA.
         */
@@ -775,7 +770,7 @@ static struct mac_model mac_data_table[]=
        }
 };
 
-void mac_identify(void)
+void __init mac_identify(void)
 {
        struct mac_model *m;
 
@@ -784,12 +779,12 @@ void mac_identify(void)
        if (!model) {
                /* no bootinfo model id -> NetBSD booter was used! */
                /* XXX FIXME: breaks for model > 31 */
-               model=(mac_bi_data.cpuid>>2)&63;
-               printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
+               model = (mac_bi_data.cpuid >> 2) & 63;
+               printk(KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
        }
 
        macintosh_config = mac_data_table;
-       for (m = macintosh_config ; m->ident != -1 ; m++) {
+       for (m = macintosh_config; m->ident != -1; m++) {
                if (m->ident == model) {
                        macintosh_config = m;
                        break;
@@ -801,27 +796,26 @@ void mac_identify(void)
        /* the serial ports set to "Faster" mode in MacOS. */
 
        iop_preinit();
-       mac_debug_init();
 
-       printk (KERN_INFO "Detected Macintosh model: %d \n", model);
+       printk(KERN_INFO "Detected Macintosh model: %d \n", model);
 
        /*
         * Report booter data:
         */
-       printk (KERN_DEBUG " Penguin bootinfo data:\n");
-       printk (KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
+       printk(KERN_DEBUG " Penguin bootinfo data:\n");
+       printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
                mac_bi_data.videoaddr, mac_bi_data.videorow,
                mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
                mac_bi_data.dimensions >> 16);
-       printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
+       printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
                mac_bi_data.videological, mac_orig_videoaddr,
                mac_bi_data.sccbase);
-       printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
+       printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
                mac_bi_data.boottime, mac_bi_data.gmtbias);
-       printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
+       printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
                mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
 #if 0
-       printk ("Ramdisk: addr 0x%lx size 0x%lx\n",
+       printk("Ramdisk: addr 0x%lx size 0x%lx\n",
                m68k_ramdisk.addr, m68k_ramdisk.size);
 #endif
 
@@ -830,22 +824,22 @@ void mac_identify(void)
         */
        switch (macintosh_config->scsi_type) {
        case MAC_SCSI_OLD:
-         MACHW_SET(MAC_SCSI_80);
-         break;
+               MACHW_SET(MAC_SCSI_80);
+               break;
        case MAC_SCSI_QUADRA:
        case MAC_SCSI_QUADRA2:
        case MAC_SCSI_QUADRA3:
-         MACHW_SET(MAC_SCSI_96);
-         if ((macintosh_config->ident == MAC_MODEL_Q900) ||
-             (macintosh_config->ident == MAC_MODEL_Q950))
-           MACHW_SET(MAC_SCSI_96_2);
-         break;
+               MACHW_SET(MAC_SCSI_96);
+               if ((macintosh_config->ident == MAC_MODEL_Q900) ||
+                   (macintosh_config->ident == MAC_MODEL_Q950))
+                       MACHW_SET(MAC_SCSI_96_2);
+               break;
        default:
-         printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
-         MACHW_SET(MAC_SCSI_80);
-         break;
-
+               printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
+               MACHW_SET(MAC_SCSI_80);
+               break;
        }
+
        iop_init();
        via_init();
        oss_init();
@@ -853,13 +847,13 @@ void mac_identify(void)
        baboon_init();
 }
 
-void mac_report_hardware(void)
+void __init mac_report_hardware(void)
 {
        printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
 }
 
 static void mac_get_model(char *str)
 {
-       strcpy(str,"Macintosh ");
+       strcpy(str, "Macintosh ");
        strcat(str, macintosh_config->name);
 }