diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/ipod/powermgmt-ipod-pcf.c | 65 |
1 files changed, 41 insertions, 24 deletions
diff --git a/firmware/target/arm/ipod/powermgmt-ipod-pcf.c b/firmware/target/arm/ipod/powermgmt-ipod-pcf.c index 703d1da833..5b8f974fda 100644 --- a/firmware/target/arm/ipod/powermgmt-ipod-pcf.c +++ b/firmware/target/arm/ipod/powermgmt-ipod-pcf.c | |||
@@ -28,44 +28,55 @@ | |||
28 | 28 | ||
29 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | 29 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = |
30 | { | 30 | { |
31 | #ifdef IPOD_NANO | 31 | #if defined(IPOD_NANO) |
32 | 3330 | 32 | 3330 |
33 | #elif defined IPOD_VIDEO | 33 | #elif defined(IPOD_VIDEO) |
34 | 3300 | 34 | 3300 |
35 | #elif defined(IPOD_COLOR) | ||
36 | 3300 | ||
37 | #elif defined(IPOD_3G) | ||
38 | 3700 | ||
35 | #else | 39 | #else |
36 | /* FIXME: calibrate value for other 3G+ ipods */ | 40 | /* FIXME: calibrate value for other iPods */ |
37 | 3380 | 41 | 3300 |
38 | #endif | 42 | #endif |
39 | }; | 43 | }; |
40 | 44 | ||
41 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = | 45 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = |
42 | { | 46 | { |
43 | #ifdef IPOD_NANO | 47 | #if defined(IPOD_NANO) |
44 | 3230 | 48 | 3230 |
45 | #elif defined IPOD_VIDEO | 49 | #elif defined(IPOD_VIDEO) |
46 | 3300 | 50 | 3300 |
51 | #elif defined(IPOD_COLOR) | ||
52 | 3300 | ||
53 | #elif defined(IPOD_3G) | ||
54 | 3500 | ||
47 | #else | 55 | #else |
48 | /* FIXME: calibrate value for other 3G+ ipods */ | 56 | /* FIXME: calibrate value for other iPods */ |
49 | 3020 | 57 | 3000 |
50 | #endif | 58 | #endif |
51 | }; | 59 | }; |
52 | 60 | ||
53 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ | 61 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ |
54 | const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | 62 | const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = |
55 | { | 63 | { |
56 | #ifdef IPOD_NANO | 64 | #if defined(IPOD_NANO) |
57 | /* measured values */ | 65 | /* measured values */ |
58 | { 3230, 3620, 3700, 3730, 3750, 3780, 3830, 3890, 3950, 4030, 4160 }, | 66 | { 3230, 3620, 3700, 3730, 3750, 3780, 3830, 3890, 3950, 4030, 4160 }, |
59 | #elif defined IPOD_VIDEO | 67 | #elif defined(IPOD_VIDEO) |
60 | /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */ | 68 | /* iPod Video 30GB Li-Ion 400mAh, first approach based upon measurements */ |
61 | { 3450, 3670, 3710, 3750, 3790, 3830, 3870, 3930, 4010, 4100, 4180 }, | 69 | { 3450, 3670, 3710, 3750, 3790, 3830, 3870, 3930, 4010, 4100, 4180 }, |
62 | #elif defined IPOD_COLOR | 70 | #elif defined(IPOD_COLOR) |
63 | /* iPOD Color 60GB Li-Ion, first approach based upon measurements */ | 71 | /* iPod Photo 30GB, see FS#9072 */ |
64 | { 3500, 3676, 3729, 3755, 3778, 3805, 3847, 3919, 3961, 4071, 4109 }, | 72 | { 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170 }, |
73 | #elif defined(IPOD_3G) | ||
74 | /* iPod 3G 40GB, first approach based upon measurements */ | ||
75 | { 3720, 3740, 3760, 3780, 3830, 3870, 3910, 3970, 4020, 4060, 4090 }, | ||
65 | #else | 76 | #else |
66 | /* FIXME: calibrate value for other 3G+ ipods */ | 77 | /* FIXME: calibrate value for other iPods */ |
67 | /* Table is "inherited" from iriver H100. */ | 78 | /* Table is "provisional" from IPOD_COLOR */ |
68 | { 3370, 3650, 3700, 3740, 3780, 3820, 3870, 3930, 4000, 4080, 4160 } | 79 | { 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170 } |
69 | #endif | 80 | #endif |
70 | }; | 81 | }; |
71 | 82 | ||
@@ -73,16 +84,22 @@ const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | |||
73 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ | 84 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ |
74 | const unsigned short percent_to_volt_charge[11] = | 85 | const unsigned short percent_to_volt_charge[11] = |
75 | { | 86 | { |
76 | #ifdef IPOD_NANO | 87 | #if defined(IPOD_NANO) |
77 | /* measured values */ | 88 | /* measured values */ |
78 | 3230, 3620, 3700, 3730, 3750, 3780, 3830, 3890, 3950, 4030, 4160 | 89 | 3230, 3620, 3700, 3730, 3750, 3780, 3830, 3890, 3950, 4030, 4160 |
79 | #elif defined IPOD_VIDEO | 90 | #elif defined(IPOD_VIDEO) |
80 | /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */ | 91 | /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */ |
81 | 3450, 3670, 3710, 3750, 3790, 3830, 3870, 3930, 4010, 4100, 4180 | 92 | 3450, 3670, 3710, 3750, 3790, 3830, 3870, 3930, 4010, 4100, 4180 |
93 | #elif defined(IPOD_COLOR) | ||
94 | /* iPod Photo 30GB, see FS#9072 */ | ||
95 | 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170 | ||
96 | #elif defined(IPOD_3G) | ||
97 | /* iPod 3G 40GB, first approach based upon measurements */ | ||
98 | 3720, 3740, 3760, 3780, 3830, 3870, 3910, 3970, 4020, 4060, 4090 | ||
82 | #else | 99 | #else |
83 | /* FIXME: calibrate value for other 3G+ ipods */ | 100 | /* FIXME: calibrate value for other iPods */ |
84 | /* Table is "inherited" from iriver H100. */ | 101 | /* Table is "provisional" from IPOD_COLOR */ |
85 | 3540, 3860, 3930, 3980, 4000, 4020, 4040, 4080, 4130, 4180, 4230 | 102 | 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170 |
86 | #endif | 103 | #endif |
87 | }; | 104 | }; |
88 | #endif /* CONFIG_CHARGING */ | 105 | #endif /* CONFIG_CHARGING */ |
@@ -101,12 +118,12 @@ void accessory_supply_set(bool enable) | |||
101 | { | 118 | { |
102 | if (enable) | 119 | if (enable) |
103 | { | 120 | { |
104 | /* Accessory voltage supply */ | 121 | /* Accessory voltage supply on */ |
105 | pcf50605_write(PCF5060X_D2REGC1, 0xf8); /* 3.3V ON */ | 122 | pcf50605_write(PCF5060X_D2REGC1, 0xf8); /* 3.3V ON */ |
106 | } | 123 | } |
107 | else | 124 | else |
108 | { | 125 | { |
109 | /* Accessory voltage supply */ | 126 | /* Accessory voltage supply off */ |
110 | pcf50605_write(PCF5060X_D2REGC1, 0x18); /* OFF */ | 127 | pcf50605_write(PCF5060X_D2REGC1, 0x18); /* OFF */ |
111 | } | 128 | } |
112 | 129 | ||