pxa27x: Add 'const' attribute to keyboard maps
The mapping is a hardware feature, so it is relatively constant. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
f57d6693e1
commit
52975c313e
@ -45,7 +45,7 @@
|
|||||||
#define S1_STSCHG_IRQ 14
|
#define S1_STSCHG_IRQ 14
|
||||||
#define S1_IRQ 15
|
#define S1_IRQ 15
|
||||||
|
|
||||||
static struct keymap map[0xE0] = {
|
static const struct keymap map[0xE0] = {
|
||||||
[0 ... 0xDF] = { -1, -1 },
|
[0 ... 0xDF] = { -1, -1 },
|
||||||
[0x1e] = {0,0}, /* a */
|
[0x1e] = {0,0}, /* a */
|
||||||
[0x30] = {0,1}, /* b */
|
[0x30] = {0,1}, /* b */
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#define DPRINTF(fmt, ...)
|
#define DPRINTF(fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct keymap map[0x100] = {
|
static const struct keymap map[0x100] = {
|
||||||
[0 ... 0xff] = { -1, -1 },
|
[0 ... 0xff] = { -1, -1 },
|
||||||
[0x3b] = {0, 0}, /* Option = F1 */
|
[0x3b] = {0, 0}, /* Option = F1 */
|
||||||
[0xc8] = {0, 1}, /* Up */
|
[0xc8] = {0, 1}, /* Up */
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
struct PXA2xxKeyPadState {
|
struct PXA2xxKeyPadState {
|
||||||
MemoryRegion iomem;
|
MemoryRegion iomem;
|
||||||
qemu_irq irq;
|
qemu_irq irq;
|
||||||
struct keymap *map;
|
const struct keymap *map;
|
||||||
int pressed_cnt;
|
int pressed_cnt;
|
||||||
int alt_code;
|
int alt_code;
|
||||||
|
|
||||||
@ -322,8 +322,8 @@ PXA2xxKeyPadState *pxa27x_keypad_init(MemoryRegion *sysmem,
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pxa27x_register_keypad(PXA2xxKeyPadState *kp, struct keymap *map,
|
void pxa27x_register_keypad(PXA2xxKeyPadState *kp,
|
||||||
int size)
|
const struct keymap *map, int size)
|
||||||
{
|
{
|
||||||
if(!map || size < 0x80) {
|
if(!map || size < 0x80) {
|
||||||
fprintf(stderr, "%s - No PXA keypad map defined\n", __FUNCTION__);
|
fprintf(stderr, "%s - No PXA keypad map defined\n", __FUNCTION__);
|
||||||
|
@ -109,8 +109,8 @@ typedef struct PXA2xxKeyPadState PXA2xxKeyPadState;
|
|||||||
PXA2xxKeyPadState *pxa27x_keypad_init(MemoryRegion *sysmem,
|
PXA2xxKeyPadState *pxa27x_keypad_init(MemoryRegion *sysmem,
|
||||||
hwaddr base,
|
hwaddr base,
|
||||||
qemu_irq irq);
|
qemu_irq irq);
|
||||||
void pxa27x_register_keypad(PXA2xxKeyPadState *kp, struct keymap *map,
|
void pxa27x_register_keypad(PXA2xxKeyPadState *kp,
|
||||||
int size);
|
const struct keymap *map, int size);
|
||||||
|
|
||||||
/* pxa2xx.c */
|
/* pxa2xx.c */
|
||||||
typedef struct PXA2xxI2CState PXA2xxI2CState;
|
typedef struct PXA2xxI2CState PXA2xxI2CState;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user