From: "Mårten Lindahl" <marten.lindahl@axis.com>
To: Guenter Roeck <linux@roeck-us.net>, Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org, kernel@axis.com,
"Mårten Lindahl" <marten.lindahl@axis.com>
Subject: [PATCH v3 0/3] hwmon: (pmbus/ltc2978) Set voltage resolution
Date: Tue, 14 Jun 2022 11:51:09 +0200 [thread overview]
Message-ID: <20220614095109.3472201-1-marten.lindahl@axis.com> (raw)
Hi!
When checking if a regulator supports a voltage range, the regulator
needs to have support for listing the range or else -EINVAL will be
returned.
This support does not exist for the LTC2977 regulator, so this change
adds support for list voltage to the pmbus regulators by adding
regulator_list_voltage_linear to the pmbus_regulator_ops. It also
defines the voltage resolution for regulators LTC2972/LTC2974/LTC2975/
LTC2977/LTC2978/LTC2979/LTC2980/LTM2987 based on that they all have the
same stepwise 122.07uV resolution, and scales the resolution to a 1mV
resolution which is easier to handle.
These patches have been tested on an ARTPEC-8 developer board with a group
of LTC2977 power regulators.
Kind regards
Mårten Lindahl
Changes in v3:
- Move read of low/high margins into local functions
- Add check for invalid selector value
- Introduce new macro PMBUS_REGULATOR_STEP(_name, _id, _voltages, _step)
Changes in v2:
- Correct #define format
- Change dev_err to dev_warn
- Add new pmbus_regulator_list_voltage function
- Cache low/high vout margins
Mårten Lindahl (3):
hwmon: (pmbus) Introduce and use cached vout margins
hwmon: (pmbus) Add list_voltage to pmbus ops
hwmon: (pmbus/ltc2978) Set voltage resolution
drivers/hwmon/pmbus/ltc2978.c | 44 +++++++++++--
drivers/hwmon/pmbus/pmbus.h | 8 ++-
drivers/hwmon/pmbus/pmbus_core.c | 108 ++++++++++++++++++++++++++-----
3 files changed, 137 insertions(+), 23 deletions(-)
--
2.30.2
next reply other threads:[~2022-06-14 9:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-14 9:51 Mårten Lindahl [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-06-14 9:38 [PATCH v3 0/3] hwmon: (pmbus/ltc2978) Set voltage resolution Mårten Lindahl
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=20220614095109.3472201-1-marten.lindahl@axis.com \
--to=marten.lindahl@axis.com \
--cc=jdelvare@suse.com \
--cc=kernel@axis.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.