Re: [PATCH 5/5] HID: wacom: generic: Refactor generic battery handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 5, 2017 at 5:15 AM, Jiri Kosina <jikos@xxxxxxxxxx> wrote:
> On Wed, 3 May 2017, Ping Cheng wrote:
>
>> > Generic battery handling code is spread between the pen and pad codepaths
>> > since battery usages may appear in reports for either. This makes it
>> > difficult to concisely see the logic involved. Since battery data is
>> > not treated like other data (i.e., we report it through the power_supply
>> > subsystem rather than through the input subsystem), it makes reasonable
>> > sense to split the functionality out into its own functions.
>> >
>> > This commit has the generic battery handling duplicate the same pattern
>> > that is used by the pen, pad, and touch interfaces. A "mapping" function
>> > is provided to set up the battery, an "event" function is provided to
>> > update the battery data, and a "report" function is provided to notify
>> > the power_supply subsystem after all the data has been read. We look at
>> > the usage itself rather than its collection to determine if one of the
>> > battery functions should handle it. Additionally, we unconditionally
>> > call the "report" function since there is no particularly good way to
>> > know if a report contained a battery usage; 'wacom_notify_battery()'
>> > will filter out any duplicate updates, however.
>> >
>> > Signed-off-by: Jason Gerecke <jason.gerecke@xxxxxxxxx>
>>
>> Reviewed-by: Ping Cheng <ping.cheng@wacom,com> for the whole set.
>
> Do these fix any user-triggerable problems in the real world, or are they
> "nice to have"s?
>
> IOW, I see this currently as 4.13 merge window material, unless you
> convince me otherwise.
>
> Thanks,
>
> --
> Jiri Kosina
> SUSE Labs
>

I have no strong objections to a 4.13 target. This is a feature I had
forgotten to complete and much more of a "nice to have" than something
whose omission will cause serious issues. Even without the monitoring,
its not hard the guess the battery may have died if the pen suddenly
stops working ;)

Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one  /
(That is to say, eight) to the two,     /
But you can’t take seven from three,    /
So you look at the sixty-fours....
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux