diff options
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/hp6xx/hp6xx_apm.c | 22 | ||||
-rw-r--r-- | arch/sh/boards/renesas/sh7710voipgw/Makefile | 1 | ||||
-rw-r--r-- | arch/sh/boards/renesas/sh7710voipgw/setup.c | 94 | ||||
-rw-r--r-- | arch/sh/boards/renesas/x3proto/ilsel.c | 2 | ||||
-rw-r--r-- | arch/sh/boards/superh/microdev/io.c | 2 |
5 files changed, 18 insertions, 103 deletions
diff --git a/arch/sh/boards/hp6xx/hp6xx_apm.c b/arch/sh/boards/hp6xx/hp6xx_apm.c index 640ca2a74f16..177f4f028e0d 100644 --- a/arch/sh/boards/hp6xx/hp6xx_apm.c +++ b/arch/sh/boards/hp6xx/hp6xx_apm.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * bios-less APM driver for hp680 | 2 | * bios-less APM driver for hp680 |
3 | * | 3 | * |
4 | * Copyright 2005 (c) Andriy Skulysh <askulysh@gmail.com> | 4 | * Copyright 2005 (c) Andriy Skulysh <askulysh@gmail.com> |
5 | * Copyright 2008 (c) Kristoffer Ericson <kristoffer.ericson@gmail.com> | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or | 7 | * This program is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License. | 8 | * modify it under the terms of the GNU General Public License. |
@@ -15,17 +16,19 @@ | |||
15 | #include <asm/adc.h> | 16 | #include <asm/adc.h> |
16 | #include <asm/hp6xx.h> | 17 | #include <asm/hp6xx.h> |
17 | 18 | ||
18 | #define SH7709_PGDR 0xa400012c | 19 | /* percentage values */ |
19 | |||
20 | #define APM_CRITICAL 10 | 20 | #define APM_CRITICAL 10 |
21 | #define APM_LOW 30 | 21 | #define APM_LOW 30 |
22 | 22 | ||
23 | /* resonably sane values */ | ||
23 | #define HP680_BATTERY_MAX 898 | 24 | #define HP680_BATTERY_MAX 898 |
24 | #define HP680_BATTERY_MIN 486 | 25 | #define HP680_BATTERY_MIN 486 |
25 | #define HP680_BATTERY_AC_ON 1023 | 26 | #define HP680_BATTERY_AC_ON 1023 |
26 | 27 | ||
27 | #define MODNAME "hp6x0_apm" | 28 | #define MODNAME "hp6x0_apm" |
28 | 29 | ||
30 | #define PGDR 0xa400012c | ||
31 | |||
29 | static void hp6x0_apm_get_power_status(struct apm_power_info *info) | 32 | static void hp6x0_apm_get_power_status(struct apm_power_info *info) |
30 | { | 33 | { |
31 | int battery, backup, charging, percentage; | 34 | int battery, backup, charging, percentage; |
@@ -38,17 +41,26 @@ static void hp6x0_apm_get_power_status(struct apm_power_info *info) | |||
38 | percentage = 100 * (battery - HP680_BATTERY_MIN) / | 41 | percentage = 100 * (battery - HP680_BATTERY_MIN) / |
39 | (HP680_BATTERY_MAX - HP680_BATTERY_MIN); | 42 | (HP680_BATTERY_MAX - HP680_BATTERY_MIN); |
40 | 43 | ||
44 | /* % of full battery */ | ||
45 | info->battery_life = percentage; | ||
46 | |||
47 | /* We want our estimates in minutes */ | ||
48 | info->units = 0; | ||
49 | |||
50 | /* Extremely(!!) rough estimate, we will replace this with a datalist later on */ | ||
51 | info->time = (2 * battery); | ||
52 | |||
41 | info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ? | 53 | info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ? |
42 | APM_AC_ONLINE : APM_AC_OFFLINE; | 54 | APM_AC_ONLINE : APM_AC_OFFLINE; |
43 | 55 | ||
44 | pgdr = ctrl_inb(SH7709_PGDR); | 56 | pgdr = ctrl_inb(PGDR); |
45 | if (pgdr & PGDR_MAIN_BATTERY_OUT) { | 57 | if (pgdr & PGDR_MAIN_BATTERY_OUT) { |
46 | info->battery_status = APM_BATTERY_STATUS_NOT_PRESENT; | 58 | info->battery_status = APM_BATTERY_STATUS_NOT_PRESENT; |
47 | info->battery_flag = 0x80; | 59 | info->battery_flag = 0x80; |
48 | } else if (charging < 8) { | 60 | } else if (charging < 8) { |
49 | info->battery_status = APM_BATTERY_STATUS_CHARGING; | 61 | info->battery_status = APM_BATTERY_STATUS_CHARGING; |
50 | info->battery_flag = 0x08; | 62 | info->battery_flag = 0x08; |
51 | info->ac_line_status = 0xff; | 63 | info->ac_line_status = 0x01; |
52 | } else if (percentage <= APM_CRITICAL) { | 64 | } else if (percentage <= APM_CRITICAL) { |
53 | info->battery_status = APM_BATTERY_STATUS_CRITICAL; | 65 | info->battery_status = APM_BATTERY_STATUS_CRITICAL; |
54 | info->battery_flag = 0x04; | 66 | info->battery_flag = 0x04; |
@@ -59,8 +71,6 @@ static void hp6x0_apm_get_power_status(struct apm_power_info *info) | |||
59 | info->battery_status = APM_BATTERY_STATUS_HIGH; | 71 | info->battery_status = APM_BATTERY_STATUS_HIGH; |
60 | info->battery_flag = 0x01; | 72 | info->battery_flag = 0x01; |
61 | } | 73 | } |
62 | |||
63 | info->units = 0; | ||
64 | } | 74 | } |
65 | 75 | ||
66 | static irqreturn_t hp6x0_apm_interrupt(int irq, void *dev) | 76 | static irqreturn_t hp6x0_apm_interrupt(int irq, void *dev) |
diff --git a/arch/sh/boards/renesas/sh7710voipgw/Makefile b/arch/sh/boards/renesas/sh7710voipgw/Makefile deleted file mode 100644 index 77037567633b..000000000000 --- a/arch/sh/boards/renesas/sh7710voipgw/Makefile +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | obj-y := setup.o | ||
diff --git a/arch/sh/boards/renesas/sh7710voipgw/setup.c b/arch/sh/boards/renesas/sh7710voipgw/setup.c deleted file mode 100644 index 0d56fd83bcba..000000000000 --- a/arch/sh/boards/renesas/sh7710voipgw/setup.c +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* | ||
2 | * Renesas Technology SH7710 VoIP Gateway | ||
3 | * | ||
4 | * Copyright (C) 2006 Ranjit Deshpande | ||
5 | * Kenati Technologies Inc. | ||
6 | * | ||
7 | * May be copied or modified under the terms of the GNU General Public | ||
8 | * License. See linux/COPYING for more information. | ||
9 | */ | ||
10 | #include <linux/init.h> | ||
11 | #include <asm/machvec.h> | ||
12 | #include <asm/irq.h> | ||
13 | #include <asm/io.h> | ||
14 | |||
15 | static struct ipr_data sh7710voipgw_ipr_map[] = { | ||
16 | { TIMER2_IRQ, TIMER2_IPR_ADDR, TIMER2_IPR_POS, TIMER2_PRIORITY }, | ||
17 | { WDT_IRQ, WDT_IPR_ADDR, WDT_IPR_POS, WDT_PRIORITY }, | ||
18 | |||
19 | /* SCIF0 */ | ||
20 | { SCIF0_ERI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY }, | ||
21 | { SCIF0_RXI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY }, | ||
22 | { SCIF0_BRI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY }, | ||
23 | { SCIF0_TXI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY }, | ||
24 | |||
25 | /* DMAC-1 */ | ||
26 | { DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY }, | ||
27 | { DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY }, | ||
28 | { DMTE2_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY }, | ||
29 | { DMTE3_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY }, | ||
30 | |||
31 | /* DMAC-2 */ | ||
32 | { DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY }, | ||
33 | { DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY }, | ||
34 | |||
35 | /* IPSEC */ | ||
36 | { IPSEC_IRQ, IPSEC_IPR_ADDR, IPSEC_IPR_POS, IPSEC_PRIORITY }, | ||
37 | |||
38 | /* EDMAC */ | ||
39 | { EDMAC0_IRQ, EDMAC0_IPR_ADDR, EDMAC0_IPR_POS, EDMAC0_PRIORITY }, | ||
40 | { EDMAC1_IRQ, EDMAC1_IPR_ADDR, EDMAC1_IPR_POS, EDMAC1_PRIORITY }, | ||
41 | { EDMAC2_IRQ, EDMAC2_IPR_ADDR, EDMAC2_IPR_POS, EDMAC2_PRIORITY }, | ||
42 | |||
43 | /* SIOF0 */ | ||
44 | { SIOF0_ERI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY }, | ||
45 | { SIOF0_TXI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY }, | ||
46 | { SIOF0_RXI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY }, | ||
47 | { SIOF0_CCI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY }, | ||
48 | |||
49 | /* SIOF1 */ | ||
50 | { SIOF1_ERI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY }, | ||
51 | { SIOF1_TXI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY }, | ||
52 | { SIOF1_RXI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY }, | ||
53 | { SIOF1_CCI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY }, | ||
54 | |||
55 | /* SLIC IRQ's */ | ||
56 | { IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, IRQ1_PRIORITY }, | ||
57 | { IRQ2_IRQ, IRQ2_IPR_ADDR, IRQ2_IPR_POS, IRQ2_PRIORITY }, | ||
58 | }; | ||
59 | |||
60 | /* | ||
61 | * Initialize IRQ setting | ||
62 | */ | ||
63 | static void __init sh7710voipgw_init_irq(void) | ||
64 | { | ||
65 | /* Disable all interrupts in IPR registers */ | ||
66 | ctrl_outw(0x0, INTC_IPRA); | ||
67 | ctrl_outw(0x0, INTC_IPRB); | ||
68 | ctrl_outw(0x0, INTC_IPRC); | ||
69 | ctrl_outw(0x0, INTC_IPRD); | ||
70 | ctrl_outw(0x0, INTC_IPRE); | ||
71 | ctrl_outw(0x0, INTC_IPRF); | ||
72 | ctrl_outw(0x0, INTC_IPRG); | ||
73 | ctrl_outw(0x0, INTC_IPRH); | ||
74 | ctrl_outw(0x0, INTC_IPRI); | ||
75 | |||
76 | /* Ack all interrupt sources in the IRR0 register */ | ||
77 | ctrl_outb(0x3f, INTC_IRR0); | ||
78 | |||
79 | /* Use IRQ0 - IRQ3 as active low interrupt lines i.e. disable | ||
80 | * IRL mode. | ||
81 | */ | ||
82 | ctrl_outw(0x2aa, INTC_ICR1); | ||
83 | |||
84 | make_ipr_irq(sh7710voipgw_ipr_map, ARRAY_SIZE(sh7710voipgw_ipr_map)); | ||
85 | } | ||
86 | |||
87 | /* | ||
88 | * The Machine Vector | ||
89 | */ | ||
90 | static struct sh_machine_vector mv_sh7710voipgw __initmv = { | ||
91 | .mv_name = "SH7710 VoIP Gateway", | ||
92 | .mv_nr_irqs = 104, | ||
93 | .mv_init_irq = sh7710voipgw_init_irq, | ||
94 | }; | ||
diff --git a/arch/sh/boards/renesas/x3proto/ilsel.c b/arch/sh/boards/renesas/x3proto/ilsel.c index 6d4454fef97c..b5c673c39337 100644 --- a/arch/sh/boards/renesas/x3proto/ilsel.c +++ b/arch/sh/boards/renesas/x3proto/ilsel.c | |||
@@ -68,7 +68,7 @@ static void __ilsel_enable(ilsel_source_t set, unsigned int bit) | |||
68 | shift = mk_ilsel_shift(bit); | 68 | shift = mk_ilsel_shift(bit); |
69 | 69 | ||
70 | pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n", | 70 | pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n", |
71 | __FUNCTION__, bit, addr, shift, set); | 71 | __func__, bit, addr, shift, set); |
72 | 72 | ||
73 | tmp = ctrl_inw(addr); | 73 | tmp = ctrl_inw(addr); |
74 | tmp &= ~(0xf << shift); | 74 | tmp &= ~(0xf << shift); |
diff --git a/arch/sh/boards/superh/microdev/io.c b/arch/sh/boards/superh/microdev/io.c index b704e20d7e4d..9f8a540f7e14 100644 --- a/arch/sh/boards/superh/microdev/io.c +++ b/arch/sh/boards/superh/microdev/io.c | |||
@@ -127,7 +127,7 @@ static unsigned long microdev_isa_port2addr(unsigned long offset) | |||
127 | * safe default. | 127 | * safe default. |
128 | */ | 128 | */ |
129 | printk("Warning: unexpected port in %s( offset = 0x%lx )\n", | 129 | printk("Warning: unexpected port in %s( offset = 0x%lx )\n", |
130 | __FUNCTION__, offset); | 130 | __func__, offset); |
131 | result = PVR; | 131 | result = PVR; |
132 | } | 132 | } |
133 | 133 | ||