From: plagnioj@jcrosoft.com (Jean-Christophe PLAGNIOL-VILLARD) Date: Fri, 29 Mar 2013 19:43:10 +0100 Subject: [PATCH] video: fb: vt8500: Convert framebuffer drivers to standardized binding In-Reply-To: <1364100587-9320-1-git-send-email-linux@prisktech.co.nz> References: <1364100587-9320-1-git-send-email-linux@prisktech.co.nz> Message-ID: <20130329184310.GI20693@game.jcrosoft.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 17:49 Sun 24 Mar , Tony Prisk wrote: > Now that a display timing binding is available, convert our almost identical > binding to use the standard binding. > > This patch converts the vt8500 and wm8505 framebuffer drivers and > associated dts/dtsi files to use the standard binding as defined in > bindings/video/display-timing.txt. > > There are two side-effects of making this conversion: > > 1) The fb node should now be in the board file, rather than the soc file as > the display-timing node is a child of the fb node. > > 2) We still require a bits per pixel property to initialize the framebuffer > for the different lcd panels. Rather than including this as part of the > display timing, it is moved into the framebuffer node. > > I have also taken the opportunity to alphabetise the includes of each > driver to avoid double-ups. > > Signed-off-by: Tony Prisk > --- > Hi Florian, > > This patch is based on top of the previous patchset (0/5 video: vt8500 patches > for 3.10). It could be considered patch 6 of the same set. > > Regards > Tony P > > .../devicetree/bindings/video/via,vt8500-fb.txt | 48 ++++---------- > .../devicetree/bindings/video/wm,wm8505-fb.txt | 32 +++++---- > arch/arm/boot/dts/vt8500-bv07.dts | 24 +++---- > arch/arm/boot/dts/vt8500.dtsi | 8 --- > arch/arm/boot/dts/wm8505-ref.dts | 21 +++--- > arch/arm/boot/dts/wm8505.dtsi | 7 -- > arch/arm/boot/dts/wm8650-mid.dts | 21 +++--- > arch/arm/boot/dts/wm8650.dtsi | 7 -- > arch/arm/boot/dts/wm8850-w70v2.dts | 21 +++--- > arch/arm/boot/dts/wm8850.dtsi | 7 -- > drivers/video/Kconfig | 6 ++ > drivers/video/vt8500lcdfb.c | 53 ++++++--------- > drivers/video/wm8505fb.c | 68 ++++++++------------ > 13 files changed, 130 insertions(+), 193 deletions(-) > > diff --git a/Documentation/devicetree/bindings/video/via,vt8500-fb.txt b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt > index c870b64..2871e21 100644 > --- a/Documentation/devicetree/bindings/video/via,vt8500-fb.txt > +++ b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt > @@ -5,58 +5,32 @@ Required properties: > - compatible : "via,vt8500-fb" > - reg : Should contain 1 register ranges(address and length) > - interrupts : framebuffer controller interrupt > -- display: a phandle pointing to the display node > +- bits-per-pixel : bit depth of framebuffer (16 or 32) > > -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. > +Required subnodes: > +- display-timings: see display-timing.txt for information > > Example: > > - fb at d800e400 { > + fb at d8050800 { > compatible = "via,vt8500-fb"; > reg = <0xd800e400 0x400>; > interrupts = <12>; > - display = <&display>; > - default-mode = <&mode0>; > - }; > - > -VIA VT8500 Display > ------------------------------------------------------ > -Required properties (as per of_videomode_helper): > - > - - hactive, vactive: Display resolution > - - hfront-porch, hback-porch, hsync-len: Horizontal Display timing parameters > - in pixels > - vfront-porch, vback-porch, vsync-len: Vertical display timing parameters in > - lines > - - clock: displayclock in Hz > - - bpp: lcd panel bit-depth. > - <16> for RGB565, <32> for RGB888 > - > -Optional properties (as per of_videomode_helper): > - - width-mm, height-mm: Display dimensions in mm > - - hsync-active-high (bool): Hsync pulse is active high > - - vsync-active-high (bool): Vsync pulse is active high > - - interlaced (bool): This is an interlaced mode > - - doublescan (bool): This is a doublescan mode > + bits-per-pixel = <16>; > > -Example: > - display: display at 0 { > - modes { > - mode0: mode at 0 { > + display-timings { > + native-mode = <&timing0>; > + timing0: 800x480 { > + clock-frequency = <0>; /* unused but required */ > hactive = <800>; > vactive = <480>; > - hback-porch = <88>; > hfront-porch = <40>; > + hback-porch = <88>; > hsync-len = <0>; > vback-porch = <32>; > vfront-porch = <11>; > vsync-len = <1>; > - clock = <0>; /* unused but required */ > - bpp = <16>; /* non-standard but required */ > }; > }; > }; > + > diff --git a/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt b/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt > index 3d325e1..0bcadb2 100644 > --- a/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt > +++ b/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt > @@ -4,20 +4,30 @@ Wondermedia WM8505 Framebuffer > Required properties: > - compatible : "wm,wm8505-fb" > - reg : Should contain 1 register ranges(address and length) > -- via,display: a phandle pointing to the display node > +- bits-per-pixel : bit depth of framebuffer (16 or 32) > > -Required nodes: > -- display: a display node is required to initialize the lcd panel > - This should be in the board dts. See definition in > - Documentation/devicetree/bindings/video/via,vt8500-fb.txt > -- default-mode: a videomode node as specified in > - Documentation/devicetree/bindings/video/via,vt8500-fb.txt > +Required subnodes: > +- display-timings: see display-timing.txt for information > > Example: > > - fb at d8050800 { > + fb at d8051700 { > compatible = "wm,wm8505-fb"; > - reg = <0xd8050800 0x200>; > - display = <&display>; > - default-mode = <&mode0>; > + reg = <0xd8051700 0x200>; > + bits-per-pixel = <16>; > + > + display-timings { > + native-mode = <&timing0>; > + timing0: 800x480 { > + clock-frequency = <0>; /* unused but required */ > + hactive = <800>; > + vactive = <480>; > + hfront-porch = <40>; > + hback-porch = <88>; > + hsync-len = <0>; > + vback-porch = <32>; > + vfront-porch = <11>; > + vsync-len = <1>; > + }; > + }; > }; > diff --git a/arch/arm/boot/dts/vt8500-bv07.dts b/arch/arm/boot/dts/vt8500-bv07.dts > index 567cf4e..7ec9a41 100644 > --- a/arch/arm/boot/dts/vt8500-bv07.dts > +++ b/arch/arm/boot/dts/vt8500-bv07.dts > @@ -12,24 +12,26 @@ > / { > model = "Benign BV07 Netbook"; > > - /* > - * Display node is based on Sascha Hauer's patch on dri-devel. > - * Added a bpp property to calculate the size of the framebuffer > - * until the binding is formalized. > - */ > - display: display at 0 { > - modes { > - mode0: mode at 0 { > + interrupt-parent = <&intc>; > + > + fb at d8050800 { > + compatible = "via,vt8500-fb"; > + reg = <0xd800e400 0x400>; > + interrupts = <12>; > + bits-per-pixel = <16>; > + > + display-timings { > + native-mode = <&timing0>; > + timing0: 800x480 { > + clock-frequency = <0>; /* unused but required */ > hactive = <800>; > vactive = <480>; > - hback-porch = <88>; > hfront-porch = <40>; > + hback-porch = <88>; > hsync-len = <0>; > vback-porch = <32>; > vfront-porch = <11>; > vsync-len = <1>; > - clock = <0>; /* unused but required */ > - bpp = <16>; /* non-standard but required */ > }; > }; > }; > diff --git a/arch/arm/boot/dts/vt8500.dtsi b/arch/arm/boot/dts/vt8500.dtsi > index cf31ced..fc25d9f 100644 > --- a/arch/arm/boot/dts/vt8500.dtsi > +++ b/arch/arm/boot/dts/vt8500.dtsi > @@ -98,14 +98,6 @@ > interrupts = <43>; > }; > > - fb at d800e400 { > - compatible = "via,vt8500-fb"; > - reg = <0xd800e400 0x400>; > - interrupts = <12>; > - display = <&display>; > - default-mode = <&mode0>; > - }; no this belong here at Soc level not board fb at d800e400 { compatible = "via,vt8500-fb"; reg = <0xd800e400 0x400>; interrupts = <12>; }; > - > ge_rops at d8050400 { > compatible = "wm,prizm-ge-rops"; > reg = <0xd8050400 0x100>; > diff --git a/arch/arm/boot/dts/wm8505-ref.dts b/arch/arm/boot/dts/wm8505-ref.dts > index fd4e248..a600572 100644 > --- a/arch/arm/boot/dts/wm8505-ref.dts > +++ b/arch/arm/boot/dts/wm8505-ref.dts > @@ -12,24 +12,23 @@ > / { > model = "Wondermedia WM8505 Netbook"; > > - /* > - * Display node is based on Sascha Hauer's patch on dri-devel. > - * Added a bpp property to calculate the size of the framebuffer > - * until the binding is formalized. > - */ > - display: display at 0 { > - modes { > - mode0: mode at 0 { > + fb at d8050800 { > + compatible = "wm,wm8505-fb"; > + reg = <0xd8050800 0x200>; > + bits-per-pixel = <32>; > + > + display-timings { > + native-mode = <&timing0>; > + timing0: 800x480 { > + clock-frequency = <0>; /* unused but required */ > hactive = <800>; > vactive = <480>; > - hback-porch = <88>; > hfront-porch = <40>; > + hback-porch = <88>; > hsync-len = <0>; > vback-porch = <32>; > vfront-porch = <11>; > vsync-len = <1>; > - clock = <0>; /* unused but required */ > - bpp = <32>; /* non-standard but required */ > }; > }; > }; > diff --git a/arch/arm/boot/dts/wm8505.dtsi b/arch/arm/boot/dts/wm8505.dtsi > index e74a1c0..826bd8d 100644 > --- a/arch/arm/boot/dts/wm8505.dtsi > +++ b/arch/arm/boot/dts/wm8505.dtsi > @@ -128,13 +128,6 @@ > interrupts = <0>; > }; > > - fb at d8050800 { > - compatible = "wm,wm8505-fb"; > - reg = <0xd8050800 0x200>; > - display = <&display>; > - default-mode = <&mode0>; > - }; > - > ge_rops at d8050400 { > compatible = "wm,prizm-ge-rops"; > reg = <0xd8050400 0x100>; > diff --git a/arch/arm/boot/dts/wm8650-mid.dts b/arch/arm/boot/dts/wm8650-mid.dts > index cefd938..d77bf22 100644 > --- a/arch/arm/boot/dts/wm8650-mid.dts > +++ b/arch/arm/boot/dts/wm8650-mid.dts > @@ -12,24 +12,23 @@ > / { > model = "Wondermedia WM8650-MID Tablet"; > > - /* > - * Display node is based on Sascha Hauer's patch on dri-devel. > - * Added a bpp property to calculate the size of the framebuffer > - * until the binding is formalized. > - */ > - display: display at 0 { > - modes { > - mode0: mode at 0 { > + fb at d8050800 { > + compatible = "wm,wm8505-fb"; > + reg = <0xd8050800 0x200>; > + bits-per-pixel = <16>; > + > + display-timings { > + native-mode = <&timing0>; > + timing0: 800x480 { > + clock-frequency = <0>; /* unused but required */ > hactive = <800>; > vactive = <480>; > - hback-porch = <88>; > hfront-porch = <40>; > + hback-porch = <88>; > hsync-len = <0>; > vback-porch = <32>; > vfront-porch = <11>; > vsync-len = <1>; > - clock = <0>; /* unused but required */ > - bpp = <16>; /* non-standard but required */ > }; > }; > }; > diff --git a/arch/arm/boot/dts/wm8650.dtsi b/arch/arm/boot/dts/wm8650.dtsi > index db3c0a1..2073963 100644 > --- a/arch/arm/boot/dts/wm8650.dtsi > +++ b/arch/arm/boot/dts/wm8650.dtsi > @@ -128,13 +128,6 @@ > interrupts = <43>; > }; > > - fb at d8050800 { > - compatible = "wm,wm8505-fb"; > - reg = <0xd8050800 0x200>; > - display = <&display>; > - default-mode = <&mode0>; > - }; > - > ge_rops at d8050400 { > compatible = "wm,prizm-ge-rops"; > reg = <0xd8050400 0x100>; > diff --git a/arch/arm/boot/dts/wm8850-w70v2.dts b/arch/arm/boot/dts/wm8850-w70v2.dts > index fcc660c..9b56701 100644 > --- a/arch/arm/boot/dts/wm8850-w70v2.dts > +++ b/arch/arm/boot/dts/wm8850-w70v2.dts > @@ -15,24 +15,23 @@ > / { > model = "Wondermedia WM8850-W70v2 Tablet"; > > - /* > - * Display node is based on Sascha Hauer's patch on dri-devel. > - * Added a bpp property to calculate the size of the framebuffer > - * until the binding is formalized. > - */ > - display: display at 0 { > - modes { > - mode0: mode at 0 { > + fb at d8051700 { > + compatible = "wm,wm8505-fb"; > + reg = <0xd8051700 0x200>; > + bits-per-pixel = <16>; > + > + display-timings { > + native-mode = <&timing0>; > + timing0: 800x480 { > + clock-frequency = <0>; /* unused but required */ > hactive = <800>; > vactive = <480>; > - hback-porch = <88>; > hfront-porch = <40>; > + hback-porch = <88>; > hsync-len = <0>; > vback-porch = <32>; > vfront-porch = <11>; > vsync-len = <1>; > - clock = <0>; /* unused but required */ > - bpp = <16>; /* non-standard but required */ > }; > }; > }; > diff --git a/arch/arm/boot/dts/wm8850.dtsi b/arch/arm/boot/dts/wm8850.dtsi > index e8cbfdc..dfc50a4 100644 > --- a/arch/arm/boot/dts/wm8850.dtsi > +++ b/arch/arm/boot/dts/wm8850.dtsi > @@ -135,13 +135,6 @@ > }; > }; > > - fb at d8051700 { > - compatible = "wm,wm8505-fb"; > - reg = <0xd8051700 0x200>; > - display = <&display>; > - default-mode = <&mode0>; > - }; > - > ge_rops at d8050400 { > compatible = "wm,prizm-ge-rops"; > reg = <0xd8050400 0x100>; > diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig > index ad762ed..d0c932a 100644 > --- a/drivers/video/Kconfig > +++ b/drivers/video/Kconfig > @@ -1794,6 +1794,9 @@ config FB_VT8500 > select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS) > select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS) > select FB_SYS_IMAGEBLIT > + select FB_MODE_HELPERS > + select OF_DISPLAY_TIMING > + select OF_VIDEOMODE > help > This is the framebuffer driver for VIA VT8500 integrated LCD > controller. > @@ -1804,6 +1807,9 @@ config FB_WM8505 > select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS) > select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS) > select FB_SYS_IMAGEBLIT > + select FB_MODE_HELPERS > + select OF_DISPLAY_TIMING > + select OF_VIDEOMODE > help > This is the framebuffer driver for WonderMedia WM8xxx-series > integrated LCD controller. This driver covers the WM8505, WM8650 > diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c > index 1c34821..816e8ce 100644 > --- a/drivers/video/vt8500lcdfb.c > +++ b/drivers/video/vt8500lcdfb.c > @@ -15,20 +15,21 @@ > * GNU General Public License for more details. > */ > > -#include > -#include > -#include > -#include > -#include > -#include > #include > +#include > +#include > #include > #include > #include > #include > -#include > +#include > +#include > +#include > #include > +#include > +#include > #include > +#include