Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-11 Thread Guenter Roeck
On Thu, Dec 11, 2014 at 11:26:07AM +0100, Bartosz Golaszewski wrote: > 2014-12-10 19:31 GMT+01:00 Guenter Roeck : > > I don't really want it at all ;-). Seems to me all those options are broken > > one way or another. The only real solution would be to re-instantiate the > > driver if the chip was

Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-11 Thread Bartosz Golaszewski
2014-12-10 19:31 GMT+01:00 Guenter Roeck : > I don't really want it at all ;-). Seems to me all those options are broken > one way or another. The only real solution would be to re-instantiate the > driver if the chip was removed and re-inserted, and to provide parameters > either with platform

Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-11 Thread Bartosz Golaszewski
2014-12-10 19:31 GMT+01:00 Guenter Roeck li...@roeck-us.net: I don't really want it at all ;-). Seems to me all those options are broken one way or another. The only real solution would be to re-instantiate the driver if the chip was removed and re-inserted, and to provide parameters either

Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-11 Thread Guenter Roeck
On Thu, Dec 11, 2014 at 11:26:07AM +0100, Bartosz Golaszewski wrote: 2014-12-10 19:31 GMT+01:00 Guenter Roeck li...@roeck-us.net: I don't really want it at all ;-). Seems to me all those options are broken one way or another. The only real solution would be to re-instantiate the driver if

Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-10 Thread Guenter Roeck
On Wed, Dec 10, 2014 at 05:46:43PM +0100, Bartosz Golaszewski wrote: > 2014-12-10 15:20 GMT+01:00 Guenter Roeck : > >> + case INA2XX_CALIBRATION: > >> + if (data->regs[reg] == 0) > >> + val = 0; > >> + else > >> + val =

Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-10 Thread Bartosz Golaszewski
2014-12-10 15:20 GMT+01:00 Guenter Roeck : >> + case INA2XX_CALIBRATION: >> + if (data->regs[reg] == 0) >> + val = 0; >> + else >> + val = data->config->calibration_factor >> +

Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-10 Thread Guenter Roeck
On 12/10/2014 02:38 AM, Bartosz Golaszewski wrote: The shunt resistance can only be set via platform_data or device tree. This isn't suitable for devices in which the shunt resistance can change/isn't known at boot-time. Add a sysfs attribute that allows to read and set the shunt resistance.

[PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-10 Thread Bartosz Golaszewski
The shunt resistance can only be set via platform_data or device tree. This isn't suitable for devices in which the shunt resistance can change/isn't known at boot-time. Add a sysfs attribute that allows to read and set the shunt resistance. Signed-off-by: Bartosz Golaszewski ---

[PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-10 Thread Bartosz Golaszewski
The shunt resistance can only be set via platform_data or device tree. This isn't suitable for devices in which the shunt resistance can change/isn't known at boot-time. Add a sysfs attribute that allows to read and set the shunt resistance. Signed-off-by: Bartosz Golaszewski

Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-10 Thread Guenter Roeck
On 12/10/2014 02:38 AM, Bartosz Golaszewski wrote: The shunt resistance can only be set via platform_data or device tree. This isn't suitable for devices in which the shunt resistance can change/isn't known at boot-time. Add a sysfs attribute that allows to read and set the shunt resistance.

Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-10 Thread Bartosz Golaszewski
2014-12-10 15:20 GMT+01:00 Guenter Roeck li...@roeck-us.net: + case INA2XX_CALIBRATION: + if (data-regs[reg] == 0) + val = 0; + else + val = data-config-calibration_factor +

Re: [PATCH v5 1/3] hwmon: ina2xx: make shunt resistance configurable at run-time

2014-12-10 Thread Guenter Roeck
On Wed, Dec 10, 2014 at 05:46:43PM +0100, Bartosz Golaszewski wrote: 2014-12-10 15:20 GMT+01:00 Guenter Roeck li...@roeck-us.net: + case INA2XX_CALIBRATION: + if (data-regs[reg] == 0) + val = 0; + else + val =