On Fri, Apr 09, 2021 at 07:40:57AM -0700, Joe Perches wrote:
> On Fri, 2021-04-09 at 00:09 -0300, Luiz Sampaio wrote:
> > Since there is only one statement inside the if clause, no brackets are
> > required.
> []
> > diff --git a/drivers/w1/slaves/w1_ds2438.c b/drive
to
the offset register if the two's complement of the current register while
passing zero current to the load will calibrate the measurements. This
change was tested on real hardware and it was able to calibrate the chip
correctly.
Signed-off-by: Luiz Sampaio
---
.../ABI/stable/sysfs-driver-w1_ds2438
Added a sysfs entry to support reading the page1 registers. This registers
contain Elapsed Time Meter (ETM) data, which shows for how long the chip is
on, as well as an Offset Register data, which can be used to calibrate the
current measurement of the chip.
Signed-off-by: Luiz Sampaio
The purpose of the w1_ds2438_get_page function is to get the register
values at the page passed as the pageno parameter. However, the page0 was
hardcoded, such that the function always returned the page0 contents. Fixed
so that the function can retrieve any page.
Signed-off-by: Luiz Sampaio
The iad sysfs file has permissions for read and write. Changed to the
recommended macro BIN_ATTR_RW.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
Since there is only one statement inside the if clause, no brackets are
required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
There is an if statement and, if the function goes into it, it returns. So,
the next else is not required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1
not compile. I'm sorry. Fixed it.
Changes in v2:
- Using git send-email to send the patches
- Adding documentation as requested
- Separating the coding style changes in different patches as requested
Luiz Sampaio (6):
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed if brackets coding
to
the offset register if the two's complement of the current register while
passing zero current to the load will calibrate the measurements. This
change was tested on real hardware and it was able to calibrate the chip
correctly.
Signed-off-by: Luiz Sampaio
---
.../ABI/stable/sysfs-driver-w1_ds2438
Added a sysfs entry to support reading the page1 registers. This registers
contain Elapsed Time Meter (ETM) data, which shows for how long the chip is
on, as well as an Offset Register data, which can be used to calibrate the
current measurement of the chip.
Signed-off-by: Luiz Sampaio
Since there is only one statement inside the if clause, no brackets are
required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
The purpose of the w1_ds2438_get_page function is to get the register
values at the page passed as the pageno parameter. However, the page0 was
hardcoded, such that the function always returned the page0 contents. Fixed
so that the function can retrieve any page.
Signed-off-by: Luiz Sampaio
Changed the permissions to preferred octal style.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index 56e53a748059..ccb06b8c2d78 100644
--- a/drivers
There is an if statement and, if the function goes into it, it returns. So,
the next else is not required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1
it.
Changes in v2:
- Using git send-email to send the patches
- Adding documentation as requested
- Separating the coding style changes in different patches as requested
Luiz Sampaio (9):
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style
to
the offset register if the two's complement of the current register while
passing zero current to the load will calibrate the measurements. This
change was tested on real hardware and it was able to calibrate the chip
correctly.
Signed-off-by: Luiz Sampaio
---
.../ABI/stable/sysfs-driver-w1_ds2438
Added a sysfs entry to support reading the page1 registers. This registers
contain Elapsed Time Meter (ETM) data, which shows for how long the chip is
on, as well as an Offset Register data, which can be used to calibrate the
current measurement of the chip.
Signed-off-by: Luiz Sampaio
There is an if statement and, if the function goes into it, it returns. So,
the next else is not required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1
The purpose of the w1_ds2438_get_page function is to get the register
values at the page passed as the pageno parameter. However, the page0 was
hardcoded, such that the function always returned the page0 contents. Fixed
so that the function can retrieve any page.
Signed-off-by: Luiz Sampaio
Changed the permissions to preferred octal style.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index 56e53a748059..ccb06b8c2d78 100644
--- a/drivers
Since there is only one statement inside the if clause, no brackets are
required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
documentation as requested
- Separating the coding style changes in different patches as requested
Luiz Sampaio (9):
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed
On Mon, Apr 05, 2021 at 12:53:22PM +0200, Greg KH wrote:
> On Mon, Apr 05, 2021 at 07:50:06AM -0300, Luiz Sampaio wrote:
> > Changed the permissions to preferred octal style.
> >
> > Signed-off-by: Luiz Sampaio
> > ---
> > drivers/w1/slaves/w1_ds2438.c | 2 +-
On Mon, Apr 05, 2021 at 12:53:38PM +0200, Greg KH wrote:
> On Mon, Apr 05, 2021 at 07:50:00AM -0300, Luiz Sampaio wrote:
> > The following patches aim to make a user able to calibrate the current
> > measurement of the DS2438. This chip uses a offset register in page1, whic
On Mon, Apr 05, 2021 at 01:04:59PM +0200, Greg KH wrote:
> On Mon, Apr 05, 2021 at 07:50:09AM -0300, Luiz Sampaio wrote:
> > Added a sysfs entry to support writing to the offset register on page1.
> > This register is used to calibrate the chip canceling offset errors in the
The purpose of the w1_ds2438_get_page function is to get the register
values at the page passed as the pageno parameter. However, the page0 was
hardcoded, such that the function always returned the page0 contents. Fixed
so that the function can retrieve any page.
Signed-off-by: Luiz Sampaio
to
the offset register if the two's complement of the current register while
passing zero current to the load will calibrate the measurements. This
change was tested on real hardware and it was able to calibrate the chip
correctly.
Signed-off-by: Luiz Sampaio
---
Documentation/w1/slaves/w1_ds2438.rst
Changed the permissions to preferred octal style.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index 56e53a748059..ccb06b8c2d78 100644
--- a/drivers
Added a sysfs entry to support reading the page1 registers. This registers
contain Elapsed Time Meter (ETM) data, which shows for how long the chip is
on, as well as an Offset Register data, which can be used to calibrate the
current measurement of the chip.
Signed-off-by: Luiz Sampaio
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
added a wrong line that would not compile. I'm sorry. Fixed it.
Changes in v2:
- Using git send-email to send the patches
- Adding documentation as requested
- Separating the coding style changes in different patches as requested
Luiz Sampaio (9):
w1: ds2438: fixed a coding style issue
w1
There is an if statement and, if the function goes into it, it returns.
So, the next else is not required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1
to
the offset register if the two's complement of the current register while
passing zero current to the load will calibrate the measurements. This
change was tested on real hardware and it was able to calibrate the chip
correctly.
Signed-off-by: Luiz Sampaio
---
Documentation/w1/slaves/w1_ds2438.rst
Added a sysfs entry to support reading the page1 registers. This registers
contain Elapsed Time Meter (ETM) data, which shows for how long the chip is
on, as well as an Offset Register data, which can be used to calibrate the
current measurement of the chip.
Signed-off-by: Luiz Sampaio
The purpose of the w1_ds2438_get_page function is to get the register
values at the page passed as the pageno parameter. However, the page0 was
hardcoded, such that the function always returned the page0 contents. Fixed
so that the function can retrieve any page.
Signed-off-by: Luiz Sampaio
Changed the permissions to preferred octal style.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index 56e53a748059..ccb06b8c2d78 100644
--- a/drivers
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
There is an if statement and, if the function goes into it, it returns.
So, the next else is not required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
git send-email to send the patches
- Adding documentation as requested
- Separating the coding style changes in different patches as requested
Luiz Sampaio (9):
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style issue
w1: ds2438
to
the offset register if the two's complement of the current register while
passing zero current to the load will calibrate the measurements. This
change was tested on real hardware and it was able to calibrate the chip
correctly.
Signed-off-by: Luiz Sampaio
---
Documentation/w1/slaves/w1_ds2438.rst
Added a sysfs entry to support reading the page1 registers. This registers
contain Elapsed Time Meter (ETM) data, which shows for how long the chip is
on, as well as an Offset Register data, which can be used to calibrate the
current measurement of the chip.
Signed-off-by: Luiz Sampaio
The purpose of the w1_ds2438_get_page function is to get the register
values at the page passed as the pageno parameter. However, the page0 was
hardcoded, such that the function always returned the page0 contents. Fixed
so that the function can retrieve any page.
Signed-off-by: Luiz Sampaio
Changed the permissions to preferred octal style.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index 56e53a748059..ccb06b8c2d78 100644
--- a/drivers
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
Since there is only one statement inside the if clause, no brackets
are required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index
There is an if statement and, if the function goes into it, it returns.
So, the next else is not required.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1
style changes in different patches as requested
Luiz Sampaio (9):
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding style issue
w1: ds2438: fixed a coding
the calibration steps explained in the datasheet can use this driver
to fully calibrate de current measurements.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 94 ++-
1 file changed, 92 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves
The get_page function always returned register values from page 0.
Fixes by writing the actual page number to the bus.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1
Fixed coding style issues.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 26 --
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index 5cfb0ae23e91..a9884fc8c726 100644
to the offset register.
This patch was tested on real hardware using a power supply and an electronic
load.
Please help to review this series of patches.
Best regards!
Sampaio
Luiz Sampaio (3):
w1: ds2438: fixed a coding style issues
w1: ds2438: fixed bug in get_page function
w1: ds2438: adding
In the w1_ds2438_get_page function, there is an argument to change the page
number you want to read from the chip. But this was always getting the page
0, not the pageno page. Fixed it.
Also fixed coding style issue.
Signed-off-by: Luiz Sampaio
---
drivers/w1/slaves/w1_ds2438.c | 31
60 matches
Mail list logo