Hi!
> The current hdaps driver got some details wrong about the result of
> hardware queries.
>
> First, it fails to check a couple of status values.
>
> Second, it turns out that the hardware will return up to two readouts:
> the latest one and also the previous one if it was missed (host didn't
> poll fast enough). The current driver wrongly interprets the latter as
> a "variance", which is nonsensical. We have no use for that previous
> readout, so it should be ignored.
>
> This patch adds proper status checking, and removes the "variance" and
> "temp2" sysfs attributes which refer to the old readout.
>
> Signed-off-by: Shem Multinymous <[email protected]>
Signed-off-by: Pavel Machek <[email protected]>
> + if (data.val[EC_ACCEL_IDX_READOUTS]<1)
Could we get spaces around '<'?
> + int total, ret;
> + for (total=READ_TIMEOUT_MSECS; total>0; total-=RETRY_MSECS) {
Could we go from 0 to timeout, not the other way around?
> static DEVICE_ATTR(position, 0444, hdaps_position_show, NULL);
> -static DEVICE_ATTR(variance, 0444, hdaps_variance_show, NULL);
> static DEVICE_ATTR(temp1, 0444, hdaps_temp1_show, NULL);
> -static DEVICE_ATTR(temp2, 0444, hdaps_temp2_show, NULL);
> + /* "temp1" instead of "temperature" is hwmon convention */
> static DEVICE_ATTR(keyboard_activity, 0444, hdaps_keyboard_activity_show, NULL);
> static DEVICE_ATTR(mouse_activity, 0444, hdaps_mouse_activity_show, NULL);
> static DEVICE_ATTR(calibrate, 0644, hdaps_calibrate_show,hdaps_calibrate_store);
This actually changes userland interface... but that is probably okay.
Pavel
--
Thanks for all the (sleeping) penguins.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]