From: Fabio Estevam <festevam@gmail.com>
To: Yongcai Huang <anson.huang@nxp.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
linux-iio@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>,
NXP Linux Team <linux-imx@nxp.com>
Subject: Re: [PATCH] iio: light: isl29018: add optional vcc regulator operation support
Date: Fri, 7 Dec 2018 08:29:23 -0200 [thread overview]
Message-ID: <CAOMZO5Be-RzekcsigNKrss-7DGV0F8yU2yhT11n+eAmqP1euKw@mail.gmail.com> (raw)
In-Reply-To: <1544065798-4465-1-git-send-email-Anson.Huang@nxp.com>
Hi Anson,
On Thu, Dec 6, 2018 at 1:17 AM Anson Huang <anson.huang@nxp.com> wrote:
>
> The light sensor's power supply could be controlled by regulator
> on some platforms, such as i.MX6Q-SABRESD board, the light sensor
> isl29023's power supply is controlled by a GPIO fixed regulator,
> need to make sure the regulator is enabled before any operation of
> sensor, this patch adds optional vcc regulator operation support.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> drivers/iio/light/isl29018.c | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c
> index b45400f..47a55c8 100644
> --- a/drivers/iio/light/isl29018.c
> +++ b/drivers/iio/light/isl29018.c
> @@ -23,6 +23,7 @@
> #include <linux/mutex.h>
> #include <linux/delay.h>
> #include <linux/regmap.h>
> +#include <linux/regulator/consumer.h>
> #include <linux/slab.h>
> #include <linux/iio/iio.h>
> #include <linux/iio/sysfs.h>
> @@ -95,6 +96,7 @@ struct isl29018_chip {
> struct isl29018_scale scale;
> int prox_scheme;
> bool suspended;
> + struct regulator *vcc_reg;
> };
>
> static int isl29018_set_integration_time(struct isl29018_chip *chip,
> @@ -735,6 +737,15 @@ static int isl29018_probe(struct i2c_client *client,
>
> mutex_init(&chip->lock);
>
> + chip->vcc_reg = devm_regulator_get_optional(&client->dev, "vcc");
> + if (!IS_ERR(chip->vcc_reg)) {
> + err = regulator_enable(chip->vcc_reg);
> + if (err) {
> + dev_err(&client->dev, "failed to enable VDD regulator\n");
You call the regulator as "vcc", but in the error message you mention
"VDD", which is confusing.
Same comment as in the previous patch.
There is no VCC regulator as per the datasheet. There are VDDD and
VDDA power supplies, so better represent both and with the same name
they appear in the datasheet.
prev parent reply other threads:[~2018-12-07 10:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-06 3:15 Anson Huang
2018-12-07 10:29 ` Fabio Estevam [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=CAOMZO5Be-RzekcsigNKrss-7DGV0F8yU2yhT11n+eAmqP1euKw@mail.gmail.com \
--to=festevam@gmail.com \
--cc=anson.huang@nxp.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®