hp6xx.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef __ASM_SH_HP6XX_H
  2. #define __ASM_SH_HP6XX_H
  3. /*
  4. * Copyright (C) 2003, 2004, 2005 Andriy Skulysh
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. *
  10. */
  11. #define HP680_BTN_IRQ 32 /* IRQ0_IRQ */
  12. #define HP680_TS_IRQ 35 /* IRQ3_IRQ */
  13. #define HP680_HD64461_IRQ 36 /* IRQ4_IRQ */
  14. #define DAC_LCD_BRIGHTNESS 0
  15. #define DAC_SPEAKER_VOLUME 1
  16. #define PGDR_OPENED 0x01
  17. #define PGDR_MAIN_BATTERY_OUT 0x04
  18. #define PGDR_PLAY_BUTTON 0x08
  19. #define PGDR_REWIND_BUTTON 0x10
  20. #define PGDR_RECORD_BUTTON 0x20
  21. #define PHDR_TS_PEN_DOWN 0x08
  22. #define PJDR_LED_BLINK 0x02
  23. #define PKDR_LED_GREEN 0x10
  24. #define SCPDR_TS_SCAN_ENABLE 0x20
  25. #define SCPDR_TS_SCAN_Y 0x02
  26. #define SCPDR_TS_SCAN_X 0x01
  27. #define SCPCR_TS_ENABLE 0x405
  28. #define SCPCR_TS_MASK 0xc0f
  29. #define ADC_CHANNEL_TS_Y 1
  30. #define ADC_CHANNEL_TS_X 2
  31. #define ADC_CHANNEL_BATTERY 3
  32. #define ADC_CHANNEL_BACKUP 4
  33. #define ADC_CHANNEL_CHARGE 5
  34. #define HD64461_GPADR_SPEAKER 0x01
  35. #define HD64461_GPADR_PCMCIA0 (0x02|0x08)
  36. #define HD64461_GPBDR_LCDOFF 0x01
  37. #define HD64461_GPBDR_LCD_CONTRAST_MASK 0x78
  38. #define HD64461_GPBDR_LED_RED 0x80
  39. #include <asm/hd64461.h>
  40. #include <asm/io.h>
  41. #define PJDR 0xa4000130
  42. #define PKDR 0xa4000132
  43. static inline void hp6xx_led_red(int on)
  44. {
  45. u16 v16;
  46. v16 = ctrl_inw(CONFIG_HD64461_IOBASE + HD64461_GPBDR - 0x10000);
  47. if (on)
  48. ctrl_outw(v16 & (~HD64461_GPBDR_LED_RED), CONFIG_HD64461_IOBASE + HD64461_GPBDR - 0x10000);
  49. else
  50. ctrl_outw(v16 | HD64461_GPBDR_LED_RED, CONFIG_HD64461_IOBASE + HD64461_GPBDR - 0x10000);
  51. }
  52. static inline void hp6xx_led_green(int on)
  53. {
  54. u8 v8;
  55. v8 = ctrl_inb(PKDR);
  56. if (on)
  57. ctrl_outb(v8 & (~PKDR_LED_GREEN), PKDR);
  58. else
  59. ctrl_outb(v8 | PKDR_LED_GREEN, PKDR);
  60. }
  61. #endif /* __ASM_SH_HP6XX_H */