From: Guenter Roeck <linux@roeck-us.net>
To: Logan Shaw <Logan.Shaw@alliedtelesis.co.nz>
Cc: "jdelvare@suse.com" <jdelvare@suse.com>,
Joshua Scott <Joshua.Scott@alliedtelesis.co.nz>,
"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>
Subject: Re: [PATCH 1/1] hwmon: (adt7475) Added attenuator bypass support
Date: Wed, 18 Dec 2019 15:25:37 -0800 [thread overview]
Message-ID: <20191218232537.GA24464@roeck-us.net> (raw)
In-Reply-To: <ea991d7654aae9af95c6aa8e2da1b87486f90215.camel@alliedtelesis.co.nz>
On Wed, Dec 18, 2019 at 04:30:39AM +0000, Logan Shaw wrote:
[...]
> >
> > The datasheet for ADC7475 does not say anything about the ability to
> > control
> > attenuators other than for vcc in configuration register 4. Bit 4, 6,
> > and 7
> > are listed as unused/reserved, suggesting that those bits - if at all
> > - are
> > only defined for other chips. Nothing in this patch suggests what
> > those chips
> > are. Attenuation bits need to be validated against the chip type.
>
> You are right, I missed including important details. The ADT7476 and
> ADT7490 datasheets specify "Bits [7:4] of Configuration Register 4
> (0x7D) can be used to bypass individual voltage channel attenuators".
>
> My thought process was it would be up to the person configuring the
> devicetree to only add the attributes where appropiate (for example,
> not for a ADT7475 chip). I can see this is dangerious. Instead would it
> be acceptable to add a check to the load_individual_bypass_attenuators
> and load_all_bypass_attenuator functions that verifies the device
> supports setting the appropiate bits and if not return 0 immediately?
>
Devicetree properties are acceptable, but not writing bits which
are not supported (reserved) for a given chip. How to implement this
is up to you.
Based on your feedback, and my personal opinion, I won't accept
new (non-standard) sysfs attributes. Note that I also won't accept
C++ style comments in this driver.
Guenter
prev parent reply other threads:[~2019-12-18 23:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-18 2:42 [PATCH 0/1] hwmon: (adt7475) Added attenuator bypass support Logan Shaw
2019-12-18 2:42 ` [PATCH 1/1] " Logan Shaw
2019-12-18 3:17 ` Guenter Roeck
2019-12-18 4:30 ` Logan Shaw
2019-12-18 23:25 ` Guenter Roeck [this message]
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=20191218232537.GA24464@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Joshua.Scott@alliedtelesis.co.nz \
--cc=Logan.Shaw@alliedtelesis.co.nz \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox