* Re: [PATCH] Added backlight driver for Acer Aspire 4736
From: joeyli @ 2012-03-13 23:12 UTC (permalink / raw)
To: Pradeep Subrahmanion
Cc: Matthew Garrett, rpurdie, FlorianSchandinat, akpm, linux-fbdev,
linux-kernel
In-Reply-To: <1331688294.2577.19.camel@debian.Gayathri>
Hi Pradeep,
於 二,2012-03-13 於 21:24 -0400,Pradeep Subrahmanion 提到:
> On Tue, 2012-03-13 at 13:34 +0000, Matthew Garrett wrote:
> > On Tue, Mar 13, 2012 at 06:56:16PM +0530, Pradeep Subrahmanion wrote:
> > > I tried giving acpi_backlight = vendor . In that case hot key for
> > > brightness control is working. But i think , it is not calculating the
> > > correct value for brightness because increasing brightness after maximum
> > > level gives blank screen .
> >
> > Which backlight device appears then?
> >
>
> 'intel_backlight' appears when i gave option acpi_backlight = vendor. Writing to /sys/class/backlight/intel_backlight/brightness
>
> does not cause any change in brightness.
>
The above command not work, that means EC didn't change backlight
value:
Method (_BCM, 1, NotSerialized)
{
Divide (Arg0, 0x0A, Local0, Local1)
Decrement (Local1)
Store (Local1, ^^^^LPC.EC0.BRTS) <== write backlight value to EC
register
}
Per my understood, EC firmware should change brightness but didn't do
that, another
way is touch i915 register in _BCM.
Acer machine provide a broken _BCM implementation and they didn't test
it.
> > > By ' ACPI interface' , I mean 'acpi_video0' inside the
> > > /sys/class/backlight. I havn't tried the /sys/class/backlight interface
> > > directly . I will try that also.
> >
> > So writing values into /sys/class/backlight/acpi_video0/brightness does
> > nothing?
>
>
> No change in value when writing
> to /sys/class/backlight/acpi_video0/brightness.
>
> Another thing is that when i did boot with acpi_backlight = 'acer_wmi' ,
> in new kernel (3.3.0-rc7) , it shows following messages ,
>
> [ 8.350825] wmi: Mapper loaded
> [ 10.363975] acer_wmi: Acer Laptop ACPI-WMI Extras
> [ 10.396186] acer_wmi: Function bitmap for Communication Device: 0x91
> [ 10.396385] acer_wmi: Brightness must be controlled by generic video
> driver
>
> Also there was no interface inside /sys/class/backlight for acer_wmi.
>
Yes, acer_wmi support backlight control with AMW0 interface, your
machine didn't have AMW0 interface.
Normally, backlight should control by standard acpi interface.
> I also tried writing directly to Embedded controller register .But no
> change.
The machine has broken _BCM method, because EC should do something after
_BCM changed EC register.
> ----
>
> Thanks ,
>
> Pradeep Subrahmanion
>
Thanks a lot!
Joey Lee
^ permalink raw reply
* [PATCH] x86: export 'pcibios_enabled'
From: Randy Dunlap @ 2012-03-13 20:30 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linux-next, LKML, Michal Januszewski, Florian Tobias Schandinat,
linux-fbdev, x86, Andrew Morton
In-Reply-To: <20120313204114.e160849af7dbe5a4b4e5c0ad@canb.auug.org.au>
From: Randy Dunlap <rdunlap@xenotime.net>
Export 'pcibios_enabled' so that when uvesafb is built as a
loadable module (on X86_32), the build will succeed.
ERROR: "pcibios_enabled" [drivers/video/uvesafb.ko] undefined!
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Michal Januszewski <spock@gentoo.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: x86@kernel.org
---
Applies to mainline; found in linux-next.
arch/x86/pci/pcbios.c | 1 +
1 file changed, 1 insertion(+)
--- linux-next-20120313.orig/arch/x86/pci/pcbios.c
+++ linux-next-20120313/arch/x86/pci/pcbios.c
@@ -27,6 +27,7 @@
#define PCIBIOS_HW_TYPE2_SPEC 0x20
int pcibios_enabled;
+EXPORT_SYMBOL(pcibios_enabled);
/* According to the BIOS specification at:
* http://members.datafast.net.au/dft0802/specs/bios21.pdf, we could
^ permalink raw reply
* Re: [PATCH] Added backlight driver for Acer Aspire 4736
From: Pradeep Subrahmanion @ 2012-03-13 15:49 UTC (permalink / raw)
To: Matthew Garrett
Cc: rpurdie, FlorianSchandinat, akpm, linux-fbdev, linux-kernel
In-Reply-To: <20120313133458.GA11574@srcf.ucam.org>
On Tue, 2012-03-13 at 13:34 +0000, Matthew Garrett wrote:
> On Tue, Mar 13, 2012 at 06:56:16PM +0530, Pradeep Subrahmanion wrote:
> > I tried giving acpi_backlight = vendor . In that case hot key for
> > brightness control is working. But i think , it is not calculating the
> > correct value for brightness because increasing brightness after maximum
> > level gives blank screen .
>
> Which backlight device appears then?
>
'intel_backlight' appears when i gave option acpi_backlight = vendor. Writing to /sys/class/backlight/intel_backlight/brightness
does not cause any change in brightness.
> > By ' ACPI interface' , I mean 'acpi_video0' inside the
> > /sys/class/backlight. I havn't tried the /sys/class/backlight interface
> > directly . I will try that also.
>
> So writing values into /sys/class/backlight/acpi_video0/brightness does
> nothing?
No change in value when writing
to /sys/class/backlight/acpi_video0/brightness.
Another thing is that when i did boot with acpi_backlight = 'acer_wmi' ,
in new kernel (3.3.0-rc7) , it shows following messages ,
[ 8.350825] wmi: Mapper loaded
[ 10.363975] acer_wmi: Acer Laptop ACPI-WMI Extras
[ 10.396186] acer_wmi: Function bitmap for Communication Device: 0x91
[ 10.396385] acer_wmi: Brightness must be controlled by generic video
driver
Also there was no interface inside /sys/class/backlight for acer_wmi.
I also tried writing directly to Embedded controller register .But no
change.
----
Thanks ,
Pradeep Subrahmanion
^ permalink raw reply
* Re: [PATCH] Added backlight driver for Acer Aspire 4736
From: Pradeep Subrahmanion @ 2012-03-13 13:41 UTC (permalink / raw)
To: Matthew Garrett
Cc: rpurdie, FlorianSchandinat, akpm, linux-fbdev, linux-kernel
In-Reply-To: <20120313124738.GB10822@srcf.ucam.org>
I tried giving acpi_backlight = vendor . In that case hot key for
brightness control is working. But i think , it is not calculating
the correct value for brightness because increasing brightness after
maximum level gives blank screen .
I also had tried 'acpi_backlight = acer_wmi' as the boot parameter
earlier . In that case , the driver cannot find any acpi_wmi device
(showed error while booting).
By ' ACPI interface' , I mean 'acpi_video0' inside the
/sys/class/backlight. I havn't tried the /sys/class/backlight
interface directly . I will try that also.
Thanks ,
Pradeep Subrahmanion.
On Tue, Mar 13, 2012 at 6:17 PM, Matthew Garrett <mjg@redhat.com> wrote:
>
> On Tue, Mar 13, 2012 at 08:09:52AM -0400, Pradeep Subrahmanion wrote:
> > Before taking this approach , I had a look at the WMI interface.But I found from acer-acpi site that , the 4730 series
> > is using new WMI interface which needs to be reverse engineered.
> > As far as acpi interface is concerned , by default it is not at all causing any change in brightness.
> > When 'acpi_osi=Linux' was added to the boot grub config , the brightness control with hot key started to work .
> > But it was not changing to correct values. Increasing brightness after maximum level gives blank screen.
>
> That page was last updated in 2009. Have you tried the current acer-wmi
> code? You'd probably need to pass backlight=vendor if there's a
> non-working ACPI interface.
>
> When you say the ACPI interface doesn't work, what do you mean? Have you
> tried using the /sys/class/backlight interface directly?
>
> --
> Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply
* Re: [PATCH] Added backlight driver for Acer Aspire 4736
From: Matthew Garrett @ 2012-03-13 13:34 UTC (permalink / raw)
To: Pradeep Subrahmanion
Cc: rpurdie, FlorianSchandinat, akpm, linux-fbdev, linux-kernel
In-Reply-To: <CABNxG=Dqg26EHmC3vibf3-SjVhby1qgQfMniQObUeh9eJ6SwEw@mail.gmail.com>
On Tue, Mar 13, 2012 at 06:56:16PM +0530, Pradeep Subrahmanion wrote:
> I tried giving acpi_backlight = vendor . In that case hot key for
> brightness control is working. But i think , it is not calculating the
> correct value for brightness because increasing brightness after maximum
> level gives blank screen .
Which backlight device appears then?
> By ' ACPI interface' , I mean 'acpi_video0' inside the
> /sys/class/backlight. I havn't tried the /sys/class/backlight interface
> directly . I will try that also.
So writing values into /sys/class/backlight/acpi_video0/brightness does
nothing?
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply
* [PATCH v2 2/2] fbdev: da8xx: add support for SP10Q010 display
From: Anatolij Gustschin @ 2012-03-13 13:13 UTC (permalink / raw)
To: linux-fbdev
Add timing data for Hitachi SP10Q010 display and allow configuration
of the 4bpp palette. For 4bpp framebuffer enable reversed order of
pixels in a byte. This requires defining FB_CFB_REV_PIXELS_IN_BYTE
and additionally setting var.nonstd to the value FB_NONSTD_REV_PIX_IN_B.
Note that it is not enough to set da8xx_fb_var.nonstd to this value
statically, since FBIOPUT_VSCREENINFO ioctl might pass var struct with
.nonstd field set to zero or another value. Therefore this setting must
be adjusted in fb_check_var() according to the requested bpp value.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Manjunathappa, Prakash <prakash.pm@ti.com>
---
v2:
- rebased on fbdev-next branch
drivers/video/Kconfig | 1 +
drivers/video/da8xx-fb.c | 38 +++++++++++++++++++++++++++++++++++++-
2 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 8951cbd..58ea0be 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -2245,6 +2245,7 @@ config FB_DA8XX
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
+ select FB_CFB_REV_PIXELS_IN_BYTE
---help---
This is the frame buffer device driver for the TI LCD controller
found on DA8xx/OMAP-L1xx SoCs.
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 8f7e051..47118c7 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -239,6 +239,20 @@ static struct da8xx_panel known_lcd_panels[] = {
.pxl_clk = 7833600,
.invert_pxl_clk = 0,
},
+ [2] = {
+ /* Hitachi SP10Q010 */
+ .name = "SP10Q010",
+ .width = 320,
+ .height = 240,
+ .hfp = 10,
+ .hbp = 10,
+ .hsw = 10,
+ .vfp = 10,
+ .vbp = 10,
+ .vsw = 10,
+ .pxl_clk = 7833600,
+ .invert_pxl_clk = 0,
+ },
};
/* Enable the Raster Engine of the LCD Controller */
@@ -547,7 +561,26 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
if (info->fix.visual = FB_VISUAL_DIRECTCOLOR)
return 1;
- if (info->var.bits_per_pixel = 8) {
+ if (info->var.bits_per_pixel = 4) {
+ if (regno > 15)
+ return 1;
+
+ if (info->var.grayscale) {
+ pal = regno;
+ } else {
+ red >>= 4;
+ green >>= 8;
+ blue >>= 12;
+
+ pal = (red & 0x0f00);
+ pal |= (green & 0x00f0);
+ pal |= (blue & 0x000f);
+ }
+ if (regno = 0)
+ pal |= 0x2000;
+ palette[regno] = pal;
+
+ } else if (info->var.bits_per_pixel = 8) {
red >>= 4;
green >>= 8;
blue >>= 12;
@@ -802,6 +835,7 @@ static int fb_check_var(struct fb_var_screeninfo *var,
var->blue.length = 8;
var->transp.offset = 0;
var->transp.length = 0;
+ var->nonstd = 0;
break;
case 4:
var->red.offset = 0;
@@ -812,6 +846,7 @@ static int fb_check_var(struct fb_var_screeninfo *var,
var->blue.length = 4;
var->transp.offset = 0;
var->transp.length = 0;
+ var->nonstd = FB_NONSTD_REV_PIX_IN_B;
break;
case 16: /* RGB 565 */
var->red.offset = 11;
@@ -822,6 +857,7 @@ static int fb_check_var(struct fb_var_screeninfo *var,
var->blue.length = 5;
var->transp.offset = 0;
var->transp.length = 0;
+ var->nonstd = 0;
break;
default:
err = -EINVAL;
--
1.7.1
^ permalink raw reply related
* [PATCH v2 1/2] fbdev: da8xx:: fix reporting of the display timing info
From: Anatolij Gustschin @ 2012-03-13 13:13 UTC (permalink / raw)
To: linux-fbdev
Timing info is not properly reported by the driver, e.g.:
$ fbset -i
mode "480x272-35"
# D: 7.895 MHz, H: 12.165 kHz, V: 35.158 Hz
geometry 480 272 480 544 16
timings 126666 64 64 32 32 41 10
According to the timing values defined for LK043T1DG01 display
it should be reported as:
mode "480x272-53"
# D: 7.895 MHz, H: 15.038 kHz, V: 52.579 Hz
geometry 480 272 480 544 16
timings 126666 2 2 2 2 41 10
Initialize additional fb_var_screeninfo fields so fix this problem.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Manjunathappa, Prakash <prakash.pm@ti.com>
---
v2:
- removed pixclock setting as it is already done in fbdev-next
- rebased on fbdev-next branch
drivers/video/da8xx-fb.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index dd80386..8f7e051 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1231,6 +1231,10 @@ static int __devinit fb_probe(struct platform_device *device)
da8xx_fb_var.hsync_len = lcdc_info->hsw;
da8xx_fb_var.vsync_len = lcdc_info->vsw;
+ da8xx_fb_var.right_margin = lcdc_info->hfp;
+ da8xx_fb_var.left_margin = lcdc_info->hbp;
+ da8xx_fb_var.lower_margin = lcdc_info->vfp;
+ da8xx_fb_var.upper_margin = lcdc_info->vbp;
da8xx_fb_var.pixclock = da8xxfb_pixel_clk_period(par);
/* Initialize fbinfo */
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] Added backlight driver for Acer Aspire 4736
From: Matthew Garrett @ 2012-03-13 12:47 UTC (permalink / raw)
To: Pradeep Subrahmanion
Cc: rpurdie, FlorianSchandinat, akpm, linux-fbdev, linux-kernel
In-Reply-To: <1331640592.3485.50.camel@debian.Gayathri>
On Tue, Mar 13, 2012 at 08:09:52AM -0400, Pradeep Subrahmanion wrote:
> Before taking this approach , I had a look at the WMI interface.But I found from acer-acpi site that , the 4730 series
> is using new WMI interface which needs to be reverse engineered.
> As far as acpi interface is concerned , by default it is not at all causing any change in brightness.
> When 'acpi_osi=Linux' was added to the boot grub config , the brightness control with hot key started to work .
> But it was not changing to correct values. Increasing brightness after maximum level gives blank screen.
That page was last updated in 2009. Have you tried the current acer-wmi
code? You'd probably need to pass backlight=vendor if there's a
non-working ACPI interface.
When you say the ACPI interface doesn't work, what do you mean? Have you
tried using the /sys/class/backlight interface directly?
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply
* Re: [PATCH v2] OMAPDSS: provide default timings functions for panels
From: Archit Taneja @ 2012-03-13 12:25 UTC (permalink / raw)
To: Grazvydas Ignotas, Tomi Valkeinen; +Cc: linux-fbdev, linux-omap
In-Reply-To: <1331551631-11420-1-git-send-email-notasas@gmail.com>
On Monday 12 March 2012 04:57 PM, Grazvydas Ignotas wrote:
> With this we can eliminate some duplicate code in panel drivers.
> Also lgphilips-lb035q02, nec-nl8048hl11-01b, picodlp and
> tpo-td043mtea1 gain support of timings control over sysfs.
>
> Signed-off-by: Grazvydas Ignotas<notasas@gmail.com>
> ---
> drivers/video/omap2/displays/panel-acx565akm.c | 15 -------------
> drivers/video/omap2/displays/panel-generic-dpi.c | 22 -------------------
> drivers/video/omap2/displays/panel-n8x0.c | 8 -------
> drivers/video/omap2/displays/panel-taal.c | 8 -------
> drivers/video/omap2/dss/core.c | 6 +++++
> drivers/video/omap2/dss/display.c | 25 ++++++++++++++++++++++
> drivers/video/omap2/dss/venc.c | 7 ------
> include/video/omapdss.h | 6 +++++
> 8 files changed, 37 insertions(+), 60 deletions(-)
>
> diff --git a/drivers/video/omap2/displays/panel-acx565akm.c b/drivers/video/omap2/displays/panel-acx565akm.c
> index dbd59b8..be83eed 100644
> --- a/drivers/video/omap2/displays/panel-acx565akm.c
> +++ b/drivers/video/omap2/displays/panel-acx565akm.c
> @@ -738,19 +738,6 @@ static void acx_panel_set_timings(struct omap_dss_device *dssdev,
> }
> }
>
> -static void acx_panel_get_timings(struct omap_dss_device *dssdev,
> - struct omap_video_timings *timings)
> -{
> - *timings = dssdev->panel.timings;
> -}
> -
> -static int acx_panel_check_timings(struct omap_dss_device *dssdev,
> - struct omap_video_timings *timings)
> -{
> - return 0;
> -}
> -
> -
> static struct omap_dss_driver acx_panel_driver = {
> .probe = acx_panel_probe,
> .remove = acx_panel_remove,
> @@ -761,8 +748,6 @@ static struct omap_dss_driver acx_panel_driver = {
> .resume = acx_panel_resume,
>
> .set_timings = acx_panel_set_timings,
> - .get_timings = acx_panel_get_timings,
> - .check_timings = acx_panel_check_timings,
>
> .get_recommended_bpp = acx_get_recommended_bpp,
>
> diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
> index 519c47d..45a46af 100644
> --- a/drivers/video/omap2/displays/panel-generic-dpi.c
> +++ b/drivers/video/omap2/displays/panel-generic-dpi.c
> @@ -454,24 +454,6 @@ static int generic_dpi_panel_resume(struct omap_dss_device *dssdev)
> return 0;
> }
>
> -static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev,
> - struct omap_video_timings *timings)
> -{
> - dpi_set_timings(dssdev, timings);
> -}
> -
> -static void generic_dpi_panel_get_timings(struct omap_dss_device *dssdev,
> - struct omap_video_timings *timings)
> -{
> - *timings = dssdev->panel.timings;
> -}
> -
> -static int generic_dpi_panel_check_timings(struct omap_dss_device *dssdev,
> - struct omap_video_timings *timings)
> -{
> - return dpi_check_timings(dssdev, timings);
> -}
> -
> static struct omap_dss_driver dpi_driver = {
> .probe = generic_dpi_panel_probe,
> .remove = __exit_p(generic_dpi_panel_remove),
> @@ -481,10 +463,6 @@ static struct omap_dss_driver dpi_driver = {
> .suspend = generic_dpi_panel_suspend,
> .resume = generic_dpi_panel_resume,
>
> - .set_timings = generic_dpi_panel_set_timings,
> - .get_timings = generic_dpi_panel_get_timings,
> - .check_timings = generic_dpi_panel_check_timings,
> -
> .driver = {
> .name = "generic_dpi_panel",
> .owner = THIS_MODULE,
> diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c
> index 150e8ba..eba98a0 100644
> --- a/drivers/video/omap2/displays/panel-n8x0.c
> +++ b/drivers/video/omap2/displays/panel-n8x0.c
> @@ -610,12 +610,6 @@ static int n8x0_panel_resume(struct omap_dss_device *dssdev)
> return 0;
> }
>
> -static void n8x0_panel_get_timings(struct omap_dss_device *dssdev,
> - struct omap_video_timings *timings)
> -{
> - *timings = dssdev->panel.timings;
> -}
> -
> static void n8x0_panel_get_resolution(struct omap_dss_device *dssdev,
> u16 *xres, u16 *yres)
> {
> @@ -678,8 +672,6 @@ static struct omap_dss_driver n8x0_panel_driver = {
> .get_resolution = n8x0_panel_get_resolution,
> .get_recommended_bpp = omapdss_default_get_recommended_bpp,
>
> - .get_timings = n8x0_panel_get_timings,
> -
> .driver = {
> .name = "n8x0_panel",
> .owner = THIS_MODULE,
> diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
> index 80c3f6a..174c004 100644
> --- a/drivers/video/omap2/displays/panel-taal.c
> +++ b/drivers/video/omap2/displays/panel-taal.c
> @@ -583,12 +583,6 @@ static const struct backlight_ops taal_bl_ops = {
> .update_status = taal_bl_update_status,
> };
>
> -static void taal_get_timings(struct omap_dss_device *dssdev,
> - struct omap_video_timings *timings)
> -{
> - *timings = dssdev->panel.timings;
> -}
> -
> static void taal_get_resolution(struct omap_dss_device *dssdev,
> u16 *xres, u16 *yres)
> {
> @@ -1899,8 +1893,6 @@ static struct omap_dss_driver taal_driver = {
> .run_test = taal_run_test,
> .memory_read = taal_memory_read,
>
> - .get_timings = taal_get_timings,
> -
> .driver = {
> .name = "taal",
> .owner = THIS_MODULE,
> diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
> index 86ec12e..9dc0c10 100644
> --- a/drivers/video/omap2/dss/core.c
> +++ b/drivers/video/omap2/dss/core.c
> @@ -434,6 +434,12 @@ int omap_dss_register_driver(struct omap_dss_driver *dssdriver)
> if (dssdriver->get_recommended_bpp = NULL)
> dssdriver->get_recommended_bpp > omapdss_default_get_recommended_bpp;
> + if (dssdriver->set_timings = NULL)
> + dssdriver->set_timings = omapdss_default_set_timings;
> + if (dssdriver->get_timings = NULL)
> + dssdriver->get_timings = omapdss_default_get_timings;
> + if (dssdriver->check_timings = NULL)
> + dssdriver->check_timings = omapdss_default_check_timings;
>
> return driver_register(&dssdriver->driver);
> }
> diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
> index be331dc..0d724a4 100644
> --- a/drivers/video/omap2/dss/display.c
> +++ b/drivers/video/omap2/dss/display.c
> @@ -318,6 +318,31 @@ int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev)
> }
> EXPORT_SYMBOL(omapdss_default_get_recommended_bpp);
>
> +void omapdss_default_set_timings(struct omap_dss_device *dssdev,
> + struct omap_video_timings *timings)
> +{
> + if (dssdev->type = OMAP_DISPLAY_TYPE_DPI)
> + dpi_set_timings(dssdev, timings);
> +}
> +EXPORT_SYMBOL(omapdss_default_set_timings);
> +
> +void omapdss_default_get_timings(struct omap_dss_device *dssdev,
> + struct omap_video_timings *timings)
> +{
> + *timings = dssdev->panel.timings;
> +}
> +EXPORT_SYMBOL(omapdss_default_get_timings);
> +
> +int omapdss_default_check_timings(struct omap_dss_device *dssdev,
> + struct omap_video_timings *timings)
> +{
> + if (dssdev->type = OMAP_DISPLAY_TYPE_DPI)
> + return dpi_check_timings(dssdev, timings);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(omapdss_default_check_timings);
This looks fine to me. We could add check/set timings for other
interfaces, if needed. Ack from me. Tomi needs to have a look at it.
Archit
> +
> /* Checks if replication logic should be used. Only use for active matrix,
> * when overlay is in RGB12U or RGB16 mode, and LCD interface is
> * 18bpp or 24bpp */
> diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
> index 7bb6219..dee2ec4 100644
> --- a/drivers/video/omap2/dss/venc.c
> +++ b/drivers/video/omap2/dss/venc.c
> @@ -557,12 +557,6 @@ static int venc_panel_resume(struct omap_dss_device *dssdev)
> return venc_panel_enable(dssdev);
> }
>
> -static void venc_get_timings(struct omap_dss_device *dssdev,
> - struct omap_video_timings *timings)
> -{
> - *timings = dssdev->panel.timings;
> -}
> -
> static void venc_set_timings(struct omap_dss_device *dssdev,
> struct omap_video_timings *timings)
> {
> @@ -641,7 +635,6 @@ static struct omap_dss_driver venc_driver = {
> .get_resolution = omapdss_default_get_resolution,
> .get_recommended_bpp = omapdss_default_get_recommended_bpp,
>
> - .get_timings = venc_get_timings,
> .set_timings = venc_set_timings,
> .check_timings = venc_check_timings,
>
> diff --git a/include/video/omapdss.h b/include/video/omapdss.h
> index 378c7ed..ff1dacd 100644
> --- a/include/video/omapdss.h
> +++ b/include/video/omapdss.h
> @@ -646,6 +646,12 @@ struct omap_overlay *omap_dss_get_overlay(int num);
> void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
> u16 *xres, u16 *yres);
> int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
> +void omapdss_default_set_timings(struct omap_dss_device *dssdev,
> + struct omap_video_timings *timings);
> +void omapdss_default_get_timings(struct omap_dss_device *dssdev,
> + struct omap_video_timings *timings);
> +int omapdss_default_check_timings(struct omap_dss_device *dssdev,
> + struct omap_video_timings *timings);
>
> typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
> int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
^ permalink raw reply
* Re: [PATCH v2 3/3] ARM: Samsung: Rework platform data of s3c-fb driver
From: Thomas Abraham @ 2012-03-13 10:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <002f01cd00fe$5df84fa0$19e8eee0$%han@samsung.com>
On 13 March 2012 15:17, Jingoo Han <jg1.han@samsung.com> wrote:
>> -----Original Message-----
>> From: Thomas Abraham [mailto:thomas.abraham@linaro.org]
>> Sent: Tuesday, March 13, 2012 6:00 AM
>> To: linux-fbdev@vger.kernel.org
>> Cc: FlorianSchandinat@gmx.de; linux-arm-kernel@lists.infradead.org; linux-samsung-soc@vger.kernel.org;
>> kgene.kim@samsung.com; jg1.han@samsung.com; ben-linux@fluff.org; patches@linaro.org; Kyungmin Park;
>> JeongHyeon Kim; Heiko Stuebner; Kwangwoo Lee; Mark Brown; Peter Korsgaard; Darius Augulis; Maurus
>> Cuelenaere
>> Subject: [PATCH v2 3/3] ARM: Samsung: Rework platform data of s3c-fb driver
>>
>> For all the Samsung SoC based boards which have the platform data for
>> s3c-fb driver, the 'default_win' element in the platform data is removed
>> and the lcd panel video timing values are moved out of individual window
>> configuration data.
>>
>> Cc: Jingoo Han <jg1.han@samsung.com>
>> Cc: Kyungmin Park <kyungmin.park@samsung.com>
>> Cc: JeongHyeon Kim <jhkim@insignal.co.kr>
>> Cc: Kukjin Kim <kgene.kim@samsung.com>
>> Cc: Heiko Stuebner <heiko@sntech.de>
>> Cc: Ben Dooks <ben-linux@fluff.org>
>> Cc: Kwangwoo Lee <kwangwoo.lee@gmail.com>
>> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
>> Cc: Peter Korsgaard <jacmet@sunsite.dk>
>> Cc: Darius Augulis <augulis.darius@gmail.com>
>> Cc: Maurus Cuelenaere <mcuelenaere@gmail.com>
>> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
>> ---
>> arch/arm/mach-exynos/mach-nuri.c | 26 ++++++++++-------
>> arch/arm/mach-exynos/mach-origen.c | 24 ++++++++++-------
>> arch/arm/mach-exynos/mach-smdkv310.c | 28 +++++++++++--------
>> arch/arm/mach-exynos/mach-universal_c210.c | 26 ++++++++++-------
>> arch/arm/mach-s3c24xx/mach-smdk2416.c | 27 ++++++++++--------
>> arch/arm/mach-s3c64xx/mach-anw6410.c | 25 ++++++++++-------
>> arch/arm/mach-s3c64xx/mach-crag6410.c | 25 ++++++++++-------
>> arch/arm/mach-s3c64xx/mach-hmt.c | 24 ++++++++++-------
>> arch/arm/mach-s3c64xx/mach-mini6410.c | 40 ++++++++++++---------------
>> arch/arm/mach-s3c64xx/mach-real6410.c | 40 ++++++++++++---------------
>> arch/arm/mach-s3c64xx/mach-smartq5.c | 26 ++++++++++-------
>> arch/arm/mach-s3c64xx/mach-smartq7.c | 26 ++++++++++-------
>> arch/arm/mach-s3c64xx/mach-smdk6410.c | 25 ++++++++++-------
>> arch/arm/mach-s5p64x0/mach-smdk6440.c | 24 ++++++++++-------
>> arch/arm/mach-s5p64x0/mach-smdk6450.c | 24 ++++++++++-------
>> arch/arm/mach-s5pc100/mach-smdkc100.c | 27 ++++++++++--------
>> arch/arm/mach-s5pv210/mach-aquila.c | 36 +++++++++++--------------
>> arch/arm/mach-s5pv210/mach-goni.c | 26 ++++++++++-------
>> arch/arm/mach-s5pv210/mach-smdkv210.c | 24 ++++++++++-------
>> 19 files changed, 285 insertions(+), 238 deletions(-)
>>
>
> [.....]
>
>> diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
>> index c34c2ab..24dcdc9 100644
>> --- a/arch/arm/mach-s3c64xx/mach-mini6410.c
>> +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
>> @@ -153,36 +153,32 @@ static struct s3c2410_platform_nand mini6410_nand_info = {
>>
>> static struct s3c_fb_pd_win mini6410_fb_win[] = {
>> {
>> - .win_mode = { /* 4.3" 480x272 */
>> - .left_margin = 3,
>> - .right_margin = 2,
>> - .upper_margin = 1,
>> - .lower_margin = 1,
>> - .hsync_len = 40,
>> - .vsync_len = 1,
>> - .xres = 480,
>> - .yres = 272,
>> - },
>> .max_bpp = 32,
>> .default_bpp = 16,
>> + .xres = 480,
>> + .yres = 272,
>> }, {
>> - .win_mode = { /* 7.0" 800x480 */
>> - .left_margin = 8,
>> - .right_margin = 13,
>> - .upper_margin = 7,
>> - .lower_margin = 5,
>> - .hsync_len = 3,
>> - .vsync_len = 1,
>> - .xres = 800,
>> - .yres = 480,
>> - },
>> .max_bpp = 32,
>> .default_bpp = 16,
>> + .xres = 800,
>> + .yres = 480,
>> },
>> };
>>
>> +static struct fb_videomode mini6410_lcd_timing = {
>> + .left_margin = 8,
>> + .right_margin = 13,
>> + .upper_margin = 7,
>> + .lower_margin = 5,
>> + .hsync_len = 3,
>> + .vsync_len = 1,
>> + .xres = 800,
>> + .yres = 480,
>> +};
>> +
>> static struct s3c_fb_platdata mini6410_lcd_pdata __initdata = {
>> .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
>> + .vtiming = &mini6410_lcd_timing,
>> .win[0] = &mini6410_fb_win[0],
>> .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
>> .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
>> @@ -310,8 +306,8 @@ static void __init mini6410_machine_init(void)
>> mini6410_lcd_pdata.win[0] = &mini6410_fb_win[features.lcd_index];
>>
>> printk(KERN_INFO "MINI6410: selected LCD display is %dx%d\n",
>> - mini6410_lcd_pdata.win[0]->win_mode.xres,
>> - mini6410_lcd_pdata.win[0]->win_mode.yres);
>> + mini6410_lcd_pdata.win[0]->xres,
>> + mini6410_lcd_pdata.win[0]->yres);
>>
>> s3c_nand_set_platdata(&mini6410_nand_info);
>> s3c_fb_set_platdata(&mini6410_lcd_pdata);
>> diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
>> index be2a9a2..41e4f74 100644
>> --- a/arch/arm/mach-s3c64xx/mach-real6410.c
>> +++ b/arch/arm/mach-s3c64xx/mach-real6410.c
>> @@ -119,36 +119,32 @@ static struct platform_device real6410_device_eth = {
>>
>> static struct s3c_fb_pd_win real6410_fb_win[] = {
>> {
>> - .win_mode = { /* 4.3" 480x272 */
>> - .left_margin = 3,
>> - .right_margin = 2,
>> - .upper_margin = 1,
>> - .lower_margin = 1,
>> - .hsync_len = 40,
>> - .vsync_len = 1,
>> - .xres = 480,
>> - .yres = 272,
>> - },
>> .max_bpp = 32,
>> .default_bpp = 16,
>> + .xres = 480,
>> + .yres = 272,
>> }, {
>> - .win_mode = { /* 7.0" 800x480 */
>> - .left_margin = 8,
>> - .right_margin = 13,
>> - .upper_margin = 7,
>> - .lower_margin = 5,
>> - .hsync_len = 3,
>> - .vsync_len = 1,
>> - .xres = 800,
>> - .yres = 480,
>> - },
>> .max_bpp = 32,
>> .default_bpp = 16,
>> + .xres = 800,
>> + .yres = 480,
>> },
>> };
>>
>> +static struct fb_videomode real6410_lcd_timing = {
>> + .left_margin = 3,
>> + .right_margin = 2,
>> + .upper_margin = 1,
>> + .lower_margin = 1,
>> + .hsync_len = 40,
>> + .vsync_len = 1,
>> + .xres = 800,
>> + .yres = 480,
>> +};
>
>
> What is the difference between mini6410_lcd_timing and real6410_lcd_timing?
> In my opinion, it would be good as follows:
>
> +static struct fb_videomode real6410_lcd_timing = {
> + .left_margin = 8,
> + .right_margin = 13,
> + .upper_margin = 7,
> + .lower_margin = 5,
> + .hsync_len = 3,
> + .vsync_len = 1,
> + .xres = 800,
> + .yres = 480,
> +};
>
>
Before this patch series, both real6410 and mini6410 had 'default_win'
= 0 in the platform data. And, the s3c-fb driver selected the video
timing from the window selected by the default_win parameter in s3c-fb
platform data, i.e window 0 for both mini6440 and real6410. So, in
this patch, while moving the timing values out of window data, the
timing values for window 0 was selected.
The timing value for window 1 was never used on mini6410 and real6410.
So I would suggest to use timing value of window 0 in this patch.
Thanks for your comments.
Regards,
Thomas.
^ permalink raw reply
* RE: [PATCH v2 3/3] ARM: Samsung: Rework platform data of s3c-fb driver
From: Jingoo Han @ 2012-03-13 9:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1331585999-8604-4-git-send-email-thomas.abraham@linaro.org>
> -----Original Message-----
> From: Thomas Abraham [mailto:thomas.abraham@linaro.org]
> Sent: Tuesday, March 13, 2012 6:00 AM
> To: linux-fbdev@vger.kernel.org
> Cc: FlorianSchandinat@gmx.de; linux-arm-kernel@lists.infradead.org; linux-samsung-soc@vger.kernel.org;
> kgene.kim@samsung.com; jg1.han@samsung.com; ben-linux@fluff.org; patches@linaro.org; Kyungmin Park;
> JeongHyeon Kim; Heiko Stuebner; Kwangwoo Lee; Mark Brown; Peter Korsgaard; Darius Augulis; Maurus
> Cuelenaere
> Subject: [PATCH v2 3/3] ARM: Samsung: Rework platform data of s3c-fb driver
>
> For all the Samsung SoC based boards which have the platform data for
> s3c-fb driver, the 'default_win' element in the platform data is removed
> and the lcd panel video timing values are moved out of individual window
> configuration data.
>
> Cc: Jingoo Han <jg1.han@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: JeongHyeon Kim <jhkim@insignal.co.kr>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Kwangwoo Lee <kwangwoo.lee@gmail.com>
> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Cc: Peter Korsgaard <jacmet@sunsite.dk>
> Cc: Darius Augulis <augulis.darius@gmail.com>
> Cc: Maurus Cuelenaere <mcuelenaere@gmail.com>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> arch/arm/mach-exynos/mach-nuri.c | 26 ++++++++++-------
> arch/arm/mach-exynos/mach-origen.c | 24 ++++++++++-------
> arch/arm/mach-exynos/mach-smdkv310.c | 28 +++++++++++--------
> arch/arm/mach-exynos/mach-universal_c210.c | 26 ++++++++++-------
> arch/arm/mach-s3c24xx/mach-smdk2416.c | 27 ++++++++++--------
> arch/arm/mach-s3c64xx/mach-anw6410.c | 25 ++++++++++-------
> arch/arm/mach-s3c64xx/mach-crag6410.c | 25 ++++++++++-------
> arch/arm/mach-s3c64xx/mach-hmt.c | 24 ++++++++++-------
> arch/arm/mach-s3c64xx/mach-mini6410.c | 40 ++++++++++++---------------
> arch/arm/mach-s3c64xx/mach-real6410.c | 40 ++++++++++++---------------
> arch/arm/mach-s3c64xx/mach-smartq5.c | 26 ++++++++++-------
> arch/arm/mach-s3c64xx/mach-smartq7.c | 26 ++++++++++-------
> arch/arm/mach-s3c64xx/mach-smdk6410.c | 25 ++++++++++-------
> arch/arm/mach-s5p64x0/mach-smdk6440.c | 24 ++++++++++-------
> arch/arm/mach-s5p64x0/mach-smdk6450.c | 24 ++++++++++-------
> arch/arm/mach-s5pc100/mach-smdkc100.c | 27 ++++++++++--------
> arch/arm/mach-s5pv210/mach-aquila.c | 36 +++++++++++--------------
> arch/arm/mach-s5pv210/mach-goni.c | 26 ++++++++++-------
> arch/arm/mach-s5pv210/mach-smdkv210.c | 24 ++++++++++-------
> 19 files changed, 285 insertions(+), 238 deletions(-)
>
[.....]
> diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
> index c34c2ab..24dcdc9 100644
> --- a/arch/arm/mach-s3c64xx/mach-mini6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
> @@ -153,36 +153,32 @@ static struct s3c2410_platform_nand mini6410_nand_info = {
>
> static struct s3c_fb_pd_win mini6410_fb_win[] = {
> {
> - .win_mode = { /* 4.3" 480x272 */
> - .left_margin = 3,
> - .right_margin = 2,
> - .upper_margin = 1,
> - .lower_margin = 1,
> - .hsync_len = 40,
> - .vsync_len = 1,
> - .xres = 480,
> - .yres = 272,
> - },
> .max_bpp = 32,
> .default_bpp = 16,
> + .xres = 480,
> + .yres = 272,
> }, {
> - .win_mode = { /* 7.0" 800x480 */
> - .left_margin = 8,
> - .right_margin = 13,
> - .upper_margin = 7,
> - .lower_margin = 5,
> - .hsync_len = 3,
> - .vsync_len = 1,
> - .xres = 800,
> - .yres = 480,
> - },
> .max_bpp = 32,
> .default_bpp = 16,
> + .xres = 800,
> + .yres = 480,
> },
> };
>
> +static struct fb_videomode mini6410_lcd_timing = {
> + .left_margin = 8,
> + .right_margin = 13,
> + .upper_margin = 7,
> + .lower_margin = 5,
> + .hsync_len = 3,
> + .vsync_len = 1,
> + .xres = 800,
> + .yres = 480,
> +};
> +
> static struct s3c_fb_platdata mini6410_lcd_pdata __initdata = {
> .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
> + .vtiming = &mini6410_lcd_timing,
> .win[0] = &mini6410_fb_win[0],
> .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
> .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
> @@ -310,8 +306,8 @@ static void __init mini6410_machine_init(void)
> mini6410_lcd_pdata.win[0] = &mini6410_fb_win[features.lcd_index];
>
> printk(KERN_INFO "MINI6410: selected LCD display is %dx%d\n",
> - mini6410_lcd_pdata.win[0]->win_mode.xres,
> - mini6410_lcd_pdata.win[0]->win_mode.yres);
> + mini6410_lcd_pdata.win[0]->xres,
> + mini6410_lcd_pdata.win[0]->yres);
>
> s3c_nand_set_platdata(&mini6410_nand_info);
> s3c_fb_set_platdata(&mini6410_lcd_pdata);
> diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
> index be2a9a2..41e4f74 100644
> --- a/arch/arm/mach-s3c64xx/mach-real6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-real6410.c
> @@ -119,36 +119,32 @@ static struct platform_device real6410_device_eth = {
>
> static struct s3c_fb_pd_win real6410_fb_win[] = {
> {
> - .win_mode = { /* 4.3" 480x272 */
> - .left_margin = 3,
> - .right_margin = 2,
> - .upper_margin = 1,
> - .lower_margin = 1,
> - .hsync_len = 40,
> - .vsync_len = 1,
> - .xres = 480,
> - .yres = 272,
> - },
> .max_bpp = 32,
> .default_bpp = 16,
> + .xres = 480,
> + .yres = 272,
> }, {
> - .win_mode = { /* 7.0" 800x480 */
> - .left_margin = 8,
> - .right_margin = 13,
> - .upper_margin = 7,
> - .lower_margin = 5,
> - .hsync_len = 3,
> - .vsync_len = 1,
> - .xres = 800,
> - .yres = 480,
> - },
> .max_bpp = 32,
> .default_bpp = 16,
> + .xres = 800,
> + .yres = 480,
> },
> };
>
> +static struct fb_videomode real6410_lcd_timing = {
> + .left_margin = 3,
> + .right_margin = 2,
> + .upper_margin = 1,
> + .lower_margin = 1,
> + .hsync_len = 40,
> + .vsync_len = 1,
> + .xres = 800,
> + .yres = 480,
> +};
What is the difference between mini6410_lcd_timing and real6410_lcd_timing?
In my opinion, it would be good as follows:
+static struct fb_videomode real6410_lcd_timing = {
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
+};
> +
> static struct s3c_fb_platdata real6410_lcd_pdata __initdata = {
> .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
> + .vtiming = &real6410_lcd_timing,
> .win[0] = &real6410_fb_win[0],
> .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
> .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
> @@ -291,8 +287,8 @@ static void __init real6410_machine_init(void)
> real6410_lcd_pdata.win[0] = &real6410_fb_win[features.lcd_index];
>
> printk(KERN_INFO "REAL6410: selected LCD display is %dx%d\n",
> - real6410_lcd_pdata.win[0]->win_mode.xres,
> - real6410_lcd_pdata.win[0]->win_mode.yres);
> + real6410_lcd_pdata.win[0]->xres,
> + real6410_lcd_pdata.win[0]->yres);
>
> s3c_fb_set_platdata(&real6410_lcd_pdata);
> s3c_nand_set_platdata(&real6410_nand_info);
[.....]
^ permalink raw reply
* Re: [PATCH 1/2] fbdev: da8xx:: fix reporting of the display timing info
From: Anatolij Gustschin @ 2012-03-13 9:42 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1331305336-32644-2-git-send-email-agust@denx.de>
Hi,
On Mon, 12 Mar 2012 05:19:54 +0000
"Manjunathappa, Prakash" <prakash.pm@ti.com> wrote:
...
> > +static inline unsigned long hz_to_ps(unsigned long hz_val)
> > +{
> > + unsigned long long num = 1000000000000ULL;
> > +
> > + do_div(num, hz_val);
> > + return (unsigned long)num;
> > +}
> > +
>
> I have patch to take care of this:
>
> http://davinci-linux-open-source.1494791.n2.nabble.com/PATCH-v2-video-da8xx-fb-calculate-pixel-clock-period-for-the-panel-tt7268377.html#none
Okay, thanks for the info! I'll rebase my patches and then resubmit.
Thanks,
Anatolij
^ permalink raw reply
* [PATCH v3 2/3] video: s3c-fb: remove 'default_win' element from platform data
From: Jingoo Han @ 2012-03-13 9:34 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1331585999-8604-3-git-send-email-thomas.abraham@linaro.org>
From: Thomas Abraham <thomas.abraham@linaro.org>
The decision to enable or disable the data output to the lcd panel from
the controller need not be based on the value of 'default_win' element
in the platform data. Instead, the data output to the panel is enabled
if any of the windows are active, else data output is disabled.
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
v3: fix some minor coding styles
arch/arm/plat-samsung/include/plat/fb.h | 3 ---
drivers/video/s3c-fb.c | 24 +++++-------------------
2 files changed, 5 insertions(+), 22 deletions(-)
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index 39d6bd7..b885322 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -43,7 +43,6 @@ struct s3c_fb_pd_win {
* @setup_gpio: Setup the external GPIO pins to the right state to transfer
* the data from the display system to the connected display
* device.
- * @default_win: default window layer number to be used for UI layer.
* @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.
@@ -62,8 +61,6 @@ struct s3c_fb_platdata {
struct s3c_fb_pd_win *win[S3C_FB_MAX_WIN];
struct fb_videomode *vtiming;
- u32 default_win;
-
u32 vidcon0;
u32 vidcon1;
};
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index c94f40d..dd816fb 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -531,7 +531,7 @@ static int s3c_fb_set_par(struct fb_info *info)
/* disable the window whilst we update it */
writel(0, regs + WINCON(win_no));
- if (win_no = sfb->pdata->default_win)
+ if (!sfb->output_on)
s3c_fb_enable(sfb, 1);
/* write the buffer address */
@@ -799,6 +799,7 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
struct s3c_fb *sfb = win->parent;
unsigned int index = win->index;
u32 wincon;
+ u32 output_on = sfb->output_on;
dev_dbg(sfb->dev, "blank mode %d\n", blank_mode);
@@ -844,27 +845,12 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
* it is highly likely that we also do not need to output
* anything.
*/
-
- /* We could do something like the following code, but the current
- * system of using framebuffer events means that we cannot make
- * the distinction between just window 0 being inactive and all
- * the windows being down.
- *
- * s3c_fb_enable(sfb, sfb->enabled ? 1 : 0);
- */
-
- /* we're stuck with this until we can do something about overriding
- * the power control using the blanking event for a single fb.
- */
- if (index = sfb->pdata->default_win) {
- shadow_protect_win(win, 1);
- s3c_fb_enable(sfb, blank_mode != FB_BLANK_POWERDOWN ? 1 : 0);
- shadow_protect_win(win, 0);
- }
+ s3c_fb_enable(sfb, sfb->enabled ? 1 : 0);
+ shadow_protect_win(win, 0);
pm_runtime_put_sync(sfb->dev);
- return 0;
+ return output_on = sfb->output_on;
}
/**
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] Added backlight driver for Acer Aspire 4736
From: joeyli @ 2012-03-13 4:35 UTC (permalink / raw)
To: Pradeep Subrahmanion
Cc: rpurdie, linux-kernel, linux-fbdev, Florian Tobias Schandinat
In-Reply-To: <1331644360.3319.6.camel@debian.Gayathri>
Hi Pradeep,
I think the following command doesn't work to you:
echo 5 > /sys/class/backlight/acpi_video0/brightness
It the above command not work, that means EC didn't change backlight
value:
Method (_BCM, 1, NotSerialized)
{
Divide (Arg0, 0x0A, Local0, Local1)
Decrement (Local1)
Store (Local1, ^^^^LPC.EC0.BRTS) <== write backlight value to EC register
}
Per my understood, EC firmware should change brightness but didn't do that, another
way is touch i915 register in _BCM.
Acer machine provide a broken _BCM implementation and they didn't test it.
Thanks a lot!
Joey Lee
於 二,2012-03-13 於 09:12 -0400,Pradeep Subrahmanion 提到:
> Hi Joey,
>
> yes , /sys/class/backlight/intel_backlight exists . I tried giving
> acpi_backlight=vendor in grub config.Hot keys works like earlier.But
> increasing brightness after maximum levels give blank screen(like
> earlier).
>
> I have attached acpidump.
>
> ----
> Thanks ,
>
> Pradeep Subrahmanion
>
> On Tue, 2012-03-13 at 11:10 +0800, joeyli wrote:
> > Hi Pradeep,
> >
> > 於 日,2012-03-11 於 19:42 +0000,Florian Tobias Schandinat 提到:
> > > Hi,
> > >
> > > On 03/11/2012 06:21 PM, Pradeep Subrahmanion wrote:
> > > > Hi ,
> > > >
> > > > Brightness control was not working on Acer Aspire 4736 using
> > > > default ACPI interface. acer-acpi also do not support 4730 series since
> > > > it uses new WMI interface.
> > > > This driver adds brightness control by accessing the LBB PCI
> > > > configuration register. This approach may also work on other laptops in
> > > > 4730 series .But currently , it is only tested for
> > > > Aspire 4736.
> > > >
> >
> > Pleae check does there have following interface?
> >
> > /sys/class/backlight/intel_backlight
> >
> > And,
> > did you try kernel parameter "acpi_backlight=vendor", does it work to
> > you?
> >
> > Please attach acpidump: acpidump > acpidump.dat
> >
> >
> > Thanks
> > Joey Lee
> >
> > > > From 893031c1e9bdefd9642b98825062b5df98af0d77 Mon Sep 17 00:00:00 2001
> > > > From: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > > > <mailto:subrahmanion.pradeep@gmail.com>>
> > > > Date: Sun, 11 Mar 2012 23:11:23 -0400
> > > > Subject: [PATCH] Added backlight driver for Acer Aspire 4736
> > > >
> > >
> > > the commit message should be here, I think.
> > >
> > > >
> > > > Signed-off-by: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > > > <mailto:subrahmanion.pradeep@gmail.com>>
> > >
> > > Please resend this email in the correct format: As you can see in my
> > > email the text version of your patch is severely screwed up and nobody
> > > wants to even try converting a HTML format to a proper patch again,
> > > probably most people won't even receive an email that has a HTML part as
> > > their spam filter are going to handle it as spam. git send-email will
> > > take care of it for you if you configure it for your account.
> > > You should also cc Andrew Morton <akpm@linux-foundation.org> as he's the
> > > one who handles backlight patches at the moment.
> > >
> > >
> > > Best regards,
> > >
> > > Florian Tobias Schandinat
> > >
> > > > ---
> > > > drivers/video/backlight/acer4736_bl.c | 110
> > > > +++++++++++++++++++++++++++++++++
> > > > 1 files changed, 110 insertions(+), 0 deletions(-)
> > > > create mode 100644 drivers/video/backlight/acer4736_bl.c
> > > >
> > > > diff --git a/drivers/video/backlight/acer4736_bl.c
> > > > b/drivers/video/backlight/acer4736_bl.c
> > > > new file mode 100644
> > > > index 0000000..6fe2937
> > > > --- /dev/null
> > > > +++ b/drivers/video/backlight/acer4736_bl.c
> > > > @@ -0,0 +1,110 @@
> > > > +/*
> > > > + * Backlight driver for Acer Aspire 4736
> > > > + *
> > > > + * Copyright (C) Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > > > <mailto:subrahmanion.pradeep@gmail.com>>
> > > > + *
> > > > + * This program is free software; you can redistribute it and/or modify
> > > > + * it under the terms of the GNU General Public License version 2 as
> > > > + * published by the Free Software Foundation.
> > > > + *
> > > > + * This driver uses LBB PCI configuration register to change the
> > > > + * backlight brightness.
> > > > + *
> > > > + */
> > > > +
> > > > +#include <linux/module.h>
> > > > +#include <linux/kernel.h>
> > > > +#include <linux/init.h>
> > > > +#include <linux/backlight.h>
> > > > +#include <linux/err.h>
> > > > +#include <linux/dmi.h>
> > > > +#include <linux/io.h>
> > > > +#include <linux/pci.h>
> > > > +
> > > > +static u8 max_brightness = 0xFF;
> > > > +static u8 lbb_offset = 0xF4;
> > > > +static unsigned int device_id = 0x2a42;
> > > > +static unsigned int vendor_id = 0x8086;
> > > > +
> > > > +struct backlight_device *acer_backlight_device;
> > > > +struct pci_dev *pdev;
> > > > +
> > > > +static int acer_dmi_match(const struct dmi_system_id *id)
> > > > +{
> > > > + printk(KERN_INFO "acer4736_bl: %s detected\n", id->ident);
> > > > + return 1;
> > > > +}
> > > > +
> > > > +static const struct dmi_system_id __initdata acer_device_table[] = {
> > > > +{
> > > > + .callback = acer_dmi_match,
> > > > + .ident = "Aspire 4736",
> > > > + .matches = {
> > > > + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> > > > + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 4736"),
> > > > + },
> > > > + },
> > > > + {}
> > > > +};
> > > > +static int read_brightness(struct backlight_device *bd)
> > > > +{
> > > > + u8 result;
> > > > + pci_read_config_byte(pdev, lbb_offset, &result);
> > > > + return result;
> > > > +}
> > > > +
> > > > +static int update_brightness(struct backlight_device *bd)
> > > > +{
> > > > + u8 intensity = bd->props.brightness;
> > > > + if (intensity > max_brightness) {
> > > > + printk(KERN_INFO "Acer4736_bl: Invalid parameter. Maximum value is %d"
> > > > + , max_brightness);
> > > > + return -1;
> > > > + }
> > > > + pci_write_config_byte(pdev, lbb_offset, intensity);
> > > > + return 0;
> > > > +}
> > > > +static const struct backlight_ops acer_backlight_ops = {
> > > > + .get_brightness = read_brightness,
> > > > + .update_status = update_brightness,
> > > > +};
> > > > +
> > > > +static int __init acer4736_bl_init(void)
> > > > +{
> > > > + struct backlight_properties props;
> > > > + if (!dmi_check_system(acer_device_table))
> > > > + return -ENODEV;
> > > > +
> > > > + pdev = pci_get_device(vendor_id, device_id, NULL);
> > > > +
> > > > + if (!pdev)
> > > > + return -ENODEV;
> > > > +
> > > > + printk(KERN_INFO "Loading Acer 4736 backlight driver\n");
> > > > + memset(&props, 0, sizeof(struct backlight_properties));
> > > > + props.type = BACKLIGHT_RAW;
> > > > + props.max_brightness = max_brightness;
> > > > +
> > > > + acer_backlight_device = backlight_device_register("acer_backlight",
> > > > + NULL, NULL, &acer_backlight_ops, &props);
> > > > + acer_backlight_device->props.max_brightness = max_brightness;
> > > > + acer_backlight_device->props.brightness > > > > + read_brightness(acer_backlight_device);
> > > > + backlight_update_status(acer_backlight_device);
> > > > +
> > > > + return 0;
> > > > +}
> > > > +
> > > > +static void __exit acer4736_bl_exit(void)
> > > > +{
> > > > + pci_dev_put(pdev);
> > > > + backlight_device_unregister(acer_backlight_device);
> > > > +}
> > > > +
> > > > +module_init(acer4736_bl_init);
> > > > +module_exit(acer4736_bl_exit);
> > > > +
> > > > +MODULE_AUTHOR("Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > > > <mailto:subrahmanion.pradeep@gmail.com>>");
> > > > +MODULE_DESCRIPTION("Acer Aspire 4736 Backlight Driver");
> > > > +MODULE_LICENSE("GPL");
> > > > +MODULE_DEVICE_TABLE(dmi, acer_device_table);
> > > > --
> > > > 1.7.2.5
> > > >
> > > > -------------
> > > >
> > > > Pradeep Subrahmanion
> > >
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > > Please read the FAQ at http://www.tux.org/lkml/
> > >
> >
> >
>
^ permalink raw reply
* Re: [PATCH] Added backlight driver for Acer Aspire 4736
From: joeyli @ 2012-03-13 3:10 UTC (permalink / raw)
To: Pradeep Subrahmanion
Cc: rpurdie, linux-kernel, linux-fbdev, Florian Tobias Schandinat
In-Reply-To: <4F5D000E.8040104@gmx.de>
Hi Pradeep,
於 日,2012-03-11 於 19:42 +0000,Florian Tobias Schandinat 提到:
> Hi,
>
> On 03/11/2012 06:21 PM, Pradeep Subrahmanion wrote:
> > Hi ,
> >
> > Brightness control was not working on Acer Aspire 4736 using
> > default ACPI interface. acer-acpi also do not support 4730 series since
> > it uses new WMI interface.
> > This driver adds brightness control by accessing the LBB PCI
> > configuration register. This approach may also work on other laptops in
> > 4730 series .But currently , it is only tested for
> > Aspire 4736.
> >
Pleae check does there have following interface?
/sys/class/backlight/intel_backlight
And,
did you try kernel parameter "acpi_backlight=vendor", does it work to
you?
Please attach acpidump: acpidump > acpidump.dat
Thanks
Joey Lee
> > From 893031c1e9bdefd9642b98825062b5df98af0d77 Mon Sep 17 00:00:00 2001
> > From: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > <mailto:subrahmanion.pradeep@gmail.com>>
> > Date: Sun, 11 Mar 2012 23:11:23 -0400
> > Subject: [PATCH] Added backlight driver for Acer Aspire 4736
> >
>
> the commit message should be here, I think.
>
> >
> > Signed-off-by: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > <mailto:subrahmanion.pradeep@gmail.com>>
>
> Please resend this email in the correct format: As you can see in my
> email the text version of your patch is severely screwed up and nobody
> wants to even try converting a HTML format to a proper patch again,
> probably most people won't even receive an email that has a HTML part as
> their spam filter are going to handle it as spam. git send-email will
> take care of it for you if you configure it for your account.
> You should also cc Andrew Morton <akpm@linux-foundation.org> as he's the
> one who handles backlight patches at the moment.
>
>
> Best regards,
>
> Florian Tobias Schandinat
>
> > ---
> > drivers/video/backlight/acer4736_bl.c | 110
> > +++++++++++++++++++++++++++++++++
> > 1 files changed, 110 insertions(+), 0 deletions(-)
> > create mode 100644 drivers/video/backlight/acer4736_bl.c
> >
> > diff --git a/drivers/video/backlight/acer4736_bl.c
> > b/drivers/video/backlight/acer4736_bl.c
> > new file mode 100644
> > index 0000000..6fe2937
> > --- /dev/null
> > +++ b/drivers/video/backlight/acer4736_bl.c
> > @@ -0,0 +1,110 @@
> > +/*
> > + * Backlight driver for Acer Aspire 4736
> > + *
> > + * Copyright (C) Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > <mailto:subrahmanion.pradeep@gmail.com>>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + *
> > + * This driver uses LBB PCI configuration register to change the
> > + * backlight brightness.
> > + *
> > + */
> > +
> > +#include <linux/module.h>
> > +#include <linux/kernel.h>
> > +#include <linux/init.h>
> > +#include <linux/backlight.h>
> > +#include <linux/err.h>
> > +#include <linux/dmi.h>
> > +#include <linux/io.h>
> > +#include <linux/pci.h>
> > +
> > +static u8 max_brightness = 0xFF;
> > +static u8 lbb_offset = 0xF4;
> > +static unsigned int device_id = 0x2a42;
> > +static unsigned int vendor_id = 0x8086;
> > +
> > +struct backlight_device *acer_backlight_device;
> > +struct pci_dev *pdev;
> > +
> > +static int acer_dmi_match(const struct dmi_system_id *id)
> > +{
> > + printk(KERN_INFO "acer4736_bl: %s detected\n", id->ident);
> > + return 1;
> > +}
> > +
> > +static const struct dmi_system_id __initdata acer_device_table[] = {
> > +{
> > + .callback = acer_dmi_match,
> > + .ident = "Aspire 4736",
> > + .matches = {
> > + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> > + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 4736"),
> > + },
> > + },
> > + {}
> > +};
> > +static int read_brightness(struct backlight_device *bd)
> > +{
> > + u8 result;
> > + pci_read_config_byte(pdev, lbb_offset, &result);
> > + return result;
> > +}
> > +
> > +static int update_brightness(struct backlight_device *bd)
> > +{
> > + u8 intensity = bd->props.brightness;
> > + if (intensity > max_brightness) {
> > + printk(KERN_INFO "Acer4736_bl: Invalid parameter. Maximum value is %d"
> > + , max_brightness);
> > + return -1;
> > + }
> > + pci_write_config_byte(pdev, lbb_offset, intensity);
> > + return 0;
> > +}
> > +static const struct backlight_ops acer_backlight_ops = {
> > + .get_brightness = read_brightness,
> > + .update_status = update_brightness,
> > +};
> > +
> > +static int __init acer4736_bl_init(void)
> > +{
> > + struct backlight_properties props;
> > + if (!dmi_check_system(acer_device_table))
> > + return -ENODEV;
> > +
> > + pdev = pci_get_device(vendor_id, device_id, NULL);
> > +
> > + if (!pdev)
> > + return -ENODEV;
> > +
> > + printk(KERN_INFO "Loading Acer 4736 backlight driver\n");
> > + memset(&props, 0, sizeof(struct backlight_properties));
> > + props.type = BACKLIGHT_RAW;
> > + props.max_brightness = max_brightness;
> > +
> > + acer_backlight_device = backlight_device_register("acer_backlight",
> > + NULL, NULL, &acer_backlight_ops, &props);
> > + acer_backlight_device->props.max_brightness = max_brightness;
> > + acer_backlight_device->props.brightness > > + read_brightness(acer_backlight_device);
> > + backlight_update_status(acer_backlight_device);
> > +
> > + return 0;
> > +}
> > +
> > +static void __exit acer4736_bl_exit(void)
> > +{
> > + pci_dev_put(pdev);
> > + backlight_device_unregister(acer_backlight_device);
> > +}
> > +
> > +module_init(acer4736_bl_init);
> > +module_exit(acer4736_bl_exit);
> > +
> > +MODULE_AUTHOR("Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > <mailto:subrahmanion.pradeep@gmail.com>>");
> > +MODULE_DESCRIPTION("Acer Aspire 4736 Backlight Driver");
> > +MODULE_LICENSE("GPL");
> > +MODULE_DEVICE_TABLE(dmi, acer_device_table);
> > --
> > 1.7.2.5
> >
> > -------------
> >
> > Pradeep Subrahmanion
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply
* Re: [PATCH] Added backlight driver for Acer Aspire 4736
From: Joe Perches @ 2012-03-12 23:07 UTC (permalink / raw)
To: Pradeep Subrahmanion
Cc: rpurdie, FlorianSchandinat, akpm, linux-fbdev, linux-kernel
In-Reply-To: <1331608337.2267.67.camel@debian.Gayathri>
On Mon, 2012-03-12 at 23:12 -0400, Pradeep Subrahmanion wrote:
> Hi ,
Hello yourself.
Just some trivial comments:
> diff --git a/drivers/video/backlight/acer4736_bl.c b/drivers/video/backlight/acer4736_bl.c
[]
Please add
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
before any include
> +static int update_brightness(struct backlight_device *bd)
> +{
> + u8 intensity = bd->props.brightness;
> + if (intensity > max_brightness) {
> + printk(KERN_INFO "Acer4736_bl: Invalid parameter. Maximum value is %d"
> + , max_brightness);
Beginning a line with a comma is not at all common and
should be avoided. printks need newline terminations,
and this would be better as pr_info. Maybe:
pr_info("Invalid parameter %u: Maximum allowed value: %u\n",
intensity, max_brightness);
> + printk(KERN_INFO "Loading Acer 4736 backlight driver\n");
pr_info("Loading backlight driver\n");
^ permalink raw reply
* [PULL for v3.4] SH mobile LCDC cleanups and fixes
From: Laurent Pinchart @ 2012-03-12 21:48 UTC (permalink / raw)
To: linux-fbdev
Hi Florian,
Here's the next round of SH mobile LCDC and MERAM cleanups and fixes based on
top of your fbdev-next branch (as of right now). All the patches have been
posted to the list and I've incorporated acked-by and tested-by lines when
available.
The following changes since commit c2bc0a756b1f98bd712fabe78eb49d7d5ae72075:
video:uvesafb: notice user when we failed to save hardware state (2012-03-08
18:13:10 +0000)
are available in the git repository at:
git://linuxtv.org/pinchartl/fbdev.git for-next
Laurent Pinchart (55):
fbdev: sh_mobile_lcdc: Reorder code into sections
fbdev: sh_mobile_lcdc: Mark init-only symbols with __devinit(const)
fbdev: sh_mobile_lcdc: Move pm runtime enable to probe()
fbdev: sh_mobile_lcdc: Don't pass struct device around
fbdev: sh_mobile_lcdc: Create functions to turn the display on/off
fbdev: sh_mobile_hdmi: Don't access LCDC channel in notifier callback
sh_mobile_hdmi: Remove platform data lcd_dev field
fbdev: sh_mobile_lcdc: Add sh_mobile_lcdc_entity definition
fbdev: sh_mobile_hdmi: Implement sh_mobile_lcdc_entity interface
fbdev: sh_mipi_dsi: Implement sh_mobile_lcdc_entity interface
fbdev: sh_mobile_lcdc: Handle HDMI/MIPI transmitter device directly
arm: mach-shmobile: Add LCDC tx_dev field to platform data
fbdev: sh_mipi_dsi: Don't hook up into board_cfg display operations
fbdev: sh_mobile_hdmi: Don't hook up into board_cfg display operations
arm: mach-shmobile: Don't initialize the hdmi_info lcd_chan field
fbdev: sh_mobile_hdmi: Remove sh_mobile_hdmi_info lcd_chan field
fbdev: sh_mobile_lcdc: Remove board configuration owner field
fbdev: sh_mobile_lcdc: Remove board configuration board_data field
fbdev: sh_mobile_lcdc: Move brightness ops to sh_mobile_lcdc_bl_info
fbdev: sh_mobile_lcdc: Merge board_cfg and lcd_size_cfg into panel_cfg
sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity
sh_mobile_hdmi: Use sh_mobile_lcdc_entity::channel to access fb_info
fbdev: sh_mobile_lcdc: Remove fb_info parameter to display_on operation
fbdev: sh_mobile_lcdc: Return display connection state in display_on
sh_mobile_lcdc: Add display notify callback to sh_mobile_lcdc_chan
sh_mobile_hdmi: Use LCDC notification callback
fbdev: sh_mobile_lcdc: Pass a video mode to the notify callback
fbdev: sh_mobile_hdmi: Don't set sh_hdmi::mode in the display on handler
fbdev: sh_mobile_hdmi: Don't access LCDC fb_info
fbdev: sh_mobile_lcdc: Store display mode in a struct fb_videomode
fbdev: sh_mobile_lcdc: Rename (lcd|num)_cfg (lcd|num)_modes
fbdev: sh_mobile_lcdc: Reorganize the sh_mobile_lcdc_chan structure
fbdev: sh_mobile_lcdc: Add sh_mobile_format_info() function
fbdev: sh_mobile_lcdc: Store the format in struct sh_mobile_lcdc_chan
fbdev: sh_mobile_lcdc: Split fb init/cleanup from channel init/cleanup
fbdev: sh_mobile_lcdc: Pass physical device pointer to DMA functions
fbdev: sh_mobile_lcdc: Store configuration in channel structure
fbdev: sh_mobile_lcdc: Pass channel pointer to sh_mobile_wait_for_vsync
arm: mach-shmobile: Split MERAM resources into regs and meram
fbdev: sh_mobile_meram: Request memory regions for memory resources
fbdev: sh_mobile_meram: Add _cfg suffix to struct sh_mobile_meram_icb
fbdev: sh_mobile_meram: Make variables unsigned where applicable
fbdev: sh_mobile_meram: Make current_reg field store the current reg set
fbdev: sh_mobile_meram: Add struct sh_mobile_meram_icb
fbdev: sh_mobile_meram: Don't inline everything
fbdev: sh_mobile_meram: Divide the code into sections
fbdev: sh_mobile_meram: Use genalloc to manage MERAM allocation
fbdev: sh_mobile_meram: Allocate ICBs automatically
arm: mach-shmobile: Don't set MERAM ICB numbers in platform data
fbdev: sh_mobile_meram: Remove unused sh_mobile_meram_icb_cfg fields
fbdev: sh_mobile_lcdc: Don't store copy of platform data
arm: mach-shmobile: Constify sh_mobile_meram_cfg structures
fbdev: sh_mobile_meram: Don't perform update in register operation
fbdev: sh_mobile_meram: Remove unneeded sanity checks
fbdev: sh_mobile_meram: Implement system suspend/resume
arch/arm/mach-shmobile/board-ag5evm.c | 24 +-
arch/arm/mach-shmobile/board-ap4evb.c | 290 +++---
arch/arm/mach-shmobile/board-bonito.c | 6 +-
arch/arm/mach-shmobile/board-mackerel.c | 106 +--
arch/sh/boards/mach-ap325rxa/setup.c | 22 +-
arch/sh/boards/mach-ecovec24/setup.c | 20 +-
arch/sh/boards/mach-kfr2r09/lcd_wqvga.c | 10 +-
arch/sh/boards/mach-kfr2r09/setup.c | 8 +-
arch/sh/boards/mach-migor/lcd_qvga.c | 3 +-
arch/sh/boards/mach-migor/setup.c | 16 +-
arch/sh/boards/mach-se/7724/setup.c | 12 +-
arch/sh/include/mach-kfr2r09/mach/kfr2r09.h | 16 +-
arch/sh/include/mach-migor/mach/migor.h | 2 +-
drivers/video/Kconfig | 1 +
drivers/video/sh_mipi_dsi.c | 97 +--
drivers/video/sh_mobile_hdmi.c | 297 ++-----
drivers/video/sh_mobile_lcdcfb.c | 1298 +++++++++++++++-----------
drivers/video/sh_mobile_lcdcfb.h | 84 ++-
drivers/video/sh_mobile_meram.c | 690 ++++++++-------
include/video/sh_mobile_hdmi.h | 2 -
include/video/sh_mobile_lcdc.h | 35 +-
include/video/sh_mobile_meram.h | 45 +-
22 files changed, 1594 insertions(+), 1490 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply
* [PATCH v2 3/3] ARM: Samsung: Rework platform data of s3c-fb driver
From: Thomas Abraham @ 2012-03-12 20:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1331585999-8604-1-git-send-email-thomas.abraham@linaro.org>
For all the Samsung SoC based boards which have the platform data for
s3c-fb driver, the 'default_win' element in the platform data is removed
and the lcd panel video timing values are moved out of individual window
configuration data.
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: JeongHyeon Kim <jhkim@insignal.co.kr>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kwangwoo Lee <kwangwoo.lee@gmail.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Darius Augulis <augulis.darius@gmail.com>
Cc: Maurus Cuelenaere <mcuelenaere@gmail.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
arch/arm/mach-exynos/mach-nuri.c | 26 ++++++++++-------
arch/arm/mach-exynos/mach-origen.c | 24 ++++++++++-------
arch/arm/mach-exynos/mach-smdkv310.c | 28 +++++++++++--------
arch/arm/mach-exynos/mach-universal_c210.c | 26 ++++++++++-------
arch/arm/mach-s3c24xx/mach-smdk2416.c | 27 ++++++++++--------
arch/arm/mach-s3c64xx/mach-anw6410.c | 25 ++++++++++-------
arch/arm/mach-s3c64xx/mach-crag6410.c | 25 ++++++++++-------
arch/arm/mach-s3c64xx/mach-hmt.c | 24 ++++++++++-------
arch/arm/mach-s3c64xx/mach-mini6410.c | 40 ++++++++++++---------------
arch/arm/mach-s3c64xx/mach-real6410.c | 40 ++++++++++++---------------
arch/arm/mach-s3c64xx/mach-smartq5.c | 26 ++++++++++-------
arch/arm/mach-s3c64xx/mach-smartq7.c | 26 ++++++++++-------
arch/arm/mach-s3c64xx/mach-smdk6410.c | 25 ++++++++++-------
arch/arm/mach-s5p64x0/mach-smdk6440.c | 24 ++++++++++-------
arch/arm/mach-s5p64x0/mach-smdk6450.c | 24 ++++++++++-------
arch/arm/mach-s5pc100/mach-smdkc100.c | 27 ++++++++++--------
arch/arm/mach-s5pv210/mach-aquila.c | 36 +++++++++++--------------
arch/arm/mach-s5pv210/mach-goni.c | 26 ++++++++++-------
arch/arm/mach-s5pv210/mach-smdkv210.c | 24 ++++++++++-------
19 files changed, 285 insertions(+), 238 deletions(-)
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 7ac81ce..a7e6731 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -212,25 +212,29 @@ static struct platform_device nuri_gpio_keys = {
/* Frame Buffer */
static struct s3c_fb_pd_win nuri_fb_win0 = {
- .win_mode = {
- .left_margin = 64,
- .right_margin = 16,
- .upper_margin = 64,
- .lower_margin = 1,
- .hsync_len = 48,
- .vsync_len = 3,
- .xres = 1024,
- .yres = 600,
- .refresh = 60,
- },
.max_bpp = 24,
.default_bpp = 16,
+ .xres = 1024,
+ .yres = 600,
.virtual_x = 1024,
.virtual_y = 2 * 600,
};
+static struct fb_videomode nuri_lcd_timing = {
+ .left_margin = 64,
+ .right_margin = 16,
+ .upper_margin = 64,
+ .lower_margin = 1,
+ .hsync_len = 48,
+ .vsync_len = 3,
+ .xres = 1024,
+ .yres = 600,
+ .refresh = 60,
+};
+
static struct s3c_fb_platdata nuri_fb_pdata __initdata = {
.win[0] = &nuri_fb_win0,
+ .vtiming = &nuri_lcd_timing,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
VIDCON0_CLKSEL_LCD,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index 25c9b46..de71237 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -583,22 +583,26 @@ static struct platform_device origen_lcd_hv070wsa = {
};
static struct s3c_fb_pd_win origen_fb_win0 = {
- .win_mode = {
- .left_margin = 64,
- .right_margin = 16,
- .upper_margin = 64,
- .lower_margin = 16,
- .hsync_len = 48,
- .vsync_len = 3,
- .xres = 1024,
- .yres = 600,
- },
+ .xres = 1024,
+ .yres = 600,
.max_bpp = 32,
.default_bpp = 24,
};
+static struct fb_videomode origen_lcd_timing = {
+ .left_margin = 64,
+ .right_margin = 16,
+ .upper_margin = 64,
+ .lower_margin = 16,
+ .hsync_len = 48,
+ .vsync_len = 3,
+ .xres = 1024,
+ .yres = 600,
+};
+
static struct s3c_fb_platdata origen_lcd_pdata __initdata = {
.win[0] = &origen_fb_win0,
+ .vtiming = &origen_lcd_timing,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
VIDCON1_INV_VCLK,
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c
index f08529f..6c00fa6 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -157,22 +157,26 @@ static struct platform_device smdkv310_lcd_lte480wv = {
};
static struct s3c_fb_pd_win smdkv310_fb_win0 = {
- .win_mode = {
- .left_margin = 13,
- .right_margin = 8,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- },
- .max_bpp = 32,
- .default_bpp = 24,
+ .max_bpp = 32,
+ .default_bpp = 24,
+ .xres = 800,
+ .yres = 480,
+};
+
+static struct fb_videomode smdkv310_lcd_timing = {
+ .left_margin = 13,
+ .right_margin = 8,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
};
static struct s3c_fb_platdata smdkv310_lcd0_pdata __initdata = {
.win[0] = &smdkv310_fb_win0,
+ .vtiming = &smdkv310_lcd_timing,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
.setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index 57e4418..67a9547 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -813,25 +813,29 @@ static struct i2c_board_info i2c1_devs[] __initdata = {
/* Frame Buffer */
static struct s3c_fb_pd_win universal_fb_win0 = {
- .win_mode = {
- .left_margin = 16,
- .right_margin = 16,
- .upper_margin = 2,
- .lower_margin = 28,
- .hsync_len = 2,
- .vsync_len = 1,
- .xres = 480,
- .yres = 800,
- .refresh = 55,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 480,
+ .yres = 800,
.virtual_x = 480,
.virtual_y = 2 * 800,
};
+static struct fb_videomode universal_lcd_timing = {
+ .left_margin = 16,
+ .right_margin = 16,
+ .upper_margin = 2,
+ .lower_margin = 28,
+ .hsync_len = 2,
+ .vsync_len = 1,
+ .xres = 480,
+ .yres = 800,
+ .refresh = 55,
+};
+
static struct s3c_fb_platdata universal_lcd_pdata __initdata = {
.win[0] = &universal_fb_win0,
+ .vtiming = &universal_lcd_timing,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
VIDCON0_CLKSEL_LCD,
.vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2416.c b/arch/arm/mach-s3c24xx/mach-smdk2416.c
index 30a44f8..c3100a0 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2416.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2416.c
@@ -148,23 +148,25 @@ static struct s3c24xx_hsudc_platdata smdk2416_hsudc_platdata = {
static struct s3c_fb_pd_win smdk2416_fb_win[] = {
[0] = {
- /* think this is the same as the smdk6410 */
- .win_mode = {
- .pixclock = 41094,
- .left_margin = 8,
- .right_margin = 13,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- },
.default_bpp = 16,
.max_bpp = 32,
+ .xres = 800,
+ .yres = 480,
},
};
+static struct fb_videomode smdk2416_lcd_timing = {
+ .pixclock = 41094,
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
+};
+
static void s3c2416_fb_gpio_setup_24bpp(void)
{
unsigned int gpio;
@@ -187,6 +189,7 @@ static void s3c2416_fb_gpio_setup_24bpp(void)
static struct s3c_fb_platdata smdk2416_fb_platdata = {
.win[0] = &smdk2416_fb_win[0],
+ .vtiming = &smdk2416_lcd_timing,
.setup_gpio = s3c2416_fb_gpio_setup_24bpp,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index b86f277..58fd0e3 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -134,24 +134,27 @@ static struct platform_device anw6410_lcd_powerdev = {
};
static struct s3c_fb_pd_win anw6410_fb_win0 = {
- /* this is to ensure we use win0 */
- .win_mode = {
- .left_margin = 8,
- .right_margin = 13,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 800,
+ .yres = 480,
+};
+
+static struct fb_videomode anw6410_lcd_timing = {
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
};
/* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */
static struct s3c_fb_platdata anw6410_lcd_pdata __initdata = {
.setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
+ .vtiming = &anw6410_lcd_timing,
.win[0] = &anw6410_fb_win0,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index e20bf58..c1ef57e 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -151,26 +151,29 @@ static struct platform_device crag6410_lcd_powerdev = {
/* 640x480 URT */
static struct s3c_fb_pd_win crag6410_fb_win0 = {
- /* this is to ensure we use win0 */
- .win_mode = {
- .left_margin = 150,
- .right_margin = 80,
- .upper_margin = 40,
- .lower_margin = 5,
- .hsync_len = 40,
- .vsync_len = 5,
- .xres = 640,
- .yres = 480,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 640,
+ .yres = 480,
.virtual_y = 480 * 2,
.virtual_x = 640,
};
+static struct fb_videomode crag6410_lcd_timing = {
+ .left_margin = 150,
+ .right_margin = 80,
+ .upper_margin = 40,
+ .lower_margin = 5,
+ .hsync_len = 40,
+ .vsync_len = 5,
+ .xres = 640,
+ .yres = 480,
+};
+
/* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */
static struct s3c_fb_platdata crag6410_lcd_pdata __initdata = {
.setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
+ .vtiming = &crag6410_lcd_timing,
.win[0] = &crag6410_fb_win0,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 521e07b..4e9b1ac 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -129,23 +129,27 @@ static struct platform_device hmt_backlight_device = {
};
static struct s3c_fb_pd_win hmt_fb_win0 = {
- .win_mode = {
- .left_margin = 8,
- .right_margin = 13,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 800,
+ .yres = 480,
+};
+
+static struct fb_videomode hmt_lcd_timing = {
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
};
/* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */
static struct s3c_fb_platdata hmt_lcd_pdata __initdata = {
.setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
+ .vtiming = &hmt_lcd_timing,
.win[0] = &hmt_fb_win0,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index c34c2ab..24dcdc9 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -153,36 +153,32 @@ static struct s3c2410_platform_nand mini6410_nand_info = {
static struct s3c_fb_pd_win mini6410_fb_win[] = {
{
- .win_mode = { /* 4.3" 480x272 */
- .left_margin = 3,
- .right_margin = 2,
- .upper_margin = 1,
- .lower_margin = 1,
- .hsync_len = 40,
- .vsync_len = 1,
- .xres = 480,
- .yres = 272,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 480,
+ .yres = 272,
}, {
- .win_mode = { /* 7.0" 800x480 */
- .left_margin = 8,
- .right_margin = 13,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 800,
+ .yres = 480,
},
};
+static struct fb_videomode mini6410_lcd_timing = {
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
+};
+
static struct s3c_fb_platdata mini6410_lcd_pdata __initdata = {
.setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
+ .vtiming = &mini6410_lcd_timing,
.win[0] = &mini6410_fb_win[0],
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
@@ -310,8 +306,8 @@ static void __init mini6410_machine_init(void)
mini6410_lcd_pdata.win[0] = &mini6410_fb_win[features.lcd_index];
printk(KERN_INFO "MINI6410: selected LCD display is %dx%d\n",
- mini6410_lcd_pdata.win[0]->win_mode.xres,
- mini6410_lcd_pdata.win[0]->win_mode.yres);
+ mini6410_lcd_pdata.win[0]->xres,
+ mini6410_lcd_pdata.win[0]->yres);
s3c_nand_set_platdata(&mini6410_nand_info);
s3c_fb_set_platdata(&mini6410_lcd_pdata);
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index be2a9a2..41e4f74 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -119,36 +119,32 @@ static struct platform_device real6410_device_eth = {
static struct s3c_fb_pd_win real6410_fb_win[] = {
{
- .win_mode = { /* 4.3" 480x272 */
- .left_margin = 3,
- .right_margin = 2,
- .upper_margin = 1,
- .lower_margin = 1,
- .hsync_len = 40,
- .vsync_len = 1,
- .xres = 480,
- .yres = 272,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 480,
+ .yres = 272,
}, {
- .win_mode = { /* 7.0" 800x480 */
- .left_margin = 8,
- .right_margin = 13,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 800,
+ .yres = 480,
},
};
+static struct fb_videomode real6410_lcd_timing = {
+ .left_margin = 3,
+ .right_margin = 2,
+ .upper_margin = 1,
+ .lower_margin = 1,
+ .hsync_len = 40,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
+};
+
static struct s3c_fb_platdata real6410_lcd_pdata __initdata = {
.setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
+ .vtiming = &real6410_lcd_timing,
.win[0] = &real6410_fb_win[0],
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
@@ -291,8 +287,8 @@ static void __init real6410_machine_init(void)
real6410_lcd_pdata.win[0] = &real6410_fb_win[features.lcd_index];
printk(KERN_INFO "REAL6410: selected LCD display is %dx%d\n",
- real6410_lcd_pdata.win[0]->win_mode.xres,
- real6410_lcd_pdata.win[0]->win_mode.yres);
+ real6410_lcd_pdata.win[0]->xres,
+ real6410_lcd_pdata.win[0]->yres);
s3c_fb_set_platdata(&real6410_lcd_pdata);
s3c_nand_set_platdata(&real6410_nand_info);
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index 3f42431..03a2f88 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -108,23 +108,27 @@ static struct platform_device smartq5_buttons_device = {
};
static struct s3c_fb_pd_win smartq5_fb_win0 = {
- .win_mode = {
- .left_margin = 216,
- .right_margin = 40,
- .upper_margin = 35,
- .lower_margin = 10,
- .hsync_len = 1,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- .refresh = 80,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 800,
+ .yres = 480,
+};
+
+static struct fb_videomode smartq5_lcd_timing = {
+ .left_margin = 216,
+ .right_margin = 40,
+ .upper_margin = 35,
+ .lower_margin = 10,
+ .hsync_len = 1,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
+ .refresh = 80,
};
static struct s3c_fb_platdata smartq5_lcd_pdata __initdata = {
.setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
+ .vtiming = &smartq5_lcd_timing,
.win[0] = &smartq5_fb_win0,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index e5c09b6..4e3b038 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -124,23 +124,27 @@ static struct platform_device smartq7_buttons_device = {
};
static struct s3c_fb_pd_win smartq7_fb_win0 = {
- .win_mode = {
- .left_margin = 3,
- .right_margin = 5,
- .upper_margin = 1,
- .lower_margin = 20,
- .hsync_len = 10,
- .vsync_len = 3,
- .xres = 800,
- .yres = 480,
- .refresh = 80,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 800,
+ .yres = 480,
+};
+
+static struct fb_videomode smartq7_lcd_timing = {
+ .left_margin = 3,
+ .right_margin = 5,
+ .upper_margin = 1,
+ .lower_margin = 20,
+ .hsync_len = 10,
+ .vsync_len = 3,
+ .xres = 800,
+ .yres = 480,
+ .refresh = 80,
};
static struct s3c_fb_platdata smartq7_lcd_pdata __initdata = {
.setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
+ .vtiming = &smartq7_lcd_timing,
.win[0] = &smartq7_fb_win0,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index d55bc96..3cfc90f 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -146,26 +146,29 @@ static struct platform_device smdk6410_lcd_powerdev = {
};
static struct s3c_fb_pd_win smdk6410_fb_win0 = {
- /* this is to ensure we use win0 */
- .win_mode = {
- .left_margin = 8,
- .right_margin = 13,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 800,
+ .yres = 480,
.virtual_y = 480 * 2,
.virtual_x = 800,
};
+static struct fb_videomode smdk6410_lcd_timing = {
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
+};
+
/* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */
static struct s3c_fb_platdata smdk6410_lcd_pdata __initdata = {
.setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
+ .vtiming = &smdk6410_lcd_timing,
.win[0] = &smdk6410_fb_win0,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index a40e325..92fefad 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -103,22 +103,26 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
/* Frame Buffer */
static struct s3c_fb_pd_win smdk6440_fb_win0 = {
- .win_mode = {
- .left_margin = 8,
- .right_margin = 13,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- },
.max_bpp = 32,
.default_bpp = 24,
+ .xres = 800,
+ .yres = 480,
+};
+
+static struct fb_videomode smdk6440_lcd_timing = {
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
};
static struct s3c_fb_platdata smdk6440_lcd_pdata __initdata = {
.win[0] = &smdk6440_fb_win0,
+ .vtiming = &smdk6440_lcd_timing,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
.setup_gpio = s5p64x0_fb_gpio_setup_24bpp,
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index efb69e2..e2335ec 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -121,22 +121,26 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = {
/* Frame Buffer */
static struct s3c_fb_pd_win smdk6450_fb_win0 = {
- .win_mode = {
- .left_margin = 8,
- .right_margin = 13,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- },
.max_bpp = 32,
.default_bpp = 24,
+ .xres = 800,
+ .yres = 480,
+};
+
+static struct fb_videomode smdk6450_lcd_timing = {
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
};
static struct s3c_fb_platdata smdk6450_lcd_pdata __initdata = {
.win[0] = &smdk6450_fb_win0,
+ .vtiming = &smdk6450_lcd_timing,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
.setup_gpio = s5p64x0_fb_gpio_setup_24bpp,
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 674d229..0c3ae38 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -136,24 +136,27 @@ static struct platform_device smdkc100_lcd_powerdev = {
/* Frame Buffer */
static struct s3c_fb_pd_win smdkc100_fb_win0 = {
- /* this is to ensure we use win0 */
- .win_mode = {
- .left_margin = 8,
- .right_margin = 13,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- .refresh = 80,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 800,
+ .yres = 480,
+};
+
+static struct fb_videomode smdkc100_lcd_timing = {
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
+ .refresh = 80,
};
static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = {
.win[0] = &smdkc100_fb_win0,
+ .vtiming = &smdkc100_lcd_timing,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
.setup_gpio = s5pc100_fb_gpio_setup_24bpp,
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index a9ea64e..7b91bbf 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -96,38 +96,34 @@ static struct s3c2410_uartcfg aquila_uartcfgs[] __initdata = {
/* Frame Buffer */
static struct s3c_fb_pd_win aquila_fb_win0 = {
- .win_mode = {
- .left_margin = 16,
- .right_margin = 16,
- .upper_margin = 3,
- .lower_margin = 28,
- .hsync_len = 2,
- .vsync_len = 2,
- .xres = 480,
- .yres = 800,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 480,
+ .yres = 800,
};
static struct s3c_fb_pd_win aquila_fb_win1 = {
- .win_mode = {
- .left_margin = 16,
- .right_margin = 16,
- .upper_margin = 3,
- .lower_margin = 28,
- .hsync_len = 2,
- .vsync_len = 2,
- .xres = 480,
- .yres = 800,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 480,
+ .yres = 800,
+};
+
+static struct fb_videomode aquila_lcd_timing = {
+ .left_margin = 16,
+ .right_margin = 16,
+ .upper_margin = 3,
+ .lower_margin = 28,
+ .hsync_len = 2,
+ .vsync_len = 2,
+ .xres = 480,
+ .yres = 800,
};
static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
.win[0] = &aquila_fb_win0,
.win[1] = &aquila_fb_win1,
+ .vtiming = &aquila_lcd_timing,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index 2cf5ed7..07a840d 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -105,25 +105,29 @@ static struct s3c2410_uartcfg goni_uartcfgs[] __initdata = {
/* Frame Buffer */
static struct s3c_fb_pd_win goni_fb_win0 = {
- .win_mode = {
- .left_margin = 16,
- .right_margin = 16,
- .upper_margin = 2,
- .lower_margin = 28,
- .hsync_len = 2,
- .vsync_len = 1,
- .xres = 480,
- .yres = 800,
- .refresh = 55,
- },
.max_bpp = 32,
.default_bpp = 16,
+ .xres = 480,
+ .yres = 800,
.virtual_x = 480,
.virtual_y = 2 * 800,
};
+static struct fb_videomode goni_lcd_timing = {
+ .left_margin = 16,
+ .right_margin = 16,
+ .upper_margin = 2,
+ .lower_margin = 28,
+ .hsync_len = 2,
+ .vsync_len = 1,
+ .xres = 480,
+ .yres = 800,
+ .refresh = 55,
+};
+
static struct s3c_fb_platdata goni_lcd_pdata __initdata = {
.win[0] = &goni_fb_win0,
+ .vtiming = &goni_lcd_timing,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
VIDCON0_CLKSEL_LCD,
.vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index 91d4ad8..5e0c955 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -189,22 +189,26 @@ static struct platform_device smdkv210_lcd_lte480wv = {
};
static struct s3c_fb_pd_win smdkv210_fb_win0 = {
- .win_mode = {
- .left_margin = 13,
- .right_margin = 8,
- .upper_margin = 7,
- .lower_margin = 5,
- .hsync_len = 3,
- .vsync_len = 1,
- .xres = 800,
- .yres = 480,
- },
.max_bpp = 32,
.default_bpp = 24,
+ .xres = 800,
+ .yres = 480,
+};
+
+static struct fb_videomode smdkv210_lcd_timing = {
+ .left_margin = 13,
+ .right_margin = 8,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
};
static struct s3c_fb_platdata smdkv210_lcd0_pdata __initdata = {
.win[0] = &smdkv210_fb_win0,
+ .vtiming = &smdkv210_lcd_timing,
.vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
.setup_gpio = s5pv210_fb_gpio_setup_24bpp,
--
1.6.6.rc2
^ permalink raw reply related
* [PATCH v2 1/3] video: s3c-fb: move video interface timing out of window setup data
From: Thomas Abraham @ 2012-03-12 20:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1331585999-8604-1-git-send-email-thomas.abraham@linaro.org>
The video interface timing is independent of the window setup data.
The resolution of the window can be smaller than that of the lcd
panel to which the video data is output.
So move the video timing data from the per-window setup data to the
platform specific section in the platform data. This also removes
the restriction that atleast one window should have the same
resolution as that of the panel attached.
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Jingoo Han <jg1.han@samsung.com>
---
arch/arm/plat-samsung/include/plat/fb.h | 9 ++-
drivers/video/s3c-fb.c | 114 +++++++++++++++++--------------
2 files changed, 68 insertions(+), 55 deletions(-)
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index 0fedf47..39d6bd7 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -24,15 +24,16 @@
/**
* struct s3c_fb_pd_win - per window setup data
- * @win_mode: The display parameters to initialise (not for window 0)
+ * @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 {
- struct fb_videomode win_mode;
-
unsigned short default_bpp;
unsigned short max_bpp;
+ unsigned short xres;
+ unsigned short yres;
unsigned short virtual_x;
unsigned short virtual_y;
};
@@ -45,6 +46,7 @@ struct s3c_fb_pd_win {
* @default_win: default window layer number to be used for UI layer.
* @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.
*
@@ -58,6 +60,7 @@ struct s3c_fb_platdata {
void (*setup_gpio)(void);
struct s3c_fb_pd_win *win[S3C_FB_MAX_WIN];
+ struct fb_videomode *vtiming;
u32 default_win;
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index f310516..60d1c12 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -495,7 +495,6 @@ static int s3c_fb_set_par(struct fb_info *info)
u32 alpha = 0;
u32 data;
u32 pagewidth;
- int clkdiv;
dev_dbg(sfb->dev, "setting framebuffer parameters\n");
@@ -532,47 +531,8 @@ static int s3c_fb_set_par(struct fb_info *info)
/* disable the window whilst we update it */
writel(0, regs + WINCON(win_no));
- /* use platform specified window as the basis for the lcd timings */
-
- if (win_no = sfb->pdata->default_win) {
- clkdiv = s3c_fb_calc_pixclk(sfb, var->pixclock);
-
- data = sfb->pdata->vidcon0;
- data &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR);
-
- if (clkdiv > 1)
- data |= VIDCON0_CLKVAL_F(clkdiv-1) | VIDCON0_CLKDIR;
- else
- data &= ~VIDCON0_CLKDIR; /* 1:1 clock */
-
- /* write the timing data to the panel */
-
- if (sfb->variant.is_2443)
- data |= (1 << 5);
-
- writel(data, regs + VIDCON0);
-
- s3c_fb_enable(sfb, 1);
-
- data = VIDTCON0_VBPD(var->upper_margin - 1) |
- VIDTCON0_VFPD(var->lower_margin - 1) |
- VIDTCON0_VSPW(var->vsync_len - 1);
-
- writel(data, regs + sfb->variant.vidtcon);
-
- data = VIDTCON1_HBPD(var->left_margin - 1) |
- VIDTCON1_HFPD(var->right_margin - 1) |
- VIDTCON1_HSPW(var->hsync_len - 1);
-
- /* VIDTCON1 */
- writel(data, regs + sfb->variant.vidtcon + 4);
-
- data = VIDTCON2_LINEVAL(var->yres - 1) |
- VIDTCON2_HOZVAL(var->xres - 1) |
- VIDTCON2_LINEVAL_E(var->yres - 1) |
- VIDTCON2_HOZVAL_E(var->xres - 1);
- writel(data, regs + sfb->variant.vidtcon + 8);
- }
+ if (win_no = sfb->pdata->default_win)
+ s3c_fb_enable(sfb, 1);
/* write the buffer address */
@@ -1144,11 +1104,11 @@ static int __devinit s3c_fb_alloc_memory(struct s3c_fb *sfb,
dev_dbg(sfb->dev, "allocating memory for display\n");
- real_size = windata->win_mode.xres * windata->win_mode.yres;
+ real_size = windata->xres * windata->yres;
virt_size = windata->virtual_x * windata->virtual_y;
dev_dbg(sfb->dev, "real_size=%u (%u.%u), virt_size=%u (%u.%u)\n",
- real_size, windata->win_mode.xres, windata->win_mode.yres,
+ real_size, windata->xres, windata->yres,
virt_size, windata->virtual_x, windata->virtual_y);
size = (real_size > virt_size) ? real_size : virt_size;
@@ -1230,7 +1190,7 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
struct s3c_fb_win **res)
{
struct fb_var_screeninfo *var;
- struct fb_videomode *initmode;
+ struct fb_videomode initmode;
struct s3c_fb_pd_win *windata;
struct s3c_fb_win *win;
struct fb_info *fbinfo;
@@ -1251,11 +1211,11 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
}
windata = sfb->pdata->win[win_no];
- initmode = &windata->win_mode;
+ initmode = *sfb->pdata->vtiming;
WARN_ON(windata->max_bpp = 0);
- WARN_ON(windata->win_mode.xres = 0);
- WARN_ON(windata->win_mode.yres = 0);
+ WARN_ON(windata->xres = 0);
+ WARN_ON(windata->yres = 0);
win = fbinfo->par;
*res = win;
@@ -1294,7 +1254,9 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
}
/* setup the initial video mode from the window */
- fb_videomode_to_var(&fbinfo->var, initmode);
+ initmode.xres = windata->xres;
+ initmode.yres = windata->yres;
+ fb_videomode_to_var(&fbinfo->var, &initmode);
fbinfo->fix.type = FB_TYPE_PACKED_PIXELS;
fbinfo->fix.accel = FB_ACCEL_NONE;
@@ -1339,6 +1301,53 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
}
/**
+ * s3c_fb_set_rgb_timing() - set video timing for rgb interface.
+ * @sfb: The base resources for the hardware.
+ *
+ * Set horizontal and vertical lcd rgb interface timing.
+ */
+static void s3c_fb_set_rgb_timing(struct s3c_fb *sfb)
+{
+ struct fb_videomode *vmode = sfb->pdata->vtiming;
+ void __iomem *regs = sfb->regs;
+ int clkdiv;
+ u32 data;
+
+ if (!vmode->pixclock)
+ s3c_fb_missing_pixclock(vmode);
+
+ clkdiv = s3c_fb_calc_pixclk(sfb, vmode->pixclock);
+
+ data = sfb->pdata->vidcon0;
+ data &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR);
+
+ if (clkdiv > 1)
+ data |= VIDCON0_CLKVAL_F(clkdiv-1) | VIDCON0_CLKDIR;
+ else
+ data &= ~VIDCON0_CLKDIR; /* 1:1 clock */
+
+ if (sfb->variant.is_2443)
+ data |= (1 << 5);
+ writel(data, regs + VIDCON0);
+
+ data = VIDTCON0_VBPD(vmode->upper_margin - 1) |
+ VIDTCON0_VFPD(vmode->lower_margin - 1) |
+ VIDTCON0_VSPW(vmode->vsync_len - 1);
+ writel(data, regs + sfb->variant.vidtcon);
+
+ data = VIDTCON1_HBPD(vmode->left_margin - 1) |
+ VIDTCON1_HFPD(vmode->right_margin - 1) |
+ VIDTCON1_HSPW(vmode->hsync_len - 1);
+ writel(data, regs + sfb->variant.vidtcon + 4);
+
+ data = VIDTCON2_LINEVAL(vmode->yres - 1) |
+ VIDTCON2_HOZVAL(vmode->xres - 1) |
+ VIDTCON2_LINEVAL_E(vmode->yres - 1) |
+ VIDTCON2_HOZVAL_E(vmode->xres - 1);
+ writel(data, regs + sfb->variant.vidtcon + 8);
+}
+
+/**
* s3c_fb_clear_win() - clear hardware window registers.
* @sfb: The base resources for the hardware.
* @win: The window to process.
@@ -1481,15 +1490,14 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
writel(0xffffff, regs + WKEYCON1);
}
+ s3c_fb_set_rgb_timing(sfb);
+
/* we have the register setup, start allocating framebuffers */
for (win = 0; win < fbdrv->variant.nr_windows; win++) {
if (!pd->win[win])
continue;
- if (!pd->win[win]->win_mode.pixclock)
- s3c_fb_missing_pixclock(&pd->win[win]->win_mode);
-
ret = s3c_fb_probe_win(sfb, win, fbdrv->win[win],
&sfb->windows[win]);
if (ret < 0) {
@@ -1623,6 +1631,8 @@ static int s3c_fb_resume(struct device *dev)
shadow_protect_win(win, 0);
}
+ s3c_fb_set_rgb_timing(sfb);
+
/* restore framebuffers */
for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++) {
win = sfb->windows[win_no];
--
1.6.6.rc2
^ permalink raw reply related
* [PATCH v2 2/3] video: s3c-fb: remove 'default_win' element from platform data
From: Thomas Abraham @ 2012-03-12 20:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1331585999-8604-1-git-send-email-thomas.abraham@linaro.org>
The decision to enable or disable the data output to the lcd panel from
the controller need not be based on the value of 'default_win' element
in the platform data. Instead, the data output to the panel is enabled
if any of the windows are active, else data output is disabled.
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
arch/arm/plat-samsung/include/plat/fb.h | 2 --
drivers/video/s3c-fb.c | 28 ++++++----------------------
2 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index 39d6bd7..536002f 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -62,8 +62,6 @@ struct s3c_fb_platdata {
struct s3c_fb_pd_win *win[S3C_FB_MAX_WIN];
struct fb_videomode *vtiming;
- u32 default_win;
-
u32 vidcon0;
u32 vidcon1;
};
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 60d1c12..cfe5113 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -531,8 +531,8 @@ static int s3c_fb_set_par(struct fb_info *info)
/* disable the window whilst we update it */
writel(0, regs + WINCON(win_no));
- if (win_no = sfb->pdata->default_win)
- s3c_fb_enable(sfb, 1);
+ if (!sfb->output_on)
+ s3c_fb_enable(sfb, 1);
/* write the buffer address */
@@ -798,7 +798,7 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
struct s3c_fb_win *win = info->par;
struct s3c_fb *sfb = win->parent;
unsigned int index = win->index;
- u32 wincon;
+ u32 wincon, output_on = sfb->output_on;
dev_dbg(sfb->dev, "blank mode %d\n", blank_mode);
@@ -837,34 +837,18 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
shadow_protect_win(win, 1);
writel(wincon, sfb->regs + sfb->variant.wincon + (index * 4));
- shadow_protect_win(win, 0);
/* Check the enabled state to see if we need to be running the
* main LCD interface, as if there are no active windows then
* it is highly likely that we also do not need to output
* anything.
*/
-
- /* We could do something like the following code, but the current
- * system of using framebuffer events means that we cannot make
- * the distinction between just window 0 being inactive and all
- * the windows being down.
- *
- * s3c_fb_enable(sfb, sfb->enabled ? 1 : 0);
- */
-
- /* we're stuck with this until we can do something about overriding
- * the power control using the blanking event for a single fb.
- */
- if (index = sfb->pdata->default_win) {
- shadow_protect_win(win, 1);
- s3c_fb_enable(sfb, blank_mode != FB_BLANK_POWERDOWN ? 1 : 0);
- shadow_protect_win(win, 0);
- }
+ s3c_fb_enable(sfb, sfb->enabled ? 1 : 0);
+ shadow_protect_win(win, 0);
pm_runtime_put_sync(sfb->dev);
- return 0;
+ return output_on = sfb->output_on;
}
/**
--
1.6.6.rc2
^ permalink raw reply related
* [PATCH v2 0/3] video: s3c-fb: Rearrange the elements in platform data
From: Thomas Abraham @ 2012-03-12 20:56 UTC (permalink / raw)
To: linux-arm-kernel
Changes since v1:
- Includes all changes suggested by Jingoo Han.
- Reworked s3c-fb platform data in all Samsung SoC based board files.
This patchset rearranges the elements in the platform data of the s3c-fb
driver with the intent of adding device tree support to the driver in
subsequent patches.
The first patch moves the video timing information from the individual window
setup data into the platform specific configuration section in the platform
data. The video timing is independent of the window setup. The resolution of
the window could be smaller than that of the lcd panel attached. So the video
timing data is removed from window configuration data.
The second patch removes the need for the 'default_win' element in the
platform data. This element was used to decide whether the video data
output from the controller should be enabled or disabled when the window
specified by 'default_win' is enabled or disabled. With the first patch
removing the need for atleast one window to be of the same resolution as
that of the lcd panel, it is now possible to decide when to enable/disable
the video data output based on the state of each window. If any of the
window is active, the lcd data output is enabled. Otherwise, the lcd data
output is disabled. Hence, the 'default_win' parameter from the platform
data can be removed, which anyways cannot be specified when using
device tree.
For all the Samsung SoC based boards, the third patch reworks the platform
data of the display controller based on the changes introduced in the first
two patches.
This patch series is based on
http://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git [for-next]
with all patches merged from
https://github.com/schandinat/linux-2.6.git [fbdev-next]
and tested one Exynos4210 based Origen board (only compile tested for
other boards)
Thomas Abraham (3):
video: s3c-fb: move video interface timing out of window setup data
video: s3c-fb: remove 'default_win' element from platform data
ARM: Samsung: Rework platform data of s3c-fb driver
arch/arm/mach-exynos/mach-nuri.c | 26 +++---
arch/arm/mach-exynos/mach-origen.c | 24 +++--
arch/arm/mach-exynos/mach-smdkv310.c | 28 ++++---
arch/arm/mach-exynos/mach-universal_c210.c | 26 +++---
arch/arm/mach-s3c24xx/mach-smdk2416.c | 27 +++---
arch/arm/mach-s3c64xx/mach-anw6410.c | 25 +++---
arch/arm/mach-s3c64xx/mach-crag6410.c | 25 +++---
arch/arm/mach-s3c64xx/mach-hmt.c | 24 +++--
arch/arm/mach-s3c64xx/mach-mini6410.c | 40 ++++-----
arch/arm/mach-s3c64xx/mach-real6410.c | 40 ++++-----
arch/arm/mach-s3c64xx/mach-smartq5.c | 26 +++---
arch/arm/mach-s3c64xx/mach-smartq7.c | 26 +++---
arch/arm/mach-s3c64xx/mach-smdk6410.c | 25 +++---
arch/arm/mach-s5p64x0/mach-smdk6440.c | 24 +++--
arch/arm/mach-s5p64x0/mach-smdk6450.c | 24 +++--
arch/arm/mach-s5pc100/mach-smdkc100.c | 27 +++---
arch/arm/mach-s5pv210/mach-aquila.c | 36 ++++----
arch/arm/mach-s5pv210/mach-goni.c | 26 +++---
arch/arm/mach-s5pv210/mach-smdkv210.c | 24 +++--
arch/arm/plat-samsung/include/plat/fb.h | 11 ++-
drivers/video/s3c-fb.c | 136 +++++++++++++---------------
21 files changed, 356 insertions(+), 314 deletions(-)
^ permalink raw reply
* Re: [PATCH] Added backlight driver for Acer Aspire 4736
From: Matthew Garrett @ 2012-03-12 17:51 UTC (permalink / raw)
To: Pradeep Subrahmanion
Cc: rpurdie, FlorianSchandinat, akpm, linux-fbdev, linux-kernel
In-Reply-To: <1331608337.2267.67.camel@debian.Gayathri>
On Mon, Mar 12, 2012 at 11:12:17PM -0400, Pradeep Subrahmanion wrote:
> Hi ,
>
> Brightness control was not working on Acer Aspire 4736 using default ACPI interface. acer-acpi also do not support 4730 series since it uses new WMI interface.
> This driver adds brightness control by accessing the LBB PCI configuration register. This approach may also work on other laptops in 4730 series .But currently , it is only tested for
> Aspire 4736.
1) If there's a WMI interface to brightness control, why not use that?
2) You're hitting a hardware resource that belongs to the i915 driver,
which may well cause problems.
3) Why does the ACPI interface not work? Can you attach the acpidump
output?
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply
* [PATCH] Added backlight driver for Acer Aspire 4736
From: Pradeep Subrahmanion @ 2012-03-12 17:40 UTC (permalink / raw)
To: rpurdie; +Cc: FlorianSchandinat, akpm, linux-fbdev, linux-kernel
In-Reply-To: <4F5D000E.8040104@gmx.de>
Hi ,
Brightness control was not working on Acer Aspire 4736 using default ACPI interface. acer-acpi also do not support 4730 series since it uses new WMI interface.
This driver adds brightness control by accessing the LBB PCI configuration register. This approach may also work on other laptops in 4730 series .But currently , it is only tested for
Aspire 4736.
From 03dbda16c90278aa1c088e5208bd99ac3c76f911 Mon Sep 17 00:00:00 2001
From: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>
Date: Mon, 12 Mar 2012 23:08:20 -0400
Subject: [PATCH] Added backlight driver for Acer Aspire 4736
Added backlight driver for Acer Aspire 4736
Signed-off-by: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>
---
drivers/video/backlight/acer4736_bl.c | 110 +++++++++++++++++++++++++++++++++
1 files changed, 110 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/backlight/acer4736_bl.c
diff --git a/drivers/video/backlight/acer4736_bl.c b/drivers/video/backlight/acer4736_bl.c
new file mode 100644
index 0000000..6fe2937
--- /dev/null
+++ b/drivers/video/backlight/acer4736_bl.c
@@ -0,0 +1,110 @@
+/*
+ * Backlight driver for Acer Aspire 4736
+ *
+ * Copyright (C) Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This driver uses LBB PCI configuration register to change the
+ * backlight brightness.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/backlight.h>
+#include <linux/err.h>
+#include <linux/dmi.h>
+#include <linux/io.h>
+#include <linux/pci.h>
+
+static u8 max_brightness = 0xFF;
+static u8 lbb_offset = 0xF4;
+static unsigned int device_id = 0x2a42;
+static unsigned int vendor_id = 0x8086;
+
+struct backlight_device *acer_backlight_device;
+struct pci_dev *pdev;
+
+static int acer_dmi_match(const struct dmi_system_id *id)
+{
+ printk(KERN_INFO "acer4736_bl: %s detected\n", id->ident);
+ return 1;
+}
+
+static const struct dmi_system_id __initdata acer_device_table[] = {
+{
+ .callback = acer_dmi_match,
+ .ident = "Aspire 4736",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 4736"),
+ },
+ },
+ {}
+};
+static int read_brightness(struct backlight_device *bd)
+{
+ u8 result;
+ pci_read_config_byte(pdev, lbb_offset, &result);
+ return result;
+}
+
+static int update_brightness(struct backlight_device *bd)
+{
+ u8 intensity = bd->props.brightness;
+ if (intensity > max_brightness) {
+ printk(KERN_INFO "Acer4736_bl: Invalid parameter. Maximum value is %d"
+ , max_brightness);
+ return -1;
+ }
+ pci_write_config_byte(pdev, lbb_offset, intensity);
+ return 0;
+}
+static const struct backlight_ops acer_backlight_ops = {
+ .get_brightness = read_brightness,
+ .update_status = update_brightness,
+};
+
+static int __init acer4736_bl_init(void)
+{
+ struct backlight_properties props;
+ if (!dmi_check_system(acer_device_table))
+ return -ENODEV;
+
+ pdev = pci_get_device(vendor_id, device_id, NULL);
+
+ if (!pdev)
+ return -ENODEV;
+
+ printk(KERN_INFO "Loading Acer 4736 backlight driver\n");
+ memset(&props, 0, sizeof(struct backlight_properties));
+ props.type = BACKLIGHT_RAW;
+ props.max_brightness = max_brightness;
+
+ acer_backlight_device = backlight_device_register("acer_backlight",
+ NULL, NULL, &acer_backlight_ops, &props);
+ acer_backlight_device->props.max_brightness = max_brightness;
+ acer_backlight_device->props.brightness + read_brightness(acer_backlight_device);
+ backlight_update_status(acer_backlight_device);
+
+ return 0;
+}
+
+static void __exit acer4736_bl_exit(void)
+{
+ pci_dev_put(pdev);
+ backlight_device_unregister(acer_backlight_device);
+}
+
+module_init(acer4736_bl_init);
+module_exit(acer4736_bl_exit);
+
+MODULE_AUTHOR("Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>");
+MODULE_DESCRIPTION("Acer Aspire 4736 Backlight Driver");
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(dmi, acer_device_table);
--
1.7.2.5
------
Thanks ,
Pradeep Subrahmanion
^ permalink raw reply related
* [PATCH] Added backlight driver for Acer Aspire 4736
From: Pradeep Subrahmanion @ 2012-03-12 17:36 UTC (permalink / raw)
To: rpurdie; +Cc: FlorianSchandinat, akpm, linux-fbdev, linux-kernel
In-Reply-To: <4F5D000E.8040104@gmx.de>
Hi ,
Brightness control was not working on Acer Aspire 4736 using default ACPI interface. acer-acpi also do not support 4730 series since it uses new WMI interface.
This driver adds brightness control by accessing the LBB PCI configuration register. This approach may also work on other laptops in 4730 series .But currently , it is only tested for
Aspire 4736.
From 03dbda16c90278aa1c088e5208bd99ac3c76f911 Mon Sep 17 00:00:00 2001
From: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>
Date: Mon, 12 Mar 2012 23:08:20 -0400
Subject: [PATCH] Added backlight driver for Acer Aspire 4736
Added backlight driver for Acer Aspire 4736
Signed-off-by: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>
---
drivers/video/backlight/acer4736_bl.c | 110 +++++++++++++++++++++++++++++++++
1 files changed, 110 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/backlight/acer4736_bl.c
diff --git a/drivers/video/backlight/acer4736_bl.c b/drivers/video/backlight/acer4736_bl.c
new file mode 100644
index 0000000..6fe2937
--- /dev/null
+++ b/drivers/video/backlight/acer4736_bl.c
@@ -0,0 +1,110 @@
+/*
+ * Backlight driver for Acer Aspire 4736
+ *
+ * Copyright (C) Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This driver uses LBB PCI configuration register to change the
+ * backlight brightness.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/backlight.h>
+#include <linux/err.h>
+#include <linux/dmi.h>
+#include <linux/io.h>
+#include <linux/pci.h>
+
+static u8 max_brightness = 0xFF;
+static u8 lbb_offset = 0xF4;
+static unsigned int device_id = 0x2a42;
+static unsigned int vendor_id = 0x8086;
+
+struct backlight_device *acer_backlight_device;
+struct pci_dev *pdev;
+
+static int acer_dmi_match(const struct dmi_system_id *id)
+{
+ printk(KERN_INFO "acer4736_bl: %s detected\n", id->ident);
+ return 1;
+}
+
+static const struct dmi_system_id __initdata acer_device_table[] = {
+{
+ .callback = acer_dmi_match,
+ .ident = "Aspire 4736",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 4736"),
+ },
+ },
+ {}
+};
+static int read_brightness(struct backlight_device *bd)
+{
+ u8 result;
+ pci_read_config_byte(pdev, lbb_offset, &result);
+ return result;
+}
+
+static int update_brightness(struct backlight_device *bd)
+{
+ u8 intensity = bd->props.brightness;
+ if (intensity > max_brightness) {
+ printk(KERN_INFO "Acer4736_bl: Invalid parameter. Maximum value is %d"
+ , max_brightness);
+ return -1;
+ }
+ pci_write_config_byte(pdev, lbb_offset, intensity);
+ return 0;
+}
+static const struct backlight_ops acer_backlight_ops = {
+ .get_brightness = read_brightness,
+ .update_status = update_brightness,
+};
+
+static int __init acer4736_bl_init(void)
+{
+ struct backlight_properties props;
+ if (!dmi_check_system(acer_device_table))
+ return -ENODEV;
+
+ pdev = pci_get_device(vendor_id, device_id, NULL);
+
+ if (!pdev)
+ return -ENODEV;
+
+ printk(KERN_INFO "Loading Acer 4736 backlight driver\n");
+ memset(&props, 0, sizeof(struct backlight_properties));
+ props.type = BACKLIGHT_RAW;
+ props.max_brightness = max_brightness;
+
+ acer_backlight_device = backlight_device_register("acer_backlight",
+ NULL, NULL, &acer_backlight_ops, &props);
+ acer_backlight_device->props.max_brightness = max_brightness;
+ acer_backlight_device->props.brightness + read_brightness(acer_backlight_device);
+ backlight_update_status(acer_backlight_device);
+
+ return 0;
+}
+
+static void __exit acer4736_bl_exit(void)
+{
+ pci_dev_put(pdev);
+ backlight_device_unregister(acer_backlight_device);
+}
+
+module_init(acer4736_bl_init);
+module_exit(acer4736_bl_exit);
+
+MODULE_AUTHOR("Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>");
+MODULE_DESCRIPTION("Acer Aspire 4736 Backlight Driver");
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(dmi, acer_device_table);
--
1.7.2.5
------
Thanks ,
Pradeep Subrahmanion
^ permalink raw reply related
* [PATCH v2] OMAPDSS: provide default timings functions for panels
From: Grazvydas Ignotas @ 2012-03-12 11:27 UTC (permalink / raw)
To: linux-fbdev; +Cc: Tomi Valkeinen, linux-omap, Grazvydas Ignotas
With this we can eliminate some duplicate code in panel drivers.
Also lgphilips-lb035q02, nec-nl8048hl11-01b, picodlp and
tpo-td043mtea1 gain support of timings control over sysfs.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
drivers/video/omap2/displays/panel-acx565akm.c | 15 -------------
drivers/video/omap2/displays/panel-generic-dpi.c | 22 -------------------
drivers/video/omap2/displays/panel-n8x0.c | 8 -------
drivers/video/omap2/displays/panel-taal.c | 8 -------
drivers/video/omap2/dss/core.c | 6 +++++
drivers/video/omap2/dss/display.c | 25 ++++++++++++++++++++++
drivers/video/omap2/dss/venc.c | 7 ------
include/video/omapdss.h | 6 +++++
8 files changed, 37 insertions(+), 60 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-acx565akm.c b/drivers/video/omap2/displays/panel-acx565akm.c
index dbd59b8..be83eed 100644
--- a/drivers/video/omap2/displays/panel-acx565akm.c
+++ b/drivers/video/omap2/displays/panel-acx565akm.c
@@ -738,19 +738,6 @@ static void acx_panel_set_timings(struct omap_dss_device *dssdev,
}
}
-static void acx_panel_get_timings(struct omap_dss_device *dssdev,
- struct omap_video_timings *timings)
-{
- *timings = dssdev->panel.timings;
-}
-
-static int acx_panel_check_timings(struct omap_dss_device *dssdev,
- struct omap_video_timings *timings)
-{
- return 0;
-}
-
-
static struct omap_dss_driver acx_panel_driver = {
.probe = acx_panel_probe,
.remove = acx_panel_remove,
@@ -761,8 +748,6 @@ static struct omap_dss_driver acx_panel_driver = {
.resume = acx_panel_resume,
.set_timings = acx_panel_set_timings,
- .get_timings = acx_panel_get_timings,
- .check_timings = acx_panel_check_timings,
.get_recommended_bpp = acx_get_recommended_bpp,
diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
index 519c47d..45a46af 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -454,24 +454,6 @@ static int generic_dpi_panel_resume(struct omap_dss_device *dssdev)
return 0;
}
-static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev,
- struct omap_video_timings *timings)
-{
- dpi_set_timings(dssdev, timings);
-}
-
-static void generic_dpi_panel_get_timings(struct omap_dss_device *dssdev,
- struct omap_video_timings *timings)
-{
- *timings = dssdev->panel.timings;
-}
-
-static int generic_dpi_panel_check_timings(struct omap_dss_device *dssdev,
- struct omap_video_timings *timings)
-{
- return dpi_check_timings(dssdev, timings);
-}
-
static struct omap_dss_driver dpi_driver = {
.probe = generic_dpi_panel_probe,
.remove = __exit_p(generic_dpi_panel_remove),
@@ -481,10 +463,6 @@ static struct omap_dss_driver dpi_driver = {
.suspend = generic_dpi_panel_suspend,
.resume = generic_dpi_panel_resume,
- .set_timings = generic_dpi_panel_set_timings,
- .get_timings = generic_dpi_panel_get_timings,
- .check_timings = generic_dpi_panel_check_timings,
-
.driver = {
.name = "generic_dpi_panel",
.owner = THIS_MODULE,
diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c
index 150e8ba..eba98a0 100644
--- a/drivers/video/omap2/displays/panel-n8x0.c
+++ b/drivers/video/omap2/displays/panel-n8x0.c
@@ -610,12 +610,6 @@ static int n8x0_panel_resume(struct omap_dss_device *dssdev)
return 0;
}
-static void n8x0_panel_get_timings(struct omap_dss_device *dssdev,
- struct omap_video_timings *timings)
-{
- *timings = dssdev->panel.timings;
-}
-
static void n8x0_panel_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres)
{
@@ -678,8 +672,6 @@ static struct omap_dss_driver n8x0_panel_driver = {
.get_resolution = n8x0_panel_get_resolution,
.get_recommended_bpp = omapdss_default_get_recommended_bpp,
- .get_timings = n8x0_panel_get_timings,
-
.driver = {
.name = "n8x0_panel",
.owner = THIS_MODULE,
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index 80c3f6a..174c004 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -583,12 +583,6 @@ static const struct backlight_ops taal_bl_ops = {
.update_status = taal_bl_update_status,
};
-static void taal_get_timings(struct omap_dss_device *dssdev,
- struct omap_video_timings *timings)
-{
- *timings = dssdev->panel.timings;
-}
-
static void taal_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres)
{
@@ -1899,8 +1893,6 @@ static struct omap_dss_driver taal_driver = {
.run_test = taal_run_test,
.memory_read = taal_memory_read,
- .get_timings = taal_get_timings,
-
.driver = {
.name = "taal",
.owner = THIS_MODULE,
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 86ec12e..9dc0c10 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -434,6 +434,12 @@ int omap_dss_register_driver(struct omap_dss_driver *dssdriver)
if (dssdriver->get_recommended_bpp = NULL)
dssdriver->get_recommended_bpp omapdss_default_get_recommended_bpp;
+ if (dssdriver->set_timings = NULL)
+ dssdriver->set_timings = omapdss_default_set_timings;
+ if (dssdriver->get_timings = NULL)
+ dssdriver->get_timings = omapdss_default_get_timings;
+ if (dssdriver->check_timings = NULL)
+ dssdriver->check_timings = omapdss_default_check_timings;
return driver_register(&dssdriver->driver);
}
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index be331dc..0d724a4 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -318,6 +318,31 @@ int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev)
}
EXPORT_SYMBOL(omapdss_default_get_recommended_bpp);
+void omapdss_default_set_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+{
+ if (dssdev->type = OMAP_DISPLAY_TYPE_DPI)
+ dpi_set_timings(dssdev, timings);
+}
+EXPORT_SYMBOL(omapdss_default_set_timings);
+
+void omapdss_default_get_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+{
+ *timings = dssdev->panel.timings;
+}
+EXPORT_SYMBOL(omapdss_default_get_timings);
+
+int omapdss_default_check_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings)
+{
+ if (dssdev->type = OMAP_DISPLAY_TYPE_DPI)
+ return dpi_check_timings(dssdev, timings);
+
+ return 0;
+}
+EXPORT_SYMBOL(omapdss_default_check_timings);
+
/* Checks if replication logic should be used. Only use for active matrix,
* when overlay is in RGB12U or RGB16 mode, and LCD interface is
* 18bpp or 24bpp */
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 7bb6219..dee2ec4 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -557,12 +557,6 @@ static int venc_panel_resume(struct omap_dss_device *dssdev)
return venc_panel_enable(dssdev);
}
-static void venc_get_timings(struct omap_dss_device *dssdev,
- struct omap_video_timings *timings)
-{
- *timings = dssdev->panel.timings;
-}
-
static void venc_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
@@ -641,7 +635,6 @@ static struct omap_dss_driver venc_driver = {
.get_resolution = omapdss_default_get_resolution,
.get_recommended_bpp = omapdss_default_get_recommended_bpp,
- .get_timings = venc_get_timings,
.set_timings = venc_set_timings,
.check_timings = venc_check_timings,
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 378c7ed..ff1dacd 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -646,6 +646,12 @@ struct omap_overlay *omap_dss_get_overlay(int num);
void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres);
int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
+void omapdss_default_set_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings);
+void omapdss_default_get_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings);
+int omapdss_default_check_timings(struct omap_dss_device *dssdev,
+ struct omap_video_timings *timings);
typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
--
1.7.0.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox