RE: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2018-09-06 Thread Moore, Robert
ernel.org; Moore, Robert ; > lv.zh...@intel.com; mika.westerb...@linux.intel.com; linux- > a...@vger.kernel.org; de...@acpica.org; linux...@vger.kernel.org; lkml > > Subject: Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng > implementation > > Hi Andy, > > I

RE: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2018-09-06 Thread Moore, Robert
ernel.org; Moore, Robert ; > lv.zh...@intel.com; mika.westerb...@linux.intel.com; linux- > a...@vger.kernel.org; de...@acpica.org; linux...@vger.kernel.org; lkml > > Subject: Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng > implementation > > Hi Andy, > > I

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2018-08-31 Thread Benjamin Tissoires
Hi Andy, I am resurrecting this thread now that ACPICA seemed to finally have fixed the bug that prevent the driver to work. The patch I submitted was reverted shortly after, which lead me to ignore this review until ACPICA was fixed. It took a lot of effort from Hans to have a fix accepted, so

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2018-08-31 Thread Benjamin Tissoires
Hi Andy, I am resurrecting this thread now that ACPICA seemed to finally have fixed the bug that prevent the driver to work. The patch I submitted was reverted shortly after, which lead me to ignore this review until ACPICA was fixed. It took a lot of effort from Hans to have a fix accepted, so

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-07-01 Thread Julia Lawall
> That seems to be a common mistake in the kernel and it > might be a good idea to add some Coccinelle script for > it? Done. julia

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-07-01 Thread Julia Lawall
> That seems to be a common mistake in the kernel and it > might be a good idea to add some Coccinelle script for > it? Done. julia

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Sebastian Reichel
Hi, On Thu, Jun 29, 2017 at 02:10:09PM +0200, Benjamin Tissoires wrote: > [...] > > + /* get design capacity */ > + ret = i2c_smbus_read_word_data(client, > +MSHW0011_BAT0_REG_DESIGN_CAPACITY); > + if (ret < 0) { > + dev_err(>dev, "Error

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Sebastian Reichel
Hi, On Thu, Jun 29, 2017 at 02:10:09PM +0200, Benjamin Tissoires wrote: > [...] > > + /* get design capacity */ > + ret = i2c_smbus_read_word_data(client, > +MSHW0011_BAT0_REG_DESIGN_CAPACITY); > + if (ret < 0) { > + dev_err(>dev, "Error

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Andy Shevchenko
On Fri, Jun 30, 2017 at 8:55 PM, Andy Shevchenko wrote: > On Fri, Jun 30, 2017 at 8:42 PM, Hans de Goede wrote: >> On 30-06-17 19:40, Andy Shevchenko wrote: >>> On Fri, Jun 30, 2017 at 8:37 PM, Hans de Goede >>> wrote: On

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Andy Shevchenko
On Fri, Jun 30, 2017 at 8:55 PM, Andy Shevchenko wrote: > On Fri, Jun 30, 2017 at 8:42 PM, Hans de Goede wrote: >> On 30-06-17 19:40, Andy Shevchenko wrote: >>> On Fri, Jun 30, 2017 at 8:37 PM, Hans de Goede >>> wrote: On 30-06-17 18:37, Andy Shevchenko wrote: > On Fri, Jun 30, 2017 at

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Andy Shevchenko
On Fri, Jun 30, 2017 at 8:42 PM, Hans de Goede wrote: > On 30-06-17 19:40, Andy Shevchenko wrote: >> On Fri, Jun 30, 2017 at 8:37 PM, Hans de Goede >> wrote: >>> On 30-06-17 18:37, Andy Shevchenko wrote: On Fri, Jun 30, 2017 at 6:57 PM, Benjamin

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Andy Shevchenko
On Fri, Jun 30, 2017 at 8:42 PM, Hans de Goede wrote: > On 30-06-17 19:40, Andy Shevchenko wrote: >> On Fri, Jun 30, 2017 at 8:37 PM, Hans de Goede >> wrote: >>> On 30-06-17 18:37, Andy Shevchenko wrote: On Fri, Jun 30, 2017 at 6:57 PM, Benjamin Tissoires > Care to share that? Between me

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Hans de Goede
Hi, On 30-06-17 19:40, Andy Shevchenko wrote: On Fri, Jun 30, 2017 at 8:37 PM, Hans de Goede wrote: On 30-06-17 18:37, Andy Shevchenko wrote: On Fri, Jun 30, 2017 at 6:57 PM, Benjamin Tissoires ACPI i2c drivers still need an empty i2c_device_id table I've fixing this

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Hans de Goede
Hi, On 30-06-17 19:40, Andy Shevchenko wrote: On Fri, Jun 30, 2017 at 8:37 PM, Hans de Goede wrote: On 30-06-17 18:37, Andy Shevchenko wrote: On Fri, Jun 30, 2017 at 6:57 PM, Benjamin Tissoires ACPI i2c drivers still need an empty i2c_device_id table I've fixing this on my TODO but it has

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Andy Shevchenko
On Fri, Jun 30, 2017 at 8:37 PM, Hans de Goede wrote: > On 30-06-17 18:37, Andy Shevchenko wrote: >> On Fri, Jun 30, 2017 at 6:57 PM, Benjamin Tissoires > ACPI i2c drivers still need an empty i2c_device_id table I've > fixing this on my TODO but it has been buried in other

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Andy Shevchenko
On Fri, Jun 30, 2017 at 8:37 PM, Hans de Goede wrote: > On 30-06-17 18:37, Andy Shevchenko wrote: >> On Fri, Jun 30, 2017 at 6:57 PM, Benjamin Tissoires > ACPI i2c drivers still need an empty i2c_device_id table I've > fixing this on my TODO but it has been buried in other stuff. > > Benjamin if

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Hans de Goede
Hi, On 30-06-17 18:37, Andy Shevchenko wrote: On Fri, Jun 30, 2017 at 6:57 PM, Benjamin Tissoires +static const struct i2c_device_id mshw0011_id[] = { + { } +}; +MODULE_DEVICE_TABLE(i2c, mshw0011_id); ->probe_new(), please. Correct If I2C framework is _still_ broken we need to

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Hans de Goede
Hi, On 30-06-17 18:37, Andy Shevchenko wrote: On Fri, Jun 30, 2017 at 6:57 PM, Benjamin Tissoires +static const struct i2c_device_id mshw0011_id[] = { + { } +}; +MODULE_DEVICE_TABLE(i2c, mshw0011_id); ->probe_new(), please. Correct If I2C framework is _still_ broken we need to

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Andy Shevchenko
On Fri, Jun 30, 2017 at 6:57 PM, Benjamin Tissoires wrote: > On Jun 29 2017 or thereabouts, Andy Shevchenko wrote: >> On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires >> wrote: >> What devices (laptops, tablets) have it? >>

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Andy Shevchenko
On Fri, Jun 30, 2017 at 6:57 PM, Benjamin Tissoires wrote: > On Jun 29 2017 or thereabouts, Andy Shevchenko wrote: >> On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires >> wrote: >> What devices (laptops, tablets) have it? >> Surface 3. What else? > > So far, Surface 3 only. It's a Microsoft

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Benjamin Tissoires
Hi Andy, Thanks for the review :) On Jun 29 2017 or thereabouts, Andy Shevchenko wrote: > +Cc: Hans (he might give some advice regarding to the below) > > On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires > wrote: > > MSHW0011 replaces the battery firmware by

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Benjamin Tissoires
Hi Andy, Thanks for the review :) On Jun 29 2017 or thereabouts, Andy Shevchenko wrote: > +Cc: Hans (he might give some advice regarding to the below) > > On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires > wrote: > > MSHW0011 replaces the battery firmware by using ACPI operation regions. >

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Hans de Goede
Hi, On 30-06-17 17:26, Benjamin Tissoires wrote: On Jun 30 2017 or thereabouts, Hans de Goede wrote: +static int mshw0011_i2c_resource_lookup(struct mshw0011_data *cdata, + unsigned int index) +{ + struct i2c_client *client = cdata->adp1; +

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Hans de Goede
Hi, On 30-06-17 17:26, Benjamin Tissoires wrote: On Jun 30 2017 or thereabouts, Hans de Goede wrote: +static int mshw0011_i2c_resource_lookup(struct mshw0011_data *cdata, + unsigned int index) +{ + struct i2c_client *client = cdata->adp1; +

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Hans de Goede
HI, On 30-06-17 17:24, Benjamin Tissoires wrote: On Jun 29 2017 or thereabouts, Rafael J. Wysocki wrote: On Thu, Jun 29, 2017 at 4:22 PM, Andy Shevchenko wrote: +Cc: Hans (he might give some advice regarding to the below) On Thu, Jun 29, 2017 at 3:10 PM, Benjamin

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Hans de Goede
HI, On 30-06-17 17:24, Benjamin Tissoires wrote: On Jun 29 2017 or thereabouts, Rafael J. Wysocki wrote: On Thu, Jun 29, 2017 at 4:22 PM, Andy Shevchenko wrote: +Cc: Hans (he might give some advice regarding to the below) On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires wrote: MSHW0011

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Benjamin Tissoires
On Jun 30 2017 or thereabouts, Hans de Goede wrote: > Hi, > > On 29-06-17 16:22, Andy Shevchenko wrote: > > +Cc: Hans (he might give some advice regarding to the below) > > Thank you for the Cc, so here we have the opposite situation as > with the devices with the AXP288 PMIC and the Cherry

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Benjamin Tissoires
On Jun 30 2017 or thereabouts, Hans de Goede wrote: > Hi, > > On 29-06-17 16:22, Andy Shevchenko wrote: > > +Cc: Hans (he might give some advice regarding to the below) > > Thank you for the Cc, so here we have the opposite situation as > with the devices with the AXP288 PMIC and the Cherry

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Benjamin Tissoires
On Jun 29 2017 or thereabouts, Rafael J. Wysocki wrote: > On Thu, Jun 29, 2017 at 4:22 PM, Andy Shevchenko > wrote: > > +Cc: Hans (he might give some advice regarding to the below) > > > > On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires > >

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Benjamin Tissoires
On Jun 29 2017 or thereabouts, Rafael J. Wysocki wrote: > On Thu, Jun 29, 2017 at 4:22 PM, Andy Shevchenko > wrote: > > +Cc: Hans (he might give some advice regarding to the below) > > > > On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires > > wrote: > >> MSHW0011 replaces the battery firmware

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Hans de Goede
Hi, On 29-06-17 16:22, Andy Shevchenko wrote: +Cc: Hans (he might give some advice regarding to the below) Thank you for the Cc, so here we have the opposite situation as with the devices with the AXP288 PMIC and the Cherry Trail Whiskey Cove PMIC combined with the TI bq24292i charger and

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-30 Thread Hans de Goede
Hi, On 29-06-17 16:22, Andy Shevchenko wrote: +Cc: Hans (he might give some advice regarding to the below) Thank you for the Cc, so here we have the opposite situation as with the devices with the AXP288 PMIC and the Cherry Trail Whiskey Cove PMIC combined with the TI bq24292i charger and

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-29 Thread Rafael J. Wysocki
On Thu, Jun 29, 2017 at 4:22 PM, Andy Shevchenko wrote: > +Cc: Hans (he might give some advice regarding to the below) > > On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires > wrote: >> MSHW0011 replaces the battery firmware by using

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-29 Thread Rafael J. Wysocki
On Thu, Jun 29, 2017 at 4:22 PM, Andy Shevchenko wrote: > +Cc: Hans (he might give some advice regarding to the below) > > On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires > wrote: >> MSHW0011 replaces the battery firmware by using ACPI operation regions. >> The values have been obtained by

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-29 Thread Andy Shevchenko
+Cc: Hans (he might give some advice regarding to the below) On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires wrote: > MSHW0011 replaces the battery firmware by using ACPI operation regions. > The values have been obtained by reverse engineering, and are subject

Re: [PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-29 Thread Andy Shevchenko
+Cc: Hans (he might give some advice regarding to the below) On Thu, Jun 29, 2017 at 3:10 PM, Benjamin Tissoires wrote: > MSHW0011 replaces the battery firmware by using ACPI operation regions. > The values have been obtained by reverse engineering, and are subject to > errors. Looks like it

[PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-29 Thread Benjamin Tissoires
MSHW0011 replaces the battery firmware by using ACPI operation regions. The values have been obtained by reverse engineering, and are subject to errors. Looks like it works on overall pretty well. I couldn't manage to get the IRQ correctly triggered, so I am using a good old polling thread to

[PATCH v2] ACPI: surface3_power: MSHW0011 rev-eng implementation

2017-06-29 Thread Benjamin Tissoires
MSHW0011 replaces the battery firmware by using ACPI operation regions. The values have been obtained by reverse engineering, and are subject to errors. Looks like it works on overall pretty well. I couldn't manage to get the IRQ correctly triggered, so I am using a good old polling thread to