Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2017-01-26 Thread Bastien Nocera
On Wed, 2016-06-29 at 19:28 +1000, Peter Hutterer wrote: > If the 0x1000 Unified Battery Level Status feature exists, expose the battery > level. > > The main drawback is that while a device is plugged in its battery level is 0. > To avoid exposing that as 0% charge we make up a number based on th

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-12 Thread Peter Hutterer
On Fri, Jul 08, 2016 at 04:35:45PM +0200, Bastien Nocera wrote: > On Wed, 2016-06-29 at 19:28 +1000, Peter Hutterer wrote: > > +static int hidpp_battery_get_property(struct power_supply *psy, > > + enum power_supply_property psp, > > +

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-11 Thread Jiri Kosina
On Mon, 11 Jul 2016, Benjamin Tissoires wrote: > Hmm, I think before this gets pushed to Linus' tree, we'll also need to > have battery support for HID++ 1.0 devices too (upower seems to be > handling them, so this would introduce a regression). So depending on > how much work we can do, it mig

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-11 Thread Benjamin Tissoires
On Jul 08 2016 or thereabouts, Jiri Kosina wrote: > On Fri, 8 Jul 2016, Bastien Nocera wrote: > > > Sorry about not being able to test this before it was merged for > > inclusion. > > This is just in a topic branch of hid.git as of now, so we can still tweak > things (including API) if/as neede

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-11 Thread Benjamin Tissoires
On Jul 08 2016 or thereabouts, Bastien Nocera wrote: > On Fri, 2016-07-08 at 16:35 +0200, Bastien Nocera wrote: > > On Wed, 2016-06-29 at 19:28 +1000, Peter Hutterer wrote: > > > +static int hidpp_battery_get_property(struct power_supply *psy, > > > + enum power_

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-11 Thread Benjamin Tissoires
On Jul 08 2016 or thereabouts, Bastien Nocera wrote: > On Wed, 2016-06-29 at 19:28 +1000, Peter Hutterer wrote: > > +static int hidpp_battery_get_property(struct power_supply *psy, > > + enum power_supply_property psp, > > + un

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-08 Thread Jiri Kosina
On Fri, 8 Jul 2016, Bastien Nocera wrote: > Sorry about not being able to test this before it was merged for > inclusion. This is just in a topic branch of hid.git as of now, so we can still tweak things (including API) if/as needed. -- Jiri Kosina SUSE Labs

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-08 Thread Bastien Nocera
On Fri, 2016-07-08 at 16:35 +0200, Bastien Nocera wrote: > On Wed, 2016-06-29 at 19:28 +1000, Peter Hutterer wrote: > > +static int hidpp_battery_get_property(struct power_supply *psy, > > + enum power_supply_property > > psp, > > +   

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-08 Thread Bastien Nocera
On Wed, 2016-06-29 at 19:28 +1000, Peter Hutterer wrote: > +static int hidpp_battery_get_property(struct power_supply *psy, > + enum power_supply_property psp, > + union power_supply_propval > *val) > +{ > +   struct hidpp_

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-07 Thread Peter Hutterer
On Fri, Jul 08, 2016 at 01:21:08AM +0200, Bastien Nocera wrote: > On Wed, 2016-06-29 at 19:28 +1000, Peter Hutterer wrote: > > If the 0x1000 Unified Battery Level Status feature exists, expose the > > battery > > level. > > > > The main drawback is that while a device is plugged in its battery > >

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-07 Thread Bastien Nocera
On Wed, 2016-06-29 at 19:28 +1000, Peter Hutterer wrote: > If the 0x1000 Unified Battery Level Status feature exists, expose the > battery > level. > > The main drawback is that while a device is plugged in its battery > level is 0. > To avoid exposing that as 0% charge we make up a number based o

Re: [PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-07-07 Thread Jiri Kosina
On Wed, 29 Jun 2016, Peter Hutterer wrote: > If the 0x1000 Unified Battery Level Status feature exists, expose the battery > level. > > The main drawback is that while a device is plugged in its battery level is 0. > To avoid exposing that as 0% charge we make up a number based on the charging >

[PATCH 1/2] HID: logitech-hidpp: add battery support for HID++ 2.0 devices

2016-06-29 Thread Peter Hutterer
If the 0x1000 Unified Battery Level Status feature exists, expose the battery level. The main drawback is that while a device is plugged in its battery level is 0. To avoid exposing that as 0% charge we make up a number based on the charging status. Signed-off-by: Peter Hutterer Signed-off-by: B