From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Ferre Date: Tue, 16 Apr 2013 15:43:18 +0000 Subject: Re: [PATCH 4/8] video: atmel_lcdfb: add device tree suport Message-Id: <516D7196.4010307@atmel.com> List-Id: References: <20130411145741.GB25242@game.jcrosoft.org> <1365692422-9565-1-git-send-email-plagnioj@jcrosoft.com> <1365692422-9565-4-git-send-email-plagnioj@jcrosoft.com> <516D554C.1090909@atmel.com> <20130416134404.GA4998@game.jcrosoft.org> In-Reply-To: <20130416134404.GA4998@game.jcrosoft.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-arm-kernel@lists.infradead.org On 04/16/2013 03:44 PM, Jean-Christophe PLAGNIOL-VILLARD : > On 15:42 Tue 16 Apr , Nicolas Ferre wrote: >> On 04/11/2013 05:00 PM, Jean-Christophe PLAGNIOL-VILLARD : >>> get display timings from device tree >>> Use videomode helpers to get display timings and configurations from >>> device tree >> >> 2 sentences? Simply elaborate the 2nd one and it will be good. >> >>> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD >>> Cc: linux-fbdev@vger.kernel.org >>> Cc: Nicolas Ferre >>> Cc: Andrew Morton >>> --- >>> .../devicetree/bindings/video/atmel,lcdc.txt | 75 ++++++ >>> drivers/video/Kconfig | 2 + >>> drivers/video/atmel_lcdfb.c | 244 ++++++++++++= +++++--- >>> 3 files changed, 289 insertions(+), 32 deletions(-) >>> create mode 100644 Documentation/devicetree/bindings/video/atmel,lcdc.= txt >>> >>> diff --git a/Documentation/devicetree/bindings/video/atmel,lcdc.txt b/D= ocumentation/devicetree/bindings/video/atmel,lcdc.txt >>> new file mode 100644 >>> index 0000000..1ec175e >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/video/atmel,lcdc.txt >> >> Why lcdc? I would have preferred atmel,lcdfb, like the driver's name: it >> is even more self-explanatory... > we do not describe drivers but IP fine, but in static const struct platform_device_id atmel_lcdfb_devtypes, we use "xxx-lcdfb" type... >> >>> @@ -0,0 +1,75 @@ >>> +Atmel LCDC Framebuffer >>> +----------------------------------------------------- >>> + >>> +Required properties: >>> +- compatible : >>> + "atmel,at91sam9261-lcdc" ,=20 >>> + "atmel,at91sam9263-lcdc" , >>> + "atmel,at91sam9g10-lcdc" , >>> + "atmel,at91sam9g45-lcdc" , >>> + "atmel,at91sam9g45es-lcdc" , >>> + "atmel,at91sam9rl-lcdc" , >>> + "atmel,at32ap-lcdc" >>> +- reg : Should contain 1 register ranges(address and length) >>> +- interrupts : framebuffer controller interrupt >>> +- display: a phandle pointing to the display node >>> + >>> +Required nodes: >>> +- display: a display node is required to initialize the lcd panel >>> + This should be in the board dts. >>> +- default-mode: a videomode within the display with timing parameters >>> + as specified below. >>> + >>> +Example: >>> + >>> + fb0: fb@0x00500000 { >>> + compatible =3D "atmel,at91sam9g45-lcdc"; >>> + reg =3D <0x00500000 0x1000>; >>> + interrupts =3D <23 3 0>; >>> + pinctrl-names =3D "default"; >>> + pinctrl-0 =3D <&pinctrl_fb>; >>> + display =3D <&display0>; >>> + status =3D "okay"; >>> + #address-cells =3D <1>; >>> + #size-cells =3D <1>; >>> + >>> + }; >>> + >>> +Atmel LCDC Display >>> +----------------------------------------------------- >>> +Required properties (as per of_videomode_helper): >> >> Can you please point somewhere to the documentation: >> Documentation/devicetree/bindings/video/display-timing.txt >> >>> + - atmel,dmacon: dma controler configuration >> >> Typo: controller. >> >>> + - atmel,lcdcon2: lcd controler configuration >> >> Ditto >> >>> + - atmel,guard-time: lcd guard time (Delay in frame periods) >> >> periods -> period, no? > no it's periods even in the datasheet >> >>> + - bits-per-pixel: lcd panel bit-depth. >>> + >>> +Optional properties (as per of_videomode_helper): >>> + - atmel,lcdcon-backlight: enable backlight >>> + - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG" >> >> Is it a sting, or a number (as seen below)? If it is a number, please >> tell how to choose the index. > String Okay: so tell it in the description and correct the example below. >>> + - atmel,power-control-gpio: gpio to power on or off the LCD (as many = as needed) >>> + >>> +Example: >>> + display0: display { >>> + bits-per-pixel =3D <32>; >>> + atmel,lcdcon-backlight; >>> + atmel,dmacon =3D <0x1>; >>> + atmel,lcdcon2 =3D <0x80008002>; >>> + atmel,guard-time =3D <9>; >>> + atmel,lcd-wiring-mode =3D <1>; Here ----------------------------------^^^^ >>> + >>> + display-timings { >>> + native-mode =3D <&timing0>; >>> + timing0: timing0 { >>> + clock-frequency =3D <9000000>; >>> + hactive =3D <480>; >>> + vactive =3D <272>; >>> + hback-porch =3D <1>; >>> + hfront-porch =3D <1>; >>> + vback-porch =3D <40>; >>> + vfront-porch =3D <1>; >>> + hsync-len =3D <45>; >>> + vsync-len =3D <1>; >>> + }; >>> + }; >>> + }; >>> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig >>> index 4c1546f..0687482 100644 >>> --- a/drivers/video/Kconfig >>> +++ b/drivers/video/Kconfig >>> @@ -1018,6 +1018,8 @@ config FB_ATMEL >>> select FB_CFB_FILLRECT >>> select FB_CFB_COPYAREA >>> select FB_CFB_IMAGEBLIT >>> + select FB_MODE_HELPERS >>> + select OF_VIDEOMODE >>> help >>> This enables support for the AT91/AT32 LCD Controller. >>> =20 >>> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c >>> index f67e226..4a31570 100644 >>> --- a/drivers/video/atmel_lcdfb.c >>> +++ b/drivers/video/atmel_lcdfb.c >>> @@ -20,7 +20,11 @@ >>> #include >>> #include >>> #include >>> +#include >>> +#include >>> +#include >>> #include