On Fri, Dec 19, 2014 at 7:17 AM, Martin Pieuchot <[email protected]> wrote: > Hello David, > > On 18/12/14(Thu) 00:45, David Higgs wrote: >> While my device does not seem to provide AtRateTimeToFull or >> AtRateTimeToEmpty, it does have RunTimeToEmpty. Then I found that >> SENSOR_TIMEDELTA values are in nanoseconds and that scaling for them was >> never implemented correctly. >> >> I am confused by the spec [1], though; see 4.2.5 - Battery Measures. The >> reported values are supposedly in minutes but hid_info.unit is 0x1001 >> (seconds) and observation of RunTimeToEmpty appears to agree. I don't see >> any other drivers in the tree that pay attention to unit or unit_exponent >> fields, and don't want to go down a rabbit hole if there's no interest. >> >> As usual, feedback is welcome. > > Table 1 of section 3.2.3 indicates that the physical unit for time > reports are in seconds. So I guess it is a mistake in the document. > > I like your diff but I'd prefer to see the scaling done based on the > unit rather than the name. Why not adding new defines for the various > Physical Unit defined in the table and do the switch on hitem.unit? And > what about the exponent? >
Thanks for looking at this. I've rethought my approach to upd(4) a bit, and will be addressing bugs prior to adding new sensors. There will be a diff to address units in a more coherent fashion soon. --david
