Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Stefan Agner
Am 2013-11-27 17:58, schrieb Stephen Warren: >> +tps6586x = devm_kzalloc(>dev, sizeof(*tps6586x), GFP_KERNEL); >> +if (tps6586x == NULL) { >> +dev_err(>dev, "memory for tps6586x alloc failed\n"); >> +return -ENOMEM; >> +} > >> +tps6586x->version = (enum

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Stephen Warren
On 11/26/2013 04:45 PM, Stefan Agner wrote: > Use the VERSIONCRC to determine the exact device version. According to > the datasheet this register can be used as device identifier. The > identification is needed since some tps6586x regulators use a different > voltage table. > diff --git

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
On Wed, 27 Nov 2013, Stefan Agner wrote: > Am 2013-11-27 16:30, schrieb Lee Jones: > > On Wed, 27 Nov 2013, Stefan Agner wrote: > > > >> Am 2013-11-27 15:36, schrieb Lee Jones: > >> > >> >> Perhaps I should suggest to make TPS6586X_ANY a positive number then, > >> >> as a negative value to me

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Stefan Agner
Am 2013-11-27 16:30, schrieb Lee Jones: > On Wed, 27 Nov 2013, Stefan Agner wrote: > >> Am 2013-11-27 15:36, schrieb Lee Jones: >> >> >> Perhaps I should suggest to make TPS6586X_ANY a positive number then, >> >> as a negative value to me indicates more of an error than a generic >> >>

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
On Wed, 27 Nov 2013, Stefan Agner wrote: > Am 2013-11-27 15:36, schrieb Lee Jones: > > >> Perhaps I should suggest to make TPS6586X_ANY a positive number then, > >> as a negative value to me indicates more of an error than a generic > >> parameter. > I see, its especially confusing since the

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Stefan Agner
Am 2013-11-27 15:36, schrieb Lee Jones: >> Perhaps I should suggest to make TPS6586X_ANY a positive number then, >> as a negative value to me indicates more of an error than a generic >> parameter. I see, its especially confusing since the version is filled using the i2c_smbus_read_byte_data

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
Re-adding the list. Please remember to 'reply to all' when discussing patches. > > >> Hm, when the device is not answering on that request, the probe method > > >> should fail I would say. This means that the device is missing most > > >> likely. However, I should set the device version to

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
> >>if (ret < 0) { > >>dev_err(>dev, "Chip ID read failed: %d\n", ret); > >>return -EIO; > > > > Why are you returning an error here when you have a valid enum of: > > TPS6586X_ANY = -1, > > > Hm, when the device is not answering on that request, the probe

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Stefan Agner
Am 2013-11-27 14:09, schrieb Lee Jones: > > >> static int __remove_subdev(struct device *dev, void *unused) >> { >> platform_device_unregister(to_platform_device(dev)); >> @@ -477,6 +486,7 @@ static int tps6586x_i2c_probe(struct i2c_client *client, >> { >> struct

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
Oh, and it's usually a good idea to CC all of the maintainers. This patch nearly slipped through the gaps. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
> static int __remove_subdev(struct device *dev, void *unused) > { > platform_device_unregister(to_platform_device(dev)); > @@ -477,6 +486,7 @@ static int tps6586x_i2c_probe(struct i2c_client *client, > { > struct tps6586x_platform_data *pdata = dev_get_platdata(>dev); >

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
snip static int __remove_subdev(struct device *dev, void *unused) { platform_device_unregister(to_platform_device(dev)); @@ -477,6 +486,7 @@ static int tps6586x_i2c_probe(struct i2c_client *client, { struct tps6586x_platform_data *pdata = dev_get_platdata(client-dev);

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
Oh, and it's usually a good idea to CC all of the maintainers. This patch nearly slipped through the gaps. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Stefan Agner
Am 2013-11-27 14:09, schrieb Lee Jones: snip static int __remove_subdev(struct device *dev, void *unused) { platform_device_unregister(to_platform_device(dev)); @@ -477,6 +486,7 @@ static int tps6586x_i2c_probe(struct i2c_client *client, { struct tps6586x_platform_data *pdata

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
if (ret 0) { dev_err(client-dev, Chip ID read failed: %d\n, ret); return -EIO; Why are you returning an error here when you have a valid enum of: TPS6586X_ANY = -1, Hm, when the device is not answering on that request, the probe method should fail

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
Re-adding the list. Please remember to 'reply to all' when discussing patches. Hm, when the device is not answering on that request, the probe method should fail I would say. This means that the device is missing most likely. However, I should set the device version to TPS6586X_ANY if I

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Stefan Agner
Am 2013-11-27 15:36, schrieb Lee Jones: snip Perhaps I should suggest to make TPS6586X_ANY a positive number then, as a negative value to me indicates more of an error than a generic parameter. I see, its especially confusing since the version is filled using the i2c_smbus_read_byte_data

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
On Wed, 27 Nov 2013, Stefan Agner wrote: Am 2013-11-27 15:36, schrieb Lee Jones: snip Perhaps I should suggest to make TPS6586X_ANY a positive number then, as a negative value to me indicates more of an error than a generic parameter. I see, its especially confusing since the version is

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Stefan Agner
Am 2013-11-27 16:30, schrieb Lee Jones: On Wed, 27 Nov 2013, Stefan Agner wrote: Am 2013-11-27 15:36, schrieb Lee Jones: snip Perhaps I should suggest to make TPS6586X_ANY a positive number then, as a negative value to me indicates more of an error than a generic parameter. I see, its

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Lee Jones
On Wed, 27 Nov 2013, Stefan Agner wrote: Am 2013-11-27 16:30, schrieb Lee Jones: On Wed, 27 Nov 2013, Stefan Agner wrote: Am 2013-11-27 15:36, schrieb Lee Jones: snip Perhaps I should suggest to make TPS6586X_ANY a positive number then, as a negative value to me indicates more of

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Stephen Warren
On 11/26/2013 04:45 PM, Stefan Agner wrote: Use the VERSIONCRC to determine the exact device version. According to the datasheet this register can be used as device identifier. The identification is needed since some tps6586x regulators use a different voltage table. diff --git

Re: [PATCH 1/3] mfd: tps6586x: add version detection

2013-11-27 Thread Stefan Agner
Am 2013-11-27 17:58, schrieb Stephen Warren: snip +tps6586x = devm_kzalloc(client-dev, sizeof(*tps6586x), GFP_KERNEL); +if (tps6586x == NULL) { +dev_err(client-dev, memory for tps6586x alloc failed\n); +return -ENOMEM; +} +tps6586x-version = (enum

[PATCH 1/3] mfd: tps6586x: add version detection

2013-11-26 Thread Stefan Agner
Use the VERSIONCRC to determine the exact device version. According to the datasheet this register can be used as device identifier. The identification is needed since some tps6586x regulators use a different voltage table. Signed-off-by: Stefan Agner --- drivers/mfd/tps6586x.c | 41

[PATCH 1/3] mfd: tps6586x: add version detection

2013-11-26 Thread Stefan Agner
Use the VERSIONCRC to determine the exact device version. According to the datasheet this register can be used as device identifier. The identification is needed since some tps6586x regulators use a different voltage table. Signed-off-by: Stefan Agner ste...@agner.ch --- drivers/mfd/tps6586x.c