Gigabeat S: There's no reason to pause the LCD DMA when changing the framebuffer...
[kugel-rb.git] / firmware / target / arm / imx31 / gigabeat-s / button-target.h
blob940ebac2f2aec5380aacfce6490f87563f35908e
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 by Linus Nielsen Feltzing
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef _BUTTON_TARGET_H_
22 #define _BUTTON_TARGET_H_
24 #include <stdbool.h>
25 #include "config.h"
27 #define HAS_BUTTON_HOLD
29 #ifdef BOOTLOADER
30 #define BUTTON_DRIVER_CLOSE
31 #endif
33 bool button_hold(void);
34 void button_init_device(void);
35 void button_close_device(void);
36 int button_read_device(void);
37 void button_power_event(void);
38 void headphone_detect_event(void);
39 void headphone_init(void);
40 void button_headphone_set(int button);
42 /* Toshiba Gigabeat S-specific button codes */
44 /* These shifts are selected to optimize scanning of the keypad port */
45 #define BUTTON_LEFT (1 << 0)
46 #define BUTTON_UP (1 << 1)
47 #define BUTTON_DOWN (1 << 2)
48 #define BUTTON_RIGHT (1 << 3)
49 #define BUTTON_SELECT (1 << 4)
50 #define BUTTON_BACK (1 << 5)
51 #define BUTTON_MENU (1 << 6)
52 #define BUTTON_VOL_UP (1 << 7)
53 #define BUTTON_VOL_DOWN (1 << 8)
54 #define BUTTON_PREV (1 << 9)
55 #define BUTTON_PLAY (1 << 10)
56 #define BUTTON_NEXT (1 << 11)
57 #define BUTTON_POWER (1 << 12) /* Read from PMIC */
59 #define BUTTON_MAIN (0x00001fff)
61 /* Remote control buttons */
62 #define BUTTON_RC_VOL_UP (1 << 13)
63 #define BUTTON_RC_VOL_DOWN (1 << 14)
64 #define BUTTON_RC_FF (1 << 15)
65 #define BUTTON_RC_REW (1 << 16)
66 #define BUTTON_RC_PLAY (1 << 17)
67 #define BUTTON_RC_DSP (1 << 18)
69 #define BUTTON_REMOTE (0x0007e000)
71 #define POWEROFF_BUTTON BUTTON_POWER
72 #define POWEROFF_COUNT 10
74 #endif /* _BUTTON_TARGET_H_ */