From: Fabio Estevam <festevam@gmail.com>
To: mchehab@kernel.org
Cc: hverkuil-cisco@xs4all.nl, todor.tomov@linaro.org,
ezequiel@collabora.com, linux-media@vger.kernel.org,
Fabio Estevam <festevam@gmail.com>
Subject: [PATCH 1/2] media: ov5645: Remove unneeded regulator_set_voltage()
Date: Wed, 26 Jun 2019 20:56:13 -0300 [thread overview]
Message-ID: <20190626235614.26587-1-festevam@gmail.com> (raw)
There is no need to call regulator_set_voltage() for each regulator
that powers the camera.
The voltage value for each regulator should be retrieved from the
device tree, so remove the unneeded regulator_set_voltage().
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
drivers/media/i2c/ov5645.c | 28 ----------------------------
1 file changed, 28 deletions(-)
diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
index 124c8df04633..4e302dc15177 100644
--- a/drivers/media/i2c/ov5645.c
+++ b/drivers/media/i2c/ov5645.c
@@ -34,10 +34,6 @@
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
-#define OV5645_VOLTAGE_ANALOG 2800000
-#define OV5645_VOLTAGE_DIGITAL_CORE 1500000
-#define OV5645_VOLTAGE_DIGITAL_IO 1800000
-
#define OV5645_SYSTEM_CTRL0 0x3008
#define OV5645_SYSTEM_CTRL0_START 0x02
#define OV5645_SYSTEM_CTRL0_STOP 0x42
@@ -1156,42 +1152,18 @@ static int ov5645_probe(struct i2c_client *client,
return PTR_ERR(ov5645->io_regulator);
}
- ret = regulator_set_voltage(ov5645->io_regulator,
- OV5645_VOLTAGE_DIGITAL_IO,
- OV5645_VOLTAGE_DIGITAL_IO);
- if (ret < 0) {
- dev_err(dev, "cannot set io voltage\n");
- return ret;
- }
-
ov5645->core_regulator = devm_regulator_get(dev, "vddd");
if (IS_ERR(ov5645->core_regulator)) {
dev_err(dev, "cannot get core regulator\n");
return PTR_ERR(ov5645->core_regulator);
}
- ret = regulator_set_voltage(ov5645->core_regulator,
- OV5645_VOLTAGE_DIGITAL_CORE,
- OV5645_VOLTAGE_DIGITAL_CORE);
- if (ret < 0) {
- dev_err(dev, "cannot set core voltage\n");
- return ret;
- }
-
ov5645->analog_regulator = devm_regulator_get(dev, "vdda");
if (IS_ERR(ov5645->analog_regulator)) {
dev_err(dev, "cannot get analog regulator\n");
return PTR_ERR(ov5645->analog_regulator);
}
- ret = regulator_set_voltage(ov5645->analog_regulator,
- OV5645_VOLTAGE_ANALOG,
- OV5645_VOLTAGE_ANALOG);
- if (ret < 0) {
- dev_err(dev, "cannot set analog voltage\n");
- return ret;
- }
-
ov5645->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
if (IS_ERR(ov5645->enable_gpio)) {
dev_err(dev, "cannot get enable gpio\n");
--
2.17.1
next reply other threads:[~2019-06-26 23:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 23:56 Fabio Estevam [this message]
2019-06-26 23:56 ` [PATCH 2/2] media: ov5645: Use regulator_bulk() functions Fabio Estevam
2019-06-27 16:27 ` Sakari Ailus
2019-06-27 18:24 ` Fabio Estevam
2019-07-01 21:29 ` Todor Tomov
2019-07-04 12:16 ` Fabio Estevam
2019-06-27 16:28 ` [PATCH 1/2] media: ov5645: Remove unneeded regulator_set_voltage() Sakari Ailus
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=20190626235614.26587-1-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=ezequiel@collabora.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=todor.tomov@linaro.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;
as well as URLs for NNTP newsgroup(s).