Added battery profile change to correct file, removed unused powermgmt-as3525.c
[kugel-rb.git] / firmware / target / arm / as3525 / powermgmt-target.h
blobcc7441fe5a61a6da97d2f1b12b1d787b95661918
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2009 by Michael Sevakis
11 * Copyright (C) 2008 by Bertrik Sikken
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ****************************************************************************/
22 #ifndef POWERMGMT_TARGET_H
23 #define POWERMGMT_TARGET_H
25 #if defined(SANSA_CLIP) \
26 || defined(SANSA_CLIPV2) /* FIXME */ \
27 || defined(SANSA_CLIPPLUS) /* FIXME */
29 /* Check if topped-off and monitor voltage while plugged. */
30 #define BATT_FULL_VOLTAGE 4160
31 #define BATT_VAUTO_RECHARGE 4100
32 #define BATT_CHG_V CHG_V_4_20V
33 #define BATT_CHG_I CHG_I_100MA
34 #define CHARGER_TOTAL_TIMER (6*3600*2) /* about 1.5 * capacity / current */
35 #if defined(SANSA_CLIP)
36 #define ADC_BATTERY ADC_BVDD
37 #else
38 /* ADC_CHG_IN seems to represent battery voltage better than ADC_BVDD during
39 * charging (ADC_BVDD is way too high) and appears the same in normal use.
40 * Note that when charging some models do not give an accurate reading but jump
41 * between 2 values. */
42 #define ADC_BATTERY ADC_CHG_IN
43 #endif
45 #elif defined(SANSA_E200V2)
47 /* Check if topped-off and monitor voltage while plugged. */
48 #define BATT_FULL_VOLTAGE 4160
49 #define BATT_VAUTO_RECHARGE 4100
50 #define BATT_CHG_V CHG_V_4_20V
51 #define BATT_CHG_I CHG_I_300MA
52 #define CHARGER_TOTAL_TIMER (4*3600*2)
53 #define ADC_BATTERY ADC_BVDD
55 #elif defined(SANSA_FUZE) || defined(SANSA_FUZEV2) /* FIXME */
57 /* Check if topped-off and monitor voltage while plugged. */
58 #define BATT_FULL_VOLTAGE 4160
59 #define BATT_VAUTO_RECHARGE 4100
60 #define BATT_CHG_V CHG_V_4_20V
61 #define BATT_CHG_I CHG_I_200MA
62 #define CHARGER_TOTAL_TIMER (4*3600*2)
63 #define ADC_BATTERY ADC_BVDD
65 #elif defined(SANSA_C200V2)
67 /* Check if topped-off and monitor voltage while plugged. */
68 #define BATT_FULL_VOLTAGE 4160
69 #define BATT_VAUTO_RECHARGE 4100
70 #define BATT_CHG_V CHG_V_4_20V
71 #define BATT_CHG_I CHG_I_200MA
72 #define CHARGER_TOTAL_TIMER (4*3600*2)
73 #define ADC_BATTERY ADC_BVDD
75 #else
76 #error "Charger settings not defined!"
77 #endif
79 void powermgmt_init_target(void);
80 void charging_algorithm_step(void);
81 void charging_algorithm_close(void);
83 /* We want to be able to reset the averaging filter */
84 #define HAVE_RESET_BATTERY_FILTER
86 #define BATT_AVE_SAMPLES 32
88 #endif /* POWERMGMT_TARGET_H */