lkml.org 
[lkml]   [2023]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCHv1 02/11] power: supply: core: auto-exposure of simple-battery data
Hi Sebastian,

thanks for your patch!

On Thu, Mar 9, 2023 at 11:50 PM Sebastian Reichel <sre@kernel.org> wrote:

> + /*
> + * Set if constant battery information from firmware should be
> + * exposed automatically. No driver specific code is required
> + * in that case. If the driver also handles a property provided
> + * by constant firmware data, the driver's handler is preferred.
> + */
> + bool expose_battery_info;

Playing it safe with opt-in I see! But I would probably invert it and add
a hide_battery_info for those that don't wanna expose it. It seems
pretty useful to just expose this in general.

However I have no insight in what happens on laptops etc for this
so I guess you have your reasons, either way:

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

> +extern bool power_supply_battery_info_has_prop(struct power_supply_battery_info *info,
> + enum power_supply_property psp);
> +extern int power_supply_battery_info_get_prop(struct power_supply_battery_info *info,
> + enum power_supply_property psp,
> + union power_supply_propval *val);

I think the build robots complain because you need to add some stubs
for the not enabled case.

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2023-03-27 00:52    [W:2.389 / U:0.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site