aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/hp6xx
diff options
context:
space:
mode:
authorAndriy Skulysh <askulysh@gmail.com>2006-09-27 03:20:22 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 03:20:22 -0400
commit3aa770e7972723f479122cf66b529017d2175289 (patch)
treef70d870381cec8034693704e346c53b311db688f /include/asm-sh/hp6xx
parentef48e8e3498605351f91f195cc9af0ef981b0dde (diff)
sh: APM/PM support.
This adds some simple PM stubs and the basic APM interfaces, primarily for use by hp6xx, where the existing userland expects it. Signed-off-by: Andriy Skulysh <askulysh@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/hp6xx')
-rw-r--r--include/asm-sh/hp6xx/hp6xx.h53
1 files changed, 51 insertions, 2 deletions
diff --git a/include/asm-sh/hp6xx/hp6xx.h b/include/asm-sh/hp6xx/hp6xx.h
index a26247fd3d87..f35134c159dd 100644
--- a/include/asm-sh/hp6xx/hp6xx.h
+++ b/include/asm-sh/hp6xx/hp6xx.h
@@ -2,16 +2,33 @@
2#define __ASM_SH_HP6XX_H 2#define __ASM_SH_HP6XX_H
3 3
4/* 4/*
5 * Copyright (C) 2003 Andriy Skulysh 5 * Copyright (C) 2003, 2004, 2005 Andriy Skulysh
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 *
6 */ 11 */
7 12
8#define HP680_TS_IRQ IRQ3_IRQ 13#define HP680_BTN_IRQ IRQ0_IRQ
14#define HP680_TS_IRQ IRQ3_IRQ
15#define HP680_HD64461_IRQ IRQ4_IRQ
9 16
10#define DAC_LCD_BRIGHTNESS 0 17#define DAC_LCD_BRIGHTNESS 0
11#define DAC_SPEAKER_VOLUME 1 18#define DAC_SPEAKER_VOLUME 1
12 19
20#define PGDR_OPENED 0x01
21#define PGDR_MAIN_BATTERY_OUT 0x04
22#define PGDR_PLAY_BUTTON 0x08
23#define PGDR_REWIND_BUTTON 0x10
24#define PGDR_RECORD_BUTTON 0x20
25
13#define PHDR_TS_PEN_DOWN 0x08 26#define PHDR_TS_PEN_DOWN 0x08
14 27
28#define PJDR_LED_BLINK 0x02
29
30#define PKDR_LED_GREEN 0x10
31
15#define SCPDR_TS_SCAN_ENABLE 0x20 32#define SCPDR_TS_SCAN_ENABLE 0x20
16#define SCPDR_TS_SCAN_Y 0x02 33#define SCPDR_TS_SCAN_Y 0x02
17#define SCPDR_TS_SCAN_X 0x01 34#define SCPDR_TS_SCAN_X 0x01
@@ -21,11 +38,43 @@
21 38
22#define ADC_CHANNEL_TS_Y 1 39#define ADC_CHANNEL_TS_Y 1
23#define ADC_CHANNEL_TS_X 2 40#define ADC_CHANNEL_TS_X 2
41#define ADC_CHANNEL_BATTERY 3
42#define ADC_CHANNEL_BACKUP 4
43#define ADC_CHANNEL_CHARGE 5
24 44
25#define HD64461_GPADR_SPEAKER 0x01 45#define HD64461_GPADR_SPEAKER 0x01
26#define HD64461_GPADR_PCMCIA0 (0x02|0x08) 46#define HD64461_GPADR_PCMCIA0 (0x02|0x08)
47
27#define HD64461_GPBDR_LCDOFF 0x01 48#define HD64461_GPBDR_LCDOFF 0x01
49#define HD64461_GPBDR_LCD_CONTRAST_MASK 0x78
28#define HD64461_GPBDR_LED_RED 0x80 50#define HD64461_GPBDR_LED_RED 0x80
29 51
52#include <asm/hd64461.h>
53#include <asm/io.h>
54
55#define PJDR 0xa4000130
56#define PKDR 0xa4000132
57
58static inline void hp6xx_led_red(int on)
59{
60 u16 v16;
61 v16 = ctrl_inw(CONFIG_HD64461_IOBASE + HD64461_GPBDR - 0x10000);
62 if (on)
63 ctrl_outw(v16 & (~HD64461_GPBDR_LED_RED), CONFIG_HD64461_IOBASE + HD64461_GPBDR - 0x10000);
64 else
65 ctrl_outw(v16 | HD64461_GPBDR_LED_RED, CONFIG_HD64461_IOBASE + HD64461_GPBDR - 0x10000);
66}
67
68static inline void hp6xx_led_green(int on)
69{
70 u8 v8;
71
72 v8 = ctrl_inb(PKDR);
73 if (on)
74 ctrl_outb(v8 & (~PKDR_LED_GREEN), PKDR);
75 else
76 ctrl_outb(v8 | PKDR_LED_GREEN, PKDR);
77}
78
30 79
31#endif /* __ASM_SH_HP6XX_H */ 80#endif /* __ASM_SH_HP6XX_H */