[PATCH v6 0/2] hwmon: (adt7475) Added attenuator bypass support

From: Logan Shaw
Date: Sun Jan 26 2020 - 17:10:28 EST


The ADT7473 and ADT7475 support bypassing voltage input attenuators on
voltage input 1 and the ADT7476 and ADT7490 additionally support
bypassing voltage input attenuators on voltage inputs 0, 3, and 4. This
can be useful to improve measurement resolution when measuring voltages
0 V - 2.25 V.

This patch adds 4 optional devicetree properties to the adt7475
driver, each setting the attenuator bypass (or clearing) on a
specific voltage input.

* v6
- removed unnecessary comments marked for kernal documentation in file
adt7475.c.
- fixed parenthesis whitespace allignment in multiple places in file
adt7475.c.
- removed unnecessary parentheses around data->config4 in file
adt7475.c.
- removed unused assignment "int i = 0" in file adt7475.c.
- fixed mispelling of documentation in commit subject.

* v5
- modified adt7475.yaml to remove dt_binding_check errors
- made various alignment fixes to adt7475.c to improve style.
- renamed function modify_config_from_dts_prop to modify_config
- changed return type of function modify_config to void
- function modify_config error return code modified no longer override
the dependent functions i2c_smbus_write_byte_data error.
- renamed function load_all_bypass_attenuators to load_attenuators
- in function load_attenuators the two local variables config2_copy
and config4_copy have been combined into one: conf_copy.

* v4
- fixed a small error in file adt7475.yaml (duplicate property names).

* v3
- removed the functionality to set the global attenuator bypass.
- added functionality to allow bypassing voltage input 1 on the
ADT7473 and ADT7475.
- added DTS definition file adt7475.yaml and 4 new properties.
- added the previousely missing newline character to the end of
file adt7475.c.

* v2
- removed sysfs changes from patch
- removed adt7475_write macro from patch and replaced it by using
the i2c_smbus_write_byte_data function directly in code.
- removed config4_attenuate_index function from patch and replaced it
by modifying the function load_individual_bypass_attenuators
to use hard coded bit values.
- modified function load_individual_bypass_attenuators to use 4 if
statements, one for each voltage input, replacing the for loop.
- modified function adt7475_probe to check the device is a ADT7476 or
ADT7490 (other devices do not support bypassing all or
individual attenuators), and only then set the relevant bits.
- added new file adt7475.txt to document the new devicetree properties.
- removed c++ style comments.

Logan Shaw (2):
hwmon: (adt7475) Added attenuator bypass support
dt-bindings: hwmon: (adt7475) Added missing adt7475 documentation

.../devicetree/bindings/hwmon/adt7475.yaml | 95 +++++++++++++++++++
drivers/hwmon/adt7475.c | 55 +++++++++++
2 files changed, 150 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/adt7475.yaml

--
2.25.0