| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ASM_SH_HP6XX_H | 
|  | 2 | #define __ASM_SH_HP6XX_H | 
|  | 3 |  | 
|  | 4 | /* | 
| Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 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 | * | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | */ | 
|  | 12 |  | 
| Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 13 | #define HP680_BTN_IRQ		IRQ0_IRQ | 
|  | 14 | #define HP680_TS_IRQ		IRQ3_IRQ | 
|  | 15 | #define HP680_HD64461_IRQ	IRQ4_IRQ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 |  | 
|  | 17 | #define DAC_LCD_BRIGHTNESS	0 | 
|  | 18 | #define DAC_SPEAKER_VOLUME	1 | 
|  | 19 |  | 
| Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 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 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #define PHDR_TS_PEN_DOWN	0x08 | 
|  | 27 |  | 
| Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 28 | #define PJDR_LED_BLINK		0x02 | 
|  | 29 |  | 
|  | 30 | #define PKDR_LED_GREEN		0x10 | 
|  | 31 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #define SCPDR_TS_SCAN_ENABLE	0x20 | 
|  | 33 | #define SCPDR_TS_SCAN_Y		0x02 | 
|  | 34 | #define SCPDR_TS_SCAN_X		0x01 | 
|  | 35 |  | 
|  | 36 | #define SCPCR_TS_ENABLE		0x405 | 
|  | 37 | #define SCPCR_TS_MASK		0xc0f | 
|  | 38 |  | 
|  | 39 | #define ADC_CHANNEL_TS_Y	1 | 
|  | 40 | #define ADC_CHANNEL_TS_X	2 | 
| Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 41 | #define ADC_CHANNEL_BATTERY	3 | 
|  | 42 | #define ADC_CHANNEL_BACKUP	4 | 
|  | 43 | #define ADC_CHANNEL_CHARGE	5 | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 |  | 
|  | 45 | #define HD64461_GPADR_SPEAKER	0x01 | 
|  | 46 | #define HD64461_GPADR_PCMCIA0	(0x02|0x08) | 
| Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 47 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | #define HD64461_GPBDR_LCDOFF	0x01 | 
| Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 49 | #define HD64461_GPBDR_LCD_CONTRAST_MASK	0x78 | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | #define HD64461_GPBDR_LED_RED	0x80 | 
|  | 51 |  | 
| Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 52 | #include <asm/hd64461.h> | 
|  | 53 | #include <asm/io.h> | 
|  | 54 |  | 
|  | 55 | #define PJDR	0xa4000130 | 
|  | 56 | #define PKDR	0xa4000132 | 
|  | 57 |  | 
|  | 58 | static 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 |  | 
|  | 68 | static 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 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 |  | 
|  | 80 | #endif /* __ASM_SH_HP6XX_H */ |