1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2008 by Mark Arigo
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"
36 GPIOB_OUTPUT_VAL
|= 0x80;
37 GPIOB_OUTPUT_EN
|= 0x80;
39 /* charger inserted bit */
41 GPIOE_INPUT_VAL
|= 0x20;
46 GPIOE_OUTPUT_EN
|= 0x40;
47 GPIOE_OUTPUT_VAL
&= ~0x40; /* off */
51 /* enable touchpad here because we need it for
52 both buttons and button lights */
57 GPIOD_ENABLE
|= 0x80; /* enable ACK */
58 GPIOA_ENABLE
|= (0x10 | 0x20); /* enable DATA, CLK */
60 GPIOD_OUTPUT_EN
|= 0x80; /* set ACK */
61 GPIOD_OUTPUT_VAL
|= 0x80; /* high */
63 GPIOA_OUTPUT_EN
&= ~0x20; /* CLK */
65 GPIOA_OUTPUT_EN
|= 0x10; /* set DATA */
66 GPIOA_OUTPUT_VAL
|= 0x10; /* high */
70 logf("touchpad not ready");
75 unsigned int power_input_status(void)
77 unsigned int status
= POWER_INPUT_NONE
;
80 if (GPIOE_INPUT_VAL
& 0x20)
81 status
|= POWER_INPUT_MAIN_CHARGER
;
83 /* Do nothing with USB for now
84 if (GPIOE_INPUT_VAL & 0x4)
85 status |= POWER_INPUT_USB_CHARGER;
91 void ide_power_enable(bool on
)
97 bool ide_powered(void)
99 /* pretend we are always powered - we don't turn it off */
106 GPIOB_ENABLE
|= 0x80;
107 GPIOB_OUTPUT_VAL
&= ~0x80;
108 GPIOB_OUTPUT_EN
|= 0x80;
112 bool tuner_power(bool status
)
115 GPIOE_OUTPUT_VAL
|= 0x40;
117 GPIOE_OUTPUT_VAL
&= ~0x40;