All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: ov8856: ignore gpio and regulator for ov8856 with ACPI
@ 2021-07-06  9:18 Bingbu Cao
  2021-07-28  1:34 ` Sergey Senozhatsky
  0 siblings, 1 reply; 2+ messages in thread
From: Bingbu Cao @ 2021-07-06  9:18 UTC (permalink / raw)
  To: linux-media, sakari.ailus, robert.foss
  Cc: tian.shu.qiu, senozhatsky, tfiga, bingbu.cao, bingbu.cao

For ov8856 working with ACPI, it does not depend on the reset gpio
and regulator to do reset and power control, so should get the gpio
and regulator for non-ACPI cases only, otherwise it will break ov8856
with ACPI.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Tianshu Qiu <tian.shu.qiu@intel.com>
Cc: Robert Foss <robert.foss@linaro.org>
---
 drivers/media/i2c/ov8856.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c
index 88e19f30d376..a88857209a46 100644
--- a/drivers/media/i2c/ov8856.c
+++ b/drivers/media/i2c/ov8856.c
@@ -2304,25 +2304,25 @@ static int ov8856_get_hwcfg(struct ov8856 *ov8856, struct device *dev)
 
 		clk_set_rate(ov8856->xvclk, xvclk_rate);
 		xvclk_rate = clk_get_rate(ov8856->xvclk);
+
+		ov8856->reset_gpio = devm_gpiod_get_optional(dev, "reset",
+							     GPIOD_OUT_LOW);
+		if (IS_ERR(ov8856->reset_gpio))
+			return PTR_ERR(ov8856->reset_gpio);
+
+		for (i = 0; i < ARRAY_SIZE(ov8856_supply_names); i++)
+			ov8856->supplies[i].supply = ov8856_supply_names[i];
+
+		ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ov8856_supply_names),
+					      ov8856->supplies);
+		if (ret)
+			return ret;
 	}
 
 	if (xvclk_rate != OV8856_XVCLK_19_2)
 		dev_warn(dev, "external clock rate %u is unsupported",
 			 xvclk_rate);
 
-	ov8856->reset_gpio = devm_gpiod_get_optional(dev, "reset",
-						     GPIOD_OUT_LOW);
-	if (IS_ERR(ov8856->reset_gpio))
-		return PTR_ERR(ov8856->reset_gpio);
-
-	for (i = 0; i < ARRAY_SIZE(ov8856_supply_names); i++)
-		ov8856->supplies[i].supply = ov8856_supply_names[i];
-
-	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ov8856_supply_names),
-				      ov8856->supplies);
-	if (ret)
-		return ret;
-
 	ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
 	if (!ep)
 		return -ENXIO;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: ov8856: ignore gpio and regulator for ov8856 with ACPI
  2021-07-06  9:18 [PATCH] media: ov8856: ignore gpio and regulator for ov8856 with ACPI Bingbu Cao
@ 2021-07-28  1:34 ` Sergey Senozhatsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Senozhatsky @ 2021-07-28  1:34 UTC (permalink / raw)
  To: Bingbu Cao
  Cc: linux-media, sakari.ailus, robert.foss, tian.shu.qiu,
	senozhatsky, tfiga, bingbu.cao

On (21/07/06 17:18), Bingbu Cao wrote:
> 
> For ov8856 working with ACPI, it does not depend on the reset gpio
> and regulator to do reset and power control, so should get the gpio
> and regulator for non-ACPI cases only, otherwise it will break ov8856
> with ACPI.
> 

LGTM

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-28  1:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06  9:18 [PATCH] media: ov8856: ignore gpio and regulator for ov8856 with ACPI Bingbu Cao
2021-07-28  1:34 ` Sergey Senozhatsky

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.