From mboxrd@z Thu Jan 1 00:00:00 1970 From: mpa@pengutronix.de (Markus Pargmann) Date: Sun, 21 Apr 2013 10:11:15 +0200 Subject: [PATCH v4 2/2] video: imxfb: Add DT support In-Reply-To: <20130418160614.GF4998@game.jcrosoft.org> References: <1366290183-367-1-git-send-email-mpa@pengutronix.de> <1366290183-367-3-git-send-email-mpa@pengutronix.de> <20130418160614.GF4998@game.jcrosoft.org> Message-ID: <20130421081115.GA31179@pengutronix.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Apr 18, 2013 at 06:06:14PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 15:03 Thu 18 Apr , Markus Pargmann wrote: > > Add devicetree support for imx framebuffer driver. It uses the generic > > display bindings and helper functions. > > > > Signed-off-by: Markus Pargmann > > Cc: Fabio Estevam > > Cc: Mark Rutland > > --- > > > > Notes: > > Changes in v4: > > - Remove eukrea specific dmacr property. > > - Add optional dmacr property. If not present, the dmacr reset value is not > > changed. > > > > Changes in v3: > > - Fix returncodes of of_read_mode function and print error messages > > - Introduce a lower bound check for bits per pixel > > - Calculate correct bytes per pixel value before using it for the calculation of > > memory size > > - Change DT property names > > > > Changes in v2: > > - Removed pwmr register property > > - Cleanup of devicetree binding documentation > > - Use default values for pwmr and lscr1 > > > > .../devicetree/bindings/video/fsl,imx-fb.txt | 51 ++++++ > > drivers/video/imxfb.c | 194 +++++++++++++++++---- > > 2 files changed, 210 insertions(+), 35 deletions(-) > > create mode 100644 Documentation/devicetree/bindings/video/fsl,imx-fb.txt > > > > diff --git a/Documentation/devicetree/bindings/video/fsl,imx-fb.txt b/Documentation/devicetree/bindings/video/fsl,imx-fb.txt > > new file mode 100644 > > index 0000000..aff16a4 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/video/fsl,imx-fb.txt > > @@ -0,0 +1,51 @@ > > +Freescale imx21 Framebuffer > > + > > +This framebuffer driver supports devices imx1, imx21, imx25, and imx27. > > + > > +Required properties: > > +- compatible : "fsl,-fb", chip should be imx1 or imx21 > > +- reg : Should contain 1 register ranges(address and length) > > +- interrupts : One interrupt of the fb dev > > + > > +Required nodes: > > +- display: Phandle to a display node as described in > > + Documentation/devicetree/bindings/video/display-timing.txt > > + Additional, the display node has to define properties: > > + - fsl,bpp: Bits per pixel > > + - fsl,pcr: LCDC PCR value > > + > > +Optional properties: > > +- fsl,dmacr: DMA Control Register value. This is optional. By default, the > > + register is not modified as recommended by the datasheet. > > +- fsl,lscr1: LCDC Sharp Configuration Register value. > > + > > +Example: > > + > > + imxfb: fb at 10021000 { > > + compatible = "fsl,imx27-fb", "fsl,imx21-fb"; > you put both when in the doc you request one Thanks, fixed. > > + interrupts = <61>; > > + reg = <0x10021000 0x1000>; > > + display = <&display0>; > > + }; > > + > > + ... > > + > > + display0: display0 { > > + model = "Primeview-PD050VL1"; > > + native-mode = <&timing_disp0>; > > + fsl,bpp = <16>; /* non-standard but required */ > there is a generic binding bit-per-pixel use a cross other IP I can't find a generic binding for that. There are only 2 other drivers using a "bpp" property, but they both use it within different contexts. tilcdc panel uses it within a "panel-info" property and via,vt8500-fb within modes. So I think it would be better to use a clear distinction because there is no generic binding. That was also suggested in comments on version 2 of this patch: https://patchwork.kernel.org/patch/2220511/ Regards, Markus > > + fsl,pcr = <0xf0c88080>; /* non-standard but required */ > > + display-timings { > > + timing_disp0: 640x480 { > > + hactive = <640>; > > + vactive = <480>; > > + hback-porch = <112>; > > + hfront-porch = <36>; > > + hsync-len = <32>; > > + vback-porch = <33>; > > + vfront-porch = <33>; > > + vsync-len = <2>; > > + clock-frequency = <25000000>; > > + }; > > + }; > > + }; > > diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c > > index ef2b587..e0230f8 100644 > > --- a/drivers/video/imxfb.c > > +++ b/drivers/video/imxfb.c > > @@ -32,6 +32,12 @@ > > #include > > #include > > #include > > +#include > > +#include > > + > > +#include