Hello Matt,
Wednesday, March 21, 2007, 11:41:31 PM, you wrote:
> On 3/21/07, Anton Vorontsov <cbou_at_mail.ru> wrote:
>> Much thanks to creators of apm_power: Eugeny Boger (implementation)
>> and Paul Sokolovsky (idea).
>>
>> Signed-off-by: Anton Vorontsov <cbou_at_mail.ru>
> Good work. This makes a lot of sense.
>> @@ -91,78 +88,39 @@ static int ds2760_battery_get_min_current(struct battery *bat)
>> static int ds2760_battery_get_current(struct battery *bat)
>> {
>> struct ds2760_device_info *di = to_ds2760_device_info(bat);
>> - ds2760_battery_read_status(di);
>> return di->current_mA;
>> }
> Why remove the call to ds2760_battery_read_status()? Now cat'ing
> "current" will only show the value when it was last read, not at the
> moment when cat'ing.
We discussed this with Anton - using raw reads in such manner can
lead to performance issues (and actually leads in case of apm_power,
as Anton experienced). So, it would be pretty natural to cache value.
IIRC, for ds2760_battery update frequency is 1min which is of course
to rare. I guess, caching for 5secs would be a good choice.
> Matt
-- Best regards, Paul mailto:pmiscml_at_gmail.comReceived on Wed Mar 21 2007 - 16:52:04 EST
This archive was generated by hypermail 2.2.0 : Wed Mar 21 2007 - 16:52:30 EST