linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Logan Shaw <logan.shaw@alliedtelesis.co.nz>
To: jdelvare@suse.com, linux@roeck-us.net
Cc: logan.shaw@alliedtelesis.co.nz, joshua.scott@alliedtelesis.co.nz,
	linux-hwmon@vger.kernel.org
Subject: [PATCH v2 0/2] hwmon: (adt7475) Added attenuator bypass support
Date: Thu, 19 Dec 2019 16:32:11 +1300	[thread overview]
Message-ID: <20191219033213.30364-1-logan.shaw@alliedtelesis.co.nz> (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

-- 
2.23.0


             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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20191219033213.30364-1-logan.shaw@alliedtelesis.co.nz \
    --to=logan.shaw@alliedtelesis.co.nz \
    --cc=jdelvare@suse.com \
    --cc=joshua.scott@alliedtelesis.co.nz \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --subject='Re: [PATCH v2 0/2] hwmon: (adt7475) Added attenuator bypass support' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).