From 0a109d31fcbed60e647da0266aa92828a60d9739 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 27 Sep 2012 19:24:05 +0900 Subject: video: s3c-fb: fix typo in comment "sturucture" should be "structure". Signed-off-by: Jingoo Han --- drivers/video/s3c-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video/s3c-fb.c') diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 2ed7b633bbd9..d23fd46ecf74 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -189,7 +189,7 @@ struct s3c_fb_vsync { /** * struct s3c_fb - overall hardware state of the hardware - * @slock: The spinlock protection for this data sturucture. + * @slock: The spinlock protection for this data structure. * @dev: The device that we bound to, for printing, etc. * @bus_clk: The clk (hclk) feeding our interface and possibly pixclk. * @lcd_clk: The clk (sclk) feeding pixclk. -- cgit v1.2.2 From 0b466568c980300a3ac69c4f40f8f3fd5ae14bae Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 27 Sep 2012 16:23:59 +0900 Subject: video: s3c-fb: use FIMD_V8_VIDTCON0 for EXYNOS5 FIMD This patch uses FIMD_V8_VIDTCON0 as the address definition of VIDTCON0 register, because the address offset of VIDTCONx registers is changed from 0x0 to 0x20000 for EXYNOS5 FIMD. So, FIMD_V8_VIDTCON0 should be used. Signed-off-by: Jingoo Han --- drivers/video/s3c-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video/s3c-fb.c') diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index d23fd46ecf74..6d2479d9aa7a 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -1910,7 +1910,7 @@ static struct s3c_fb_driverdata s3c_fb_data_exynos4 = { static struct s3c_fb_driverdata s3c_fb_data_exynos5 = { .variant = { .nr_windows = 5, - .vidtcon = VIDTCON0, + .vidtcon = FIMD_V8_VIDTCON0, .wincon = WINCON(0), .winmap = WINxMAP(0), .keycon = WKEYCON, -- cgit v1.2.2 From bab8b563ef08455440badca7fe79b2c700bd1b75 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 16 Oct 2012 13:21:44 +0900 Subject: video: s3c-fb: use dev_get_drvdata() instead of platform_get_drvdata() Because there is no need to access to the platform device in suspend/resume and runtime_suspend/resume, dev_get_drvdata() can be used instead of platform_get_drvdata() to make the code smaller. Signed-off-by: Jingoo Han --- drivers/video/s3c-fb.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'drivers/video/s3c-fb.c') diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 6d2479d9aa7a..8a0f022c60cc 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -1544,8 +1544,7 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int s3c_fb_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct s3c_fb *sfb = platform_get_drvdata(pdev); + struct s3c_fb *sfb = dev_get_drvdata(dev); struct s3c_fb_win *win; int win_no; @@ -1572,8 +1571,7 @@ static int s3c_fb_suspend(struct device *dev) static int s3c_fb_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct s3c_fb *sfb = platform_get_drvdata(pdev); + struct s3c_fb *sfb = dev_get_drvdata(dev); struct s3c_fb_platdata *pd = sfb->pdata; struct s3c_fb_win *win; int win_no; @@ -1623,7 +1621,7 @@ static int s3c_fb_resume(struct device *dev) if (!win) continue; - dev_dbg(&pdev->dev, "resuming window %d\n", win_no); + dev_dbg(dev, "resuming window %d\n", win_no); s3c_fb_set_par(win->fbinfo); } @@ -1636,8 +1634,7 @@ static int s3c_fb_resume(struct device *dev) #ifdef CONFIG_PM_RUNTIME static int s3c_fb_runtime_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct s3c_fb *sfb = platform_get_drvdata(pdev); + struct s3c_fb *sfb = dev_get_drvdata(dev); if (!sfb->variant.has_clksel) clk_disable_unprepare(sfb->lcd_clk); @@ -1649,8 +1646,7 @@ static int s3c_fb_runtime_suspend(struct device *dev) static int s3c_fb_runtime_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct s3c_fb *sfb = platform_get_drvdata(pdev); + struct s3c_fb *sfb = dev_get_drvdata(dev); struct s3c_fb_platdata *pd = sfb->pdata; clk_prepare_enable(sfb->bus_clk); -- cgit v1.2.2 From d65c6a99bccca167df8ddcb93a2190f048727914 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 26 Oct 2012 14:34:24 +0900 Subject: video: s3c-fb: add "drop through" comment This patch adds a "drop through" comment to improve the readability. Signed-off-by: Jingoo Han --- drivers/video/s3c-fb.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/video/s3c-fb.c') diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 8a0f022c60cc..9cee67c08d94 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -288,6 +288,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var, /* 666 with one bit alpha/transparency */ var->transp.offset = 18; var->transp.length = 1; + /* drop through */ case 18: var->bits_per_pixel = 32; -- cgit v1.2.2 From 418d620e080f3d17735be8ee95a2f40c0e6edc3e Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 26 Oct 2012 14:54:01 +0900 Subject: video: s3c-fb: return an error when bpp is invalid This patch returns an error, when bpp is invalid in s3c_fb_check_var(). If invalid bpp is requested, an error should be returned. Signed-off-by: Jingoo Han --- drivers/video/s3c-fb.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/video/s3c-fb.c') diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 9cee67c08d94..21e5d79ce65d 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -330,6 +330,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var, default: dev_err(sfb->dev, "invalid bpp\n"); + return -EINVAL; } dev_dbg(sfb->dev, "%s: verified parameters\n", __func__); -- cgit v1.2.2 From 5a9c30a32dd187344cb966db3016861b6b385384 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 26 Oct 2012 15:41:49 +0900 Subject: video: s3c-fb: fix red offset and length for ARGB232 format Green pixel and blue pixel are 3 bits and 2 bits respectively at ARGB232 format. Thus, the value of red offset should be 5, not 4. Also, the value of red length should be 2, because red pixel is 2 bits at ARGB232 format. Signed-off-by: Jingoo Han --- drivers/video/s3c-fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/video/s3c-fb.c') diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 21e5d79ce65d..1a00ad241edd 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -268,10 +268,10 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var, case 8: if (sfb->variant.palette[win->index] != 0) { /* non palletised, A:1,R:2,G:3,B:2 mode */ - var->red.offset = 4; + var->red.offset = 5; var->green.offset = 2; var->blue.offset = 0; - var->red.length = 5; + var->red.length = 2; var->green.length = 3; var->blue.length = 2; var->transp.offset = 7; -- cgit v1.2.2