2 * Copyright (C) 2012-2014 Panasonic Corporation
3 * Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
5 * SPDX-License-Identifier: GPL-2.0+
13 #define LED_CHAR_0 0x7e
14 #define LED_CHAR_1 0x0c
15 #define LED_CHAR_2 0xb6
16 #define LED_CHAR_3 0x9e
17 #define LED_CHAR_4 0xcc
18 #define LED_CHAR_5 0xda
19 #define LED_CHAR_6 0xfa
20 #define LED_CHAR_7 0x4e
21 #define LED_CHAR_8 0xfe
22 #define LED_CHAR_9 0xde
24 #define LED_CHAR_A 0xee
25 #define LED_CHAR_B 0xf8
26 #define LED_CHAR_C 0x72
27 #define LED_CHAR_D 0xbc
28 #define LED_CHAR_E 0xf2
29 #define LED_CHAR_F 0xe2
30 #define LED_CHAR_G 0x7a
31 #define LED_CHAR_H 0xe8
32 #define LED_CHAR_I 0x08
33 #define LED_CHAR_J 0x3c
34 #define LED_CHAR_K 0xea
35 #define LED_CHAR_L 0x70
36 #define LED_CHAR_M 0x6e
37 #define LED_CHAR_N 0xa8
38 #define LED_CHAR_O 0xb8
39 #define LED_CHAR_P 0xe6
40 #define LED_CHAR_Q 0xce
41 #define LED_CHAR_R 0xa0
42 #define LED_CHAR_S 0xc8
43 #define LED_CHAR_T 0x8c
44 #define LED_CHAR_U 0x7c
45 #define LED_CHAR_V 0x54
46 #define LED_CHAR_W 0xfc
47 #define LED_CHAR_X 0xec
48 #define LED_CHAR_Y 0xdc
49 #define LED_CHAR_Z 0xa4
51 #define LED_CHAR_SPACE 0x00
52 #define LED_CHAR_DOT 0x01
54 #define LED_CHAR_ (LED_CHAR_SPACE)
56 /** Macro to translate 4 characters into integer to display led */
57 #define LED_C2I(C0, C1, C2, C3) \
59 (LED_CHAR_##C0 << 24) | \
60 (LED_CHAR_##C1 << 16) | \
61 (LED_CHAR_##C2 << 8) | \
65 #if defined(CONFIG_SUPPORT_CARD_LED_BASE)
67 #define LED_ADDR CONFIG_SUPPORT_CARD_LED_BASE
71 #define led_write(C0, C1, C2, C3) raw_led_write LED_C2I(C0, C1, C2, C3)
72 .macro raw_led_write data
78 #else /* __ASSEMBLY__ */
82 #define led_write(C0, C1, C2, C3) \
84 raw_led_write(LED_C2I(C0, C1, C2, C3)); \
87 static inline void raw_led_write(u32 data)
89 writel(data, LED_ADDR);
92 #endif /* __ASSEMBLY__ */
94 #else /* CONFIG_SUPPORT_CARD_LED_BASE */
96 #define led_write(C0, C1, C2, C3)
97 #define raw_led_write(x)
99 #endif /* CONFIG_SUPPORT_CARD_LED_BASE */
101 #endif /* ARCH_LED_H */