Re: [PATCH v3 2/2] hwmon: ina3221: Read channel input source info from DT

2018-09-22 Thread Guenter Roeck
On 09/22/2018 08:33 PM, Nicolin Chen wrote: No. If the chip was configured by the BIOS/ROMMON, it is supposed to be that way. We can not just override that. For this driver, it does soft reset in the probe() so we're sure that all channels are enabled at the moment of calling this regmap_updat

Re: [PATCH v3 2/2] hwmon: ina3221: Read channel input source info from DT

2018-09-22 Thread Nicolin Chen
On Sat, Sep 22, 2018 at 08:33:00PM -0700, Nicolin Chen wrote: > On Sat, Sep 22, 2018 at 07:07:02PM -0700, Guenter Roeck wrote: > > On 09/22/2018 05:38 PM, Nicolin Chen wrote: > > >On Sat, Sep 22, 2018 at 04:59:55PM -0700, Guenter Roeck wrote: > > > > > >+ /* Disable channels if their input

Re: [PATCH v3 2/2] hwmon: ina3221: Read channel input source info from DT

2018-09-22 Thread Nicolin Chen
On Sat, Sep 22, 2018 at 07:07:02PM -0700, Guenter Roeck wrote: > On 09/22/2018 05:38 PM, Nicolin Chen wrote: > >On Sat, Sep 22, 2018 at 04:59:55PM -0700, Guenter Roeck wrote: > > > >+/* Disable channels if their inputs are disconnected */ > >+for (i = 0, mask = 0; i < INA322

Re: [PATCH v3 2/2] hwmon: ina3221: Read channel input source info from DT

2018-09-22 Thread Guenter Roeck
On 09/22/2018 05:38 PM, Nicolin Chen wrote: On Sat, Sep 22, 2018 at 04:59:55PM -0700, Guenter Roeck wrote: + /* Disable channels if their inputs are disconnected */ + for (i = 0, mask = 0; i < INA3221_NUM_CHANNELS; i++) { + if (ina->inputs[i].disconnected) +

Re: [PATCH v3 2/2] hwmon: ina3221: Read channel input source info from DT

2018-09-22 Thread Nicolin Chen
On Sat, Sep 22, 2018 at 05:38:41PM -0700, Nicolin Chen wrote: > On Sat, Sep 22, 2018 at 04:59:55PM -0700, Guenter Roeck wrote: > > > > > > + /* Disable channels if their inputs are disconnected */ > > > > > + for (i = 0, mask = 0; i < INA3221_NUM_CHANNELS; i++) { > > > > > + if

Re: [PATCH v3 2/2] hwmon: ina3221: Read channel input source info from DT

2018-09-22 Thread Nicolin Chen
On Sat, Sep 22, 2018 at 04:59:55PM -0700, Guenter Roeck wrote: > > > > + /* Disable channels if their inputs are disconnected */ > > > > + for (i = 0, mask = 0; i < INA3221_NUM_CHANNELS; i++) { > > > > + if (ina->inputs[i].disconnected) > > > > + mas

Re: [PATCH v3 2/2] hwmon: ina3221: Read channel input source info from DT

2018-09-22 Thread Guenter Roeck
On 09/22/2018 11:46 AM, Nicolin Chen wrote: This patch adds a new structure of input source specific information including input source label, shunt resistor value and its connection status. It exposes these labels via sysfs and also disables those channels where there's no input source being con

Re: [PATCH v3 2/2] hwmon: ina3221: Read channel input source info from DT

2018-09-22 Thread Nicolin Chen
> >This patch adds a new structure of input source specific > >information including input source label, shunt resistor > >value and its connection status. It exposes these labels > >via sysfs and also disables those channels where there's > >no input source being connected. > > > > I see you have

Re: [PATCH v3 2/2] hwmon: ina3221: Read channel input source info from DT

2018-09-22 Thread Guenter Roeck
Hi, On 09/21/2018 03:32 PM, Nicolin Chen wrote: From: Nicolin Chen An ina3221 chip has three input ports. Each port is used to measure the voltage and current of its input source. The DT binding now has defined bindings for their input sources, so the driver should read these information and

[PATCH v3 2/2] hwmon: ina3221: Read channel input source info from DT

2018-09-21 Thread Nicolin Chen
From: Nicolin Chen An ina3221 chip has three input ports. Each port is used to measure the voltage and current of its input source. The DT binding now has defined bindings for their input sources, so the driver should read these information and handle accordingly. This patch adds a new structur