led.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * arch/sh/boards/cayman/led.c
  3. *
  4. * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com>
  5. *
  6. * May be copied or modified under the terms of the GNU General Public
  7. * License. See linux/COPYING for more information.
  8. *
  9. * Flash the LEDs
  10. */
  11. #include <asm/io.h>
  12. /*
  13. ** It is supposed these functions to be used for a low level
  14. ** debugging (via Cayman LEDs), hence to be available as soon
  15. ** as possible.
  16. ** Unfortunately Cayman LEDs relies on Cayman EPLD to be mapped
  17. ** (this happen when IRQ are initialized... quite late).
  18. ** These triky dependencies should be removed. Temporary, it
  19. ** may be enough to NOP until EPLD is mapped.
  20. */
  21. extern unsigned long epld_virt;
  22. #define LED_ADDR (epld_virt + 0x008)
  23. #define HDSP2534_ADDR (epld_virt + 0x100)
  24. void mach_led(int position, int value)
  25. {
  26. if (!epld_virt)
  27. return;
  28. if (value)
  29. ctrl_outl(0, LED_ADDR);
  30. else
  31. ctrl_outl(1, LED_ADDR);
  32. }
  33. void mach_alphanum(int position, unsigned char value)
  34. {
  35. if (!epld_virt)
  36. return;
  37. ctrl_outb(value, HDSP2534_ADDR + 0xe0 + (position << 2));
  38. }
  39. void mach_alphanum_brightness(int setting)
  40. {
  41. ctrl_outb(setting & 7, HDSP2534_ADDR + 0xc0);
  42. }