linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denis Carikli <denis@eukrea.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v7][ 3/5] video: mx3fb: Introduce regulator support.
Date: Fri, 14 Mar 2014 11:23:22 +0000	[thread overview]
Message-ID: <5322E6AA.1010400@eukrea.com> (raw)
In-Reply-To: <1394789035.649593084@f301.i.mail.ru>

On 03/14/2014 10:23 AM, Alexander Shiyan wrote:
> Why this cannot be devm_regulator_get(dev, "lcd") in both DT and non-DT case?

I need to add device tree support to the mx3fb driver.
My first approach gave a binding that looked like that:

cmo_qvga: display {
   model = "CMO-QVGA";
   [...]
   display-timings {
     qvga_timings: 320x240 {
       hactive = <320>;
       vactive = <240>;
       [...]
    };
};

ipu: ipu@53fc0000 {
   compatible = "fsl,imx31-ipu";
   reg = < 0x53fc0000 0x5f
   0x53fc0088 0x2b >;
   interrupts = <42 41>;
   dma-channels = <32>;
   #dma-cells = <1>;
   clocks = <&clks 55>;
   clock-names = "";
};

lcdc: mx3fb@53fc00b4 {
   compatible = "fsl,mx3-fb";
   reg = <0x53fc00b4 0x0b>;
   clocks = <&clks 55>;
   dmas = <&ipu 14>;
   dma-names = "tx";
   display = <&cmo_qvga>;
};

The issue was that exporting the "dma ipu driver" was not a good idea.
I was told to instead make bindings that looks very similar to the ipuv3 
driver[1]
So at the end that gave something like that:

cmo_qvga: display@di0 {
   compatible = "fsl,mx3-parallel-display";
   regulator-name = "lcd";
   lcd-supply = <&reg_lcd_3v3>;
   model = "CMO-QVGA";
   display-timings {
     qvga_timings: 320x240 {
       hactive = <320>;
       vactive = <240>;
       [...]
    };
};

ipu: ipu@53fc0000 {
   compatible = "fsl,imx35-ipu";
   reg = <0x53fc0000 0x4000>;
   clocks = <&clks 55>;
   display = <&cmo_qvga>;
};

So here fsl,imx35-ipu is binded to the mx3fb driver.
But the mx3fb driver still need to use the dma-ipu driver somehow.
That's why the dma-ipu driver is handled behind the scenes, that way
it's not exported to the device tree bindings.

Now, since the mx3fb driver is binded to the "fsl,imx35-ipu" compatible,
if I would do a "mx3fbi->reg_lcd = devm_regulator_get(dev, "lcd");",
that would then lookup for the regulator in the mx3fb node
(The last "ipu@53fc0000" here).

Instead the regulator can be found in the display node,
which has no driver associated with it.

In the case of the ipuv3, the parallel display driver is associated
with the display@di0 node, so the device matches with the device tree
node directly.

References:
-----------
[1] The ipuv3 driver is in drivers/staging/imx-drm/
[2] the dma ipu driver is in drivers/dma/ipu/

Denis.


  reply	other threads:[~2014-03-14 11:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14  9:12 [PATCH v7][ 1/5] video: mx3fb: Use devm_kzalloc Denis Carikli
2014-03-14  9:12 ` [PATCH v7][ 2/5] video: mx3fb: Add device tree suport Denis Carikli
2014-03-14  9:12 ` [PATCH v7][ 3/5] video: mx3fb: Introduce regulator support Denis Carikli
2014-03-14  9:23   ` [PATCH v7][ 3/5] video: mx3fb: Introduce =?UTF-8?B?cmVndWxhdG9yIHN1c Alexander Shiyan
2014-03-14 11:23     ` Denis Carikli [this message]
2014-03-14 12:38       ` Alexander Shiyan
2014-03-17  6:20   ` [PATCH v7][ 3/5] video: mx3fb: Introduce regulator support Sascha Hauer
2014-06-10 13:29     ` Denis Carikli
2014-08-22 22:00       ` Mark Brown
2014-06-19  6:58   ` Denis Carikli
2014-03-14  9:12 ` [PATCH v7][ 4/5] ARM: dts: i.MX35: Add display support Denis Carikli
2014-03-14  9:12 ` =?UTF-8?q?=5BPATCH=20v7=5D=5B=205/5=5D=20ARM=3A=20dts=3A=20mbimxsd35=20Add=20video=20and=20displays= Denis Carikli
2014-05-08 10:31 ` [PATCH v7][ 1/5] video: mx3fb: Use devm_kzalloc Tomi Valkeinen

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=5322E6AA.1010400@eukrea.com \
    --to=denis@eukrea.com \
    --cc=linux-arm-kernel@lists.infradead.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).