1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2009 by Szymon Dziok
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 ****************************************************************************/
30 #include "synaptics-mep.h"
34 GPIOD_ENABLE
|= 0x80; /* enable ACK */
35 GPIOA_ENABLE
|= (0x10 | 0x20); /* enable DATA, CLK */
37 GPIOD_OUTPUT_EN
|= 0x80; /* set ACK */
38 GPIOD_OUTPUT_VAL
|= 0x80; /* high */
40 GPIOA_OUTPUT_EN
&= ~0x20; /* CLK */
42 GPIOA_OUTPUT_EN
|= 0x10; /* set DATA */
43 GPIOA_OUTPUT_VAL
|= 0x10; /* high */
47 logf("touchpad not ready");
49 /* Sound unmute (on) */
50 GPIO_CLEAR_BITWISE(GPIOL_OUTPUT_VAL
, 0x10);
53 unsigned int power_input_status(void)
55 unsigned int status
= POWER_INPUT_NONE
;
56 /* GPIOL - external charger connected */
57 if (GPIOL_INPUT_VAL
& 0x20)
58 status
= POWER_INPUT_MAIN_CHARGER
;
59 /* GPIOL - usb connected */
60 if (GPIOL_INPUT_VAL
& 0x04)
61 status
|= POWER_INPUT_USB_CHARGER
;
66 void ide_power_enable(bool on
)
69 GPIO_SET_BITWISE(GPIOC_OUTPUT_VAL
, 0x08);
74 GPIO_CLEAR_BITWISE(GPIOC_OUTPUT_VAL
, 0x08);
78 bool ide_powered(void)
80 return ((GPIOC_INPUT_VAL
& 0x08) == 1);
88 GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL, 0x10);
90 GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL, 0x10);
92 GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x80);
94 GPIO_CLEAR_BITWISE(GPIOC_OUTPUT_VAL, 0x08);
95 GPO32_VAL |= 0x40000000;
96 GPO32_ENABLE |= 0x40000000;
98 /* Sound mute (off) */
100 GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL
, 0x10);
102 GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL
, 0x80);