📄 x
字号:
msg->flags = 0;@@ -773,7 +859,8 @@ h4_i2c_tvout_off(struct work_struct *wor omap2_disp_put_all_clks(); #endif -#if defined(CONFIG_TWL4030_CORE_T2) && defined(CONFIG_I2C_TWL4030_CORE)+#if (defined(CONFIG_TWL4030_CORE_T2) && defined(CONFIG_I2C_TWL4030_CORE)) \+ || defined(CONFIG_MACH_OMAP_3430LABRADOR) || defined(CONFIG_MACH_OMAP3EVM) omap2_disp_get_all_clks(); omap2_disp_set_tvref(TVREF_OFF); omap2_disp_put_all_clks();@@ -791,14 +878,14 @@ h4_i2c_tvout_on(struct work_struct *work struct i2c_msg msg[1]; unsigned char data[2]; - /*+ /* * Turn ON TV block (AVDD and VREF) in menelaus chip * MENELAUS_LDO_CTRL8 (0x11 -> 0x03) */ adap = i2c_get_adapter(MENELAUS_I2C_ADAP_ID); if (!adap) { printk(KERN_ERR DRIVER- "Unable to get I2C adapter \n");+ "Unable to get I2C adapter \n"); } msg->addr = 0x72;/* I2C address of Menelaus Chip */ msg->flags = 0;@@ -819,11 +906,12 @@ h4_i2c_tvout_on(struct work_struct *work omap2_disp_set_tvref(TVREF_ON); omap2_disp_put_all_clks(); #endif-#if defined(CONFIG_TWL4030_CORE_T2) && defined(CONFIG_I2C_TWL4030_CORE)+#if (defined(CONFIG_TWL4030_CORE_T2) && defined(CONFIG_I2C_TWL4030_CORE)) \+ || defined(CONFIG_MACH_OMAP_3430LABRADOR) omap2_disp_get_all_clks(); omap2_disp_set_tvref(TVREF_ON); omap2_disp_put_all_clks();- + twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECIEVER, ENABLE_VDAC_DEDICATED,TWL4030_VDAC_DEDICATED); twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECIEVER,@@ -841,7 +929,7 @@ tv_init(void) omap2_disp_enable_output_dev(OMAP2_OUTPUT_TV); omap2_disp_put_all_clks(); printk(KERN_DEBUG DRIVER- "TV %dx%d interlaced\n", H4_TV_XRES, H4_TV_YRES);+ "TV %dx%d interlaced\n", H4_TV_XRES, H4_TV_YRES); tv_in_use = 1; return 0; }@@ -849,7 +937,7 @@ tv_init(void) static int tv_exit(void) {- if (!tv_in_use)+ if (!tv_in_use) return 0; omap2_disp_get_all_clks();@@ -892,26 +980,27 @@ tv_probe(struct platform_device *odev) static int tv_suspend(struct platform_device *odev, pm_message_t state) {- if (!tv_in_use)- return 0;-- /* TODO-- need to delink DSS and TV clocks.. For now, TV is put to - * off in fb_blank and put_dss */- - tv_in_use = 0;+ if (!tv_in_use) return 0;++ /* TODO-- need to delink DSS and TV clocks.. For now, TV is put to + * off in fb_blank and put_dss */++ tv_in_use = 0;++ return 0; } static int tv_resume(struct platform_device *odev) {- if (tv_in_use)- return 0;-- /* TODO-- need to delink DSS and TV clocks.. For now, TV is put to - * on in fb_blank and get_dss */- tv_in_use = 1;+ if (tv_in_use) return 0;++ /* TODO-- need to delink DSS and TV clocks.. For now, TV is put to + * on in fb_blank and get_dss */+ tv_in_use = 1;+ return 0; } #endif /* CONFIG_PM */@@ -951,10 +1040,12 @@ read_layer_out(char *buf, int layer) int output_dev = omap2_disp_get_output_dev(layer); switch (output_dev) {- case OMAP2_OUTPUT_LCD : p = sprintf(buf, "lcd\n");- break;- case OMAP2_OUTPUT_TV : p = sprintf(buf, "tv\n");- break;+ case OMAP2_OUTPUT_LCD : + p = sprintf(buf, "lcd\n");+ break;+ case OMAP2_OUTPUT_TV : + p = sprintf(buf, "tv\n");+ break; } return(p); }@@ -989,11 +1080,11 @@ write_layer_out(const char *buffer, size mdelay(1); omap2_disp_set_output_dev(layer, out_dev); mdelay(1);- + if(fb_out_layer != OMAP2_GRAPHICS) omap24xxfb_set_output_layer(fb_out_layer); omap2_disp_put_all_clks();- return count;+ return count; } static ssize_t @@ -1036,12 +1127,14 @@ static ssize_t lcdbacklight_show(struct class_device *cdev, char *buf) { int p =0;- + switch (lcd_backlight_state) {- case LCD_ON: p = sprintf(buf, "on\n");- break;- case LCD_OFF: p = sprintf(buf, "off\n");- break;+ case LCD_ON:+ p = sprintf(buf, "on\n");+ break;+ case LCD_OFF:+ p = sprintf(buf, "off\n");+ break; } return p; }@@ -1079,11 +1172,13 @@ lcd_data_lines_show(struct class_device int current_lcddatalines_state; current_lcddatalines_state = omap2_disp_get_lcddatalines();- + switch (current_lcddatalines_state) {- case LCD_DATA_LINE_18BIT: p = sprintf(buf, "18 bits\n");+ case LCD_DATA_LINE_18BIT:+ p = sprintf(buf, "18 bits\n"); break;- case LCD_DATA_LINE_16BIT: p = sprintf(buf, "16 bits\n");+ case LCD_DATA_LINE_16BIT:+ p = sprintf(buf, "16 bits\n"); break; } return (p);@@ -1114,15 +1209,17 @@ dithering_show(struct class_device *cdev int p=0; int current_dither_state; - omap2_disp_get_dss();+ omap2_disp_get_dss(); current_dither_state = omap2_disp_get_dithering(); switch (current_dither_state) {- case DITHERING_ON: p = sprintf(buf, "on\n");+ case DITHERING_ON:+ p = sprintf(buf, "on\n"); break;- case DITHERING_OFF: p = sprintf(buf, "off\n");+ case DITHERING_OFF:+ p = sprintf(buf, "off\n"); break; }- omap2_disp_put_dss();+ omap2_disp_put_dss(); return p; } @@ -1156,15 +1253,17 @@ lcd_alphablend_show(struct class_device int p=0; int alphablend_state; - omap2_disp_get_dss();+ omap2_disp_get_dss(); alphablend_state = omap2_disp_get_alphablend(OMAP2_OUTPUT_LCD); switch (alphablend_state) {- case 0: p = sprintf(buf, "off\n");+ case 0:+ p = sprintf(buf, "off\n"); break;- case 1: p = sprintf(buf, "on\n");+ case 1:+ p = sprintf(buf, "on\n"); break; }- omap2_disp_put_dss();+ omap2_disp_put_dss(); return p; } @@ -1196,15 +1295,17 @@ tv_alphablend_show(struct class_device * int p=0; int alphablend_state; - omap2_disp_get_dss();+ omap2_disp_get_dss(); alphablend_state = omap2_disp_get_alphablend(OMAP2_OUTPUT_TV); switch (alphablend_state) {- case 0: p = sprintf(buf, "off\n");+ case 0:+ p = sprintf(buf, "off\n"); break;- case 1: p = sprintf(buf, "on\n");+ case 1:+ p = sprintf(buf, "on\n"); break; }- omap2_disp_put_dss();+ omap2_disp_put_dss(); return p; } @@ -1229,6 +1330,7 @@ tv_alphablend_store(struct class_device omap2_disp_put_dss(); return count; }+ static ssize_t gfx_global_alpha_show(struct class_device *cdev, char *buf) {@@ -1262,7 +1364,6 @@ gfx_global_alpha_store(struct class_devi return count; } - static ssize_t vid2_global_alpha_show(struct class_device *cdev, char *buf) {@@ -1296,16 +1397,16 @@ vid2_global_alpha_store(struct class_dev return count; } - static ssize_t lpr_show(struct class_device *cdev, char *buf) { int p = 0; switch (lpr_enabled) {- case 0: p = sprintf(buf, "disable\n");+ case 0:+ p = sprintf(buf, "disable\n"); break;-- case 1: p = sprintf(buf, "enable\n");+ case 1:+ p = sprintf(buf, "enable\n"); break; } return p;@@ -1406,7 +1507,6 @@ static ssize_t gfx_fifo_high_threshold_s return count; } - #endif #ifdef CONFIG_OMAP2_TV@@ -1420,22 +1520,30 @@ tv_standard_show(struct class_device *cd current_tvstd = omap2_disp_get_tvstandard(); switch (current_tvstd) {- case PAL_BDGHI: p = sprintf(buf, "pal_bdghi\n");- break;- case PAL_NC: p = sprintf(buf, "pal_nc\n");- break;- case PAL_N: p = sprintf(buf, "pal_n\n");- break;- case PAL_M: p = sprintf(buf, "pal_m\n");- break;- case PAL_60: p = sprintf(buf, "pal_60\n");- break;- case NTSC_M: p = sprintf(buf, "ntsc_m\n");- break;- case NTSC_J: p = sprintf(buf, "ntsc_j\n");- break;- case NTSC_443: p = sprintf(buf, "ntsc_443\n");- break;+ case PAL_BDGHI:+ p = sprintf(buf, "pal_bdghi\n");+ break;+ case PAL_NC:+ p = sprintf(buf, "pal_nc\n");+ break;+ case PAL_N:+ p = sprintf(buf, "pal_n\n");+ break;+ case PAL_M:+ p = sprintf(buf, "pal_m\n");+ break;+ case PAL_60:+ p = sprintf(buf, "pal_60\n");+ break;+ case NTSC_M:+ p = sprintf(buf, "ntsc_m\n");+ break;+ case NTSC_J:+ p = sprintf(buf, "ntsc_j\n");+ break;+ case NTSC_443:+ p = sprintf(buf, "ntsc_443\n");+ break; } omap2_disp_put_dss(); return (p);@@ -1521,18 +1629,18 @@ create_sysfs_files(void) bd = kmalloc(sizeof(struct board_properties), GFP_KERNEL); if (unlikely(!bd)) return -ENOMEM;- + bd->owner = THIS_MODULE; new_bd = kmalloc(sizeof(struct dispc_device), GFP_KERNEL); if (unlikely(!new_bd)) return -ENOMEM;- + new_bd->props = bd; memset(&new_bd->class_dev, 0, sizeof(new_bd->class_dev)); new_bd->class_dev.class = &dispc_class; strlcpy(new_bd->class_dev.class_id, "omap_disp_control", KOBJ_NAME_LEN); rc = class_device_register(&new_bd->class_dev);- + if (unlikely(rc)) { kfree(new_bd); return -EPERM;@@ -1542,7 +1650,7 @@ create_sysfs_files(void) if (unlikely(rc)) { while (--i >= 0){ class_device_remove_file(&new_bd->class_dev,- &bl_class_device_attributes[i]);+ &bl_class_device_attributes[i]); } class_device_unregister(&new_bd->class_dev); /* No need to kfree(new_bd) since release() method does it for us*/@@ -1568,17 +1676,17 @@ omap2_dispout_init(void) { if (create_sysfs_files() < 0) { printk(KERN_ERR DRIVER- "Could not create sysfs files for display control\n");+ "Could not create sysfs files for display control\n"); return -ENODEV; }- + #ifdef CONFIG_OMAP2_LCD /* Register the driver with LDM */ if (platform_driver_register(&omap2_lcd_driver)) { printk(KERN_ERR DRIVER ": failed to register omap2_lcd driver\n"); return -ENODEV; }- + /* Register the device with LDM */ if (platform_device_register(&lcd_device)) { printk(KERN_ERR DRIVER ": failed to register lcd device\n");@@ -1593,7 +1701,7 @@ omap2_dispout_init(void) printk(KERN_ERR DRIVER ": failed to register omap2_tv driver\n"); return -ENODEV; }- + /* Register the device with LDM */ if (platform_device_register(&tv_device)) { printk(KERN_ERR DRIVER ": failed to register tv device\n");@@ -1640,7 +1748,7 @@ static struct fb_var_screeninfo h4_lcd_v .xres = H4_LCD_XRES, .yres = H4_LCD_YRES, .xres_virtual = H4_LCD_XRES,- .yres_virtual = H4_LCD_YRES*3,+ .yres_virtual = H4_LCD_YRES*2, .xoffset = 0, .yoffset = 0, .bits_per_pixel = 16,@@ -1657,8 +1765,12 @@ static struct fb_var_screeninfo h4_lcd_v .pixclock = H4_LCD_PIXCLOCK_MAX,/* picoseconds */ .left_margin = 40, /* pixclocks */ .right_margin = 4, /* pixclocks */+#ifdef CONFIG_MACH_OMAP3EVM+ .upper_margin = 2, /* line clocks */+#else .upper_margin = 8, /* line clocks */- .lower_margin = 2, /* line clocks */+#endif+ .lower_margin = 2, .hsync_len = 4, /* pixclocks */ .vsync_len = 2, /* line clocks */ .sync = 0,@@ -1674,7 +1786,7 @@ static struct fb_var_screeninfo ntsc_tv_ .xres = 640, .yres = 430, .xres_virtual = 720,- .yres_virtual = 480 * 3,+ .yres_virtual = 480 * 2, .xoffset = 0, .yoffset = 0, .bits_per_pixel = 16,@@ -1708,7 +1820,7 @@ static struct fb_var_screeninfo pal_tv_v .xres = 640, .yres = 480, .xres_virtual = 720,- .yres_virtual = 576 * 3,+ .yres_virtual = 576 * 2, .xoffset = 0, .yoffset = 0, .bits_per_pixel = 16,@@ -1741,20 +1853,20 @@ get_panel_default_var(struct fb_var_scre { if (output_dev == OMAP2_OUTPUT_LCD) { memcpy((struct fb_var_screeninfo *) var,- &h4_lcd_var, sizeof(*var));+ &h4_lcd_var, sizeof(*var)); } else if (output_dev == OMAP2_OUTPUT_TV) { int tv = omap2_disp_get_tvstandard(); if(tv == PAL_BDGHI ||- tv == PAL_NC ||- tv == PAL_N ||- tv == PAL_M ||- tv == PAL_60){+ tv == PAL_NC ||+ tv == PAL_N ||+ tv == PAL_M ||+ tv == PAL_60){ memcpy((struct fb_var_screeninfo *) var,- &pal_tv_var, sizeof(*var));+ &pal_tv_var, sizeof(*var)); }else { memcpy((struct fb_var_screeninfo *) var,- &ntsc_tv_var, sizeof(*var));+ &ntsc_tv_var, sizeof(*var)); } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -