summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gigabeat-s/button-imx31.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-02-08 06:34:11 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-02-08 06:34:11 +0000
commitbc057f91b55e95ba63810bd9c3a7b1734cebdfce (patch)
treef8c4f004e973ac6a672ee0ab0739e5bdcfaf26cc /firmware/target/arm/imx31/gigabeat-s/button-imx31.c
parent2e3a8c776f9826f9480b6dbc526105ff54815629 (diff)
downloadrockbox-bc057f91b55e95ba63810bd9c3a7b1734cebdfce.tar.gz
rockbox-bc057f91b55e95ba63810bd9c3a7b1734cebdfce.zip
Gigabeat S: Get boot to go a little father.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16245 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/button-imx31.c')
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/button-imx31.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/button-imx31.c b/firmware/target/arm/imx31/gigabeat-s/button-imx31.c
index 32d2a63c49..eea0faa4eb 100644
--- a/firmware/target/arm/imx31/gigabeat-s/button-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/button-imx31.c
@@ -36,31 +36,27 @@ void button_init_device(void)
36{ 36{
37 unsigned int reg_val; 37 unsigned int reg_val;
38 /* Enable keypad clock */ 38 /* Enable keypad clock */
39 //mxc_clks_enable(KPP_CLK); 39 CLKCTL_CGR1 |= (3 << 2*10);
40 40
41 /* Enable number of rows in keypad (KPCR[7:0]) 41 /* Enable number of rows in keypad (KPCR[7:0])
42 * Configure keypad columns as open-drain (KPCR[15:8]) 42 * Configure keypad columns as open-drain (KPCR[15:8])
43 * 43 *
44 * Configure the rows/cols in KPP 44 * Configure the rows/cols in KPP
45 * LSB nibble in KPP is for 8 rows 45 * LSB nibble in KPP is for 8 rows
46 * MSB nibble in KPP is for 8 cols 46 * MSB nibble in KPP is for 8 cols
47 */ 47 */
48 reg_val = KPP_KPCR; 48#if 0
49 reg_val |= (1 << 8) - 1; /* LSB */ 49 KPP_KPCR = (0xff << 8) | 0xff;
50 reg_val |= ((1 << 8) - 1) << 8; /* MSB */ 50 /* Write 0's to KPDR[15:8] */
51 KPP_KPCR = reg_val; 51 reg_val = KPP_KPDR;
52 52 reg_val &= 0x00ff;
53 /* Write 0's to KPDR[15:8] */ 53 KPP_KPDR = reg_val;
54 reg_val = KPP_KPDR; 54
55 reg_val &= 0x00ff; 55 /* Configure columns as output, rows as input (KDDR[15:0]) */
56 KPP_KPDR = reg_val; 56 KPP_KDDR = 0xff00;
57 57#endif
58 /* Configure columns as output, rows as input (KDDR[15:0]) */ 58
59 KPP_KDDR = 0xff00; 59 KPP_KPSR = (1 << 3) | (1 << 2);
60
61 reg_val = 0xD;
62 reg_val |= (1 << 8);
63 KPP_KPSR = reg_val;
64} 60}
65 61
66inline bool button_hold(void) 62inline bool button_hold(void)