| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
| Paul Mundt | a23ba43 | 2007-11-28 20:19:38 +0900 | [diff] [blame] | 2 | * arch/sh/boards/cayman/led.c | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | /* | 
|  | 14 | ** It is supposed these functions to be used for a low level | 
|  | 15 | ** debugging (via Cayman LEDs), hence to be available as soon | 
|  | 16 | ** as possible. | 
|  | 17 | ** Unfortunately Cayman LEDs relies on Cayman EPLD to be mapped | 
|  | 18 | ** (this happen when IRQ are initialized... quite late). | 
|  | 19 | ** These triky dependencies should be removed. Temporary, it | 
|  | 20 | ** may be enough to NOP until EPLD is mapped. | 
|  | 21 | */ | 
|  | 22 |  | 
|  | 23 | extern unsigned long epld_virt; | 
|  | 24 |  | 
|  | 25 | #define LED_ADDR      (epld_virt + 0x008) | 
|  | 26 | #define HDSP2534_ADDR (epld_virt + 0x100) | 
|  | 27 |  | 
|  | 28 | void mach_led(int position, int value) | 
|  | 29 | { | 
|  | 30 | if (!epld_virt) | 
|  | 31 | return; | 
|  | 32 |  | 
|  | 33 | if (value) | 
|  | 34 | ctrl_outl(0, LED_ADDR); | 
|  | 35 | else | 
|  | 36 | ctrl_outl(1, LED_ADDR); | 
|  | 37 |  | 
|  | 38 | } | 
|  | 39 |  | 
|  | 40 | void mach_alphanum(int position, unsigned char value) | 
|  | 41 | { | 
|  | 42 | if (!epld_virt) | 
|  | 43 | return; | 
|  | 44 |  | 
|  | 45 | ctrl_outb(value, HDSP2534_ADDR + 0xe0 + (position << 2)); | 
|  | 46 | } | 
|  | 47 |  | 
|  | 48 | void mach_alphanum_brightness(int setting) | 
|  | 49 | { | 
|  | 50 | ctrl_outb(setting & 7, HDSP2534_ADDR + 0xc0); | 
|  | 51 | } |