archive mirror
 help / color / mirror / Atom feed
From: Logan Shaw <>
Subject: [PATCH v2 0/2] hwmon: (adt7475) Added attenuator bypass support
Date: Thu, 19 Dec 2019 16:32:11 +1300	[thread overview]
Message-ID: <> (raw)

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

These attenuators can be bypassed in two ways. First, bit 5 of register
0x73, if set, will bypass attenuators on all above mentioned voltage
inputs. Secondly, bits [7:4] control individually bypassing attenuators
on the above mentioned voltage inputs.

This patch adds 5 optional devicetree properties to the adt7475
driver, which if present in the devicetree and the device is one of
{ADT7476, ADT7490} will set the appropriate bits to bypass the attenuator
on the relevant voltage input.

* 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
  hwmon: (adt7475) Added attenuator bypass support

 .../devicetree/bindings/hwmon/adt7475.txt     | 35 +++++++++
 drivers/hwmon/adt7475.c                       | 73 +++++++++++++++++++
 2 files changed, 108 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/adt7475.txt


             reply	other threads:[~2019-12-19  3:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19  3:32 Logan Shaw [this message]
2019-12-19  3:32 ` [PATCH v2 1/2] " Logan Shaw
2019-12-19  3:32 ` [PATCH v2 2/2] " Logan Shaw
2019-12-19  3:53   ` Guenter Roeck
2019-12-27  2:53     ` Logan Shaw
2020-01-09  3:07       ` Logan Shaw
2020-01-09 23:03       ` Guenter Roeck
2020-01-13  0:08     ` Chris Packham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH v2 0/2] hwmon: (adt7475) Added attenuator bypass support' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).