From 06a3307975aac2d5b5a0e0f2e05d23e769f176b4 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 12 Mar 2013 10:26:45 +0200 Subject: videomode: combine videomode dmt_flags and data_flags Both videomode and display_timing contain flags describing the modes. These are stored in dmt_flags and data_flags. There's no need to separate these flags, and having separate fields just makes the flags more difficult to use. This patch combines the fields and renames VESA_DMT_* flags to DISPLAY_FLAGS_*. Signed-off-by: Tomi Valkeinen Cc: Steffen Trumtrar --- include/video/display_timing.h | 26 +++++++++++--------------- include/video/videomode.h | 3 +-- 2 files changed, 12 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/video/display_timing.h b/include/video/display_timing.h index 71e9a383a981..a8a4be5b0af7 100644 --- a/include/video/display_timing.h +++ b/include/video/display_timing.h @@ -12,19 +12,16 @@ #include #include -/* VESA display monitor timing parameters */ -#define VESA_DMT_HSYNC_LOW BIT(0) -#define VESA_DMT_HSYNC_HIGH BIT(1) -#define VESA_DMT_VSYNC_LOW BIT(2) -#define VESA_DMT_VSYNC_HIGH BIT(3) - -/* display specific flags */ -#define DISPLAY_FLAGS_DE_LOW BIT(0) /* data enable flag */ -#define DISPLAY_FLAGS_DE_HIGH BIT(1) -#define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(2) /* drive data on pos. edge */ -#define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(3) /* drive data on neg. edge */ -#define DISPLAY_FLAGS_INTERLACED BIT(4) -#define DISPLAY_FLAGS_DOUBLESCAN BIT(5) +#define DISPLAY_FLAGS_HSYNC_LOW BIT(0) +#define DISPLAY_FLAGS_HSYNC_HIGH BIT(1) +#define DISPLAY_FLAGS_VSYNC_LOW BIT(2) +#define DISPLAY_FLAGS_VSYNC_HIGH BIT(3) +#define DISPLAY_FLAGS_DE_LOW BIT(4) /* data enable flag */ +#define DISPLAY_FLAGS_DE_HIGH BIT(5) +#define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(6) /* drive data on pos. edge */ +#define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(7) /* drive data on neg. edge */ +#define DISPLAY_FLAGS_INTERLACED BIT(8) +#define DISPLAY_FLAGS_DOUBLESCAN BIT(9) /* * A single signal can be specified via a range of minimal and maximal values @@ -72,8 +69,7 @@ struct display_timing { struct timing_entry vback_porch; /* ver. back porch */ struct timing_entry vsync_len; /* ver. sync len */ - unsigned int dmt_flags; /* VESA DMT flags */ - unsigned int data_flags; /* video data flags */ + unsigned int flags; /* display flags */ }; /* diff --git a/include/video/videomode.h b/include/video/videomode.h index a42156234dd4..f4ae6edfeb08 100644 --- a/include/video/videomode.h +++ b/include/video/videomode.h @@ -29,8 +29,7 @@ struct videomode { u32 vback_porch; u32 vsync_len; - unsigned int dmt_flags; /* VESA DMT flags */ - unsigned int data_flags; /* video data flags */ + unsigned int flags; /* display flags */ }; /** -- cgit v1.2.3 From 32ed6ef133f95f960d19e3f3b30246aebf8ecd36 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 12 Mar 2013 10:31:29 +0200 Subject: videomode: create enum for videomode's display flags Instead of having plain defines for the videomode's flags, add an enum for the flags. This makes the flags clearer to use, as the enum tells which values can be used with the flags field. Signed-off-by: Tomi Valkeinen Cc: Steffen Trumtrar --- include/video/display_timing.h | 28 +++++++++++++++++----------- include/video/videomode.h | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/video/display_timing.h b/include/video/display_timing.h index a8a4be5b0af7..b63471d14097 100644 --- a/include/video/display_timing.h +++ b/include/video/display_timing.h @@ -12,16 +12,22 @@ #include #include -#define DISPLAY_FLAGS_HSYNC_LOW BIT(0) -#define DISPLAY_FLAGS_HSYNC_HIGH BIT(1) -#define DISPLAY_FLAGS_VSYNC_LOW BIT(2) -#define DISPLAY_FLAGS_VSYNC_HIGH BIT(3) -#define DISPLAY_FLAGS_DE_LOW BIT(4) /* data enable flag */ -#define DISPLAY_FLAGS_DE_HIGH BIT(5) -#define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(6) /* drive data on pos. edge */ -#define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(7) /* drive data on neg. edge */ -#define DISPLAY_FLAGS_INTERLACED BIT(8) -#define DISPLAY_FLAGS_DOUBLESCAN BIT(9) +enum display_flags { + DISPLAY_FLAGS_HSYNC_LOW = BIT(0), + DISPLAY_FLAGS_HSYNC_HIGH = BIT(1), + DISPLAY_FLAGS_VSYNC_LOW = BIT(2), + DISPLAY_FLAGS_VSYNC_HIGH = BIT(3), + + /* data enable flag */ + DISPLAY_FLAGS_DE_LOW = BIT(4), + DISPLAY_FLAGS_DE_HIGH = BIT(5), + /* drive data on pos. edge */ + DISPLAY_FLAGS_PIXDATA_POSEDGE = BIT(6), + /* drive data on neg. edge */ + DISPLAY_FLAGS_PIXDATA_NEGEDGE = BIT(7), + DISPLAY_FLAGS_INTERLACED = BIT(8), + DISPLAY_FLAGS_DOUBLESCAN = BIT(9), +}; /* * A single signal can be specified via a range of minimal and maximal values @@ -69,7 +75,7 @@ struct display_timing { struct timing_entry vback_porch; /* ver. back porch */ struct timing_entry vsync_len; /* ver. sync len */ - unsigned int flags; /* display flags */ + enum display_flags flags; /* display flags */ }; /* diff --git a/include/video/videomode.h b/include/video/videomode.h index f4ae6edfeb08..8b12e60b6173 100644 --- a/include/video/videomode.h +++ b/include/video/videomode.h @@ -29,7 +29,7 @@ struct videomode { u32 vback_porch; u32 vsync_len; - unsigned int flags; /* display flags */ + enum display_flags flags; /* display flags */ }; /** -- cgit v1.2.3 From 694f050650798b82f2c7b9983e80117d58b34bf3 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 12 Mar 2013 10:35:16 +0200 Subject: videomode: remove timing_entry_index Display timing's fields have minimum, typical and maximum values. These can be accessed by using timing_entry_index enum, and display_timing_get_value() function. There's no real need for this extra complexity. The values can be accessed more easily by just using the min/typ/max fields. Signed-off-by: Tomi Valkeinen Cc: Steffen Trumtrar --- include/video/display_timing.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'include') diff --git a/include/video/display_timing.h b/include/video/display_timing.h index b63471d14097..5d0259b08e01 100644 --- a/include/video/display_timing.h +++ b/include/video/display_timing.h @@ -39,12 +39,6 @@ struct timing_entry { u32 max; }; -enum timing_entry_index { - TE_MIN = 0, - TE_TYP = 1, - TE_MAX = 2, -}; - /* * Single "mode" entry. This describes one set of signal timings a display can * have in one setting. This struct can later be converted to struct videomode @@ -91,25 +85,6 @@ struct display_timings { struct display_timing **timings; }; -/* get value specified by index from struct timing_entry */ -static inline u32 display_timing_get_value(const struct timing_entry *te, - enum timing_entry_index index) -{ - switch (index) { - case TE_MIN: - return te->min; - break; - case TE_TYP: - return te->typ; - break; - case TE_MAX: - return te->max; - break; - default: - return te->typ; - } -} - /* get one entry from struct display_timings */ static inline struct display_timing *display_timings_get(const struct display_timings *disp, -- cgit v1.2.3 From 6cd2c7db41eab204b6474534df4ca68a7dc53d86 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 21 Mar 2013 14:20:12 +0200 Subject: videomode: videomode_from_timing work We currently have videomode_from_timing(), which takes one display_timing entry from display_timings. To make it easier to use display_timing without display_timings, this patch renames videomode_from_timing() to videomode_from_timings(), and adds a new videomode_from_timing() which just converts a given display_timing to videomode. Signed-off-by: Tomi Valkeinen Cc: Steffen Trumtrar --- include/video/videomode.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/video/videomode.h b/include/video/videomode.h index 8b12e60b6173..3f1049d870d5 100644 --- a/include/video/videomode.h +++ b/include/video/videomode.h @@ -34,14 +34,25 @@ struct videomode { /** * videomode_from_timing - convert display timing to videomode + * @dt: display_timing structure + * @vm: return value + * + * DESCRIPTION: + * This function converts a struct display_timing to a struct videomode. + */ +void videomode_from_timing(const struct display_timing *dt, + struct videomode *vm); + +/** + * videomode_from_timings - convert one display timings entry to videomode * @disp: structure with all possible timing entries * @vm: return value * @index: index into the list of display timings in devicetree * * DESCRIPTION: - * This function converts a struct display_timing to a struct videomode. + * This function converts one struct display_timing entry to a struct videomode. */ -int videomode_from_timing(const struct display_timings *disp, +int videomode_from_timings(const struct display_timings *disp, struct videomode *vm, unsigned int index); #endif -- cgit v1.2.3 From 3af4ae1e4b57a663fff9cfe711c84fefb6ec966f Mon Sep 17 00:00:00 2001 From: Tony Prisk Date: Wed, 3 Apr 2013 07:20:34 +1300 Subject: video: vt8500: Remove unused platform_data/video-vt8500lcdfb.h With the conversion to devicetree only for arch-vt8500, this header is no longer required. This patch removes the #include from the two framebuffer drivers that used it, and the header file. Signed-off-by: Tony Prisk Reviewed-by: Jean-Christophe Plagniol-Villard Signed-off-by: Tomi Valkeinen --- include/linux/platform_data/video-vt8500lcdfb.h | 31 ------------------------- 1 file changed, 31 deletions(-) delete mode 100644 include/linux/platform_data/video-vt8500lcdfb.h (limited to 'include') diff --git a/include/linux/platform_data/video-vt8500lcdfb.h b/include/linux/platform_data/video-vt8500lcdfb.h deleted file mode 100644 index 7f399c370fe0..000000000000 --- a/include/linux/platform_data/video-vt8500lcdfb.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * VT8500/WM8505 Frame Buffer platform data definitions - * - * Copyright (C) 2010 Ed Spiridonov - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef _VT8500FB_H -#define _VT8500FB_H - -#include - -struct vt8500fb_platform_data { - struct fb_videomode mode; - u32 xres_virtual; - u32 yres_virtual; - u32 bpp; - unsigned long video_mem_phys; - void *video_mem_virt; - unsigned long video_mem_len; -}; - -#endif /* _VT8500FB_H */ -- cgit v1.2.3 From fd3871aa5c0d108b89858263254b49d9bca2dc53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20St=C3=BCbner?= Date: Fri, 22 Mar 2013 15:17:00 +0100 Subject: AUO-K190x: add framebuffer rotation support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the driver to use the framebuffer rotation functions to be able to change the rotation at runtime. This also removes the setting of the rotation via the platform data. Signed-off-by: Heiko Stübner Signed-off-by: Tomi Valkeinen --- include/video/auo_k190xfb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/video/auo_k190xfb.h b/include/video/auo_k190xfb.h index 609efe8c686e..ad7bc51bee9a 100644 --- a/include/video/auo_k190xfb.h +++ b/include/video/auo_k190xfb.h @@ -98,7 +98,6 @@ struct auok190x_board { int gpio_nbusy; int resolution; - int rotation; int quirks; int fps; }; -- cgit v1.2.3 From b61f232ff09b6cff22d5186001027438c620da39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20St=C3=BCbner?= Date: Fri, 22 Mar 2013 15:17:32 +0100 Subject: AUO-K190x: Add resolutions for portrait displays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The controller also contains support for displays in a portrait orientation and it seems devices which such displays really reached the market - Pandigital Novell seems to be one example. Signed-off-by: Heiko Stübner Signed-off-by: Tomi Valkeinen --- include/video/auo_k190xfb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/video/auo_k190xfb.h b/include/video/auo_k190xfb.h index ad7bc51bee9a..ac329ee1d753 100644 --- a/include/video/auo_k190xfb.h +++ b/include/video/auo_k190xfb.h @@ -22,6 +22,8 @@ */ #define AUOK190X_RESOLUTION_800_600 0 #define AUOK190X_RESOLUTION_1024_768 1 +#define AUOK190X_RESOLUTION_600_800 4 +#define AUOK190X_RESOLUTION_768_1024 5 /* * struct used by auok190x. board specific stuff comes from *board -- cgit v1.2.3 From bbfce37b3ea11d13a984063a162c898a5fb23b1e Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 11 Apr 2013 02:04:55 +0200 Subject: video/s3c: move platform_data out of arch/arm The s3c-fb driver requires header files from the samsung platforms to find its platform_data definition, but this no longer works on multiplatform kernels, so let's move the data into a new header file under include/linux/platform_data. Signed-off-by: Arnd Bergmann Cc: linux-fbdev@vger.kernel.org Acked-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- include/linux/platform_data/video_s3c.h | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 include/linux/platform_data/video_s3c.h (limited to 'include') diff --git a/include/linux/platform_data/video_s3c.h b/include/linux/platform_data/video_s3c.h new file mode 100644 index 000000000000..48883995f47f --- /dev/null +++ b/include/linux/platform_data/video_s3c.h @@ -0,0 +1,54 @@ +#ifndef __PLATFORM_DATA_VIDEO_S3C +#define __PLATFORM_DATA_VIDEO_S3C + +/* S3C_FB_MAX_WIN + * Set to the maximum number of windows that any of the supported hardware + * can use. Since the platform data uses this for an array size, having it + * set to the maximum of any version of the hardware can do is safe. + */ +#define S3C_FB_MAX_WIN (5) + +/** + * struct s3c_fb_pd_win - per window setup data + * @xres : The window X size. + * @yres : The window Y size. + * @virtual_x: The virtual X size. + * @virtual_y: The virtual Y size. + */ +struct s3c_fb_pd_win { + unsigned short default_bpp; + unsigned short max_bpp; + unsigned short xres; + unsigned short yres; + unsigned short virtual_x; + unsigned short virtual_y; +}; + +/** + * struct s3c_fb_platdata - S3C driver platform specific information + * @setup_gpio: Setup the external GPIO pins to the right state to transfer + * the data from the display system to the connected display + * device. + * @vidcon0: The base vidcon0 values to control the panel data format. + * @vidcon1: The base vidcon1 values to control the panel data output. + * @vtiming: Video timing when connected to a RGB type panel. + * @win: The setup data for each hardware window, or NULL for unused. + * @display_mode: The LCD output display mode. + * + * The platform data supplies the video driver with all the information + * it requires to work with the display(s) attached to the machine. It + * controls the initial mode, the number of display windows (0 is always + * the base framebuffer) that are initialised etc. + * + */ +struct s3c_fb_platdata { + void (*setup_gpio)(void); + + struct s3c_fb_pd_win *win[S3C_FB_MAX_WIN]; + struct fb_videomode *vtiming; + + u32 vidcon0; + u32 vidcon1; +}; + +#endif -- cgit v1.2.3