sh: r7785rp: Fix up DECLARE_INTC_DESC() arg mismatch.
[linux-2.6.git] / arch / sh / boards / renesas / hs7751rvoip / setup.c
1 /*
2  * Renesas Technology Sales HS7751RVoIP Support.
3  *
4  * Copyright (C) 2000  Kazumoto Kojima
5  *
6  * Modified for HS7751RVoIP by
7  * Atom Create Engineering Co., Ltd. 2002.
8  * Lineo uSolutions, Inc. 2003.
9  */
10 #include <linux/init.h>
11 #include <linux/irq.h>
12 #include <linux/mm.h>
13 #include <linux/pm.h>
14 #include <asm/hs7751rvoip.h>
15 #include <asm/io.h>
16 #include <asm/machvec.h>
17
18 static void hs7751rvoip_power_off(void)
19 {
20         ctrl_outw(ctrl_inw(PA_OUTPORTR) & 0xffdf, PA_OUTPORTR);
21 }
22
23 void *area5_io8_base;
24 void *area6_io8_base;
25 void *area5_io16_base;
26 void *area6_io16_base;
27
28 static int __init hs7751rvoip_cf_init(void)
29 {
30         pgprot_t prot;
31         unsigned long paddrbase;
32
33         /* open I/O area window */
34         paddrbase = virt_to_phys((void *)(PA_AREA5_IO+0x00000800));
35         prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_COM16);
36         area5_io16_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
37         if (!area5_io16_base) {
38                 printk("allocate_cf_area : can't open CF I/O window!\n");
39                 return -ENOMEM;
40         }
41
42         /* XXX : do we need attribute and common-memory area also? */
43
44         paddrbase = virt_to_phys((void *)PA_AREA6_IO);
45 #if defined(CONFIG_HS7751RVOIP_CODEC)
46         prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_COM8);
47 #else
48         prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO8);
49 #endif
50         area6_io8_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
51         if (!area6_io8_base) {
52                 printk("allocate_cf_area : can't open CODEC I/O 8bit window!\n");
53                 return -ENOMEM;
54         }
55         prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16);
56         area6_io16_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
57         if (!area6_io16_base) {
58                 printk("allocate_cf_area : can't open CODEC I/O 16bit window!\n");
59                 return -ENOMEM;
60         }
61
62         return 0;
63 }
64 device_initcall(hs7751rvoip_cf_init);
65
66 /*
67  * Initialize the board
68  */
69 static void __init hs7751rvoip_setup(char **cmdline_p)
70 {
71         ctrl_outb(0xf0, PA_OUTPORTR);
72         pm_power_off = hs7751rvoip_power_off;
73
74         printk(KERN_INFO "Renesas Technology Sales HS7751RVoIP-2 support.\n");
75 }
76
77 static struct sh_machine_vector mv_hs7751rvoip __initmv = {
78         .mv_name                = "HS7751RVoIP",
79         .mv_setup               = hs7751rvoip_setup,
80         .mv_nr_irqs             = 72,
81
82         .mv_inb                 = hs7751rvoip_inb,
83         .mv_inw                 = hs7751rvoip_inw,
84         .mv_inl                 = hs7751rvoip_inl,
85         .mv_outb                = hs7751rvoip_outb,
86         .mv_outw                = hs7751rvoip_outw,
87         .mv_outl                = hs7751rvoip_outl,
88
89         .mv_inb_p               = hs7751rvoip_inb_p,
90         .mv_inw_p               = hs7751rvoip_inw,
91         .mv_inl_p               = hs7751rvoip_inl,
92         .mv_outb_p              = hs7751rvoip_outb_p,
93         .mv_outw_p              = hs7751rvoip_outw,
94         .mv_outl_p              = hs7751rvoip_outl,
95
96         .mv_insb                = hs7751rvoip_insb,
97         .mv_insw                = hs7751rvoip_insw,
98         .mv_insl                = hs7751rvoip_insl,
99         .mv_outsb               = hs7751rvoip_outsb,
100         .mv_outsw               = hs7751rvoip_outsw,
101         .mv_outsl               = hs7751rvoip_outsl,
102
103         .mv_init_irq            = init_hs7751rvoip_IRQ,
104         .mv_ioport_map          = hs7751rvoip_ioport_map,
105 };