aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sa1100fb.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-14 05:22:56 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-21 06:56:18 -0500
commit798892966871077b8c867abf3d491227037dc2eb (patch)
tree1ec6e44e86f364907787efc64910a384ffbd13af /drivers/video/sa1100fb.c
parent58f5cbf275f8fb9529cba20df2564d370a6107da (diff)
FB: sa1100: convert printks to dev_xxx()
Use the dev_xxx() macros for driver kernel message output, rather than open coded printk() with KERN_ levels etc. Remove DPRINTK(). Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/video/sa1100fb.c')
-rw-r--r--drivers/video/sa1100fb.c72
1 files changed, 34 insertions, 38 deletions
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index a797220fdf5c..ecd7cd4ce412 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -184,10 +184,6 @@
184#include <mach/shannon.h> 184#include <mach/shannon.h>
185 185
186/* 186/*
187 * debugging?
188 */
189#define DEBUG 0
190/*
191 * Complain if VAR is out of range. 187 * Complain if VAR is out of range.
192 */ 188 */
193#define DEBUG_VAR 1 189#define DEBUG_VAR 1
@@ -614,7 +610,7 @@ sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
614 var->xres_virtual = max(var->xres_virtual, var->xres); 610 var->xres_virtual = max(var->xres_virtual, var->xres);
615 var->yres_virtual = max(var->yres_virtual, var->yres); 611 var->yres_virtual = max(var->yres_virtual, var->yres);
616 612
617 DPRINTK("var->bits_per_pixel=%d\n", var->bits_per_pixel); 613 dev_dbg(fbi->dev, "var->bits_per_pixel=%d\n", var->bits_per_pixel);
618 switch (var->bits_per_pixel) { 614 switch (var->bits_per_pixel) {
619 case 4: 615 case 4:
620 rgbidx = RGB_4; 616 rgbidx = RGB_4;
@@ -638,16 +634,16 @@ sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
638 var->blue = fbi->rgb[rgbidx]->blue; 634 var->blue = fbi->rgb[rgbidx]->blue;
639 var->transp = fbi->rgb[rgbidx]->transp; 635 var->transp = fbi->rgb[rgbidx]->transp;
640 636
641 DPRINTK("RGBT length = %d:%d:%d:%d\n", 637 dev_dbg(fbi->dev, "RGBT length = %d:%d:%d:%d\n",
642 var->red.length, var->green.length, var->blue.length, 638 var->red.length, var->green.length, var->blue.length,
643 var->transp.length); 639 var->transp.length);
644 640
645 DPRINTK("RGBT offset = %d:%d:%d:%d\n", 641 dev_dbg(fbi->dev, "RGBT offset = %d:%d:%d:%d\n",
646 var->red.offset, var->green.offset, var->blue.offset, 642 var->red.offset, var->green.offset, var->blue.offset,
647 var->transp.offset); 643 var->transp.offset);
648 644
649#ifdef CONFIG_CPU_FREQ 645#ifdef CONFIG_CPU_FREQ
650 printk(KERN_DEBUG "dma period = %d ps, clock = %d kHz\n", 646 dev_dbg(fbi->dev, "dma period = %d ps, clock = %d kHz\n",
651 sa1100fb_display_dma_period(var), 647 sa1100fb_display_dma_period(var),
652 cpufreq_get(smp_processor_id())); 648 cpufreq_get(smp_processor_id()));
653#endif 649#endif
@@ -683,7 +679,7 @@ static int sa1100fb_set_par(struct fb_info *info)
683 struct fb_var_screeninfo *var = &info->var; 679 struct fb_var_screeninfo *var = &info->var;
684 unsigned long palette_mem_size; 680 unsigned long palette_mem_size;
685 681
686 DPRINTK("set_par\n"); 682 dev_dbg(fbi->dev, "set_par\n");
687 683
688 if (var->bits_per_pixel == 16) 684 if (var->bits_per_pixel == 16)
689 fbi->fb.fix.visual = FB_VISUAL_TRUECOLOR; 685 fbi->fb.fix.visual = FB_VISUAL_TRUECOLOR;
@@ -704,7 +700,7 @@ static int sa1100fb_set_par(struct fb_info *info)
704 700
705 palette_mem_size = fbi->palette_size * sizeof(u16); 701 palette_mem_size = fbi->palette_size * sizeof(u16);
706 702
707 DPRINTK("palette_mem_size = 0x%08lx\n", (u_long) palette_mem_size); 703 dev_dbg(fbi->dev, "palette_mem_size = 0x%08lx\n", palette_mem_size);
708 704
709 fbi->palette_cpu = (u16 *)(fbi->map_cpu + PAGE_SIZE - palette_mem_size); 705 fbi->palette_cpu = (u16 *)(fbi->map_cpu + PAGE_SIZE - palette_mem_size);
710 fbi->palette_dma = fbi->map_dma + PAGE_SIZE - palette_mem_size; 706 fbi->palette_dma = fbi->map_dma + PAGE_SIZE - palette_mem_size;
@@ -775,7 +771,7 @@ static int sa1100fb_blank(int blank, struct fb_info *info)
775 struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; 771 struct sa1100fb_info *fbi = (struct sa1100fb_info *)info;
776 int i; 772 int i;
777 773
778 DPRINTK("sa1100fb_blank: blank=%d\n", blank); 774 dev_dbg(fbi->dev, "sa1100fb_blank: blank=%d\n", blank);
779 775
780 switch (blank) { 776 switch (blank) {
781 case FB_BLANK_POWERDOWN: 777 case FB_BLANK_POWERDOWN:
@@ -863,39 +859,39 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_
863 u_int half_screen_size, yres, pcd; 859 u_int half_screen_size, yres, pcd;
864 u_long flags; 860 u_long flags;
865 861
866 DPRINTK("Configuring SA1100 LCD\n"); 862 dev_dbg(fbi->dev, "Configuring SA1100 LCD\n");
867 863
868 DPRINTK("var: xres=%d hslen=%d lm=%d rm=%d\n", 864 dev_dbg(fbi->dev, "var: xres=%d hslen=%d lm=%d rm=%d\n",
869 var->xres, var->hsync_len, 865 var->xres, var->hsync_len,
870 var->left_margin, var->right_margin); 866 var->left_margin, var->right_margin);
871 DPRINTK("var: yres=%d vslen=%d um=%d bm=%d\n", 867 dev_dbg(fbi->dev, "var: yres=%d vslen=%d um=%d bm=%d\n",
872 var->yres, var->vsync_len, 868 var->yres, var->vsync_len,
873 var->upper_margin, var->lower_margin); 869 var->upper_margin, var->lower_margin);
874 870
875#if DEBUG_VAR 871#if DEBUG_VAR
876 if (var->xres < 16 || var->xres > 1024) 872 if (var->xres < 16 || var->xres > 1024)
877 printk(KERN_ERR "%s: invalid xres %d\n", 873 dev_err(fbi->dev, "%s: invalid xres %d\n",
878 fbi->fb.fix.id, var->xres); 874 fbi->fb.fix.id, var->xres);
879 if (var->hsync_len < 1 || var->hsync_len > 64) 875 if (var->hsync_len < 1 || var->hsync_len > 64)
880 printk(KERN_ERR "%s: invalid hsync_len %d\n", 876 dev_err(fbi->dev, "%s: invalid hsync_len %d\n",
881 fbi->fb.fix.id, var->hsync_len); 877 fbi->fb.fix.id, var->hsync_len);
882 if (var->left_margin < 1 || var->left_margin > 255) 878 if (var->left_margin < 1 || var->left_margin > 255)
883 printk(KERN_ERR "%s: invalid left_margin %d\n", 879 dev_err(fbi->dev, "%s: invalid left_margin %d\n",
884 fbi->fb.fix.id, var->left_margin); 880 fbi->fb.fix.id, var->left_margin);
885 if (var->right_margin < 1 || var->right_margin > 255) 881 if (var->right_margin < 1 || var->right_margin > 255)
886 printk(KERN_ERR "%s: invalid right_margin %d\n", 882 dev_err(fbi->dev, "%s: invalid right_margin %d\n",
887 fbi->fb.fix.id, var->right_margin); 883 fbi->fb.fix.id, var->right_margin);
888 if (var->yres < 1 || var->yres > 1024) 884 if (var->yres < 1 || var->yres > 1024)
889 printk(KERN_ERR "%s: invalid yres %d\n", 885 dev_err(fbi->dev, "%s: invalid yres %d\n",
890 fbi->fb.fix.id, var->yres); 886 fbi->fb.fix.id, var->yres);
891 if (var->vsync_len < 1 || var->vsync_len > 64) 887 if (var->vsync_len < 1 || var->vsync_len > 64)
892 printk(KERN_ERR "%s: invalid vsync_len %d\n", 888 dev_err(fbi->dev, "%s: invalid vsync_len %d\n",
893 fbi->fb.fix.id, var->vsync_len); 889 fbi->fb.fix.id, var->vsync_len);
894 if (var->upper_margin < 0 || var->upper_margin > 255) 890 if (var->upper_margin < 0 || var->upper_margin > 255)
895 printk(KERN_ERR "%s: invalid upper_margin %d\n", 891 dev_err(fbi->dev, "%s: invalid upper_margin %d\n",
896 fbi->fb.fix.id, var->upper_margin); 892 fbi->fb.fix.id, var->upper_margin);
897 if (var->lower_margin < 0 || var->lower_margin > 255) 893 if (var->lower_margin < 0 || var->lower_margin > 255)
898 printk(KERN_ERR "%s: invalid lower_margin %d\n", 894 dev_err(fbi->dev, "%s: invalid lower_margin %d\n",
899 fbi->fb.fix.id, var->lower_margin); 895 fbi->fb.fix.id, var->lower_margin);
900#endif 896#endif
901 897
@@ -928,10 +924,10 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_
928 (var->sync & FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | 924 (var->sync & FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) |
929 (var->sync & FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); 925 (var->sync & FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL);
930 926
931 DPRINTK("nlccr0 = 0x%08lx\n", new_regs.lccr0); 927 dev_dbg(fbi->dev, "nlccr0 = 0x%08lx\n", new_regs.lccr0);
932 DPRINTK("nlccr1 = 0x%08lx\n", new_regs.lccr1); 928 dev_dbg(fbi->dev, "nlccr1 = 0x%08lx\n", new_regs.lccr1);
933 DPRINTK("nlccr2 = 0x%08lx\n", new_regs.lccr2); 929 dev_dbg(fbi->dev, "nlccr2 = 0x%08lx\n", new_regs.lccr2);
934 DPRINTK("nlccr3 = 0x%08lx\n", new_regs.lccr3); 930 dev_dbg(fbi->dev, "nlccr3 = 0x%08lx\n", new_regs.lccr3);
935 931
936 half_screen_size = var->bits_per_pixel; 932 half_screen_size = var->bits_per_pixel;
937 half_screen_size = half_screen_size * var->xres * var->yres / 16; 933 half_screen_size = half_screen_size * var->xres * var->yres / 16;
@@ -967,7 +963,7 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_
967 */ 963 */
968static inline void __sa1100fb_backlight_power(struct sa1100fb_info *fbi, int on) 964static inline void __sa1100fb_backlight_power(struct sa1100fb_info *fbi, int on)
969{ 965{
970 DPRINTK("backlight o%s\n", on ? "n" : "ff"); 966 dev_dbg(fbi->dev, "backlight o%s\n", on ? "n" : "ff");
971 967
972 if (sa1100fb_backlight_power) 968 if (sa1100fb_backlight_power)
973 sa1100fb_backlight_power(on); 969 sa1100fb_backlight_power(on);
@@ -975,7 +971,7 @@ static inline void __sa1100fb_backlight_power(struct sa1100fb_info *fbi, int on)
975 971
976static inline void __sa1100fb_lcd_power(struct sa1100fb_info *fbi, int on) 972static inline void __sa1100fb_lcd_power(struct sa1100fb_info *fbi, int on)
977{ 973{
978 DPRINTK("LCD power o%s\n", on ? "n" : "ff"); 974 dev_dbg(fbi->dev, "LCD power o%s\n", on ? "n" : "ff");
979 975
980 if (sa1100fb_lcd_power) 976 if (sa1100fb_lcd_power)
981 sa1100fb_lcd_power(on); 977 sa1100fb_lcd_power(on);
@@ -1015,7 +1011,7 @@ static void sa1100fb_setup_gpio(struct sa1100fb_info *fbi)
1015 1011
1016static void sa1100fb_enable_controller(struct sa1100fb_info *fbi) 1012static void sa1100fb_enable_controller(struct sa1100fb_info *fbi)
1017{ 1013{
1018 DPRINTK("Enabling LCD controller\n"); 1014 dev_dbg(fbi->dev, "Enabling LCD controller\n");
1019 1015
1020 /* 1016 /*
1021 * Make sure the mode bits are present in the first palette entry 1017 * Make sure the mode bits are present in the first palette entry
@@ -1037,19 +1033,19 @@ static void sa1100fb_enable_controller(struct sa1100fb_info *fbi)
1037 GPSR |= SHANNON_GPIO_DISP_EN; 1033 GPSR |= SHANNON_GPIO_DISP_EN;
1038 } 1034 }
1039 1035
1040 DPRINTK("DBAR1 = 0x%08x\n", DBAR1); 1036 dev_dbg(fbi->dev, "DBAR1 = 0x%08lx\n", DBAR1);
1041 DPRINTK("DBAR2 = 0x%08x\n", DBAR2); 1037 dev_dbg(fbi->dev, "DBAR2 = 0x%08lx\n", DBAR2);
1042 DPRINTK("LCCR0 = 0x%08x\n", LCCR0); 1038 dev_dbg(fbi->dev, "LCCR0 = 0x%08lx\n", LCCR0);
1043 DPRINTK("LCCR1 = 0x%08x\n", LCCR1); 1039 dev_dbg(fbi->dev, "LCCR1 = 0x%08lx\n", LCCR1);
1044 DPRINTK("LCCR2 = 0x%08x\n", LCCR2); 1040 dev_dbg(fbi->dev, "LCCR2 = 0x%08lx\n", LCCR2);
1045 DPRINTK("LCCR3 = 0x%08x\n", LCCR3); 1041 dev_dbg(fbi->dev, "LCCR3 = 0x%08lx\n", LCCR3);
1046} 1042}
1047 1043
1048static void sa1100fb_disable_controller(struct sa1100fb_info *fbi) 1044static void sa1100fb_disable_controller(struct sa1100fb_info *fbi)
1049{ 1045{
1050 DECLARE_WAITQUEUE(wait, current); 1046 DECLARE_WAITQUEUE(wait, current);
1051 1047
1052 DPRINTK("Disabling LCD controller\n"); 1048 dev_dbg(fbi->dev, "Disabling LCD controller\n");
1053 1049
1054 if (machine_is_shannon()) { 1050 if (machine_is_shannon()) {
1055 GPCR |= SHANNON_GPIO_DISP_EN; 1051 GPCR |= SHANNON_GPIO_DISP_EN;
@@ -1268,7 +1264,7 @@ sa1100fb_freq_policy(struct notifier_block *nb, unsigned long val,
1268 switch (val) { 1264 switch (val) {
1269 case CPUFREQ_ADJUST: 1265 case CPUFREQ_ADJUST:
1270 case CPUFREQ_INCOMPATIBLE: 1266 case CPUFREQ_INCOMPATIBLE:
1271 printk(KERN_DEBUG "min dma period: %d ps, " 1267 dev_dbg(fbi->dev, "min dma period: %d ps, "
1272 "new clock %d kHz\n", sa1100fb_min_dma_period(fbi), 1268 "new clock %d kHz\n", sa1100fb_min_dma_period(fbi),
1273 policy->max); 1269 policy->max);
1274 /* todo: fill in min/max values */ 1270 /* todo: fill in min/max values */
@@ -1459,7 +1455,7 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev)
1459 1455
1460 ret = request_irq(irq, sa1100fb_handle_irq, 0, "LCD", fbi); 1456 ret = request_irq(irq, sa1100fb_handle_irq, 0, "LCD", fbi);
1461 if (ret) { 1457 if (ret) {
1462 printk(KERN_ERR "sa1100fb: request_irq failed: %d\n", ret); 1458 dev_err(&pdev->dev, "request_irq failed: %d\n", ret);
1463 goto failed; 1459 goto failed;
1464 } 1460 }
1465 1461