All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dsi: Fix regulator API abuse
@ 2016-03-30 18:53 Mark Brown
  2016-04-05 11:26 ` Archit Taneja
  2016-04-29  9:49 ` [PATCH 0/3] drm/msm: Remove regulator_set_voltage calls Archit Taneja
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Brown @ 2016-03-30 18:53 UTC (permalink / raw)
  To: David Airlie, Rob Clark; +Cc: Mark Brown, dri-devel

The voltage changing code in this driver is broken and should be
removed.  The driver sets a single, exact voltage on probe.  Unless
there is a very good reason for this (which should be documented in
comments) constraints like this need to be set via the machine
constraints, voltage setting in a driver is expected to be used in cases
where the voltage varies at runtime.

In addition client drivers should almost never be calling
regulator_can_set_voltage(), if the device needs to set a voltage it
needs to set the voltage and the regulator core will handle the case
where the regulator is fixed voltage.  If the driver simply skips
setting the voltage if it doesn't have permission then it shouild just
not bother in the first place.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 4282ec6bbaaf..a3e47ad83eb3 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -325,18 +325,6 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host)
 		return ret;
 	}
 
-	for (i = 0; i < num; i++) {
-		if (regulator_can_change_voltage(s[i].consumer)) {
-			ret = regulator_set_voltage(s[i].consumer,
-				regs[i].min_voltage, regs[i].max_voltage);
-			if (ret < 0) {
-				pr_err("regulator %d set voltage failed, %d\n",
-					i, ret);
-				return ret;
-			}
-		}
-	}
-
 	return 0;
 }
 
-- 
2.8.0.rc3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-04-29  9:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-30 18:53 [PATCH] drm/msm/dsi: Fix regulator API abuse Mark Brown
2016-04-05 11:26 ` Archit Taneja
2016-04-05 16:17   ` Mark Brown
2016-04-29  9:49 ` [PATCH 0/3] drm/msm: Remove regulator_set_voltage calls Archit Taneja
2016-04-29  9:49   ` [PATCH 1/3] drm/msm/dsi: Fix regulator API abuse Archit Taneja
2016-04-29  9:49   ` [PATCH 2/3] drm/msm/edp: Drop regulator_set_voltage call Archit Taneja
2016-04-29  9:49   ` [PATCH 3/3] drm/msm/mdp4: Don't manage DSI PLL regulators in MDP driver Archit Taneja

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.