Thread (17 messages) flat view 17 messages, 7 authors, 2014-07-17

Re: [RFCv2] drm/msm: DT support for 8960/8064

From: Rob Clark <hidden>
Date: 2014-07-17 15:29:33
Also in: dri-devel, linux-arm-msm

On Thu, Jul 17, 2014 at 4:10 AM, divya ojha [off-list ref] wrote:
Hi Rob,

On Tue, Jul 8, 2014 at 9:30 PM, Rob Clark [off-list ref] wrote:
quoted
Now that we (almost) have enough dependencies in place (MMCC, RPM, etc),
add necessary DT support so that we can use drm/msm on upstream kernel.

Signed-off-by: Rob Clark <redacted>
---
I thought I sent this already, but looks like I've forgot.
..
quoted
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 7f7aade..041c2fc 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -123,7 +123,8 @@ struct hdmi *hdmi_init(struct drm_device *dev, struct drm_encoder *encoder)
        for (i = 0; i < config->hpd_reg_cnt; i++) {
                struct regulator *reg;

-               reg = devm_regulator_get(&pdev->dev, config->hpd_reg_names[i]);
+               reg = devm_regulator_get_exclusive(&pdev->dev,
+                               config->hpd_reg_names[i]);
                if (IS_ERR(reg)) {
                        ret = PTR_ERR(reg);
                        dev_err(dev->dev, "failed to get hpd regulator: %s (%d)\n",
@@ -138,7 +139,8 @@ struct hdmi *hdmi_init(struct drm_device *dev, struct drm_encoder *encoder)
        for (i = 0; i < config->pwr_reg_cnt; i++) {
                struct regulator *reg;

-               reg = devm_regulator_get(&pdev->dev, config->pwr_reg_names[i]);
+               reg = devm_regulator_get_exclusive(&pdev->dev,
+                               config->pwr_reg_names[i]);
                if (IS_ERR(reg)) {
                        ret = PTR_ERR(reg);
                        dev_err(dev->dev, "failed to get pwr regulator: %s (%d)\n",
Don't we need to have a if(regulator_enabled) check after
devm_regulator_get function ?
I see a similar test after camera regulator_get function call.
tbh, I'm not 100% sure.

Normally I would say that any driver using some resource (regulator,
etc) should take it's own reference irrespective of whether some other
driver already has the regulator/etc, enabled.  Otherwise the
reference counting doesn't work out.

The thing I'm not 100% sure about is interaction w/ bootloader, in
cases where bootloader does initial modeset.  I've had some problems
in this area in the past when I was trying to get DSI working on my
nexus4.  I doubt the correct solution is for the driver to check if
regulator is already enabled by bootloader before enabling it, but I'm
not sure if something else somewhere needs to drop references to
resources enabled by bootloader.

BR,
-R
-Regards
Divya
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help