Hello,
On Thu, Oct 04, 2018 at 09:48:02AM -0700, Guenter Roeck wrote:
> > > I would not object to adding trace support into the hwmon subsystem.
> > > However, it should be tied to the new API. I would resist patches
> > > adding trace support to individual hwmon drivers unless the new API
> > >
Hello Guenter,
I am thinking about a possibility of adding a trace event support
in hwmon subsystem. Ftrace is pretty useful and widely applied to
different subsystems already while hwmon doesn't seem to have one
yet. I know some power/perf folks who rely on the trace events to
analyse
Thanks for the quick response.
On Wed, Oct 03, 2018 at 05:42:23PM -0700, Guenter Roeck wrote:
> > Ftrace data. Similar to tz->poll_queue in thermal_core, hwmon core
> > could also have a work queue polling the registered sensor inputs
> > (by default disabled; enabled only if users configure
Hi Stefan,
Sorry for a super late reply. I took a long vacation.
On Wed, Nov 21, 2018 at 10:16:09PM +, Brüns, Stefan wrote:
> > > Another concern may be voltage drop over the shunt, but for this case you
> > > have a nominal voltage of 1.8V, so 30uV are 0.001%.
> > >
> > > > When measuring
.
Changelog
v1->v2:
* Cleaned-up PATCH-2
Nicolin Chen (2):
dt-bindings: hwmon: ina3221: Add ti,single-shot property
hwmon: (ina3221) Implement ti,single-shot DT property
.../devicetree/bindings/hwmon/ina3221.txt | 10 ++
drivers/hwmon/ina3221.c |
ingle-shot operating mode.
Signed-off-by: Nicolin Chen
---
Documentation/devicetree/bindings/hwmon/ina3221.txt | 10 ++
1 file changed, 10 insertions(+)
diff --git a/Documentation/devicetree/bindings/hwmon/ina3221.txt
b/Documentation/devicetree/bindings/hwmon/ina3221.txt
index a7b25caa2b8e..fa
consuming mode to
single-shot mode, which will measure input on demand and then shut
down to save power.
So this patch implements the DT property accordingly.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 28
1 file changed, 28 insertions(+)
diff --git
By default, ina3221, as a hardware monitor, continuously measures
the inputs and generates corresponding data. However, for battery
powered devices, this mode might be power consuming.
This series of patches add a feature of changing default operating
mode to its single-shot mode via DT.
Nicolin
ingle-shot operating mode.
Signed-off-by: Nicolin Chen
---
Documentation/devicetree/bindings/hwmon/ina3221.txt | 10 ++
1 file changed, 10 insertions(+)
diff --git a/Documentation/devicetree/bindings/hwmon/ina3221.txt
b/Documentation/devicetree/bindings/hwmon/ina3221.txt
index a7b25caa2b8e..fa
consuming mode to
single-shot mode, which will measure input on demand and then shut
down to save power.
So this patch implements the DT property accordingly.
Signed-off-by: Nicolin Chen
---
Changelog
v1->v2:
* Replaced the useless mode defines with a boolean variable.
drivers/hwmon/ina322
On Fri, Jan 04, 2019 at 06:37:55PM -0800, Guenter Roeck wrote:
> > +enum ina3221_modes {
> > + INA3221_MODE_SINGLE_SHOT,
> > + INA3221_MODE_CONTINUOUS,
> > + INA3221_NUM_MODES,
>
> Is NUM_MODES used anywhere ? Please drop unless there is a reason to keep it.
Will clean it up in v2.
Thanks
Hi Guenter,
On Thu, Jan 17, 2019 at 03:13:23PM -0800, Guenter Roeck wrote:
> I have one claim stating that your change won't make a difference,
> and your claim that it would. That leaves me with no choice but to
> spend a large amount of time with the datasheet, and possibly with
> my
On Mon, Jan 07, 2019 at 11:35:55AM -0800, Guenter Roeck wrote:
> > + if (of_property_read_bool(np, "ti,single-shot"))
> > + ina->single_shot = true;
> > +
> ina->single_shot = of_property_read_bool(np, "ti,single-shot");
>
> No need to resend right now; let's wait for feedback
On Fri, Jan 04, 2019 at 05:26:42PM -0800, Nicolin Chen wrote:
> Hi Stefan,
>
> Sorry for a super late reply. I took a long vacation.
>
> On Wed, Nov 21, 2018 at 10:16:09PM +, Brüns, Stefan wrote:
> > > > Another concern may be voltage drop over the shunt, but
On Thu, Jan 17, 2019 at 02:58:42PM -0800, Guenter Roeck wrote:
> "Right now" was supposed to mean that you should wait for Rob's
> feedback before sending v3 with the feedback above applied.
> Did you send that version ? I don't see it in patchwork, nor
> in my inbox.
Oh, sorry. Will resend it.
.
Changelog
v2->v3:
* Added "Reviewed-by" from Rob to PATCH-1
* Cleaned-up PATCH-2
v1->v2:
* Cleaned-up PATCH-2
Nicolin Chen (2):
dt-bindings: hwmon: ina3221: Add ti,single-shot property
hwmon: (ina3221) Implement ti,single-shot DT property
.../devicetree/bindings/hwmon/ina3
consuming mode to
single-shot mode, which will measure input on demand and then shut
down to save power.
So this patch implements the DT property accordingly.
Signed-off-by: Nicolin Chen
---
Changelog
v2->v3:
* Dropped useless if condition by using the return value directly.
v1->v2:
* Re
ingle-shot operating mode.
Signed-off-by: Nicolin Chen
Reviewed-by: Rob Herring
---
Changelog
v2->v3:
* Added "Reviewed-by" from Rob
v1->v2:
* N/A
Documentation/devicetree/bindings/hwmon/ina3221.txt | 10 ++
1 file changed, 10 insertions(+)
diff --git a/Documentation/devicet
This series adds a initial DT binding doc for ina3221. It adds
channel names (which should be according to board schematics)
and implements the corresponding actions (disabling channels)
in the driver.
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: ina3221: Get channel
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
.../devicetree/bindings/hwmon/ina3221.txt | 23 +++
1 file changed, 23 insertions(+)
create mode 100644 Documentation
based on
the hardware design. So the channel name should support
NC so the driver could disable the channel accordingly.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 88 +
1 file changed, 80 insertions(+), 8 deletions(-)
diff --git a/drivers
Hi,
On Thu, Sep 20, 2018 at 06:20:38PM -0700, Nicolin Chen wrote:
> > So if there are no devicetree entries, the user now gets a sequence of
> > "unknown" sensors ? I don't think so. Please keep in mind that there are
> > users of this chip who don't have devicet
On Fri, Sep 21, 2018 at 05:56:00AM -0700, Guenter Roeck wrote:
> > I tried is_visible but it looks like it won't be that neat to
> > implement as some attributes of this driver don't really pass
> > the channel index to the store()/show() but some other indexes.
> >
>
> The channel index is not
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
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v1->v2:
* Dropped channel name properties
* Added child node definitions.
* * Added shunt resistor property in the child n
This series adds a initial DT binding doc for ina3221. It defines
a child node to describe the input source of each ina3221 channel.
Then it changes the driver to handle the information properly.
Changelog
v1->v2:
* Redefined DT bindings (detail in PATCH-1)
* Changed the driver code accordingly
Found two mistakes at this doc, sending v3.
On Fri, Sep 21, 2018 at 1:12 PM Nicolin Chen wrote:
> +++ b/Documentation/devicetree/bindings/hwmon/ina3221.txt
> @@ -0,0 +1,38 @@
> +ina3221 properties
> +
Should be a description of the doc.
> + VDD_GPU {
> + s
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
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v2->v3:
* Added a simple subject in the line 1
* Fixed the shunt resistor value in the example
v1->v2:
* Dropped channe
ndings (detail in PATCH-1)
* Changed the driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: ina3221: Read channel input source info from DT
.../devicetree/bindings/hwmon/ina3221.txt | 38 ++
Documentation/hwmon/i
> >+2) child nodes
> >+ The names of child nodes should indicate input source names
> >+
> >+ Required properties:
> >+ - input-id: Must be 1, 2 or 3
> >+
> >+ Optional properties:
> >+ - shunt-resistor: Shunt resistor value in micro-Ohm
> >+ - status: Should be "disabled" if no input source
> >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
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)
> > > > +
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:
> > >
> >
ver accordingly and added is_visible (PATCH-2)
v2->v3:
* Fixed two places in DT bindings (PATCH-1)
v1->v2:
* Redefined DT bindings (detail in PATCH-1)
* Changed the driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: ina3221: Rea
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v3->v4:
* Removed the attempt of putting labels in the node names
* Added a new optional label property in the child node
* Upda
specific
information including input source label, shunt resistor
value and its connection status. It exposes these labels
via sysfs if available and also disables those channels
where there's no input source being connected.
Signed-off-by: Nicolin Chen
---
Changelog
v3->v4:
* Added is_visi
Thank you for the quick response!
On Sat, Sep 22, 2018 at 10:11:26PM -0700, Guenter Roeck wrote:
> >+static umode_t ina3221_attr_is_visible(struct kobject *kobj,
> >+ struct attribute *attr, int n)
> >+{
> >+const int max_attrs = ARRAY_SIZE(ina3221_attrs) -
On Sat, Sep 22, 2018 at 10:19:42PM -0700, Guenter Roeck wrote:
> >+2) child nodes
> >+ Required properties:
> >+ - input-id: Must be 1, 2 or 3
> >+
> >+ Optional properties:
> >+ - input-label: Name of the input source
> >+ - shunt-resistor: Shunt resistor value in micro-Ohm
> >+ - status:
On Sat, Sep 22, 2018 at 10:45:49PM -0700, Guenter Roeck wrote:
> On 09/22/2018 10:31 PM, Nicolin Chen wrote:
> > On Sat, Sep 22, 2018 at 10:19:42PM -0700, Guenter Roeck wrote:
> > > > +2) child nodes
> > > > + Required properties:
> &g
On Sat, Sep 22, 2018 at 11:36:22PM -0700, Guenter Roeck wrote:
> >+ Optional properties:
> >+ - input-label: Name of the input source
>
> Just noticed the "input-" here. Please just use "label".
Will fix in v5.
> >+ input1 {
> >+ input-id = <0x1>;
>
> We'll
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v4->v5:
* Replaced "input-id" with "reg" and added address-cells and size-cells
* Replaced "input-lab
d the driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: ina3221: Read channel input source info from DT
.../devicetree/bindings/hwmon/ina3221.txt | 49 ++
Documentation/hwmon/ina3221 | 1 +
drivers/hwm
specific
information including input source label, shunt resistor
value and its connection status. It exposes these labels
via sysfs if available and also disables those channels
where there's no input source being connected.
Signed-off-by: Nicolin Chen
---
Changelog
v4->v5:
* Replaced &qu
Hello Guenter,
On Tue, Sep 25, 2018 at 06:52:29PM -0700, Guenter Roeck wrote:
> > +2) child nodes
> > + Required properties:
> > + - reg: Must be 0, 1 or 2, corresponding to IN1, IN2 or IN3 port of
> > INA3221
> > +
> > + Optional properties:
> > + - label: Name of the input source
> > + -
On Tue, Sep 25, 2018 at 08:40:59PM -0700, Guenter Roeck wrote:
> >>>+2) child nodes
> >>>+ Required properties:
> >>>+ - reg: Must be 0, 1 or 2, corresponding to IN1, IN2 or IN3 port of
> >>>INA3221
> >>>+ input@0 {
> >>>+ reg = <0x0>;
> >>>+ status = "disabled";
> >>saying
The hwmon sysfs ABI supports powerX_input and powerX_crit. This
can ease user space programs who care more about power in total
than voltage or current individually.
So this patch adds these two sysfs nodes for INA3221 driver.
Signed-off-by: Nicolin Chen
---
Documentation/hwmon/ina3221 | 4
om DT"
As this patch is still under review (waiting for an ack from DT
binding side), these two patches can only go through review at
this point -- needs to wait for the patch above getting merged
first.
Nicolin Chen (2):
hwmon: ina3221: Add power sysfs nodes
hwmon: ina3221: Add en
On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote:
> On 09/25/2018 11:42 PM, Nicolin Chen wrote:
> > The inX_enable interface allows user space to enable or disable
> > the corresponding channel. Meanwhile, according to hwmon ABI, a
> > disabled channel/sensor s
On Wed, Sep 26, 2018 at 05:34:53AM -0700, Guenter Roeck wrote:
> Hi Nicolin,
>
> On 09/25/2018 11:42 PM, Nicolin Chen wrote:
> > The hwmon sysfs ABI supports powerX_input and powerX_crit. This
> > can ease user space programs who care more about power in total
> &
Hello Guenter,
On Wed, Sep 26, 2018 at 12:45:34PM -0700, Guenter Roeck wrote:
> Hi Nicolin,
>
> On Wed, Sep 26, 2018 at 11:20:06AM -0700, Nicolin Chen wrote:
> > On Wed, Sep 26, 2018 at 05:34:53AM -0700, Guenter Roeck wrote:
> > > Hi Nicolin,
> > >
> >
Hello,
On Wed, Sep 26, 2018 at 12:58:17PM -0700, Guenter Roeck wrote:
> On Wed, Sep 26, 2018 at 11:02:44AM -0700, Nicolin Chen wrote:
> > On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote:
> > > On 09/25/2018 11:42 PM, Nicolin Chen wrote:
> > > > The in
On Wed, Sep 26, 2018 at 01:44:55PM -0700, Guenter Roeck wrote:
> On Wed, Sep 26, 2018 at 01:25:20PM -0700, Nicolin Chen wrote:
> > Hello,
> >
> > On Wed, Sep 26, 2018 at 12:58:17PM -0700, Guenter Roeck wrote:
> > > On Wed, Sep 26, 2018 at 11:02:44AM -0700, Nicolin C
Hello Guenter,
On Thu, Sep 27, 2018 at 09:05:09AM -0700, Guenter Roeck wrote:
> > > Point is that I don't _know_ how this is going to be used, so I'd
> > > rather keep it flexible.
> >
> > Well, taking one step back, I am okay to follow your way if you
> > are really firm about it. Just please
On Thu, Sep 27, 2018 at 12:44:13PM -0500, Rob Herring wrote:
> > +2) child nodes
> > + Required properties:
> > + - reg: Must be 0, 1 or 2, corresponding to IN1, IN2 or IN3 port of
> > INA3221
> > +
> > + Optional properties:
> > + - label: Name of the input source
> > + -
* Fixed two places in DT bindings (PATCH-1)
v1->v2:
* Redefined DT bindings (detail in PATCH-1)
* Changed the driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: ina3221: Read channel input source info from DT
.../devicetree
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v5->v6:
* Removed status property as no need to explicitly list it.
* Combined all examples into a complete one.
v4->v5:
* Re
for users to get control of three channels,
and returns -ENODATA code for any sensor read according
to hwmon ABI.
Signed-off-by: Nicolin Chen
---
Changelog
v5->v6:
* Removed the code of hiding disconnected channels
* Added in[123]_label sysfs nodes to control channels
* Added -ENODATA ret
On Thu, Sep 27, 2018 at 03:38:44PM -0500, Rob Herring wrote:
> On Thu, Sep 27, 2018 at 2:49 PM Nicolin Chen wrote:
> >
> > Texas Instruments INA3221 is a triple-channel shunt and bus
> > voltage monitor. This patch adds a DT binding doc for it.
> >
>
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v6->v7:
* Restored three channel examples and merged them with the parent one
v5->v6:
* Removed status property as n
On Thu, Sep 27, 2018 at 03:06:20PM -0700, Guenter Roeck wrote:
> I am quite sure I asked to use kstrtobool(). Did that get lost or do you have
> some reason to not use it ?
>
> I can understand if you don't want to change ina3221_is_enable() to
> ina3221_is_enabled(), since that is POV, but I
On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote:
> > +static inline bool ina3221_is_enable(struct ina3221_data *ina, int channel)
>
> s/is_enable/is_enabled/, maybe ?
Fixing.
> > + return (config & INA3221_CONFIG_CHx_EN(channel)) > 0;
>
> The "> 0" is unnecessary. Conversion to
On Thu, Sep 27, 2018 at 03:52:00PM -0700, Guenter Roeck wrote:
> The proper fix for this problem would be to add support for suspend /
> resume to the driver. At resume time, all channels will have been
> re-enabled if the chip was powered off, even if they were explicitly
> disabled by
This series of patches add system suspend and resume functiosn for
ina3221 hwmon driver.
Nicolin Chen (2):
hwmon: ina3221: Add INA3221_CONFIG to volatile_table
hwmon: ina3221: Add suspend and resume functions
drivers/hwmon/ina3221.c | 56 -
1 file
not be a severe bug for the current code line since
there's no second place touching the INA3221_CONFIG except the
reset routine in the probe().
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/ina3221.c b
Depending on the hardware design, an INA3221 chip might lose
its power during system suspend/resume. So this patch adds
a pair of suspend and resume functions to cache the register
values including config register value and limit settings.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c
for users to get control of three channels,
and returns -ENODATA code for any sensor read according
to hwmon ABI.
Signed-off-by: Nicolin Chen
---
Changelog
v7->v8:
* Rebased the change after the new suspend-resume patch
* * Please apply suspend-resume patch prior to this one
* Rena
Fixed one place in child DT node bindings (PATCH-1)
* Changed the driver accordingly and added is_visible (PATCH-2)
v2->v3:
* Fixed two places in DT bindings (PATCH-1)
v1->v2:
* Redefined DT bindings (detail in PATCH-1)
* Changed the driver code accordingly (detail in PATCH-2)
Nicolin Ch
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v7->v8:
* N/A
v6->v7:
* Restored three channel examples and merged them with the parent one
v5->v6:
* Removed status
On Sat, Sep 29, 2018 at 08:33:46AM -0700, Guenter Roeck wrote:
> On Fri, Sep 28, 2018 at 02:49:21PM -0700, Nicolin Chen wrote:
> > Depending on the hardware design, an INA3221 chip might lose
> > its power during system suspend/resume. So this patch adds
> > a pair of suspend
Depending on the hardware design, an INA3221 chip might lose
its power during system suspend/resume. So this patch adds
a set of suspend and resume functions to cache the register
values including config register value and limit settings.
Signed-off-by: Nicolin Chen
---
Changelog
v1->
This series of patches add system suspend and resume functiosn for
ina3221 hwmon driver. To do so, it also needs two small fixes.
Changelog
v1->v2:
* Added PATCH-2 to fix macros
* Added power-down setting during suspend in PATCH-3
Nicolin Chen (3):
hwmon: ina3221: Add INA3221_CON
not be a severe bug for the current code line since
there's no second place touching the INA3221_CONFIG except the
reset routine in the probe().
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/ina3221.c b
at this point.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c
index cfe65ff01051..e0c4f4d83f4e 100644
--- a/drivers/hwmon/ina3221.c
+++ b/drivers/hwmon/ina3221.c
@@ -38,9
Texas Instruments INA3221 is a triple-channel shunt and bus
voltage monitor. This patch adds a DT binding doc for it.
Signed-off-by: Nicolin Chen
---
Changelog
v7->v9:
* N/A
v6->v7:
* Restored three channel examples and merged them with the parent one
v5->v6:
* Removed status
for users to get control of three channels,
and returns -ENODATA code for any sensor read according
to hwmon ABI.
Signed-off-by: Nicolin Chen
---
Changelog
v8->v9:
* Renamed the subject by following hwmon naming convention
* Rebased the patch after the merged ina3221 changes
* Fi
driver code accordingly (detail in PATCH-2)
Nicolin Chen (2):
dt-bindings: hwmon: Add ina3221 documentation
hwmon: (ina3221) Read channel input source info from DT
.../devicetree/bindings/hwmon/ina3221.txt | 44
Documentation/hwmon/ina3221 | 2 +
On Tue, Oct 02, 2018 at 10:05:18AM -0700, Guenter Roeck wrote:
> Hi Nicolin,
>
> On Mon, Oct 01, 2018 at 06:05:22PM -0700, Nicolin Chen wrote:
> > Texas Instruments INA3221 is a triple-channel shunt and bus
> > voltage monitor. This patch adds a DT binding doc for it
This series of patches applies _info API of hwmon core to
the ina3221 hwmon driver.
Nicolin Chen (2):
hwmon: (core) Add hwmon_in_enable attribute
hwmon: (ina3221) Use _info API to register hwmon device
drivers/hwmon/hwmon.c | 1 +
drivers/hwmon/ina3221.c | 528
The hwmon core has a newer API which abstracts most of common
things in the core so as to simplify the hwmon device drivers.
This patch implements this _info API to ina3221 hwmon driver.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 528 +++-
1
According to hwmon ABI, in%d_enable is a sysfs interface that
allows user space to enable and disable the input sensor. So
this patch just simply adds the attribute to the list.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/hwmon.c | 1 +
include/linux/hwmon.h | 2 ++
2 files changed, 3
The input->shunt_resistor is int type while the value from DT is
unsigned int. Meanwhile, a divide-by-zero error would happen if
the value is 0. So this patch just simply clamps the value.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 4 +++-
1 file changed, 3 insertions(+)
68261aaa drivers/hwmon/ina3221_before.o
4456 440 048961320 drivers/hwmon/ina3221.o
Signed-off-by: Nicolin Chen
---
Changelog
v1->v2:
* Added a binary size comparison in commit message
* Dropped unnecessary checks
* Dropped misleading ID conversion in the comme
The input->shunt_resistor is int type while the value from DT is
unsigned int. Meanwhile, a divide-by-zero error would happen if
the value is 0. So this patch just simply validates the value.
Signed-off-by: Nicolin Chen
---
Changelog
v1->v2:
* Validate the value and error out
drivers
_with_info API to register a hwmon
device.
Signed-off-by: Nicolin Chen
---
MAINTAINERS | 1 +
drivers/hwmon/hwmon.c| 27 ++
include/trace/events/hwmon.h | 71
3 files changed, 92 insertions(+), 7 deletions(-)
create mode
On Tue, Oct 09, 2018 at 02:57:21PM -0400, Steven Rostedt wrote:
> > Trace events are useful for people who collect data from the
> > ftrace output. This patch adds initial trace events for the
> > hwmon core. To call hwmon_attr_base() for aligned attr index
> > numbers, this patch also moves the
On Tue, Oct 09, 2018 at 03:49:45PM -0400, Steven Rostedt wrote:
> > > > Trace events are useful for people who collect data from the
> > > > ftrace output. This patch adds initial trace events for the
> > > > hwmon core. To call hwmon_attr_base() for aligned attr index
> > > > numbers, this patch
-by: Nicolin Chen
---
Changelog
v1->v2:
* Added a descriptive reason for this change in the commit message
MAINTAINERS | 1 +
drivers/hwmon/hwmon.c| 27 ++
include/trace/events/hwmon.h | 71
3 files changed, 92 inserti
Add operating mode support in the core and ina3221.
Nicolin Chen (2):
hwmon: (core) Add hwmon_mode structure and mode sysfs node
hwmon: (ina3221) Add operating mode support
Documentation/hwmon/sysfs-interface | 15 +
drivers/hwmon/hwmon.c | 87
;mode" and "available_modes" for user to check
and configure the operating mode. For hwmon device drivers that
implemented the _with_info API, the change also adds an optional
hwmon_mode structure in hwmon_chip_info structure so that those
drivers can pass mode related information.
Si
The hwmon core now has a new optional mode interface. So this patch
just implements this mode support so that user space can check and
configure via sysfs node its operating modes: power-down, one-shot,
and continuous modes.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 64
> I am open to help explore adding support for runtime power management
> to the hwmon subsystem, but that would be less than straightforward and
> require an actual use case to warrant the effort.
Is there any feasible solution from your point of view?
Thanks
Nicolin
>
> As s
Hi Guenter,
On Wed, Oct 10, 2018 at 04:43:00PM -0700, Guenter Roeck wrote:
> > > The effort to do all this using CPU cycles would in most if not all cases
> > > outweigh any perceived power savings. As such, I just don't see the
> > > practical use case.
> >
> > It really depends on the use case
On Thu, Oct 11, 2018 at 12:31:52PM -0700, Guenter Roeck wrote:
> > One more question here, and this might sound a bit abuse of using
> > the existing hwmon ABI: would it sound plausible to you that the
> > driver powers down the chip when all three channels get disabled
> > via in[123]_enable
The data might need some time to get ready after channel enabling,
although the data register is readable without CVRF being set. So
this patch adds a CVRF polling to make sure that data register is
updated with the new data.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 32
by reading other fields like alert flags.
So this patch adds a mutex lock to protect the write() and read()
callbacks. The read_string() callback won't need the lock since it
just returns the label without touching any hardware register.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 51
necessary to do so to match initial refcount
with the number of enabled channels.
Signed-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 104 +++-
1 file changed, 82 insertions(+), 22 deletions(-)
diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c
This series patches implement PM runtime feature in the ina3221 hwmon
driver (PATCH-5). However, PATCH-[1:4] are required to make sure that
the PM runtime feature would be functional and safe.
Nicolin Chen (5):
hwmon: (core) Inherit power properties to hdev
hwmon: (ina3221) Return -ENODATA
pointers.
Note that the dev->driver pointer is the place that contains
a dev_pm_ops pointer defined in the parent device driver and
the pm runtime core also checks this pointer:
if (!cb && dev->driver && dev->driver->pm)
Signed-off-by: Nicolin Chen
---
driv
-off-by: Nicolin Chen
---
drivers/hwmon/ina3221.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c
index d61688f04594..3e98b59108ee 100644
--- a/drivers/hwmon/ina3221.c
+++ b/drivers/hwmon/ina3221.c
@@ -200,6 +200,8 @@ static int
1 - 100 of 160 matches
Mail list logo