hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/video/fbdev/s3c2410fb.c
....@@ -29,26 +29,21 @@
2929 #include <linux/clk.h>
3030 #include <linux/cpufreq.h>
3131 #include <linux/io.h>
32
+#include <linux/platform_data/fb-s3c2410.h>
3233
3334 #include <asm/div64.h>
3435
3536 #include <asm/mach/map.h>
36
-#include <mach/regs-lcd.h>
37
-#include <mach/regs-gpio.h>
38
-#include <mach/fb.h>
3937
4038 #ifdef CONFIG_PM
4139 #include <linux/pm.h>
4240 #endif
4341
4442 #include "s3c2410fb.h"
43
+#include "s3c2410fb-regs-lcd.h"
4544
4645 /* Debugging stuff */
47
-#ifdef CONFIG_FB_S3C2410_DEBUG
48
-static int debug = 1;
49
-#else
50
-static int debug;
51
-#endif
46
+static int debug = IS_BUILTIN(CONFIG_FB_S3C2410_DEBUG);
5247
5348 #define dprintk(msg...) \
5449 do { \
....@@ -618,7 +613,7 @@
618613
619614 static DEVICE_ATTR(debug, 0664, s3c2410fb_debug_show, s3c2410fb_debug_store);
620615
621
-static struct fb_ops s3c2410fb_ops = {
616
+static const struct fb_ops s3c2410fb_ops = {
622617 .owner = THIS_MODULE,
623618 .fb_check_var = s3c2410fb_check_var,
624619 .fb_set_par = s3c2410fb_set_par,
....@@ -676,6 +671,9 @@
676671 {
677672 unsigned long tmp;
678673
674
+ if (!reg)
675
+ return;
676
+
679677 tmp = readl(reg) & ~mask;
680678 writel(tmp | set, reg);
681679 }
....@@ -706,10 +704,10 @@
706704
707705 /* modify the gpio(s) with interrupts set (bjd) */
708706
709
- modify_gpio(S3C2410_GPCUP, mach_info->gpcup, mach_info->gpcup_mask);
710
- modify_gpio(S3C2410_GPCCON, mach_info->gpccon, mach_info->gpccon_mask);
711
- modify_gpio(S3C2410_GPDUP, mach_info->gpdup, mach_info->gpdup_mask);
712
- modify_gpio(S3C2410_GPDCON, mach_info->gpdcon, mach_info->gpdcon_mask);
707
+ modify_gpio(mach_info->gpcup_reg, mach_info->gpcup, mach_info->gpcup_mask);
708
+ modify_gpio(mach_info->gpccon_reg, mach_info->gpccon, mach_info->gpccon_mask);
709
+ modify_gpio(mach_info->gpdup_reg, mach_info->gpdup, mach_info->gpdup_mask);
710
+ modify_gpio(mach_info->gpdcon_reg, mach_info->gpdcon, mach_info->gpdcon_mask);
713711
714712 local_irq_restore(flags);
715713
....@@ -777,7 +775,7 @@
777775 long delta_f;
778776
779777 info = container_of(nb, struct s3c2410fb_info, freq_transition);
780
- fbinfo = platform_get_drvdata(to_platform_device(info->dev));
778
+ fbinfo = dev_get_drvdata(info->dev);
781779
782780 /* work out change, <0 for speed-up */
783781 delta_f = info->clk_rate - clk_get_rate(info->clk);