]> Git Repo - linux.git/commitdiff
Merge branch 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <[email protected]>
Thu, 7 Apr 2011 19:49:17 +0000 (12:49 -0700)
committerLinus Torvalds <[email protected]>
Thu, 7 Apr 2011 19:49:17 +0000 (12:49 -0700)
* 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6:
  efifb: Add override for 11" Macbook Air 3,1
  efifb: Support overriding fields FW tells us with the DMI data.
  fb: Reduce priority of resource conflict message
  savagefb: Remove obsolete else clause in savage_setup_i2c_bus
  savagefb: Set up I2C based on chip family instead of card id
  savagefb: Replace magic register address with define
  drivers/video/bfin-lq035q1-fb.c: introduce missing kfree
  video: s3c-fb: fix checkpatch errors and warning
  efifb: support AMD Radeon HD 6490
  s3fb: fix Virge/GX2
  fbcon: Remove unused 'display *p' variable from fb_flashcursor()
  fbdev: sh_mobile_lcdcfb: fix module lock acquisition
  fbdev: sh_mobile_lcdcfb: add blanking support
  viafb: initialize margins correct
  viafb: refresh rate bug collection
  sh: mach-ap325rxa: move backlight control code
  sh: mach-ecovec24: support for main lcd backlight

1  2 
arch/sh/boards/mach-ap325rxa/setup.c
arch/sh/boards/mach-ecovec24/setup.c
drivers/video/via/viafbdev.c

index 636d8318a72a2c76136c99b4d509247d7aa3c959,d695e43d3c6b32a7bed074336a64e0fdb073cd1c..618bd566cf53bfe70b85b825072e0e7fa2b8aab5
@@@ -14,8 -14,8 +14,8 @@@
  #include <linux/device.h>
  #include <linux/interrupt.h>
  #include <linux/platform_device.h>
 -#include <linux/mfd/sh_mobile_sdhi.h>
  #include <linux/mmc/host.h>
 +#include <linux/mmc/sh_mobile_sdhi.h>
  #include <linux/mtd/physmap.h>
  #include <linux/mtd/sh_flctl.h>
  #include <linux/delay.h>
@@@ -156,24 -156,34 +156,34 @@@ static struct platform_device nand_flas
  #define PORT_DRVCRA   0xA405018A
  #define PORT_DRVCRB   0xA405018C
  
+ static int ap320_wvga_set_brightness(void *board_data, int brightness)
+ {
+       if (brightness) {
+               gpio_set_value(GPIO_PTS3, 0);
+               __raw_writew(0x100, FPGA_BKLREG);
+       } else {
+               __raw_writew(0, FPGA_BKLREG);
+               gpio_set_value(GPIO_PTS3, 1);
+       }
+       
+       return 0;
+ }
+ static int ap320_wvga_get_brightness(void *board_data)
+ {
+       return gpio_get_value(GPIO_PTS3);
+ }
  static void ap320_wvga_power_on(void *board_data, struct fb_info *info)
  {
        msleep(100);
  
        /* ASD AP-320/325 LCD ON */
        __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG);
-       /* backlight */
-       gpio_set_value(GPIO_PTS3, 0);
-       __raw_writew(0x100, FPGA_BKLREG);
  }
  
  static void ap320_wvga_power_off(void *board_data)
  {
-       /* backlight */
-       __raw_writew(0, FPGA_BKLREG);
-       gpio_set_value(GPIO_PTS3, 1);
        /* ASD AP-320/325 LCD OFF */
        __raw_writew(0, FPGA_LCDREG);
  }
@@@ -209,6 -219,12 +219,12 @@@ static struct sh_mobile_lcdc_info lcdc_
                .board_cfg = {
                        .display_on = ap320_wvga_power_on,
                        .display_off = ap320_wvga_power_off,
+                       .set_brightness = ap320_wvga_set_brightness,
+                       .get_brightness = ap320_wvga_get_brightness,
+               },
+               .bl_info = {
+                       .name = "sh_mobile_lcdc_bl",
+                       .max_brightness = 1,
                },
        }
  };
@@@ -423,7 -439,7 +439,7 @@@ static struct resource sdhi0_cn3_resour
        [0] = {
                .name   = "SDHI0",
                .start  = 0x04ce0000,
 -              .end    = 0x04ce01ff,
 +              .end    = 0x04ce00ff,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
@@@ -453,7 -469,7 +469,7 @@@ static struct resource sdhi1_cn7_resour
        [0] = {
                .name   = "SDHI1",
                .start  = 0x04cf0000,
 -              .end    = 0x04cf01ff,
 +              .end    = 0x04cf00ff,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
index 30ae2e4283f0a85f6d583c299e5209f8353ef125,c68e2863bf860d16996c27f023431656b21c9836..86a0d565adededfd69fcb491963fe30db5572f69
@@@ -11,9 -11,9 +11,9 @@@
  #include <linux/init.h>
  #include <linux/device.h>
  #include <linux/platform_device.h>
 -#include <linux/mfd/sh_mobile_sdhi.h>
  #include <linux/mmc/host.h>
  #include <linux/mmc/sh_mmcif.h>
 +#include <linux/mmc/sh_mobile_sdhi.h>
  #include <linux/mtd/physmap.h>
  #include <linux/gpio.h>
  #include <linux/interrupt.h>
@@@ -263,6 -263,18 +263,18 @@@ const static struct fb_videomode ecovec
        },
  };
  
+ static int ecovec24_set_brightness(void *board_data, int brightness)
+ {
+       gpio_set_value(GPIO_PTR1, brightness);
+       return 0;
+ }
+ static int ecovec24_get_brightness(void *board_data)
+ {
+       return gpio_get_value(GPIO_PTR1);
+ }
  static struct sh_mobile_lcdc_info lcdc_info = {
        .ch[0] = {
                .interface_type = RGB18,
                        .height = 91,
                },
                .board_cfg = {
+                       .set_brightness = ecovec24_set_brightness,
+                       .get_brightness = ecovec24_get_brightness,
+               },
+               .bl_info = {
+                       .name = "sh_mobile_lcdc_bl",
+                       .max_brightness = 1,
                },
        }
  };
@@@ -464,7 -482,7 +482,7 @@@ static struct i2c_board_info ts_i2c_cli
        .irq            = IRQ0,
  };
  
 -#ifdef CONFIG_MFD_SH_MOBILE_SDHI
 +#if defined(CONFIG_MMC_TMIO) || defined(CONFIG_MMC_TMIO_MODULE)
  /* SDHI0 */
  static void sdhi0_set_pwr(struct platform_device *pdev, int state)
  {
@@@ -482,7 -500,7 +500,7 @@@ static struct resource sdhi0_resources[
        [0] = {
                .name   = "SDHI0",
                .start  = 0x04ce0000,
 -              .end    = 0x04ce01ff,
 +              .end    = 0x04ce00ff,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
@@@ -522,7 -540,7 +540,7 @@@ static struct resource sdhi1_resources[
        [0] = {
                .name   = "SDHI1",
                .start  = 0x04cf0000,
 -              .end    = 0x04cf01ff,
 +              .end    = 0x04cf00ff,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
@@@ -880,7 -898,7 +898,7 @@@ static struct platform_device *ecovec_d
        &ceu0_device,
        &ceu1_device,
        &keysc_device,
 -#ifdef CONFIG_MFD_SH_MOBILE_SDHI
 +#if defined(CONFIG_MMC_TMIO) || defined(CONFIG_MMC_TMIO_MODULE)
        &sdhi0_device,
  #if !defined(CONFIG_MMC_SH_MMCIF)
        &sdhi1_device,
@@@ -936,7 -954,7 +954,7 @@@ static void __init sh_eth_init(struct s
                return;
        }
  
 -      /* read MAC address frome EEPROM */
 +      /* read MAC address from EEPROM */
        for (i = 0; i < sizeof(pd->mac_addr); i++) {
                pd->mac_addr[i] = mac_read(a, 0x10 + i);
                msleep(10);
@@@ -1102,7 -1120,7 +1120,7 @@@ static int __init arch_setup(void
  
                /* enable TouchScreen */
                i2c_register_board_info(0, &ts_i2c_clients, 1);
 -              set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
 +              irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
        }
  
        /* enable CEU0 */
        gpio_direction_input(GPIO_PTR5);
        gpio_direction_input(GPIO_PTR6);
  
 -#ifdef CONFIG_MFD_SH_MOBILE_SDHI
 +#if defined(CONFIG_MMC_TMIO) || defined(CONFIG_MMC_TMIO_MODULE)
        /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */
        gpio_request(GPIO_FN_SDHI0CD,  NULL);
        gpio_request(GPIO_FN_SDHI0WP,  NULL);
index b64818953aa7017f82ac559d1290eaabf74cb72f,9d9bb9b4ed3f41b4fdf8d0397b66aba74c7f6196..a542bed086e24900af1ee2f85ab670a2015ef4ff
@@@ -182,13 -182,24 +182,24 @@@ static int viafb_release(struct fb_inf
        return 0;
  }
  
+ static inline int get_var_refresh(struct fb_var_screeninfo *var)
+ {
+       u32 htotal, vtotal;
+       htotal = var->left_margin + var->xres + var->right_margin
+               + var->hsync_len;
+       vtotal = var->upper_margin + var->yres + var->lower_margin
+               + var->vsync_len;
+       return PICOS2KHZ(var->pixclock) * 1000 / (htotal * vtotal);
+ }
  static int viafb_check_var(struct fb_var_screeninfo *var,
        struct fb_info *info)
  {
-       int htotal, vtotal, depth;
+       int depth, refresh;
        struct VideoModeTable *vmode_entry;
        struct viafb_par *ppar = info->par;
-       u32 long_refresh, line;
+       u32 line;
  
        DEBUG_MSG(KERN_INFO "viafb_check_var!\n");
        /* Sanity check */
        /* Based on var passed in to calculate the refresh,
         * because our driver use some modes special.
         */
-       htotal = var->xres + var->left_margin +
-       var->right_margin + var->hsync_len;
-       vtotal = var->yres + var->upper_margin +
-               var->lower_margin + var->vsync_len;
-       long_refresh = 1000000000UL / var->pixclock * 1000;
-       long_refresh /= (htotal * vtotal);
-       viafb_refresh = viafb_get_refresh(var->xres, var->yres, long_refresh);
+       refresh = viafb_get_refresh(var->xres, var->yres,
+               get_var_refresh(var));
  
        /* Adjust var according to our driver's own table */
-       viafb_fill_var_timing_info(var, viafb_refresh, vmode_entry);
+       viafb_fill_var_timing_info(var, refresh, vmode_entry);
        if (var->accel_flags & FB_ACCELF_TEXT &&
                !ppar->shared->vdev->engine_mmio)
                var->accel_flags = 0;
@@@ -253,12 -258,13 +258,13 @@@ static int viafb_set_par(struct fb_inf
  {
        struct viafb_par *viapar = info->par;
        struct VideoModeTable *vmode_entry, *vmode_entry1 = NULL;
+       int refresh;
        DEBUG_MSG(KERN_INFO "viafb_set_par!\n");
  
        viafb_update_fix(info);
        viapar->depth = fb_get_color_depth(&info->var, &info->fix);
        viafb_update_device_setting(viafbinfo->var.xres, viafbinfo->var.yres,
-               viafbinfo->var.bits_per_pixel, viafb_refresh, 0);
+               viafbinfo->var.bits_per_pixel, 0);
  
        vmode_entry = viafb_get_mode(viafbinfo->var.xres, viafbinfo->var.yres);
        if (viafb_dual_fb) {
                        viafbinfo1->var.yres);
                viafb_update_device_setting(viafbinfo1->var.xres,
                        viafbinfo1->var.yres, viafbinfo1->var.bits_per_pixel,
-                       viafb_refresh1, 1);
+                       1);
        } else if (viafb_SAMM_ON == 1) {
                DEBUG_MSG(KERN_INFO
                "viafb_second_xres = %d, viafb_second_yres = %d, bpp = %d\n",
                        viafb_second_yres);
  
                viafb_update_device_setting(viafb_second_xres,
-                       viafb_second_yres, viafb_bpp1, viafb_refresh1, 1);
+                       viafb_second_yres, viafb_bpp1, 1);
        }
  
+       refresh = viafb_get_refresh(info->var.xres, info->var.yres,
+               get_var_refresh(&info->var));
        if (vmode_entry) {
-               if (viafb_dual_fb && viapar->iga_path == IGA2)
+               if (viafb_dual_fb && viapar->iga_path == IGA2) {
                        viafb_bpp1 = info->var.bits_per_pixel;
-               else
+                       viafb_refresh1 = refresh;
+               } else {
                        viafb_bpp = info->var.bits_per_pixel;
+                       viafb_refresh = refresh;
+               }
  
                if (info->var.accel_flags & FB_ACCELF_TEXT)
                        info->flags &= ~FBINFO_HWACCEL_DISABLED;
@@@ -1795,14 -1806,9 +1806,9 @@@ int __devinit via_fb_pci_probe(struct v
        default_var.xres_virtual = default_xres;
        default_var.yres_virtual = default_yres;
        default_var.bits_per_pixel = viafb_bpp;
-       default_var.pixclock =
-           viafb_get_pixclock(default_xres, default_yres, viafb_refresh);
-       default_var.left_margin = (default_xres >> 3) & 0xf8;
-       default_var.right_margin = 32;
-       default_var.upper_margin = 16;
-       default_var.lower_margin = 4;
-       default_var.hsync_len = default_var.left_margin;
-       default_var.vsync_len = 4;
+       viafb_fill_var_timing_info(&default_var, viafb_get_refresh(
+               default_var.xres, default_var.yres, viafb_refresh),
+               viafb_get_mode(default_var.xres, default_var.yres));
        viafb_setup_fixinfo(&viafbinfo->fix, viaparinfo);
        viafbinfo->var = default_var;
  
                default_var.xres_virtual = viafb_second_virtual_xres;
                default_var.yres_virtual = viafb_second_virtual_yres;
                default_var.bits_per_pixel = viafb_bpp1;
-               default_var.pixclock =
-                   viafb_get_pixclock(viafb_second_xres, viafb_second_yres,
-                   viafb_refresh);
-               default_var.left_margin = (viafb_second_xres >> 3) & 0xf8;
-               default_var.right_margin = 32;
-               default_var.upper_margin = 16;
-               default_var.lower_margin = 4;
-               default_var.hsync_len = default_var.left_margin;
-               default_var.vsync_len = 4;
+               viafb_fill_var_timing_info(&default_var, viafb_get_refresh(
+                       default_var.xres, default_var.yres, viafb_refresh1),
+                       viafb_get_mode(default_var.xres, default_var.yres));
  
                viafb_setup_fixinfo(&viafbinfo1->fix, viaparinfo1);
                viafb_check_var(&default_var, viafbinfo1);
@@@ -2004,22 -2004,24 +2004,24 @@@ static int __init viafb_setup(char *opt
   */
  int __init viafb_init(void)
  {
-       u32 dummy;
+       u32 dummy_x, dummy_y;
  #ifndef MODULE
        char *option = NULL;
        if (fb_get_options("viafb", &option))
                return -ENODEV;
        viafb_setup(option);
  #endif
-       if (parse_mode(viafb_mode, &dummy, &dummy)
-               || parse_mode(viafb_mode1, &dummy, &dummy)
+       if (parse_mode(viafb_mode, &dummy_x, &dummy_y)
+               || !viafb_get_mode(dummy_x, dummy_y)
+               || parse_mode(viafb_mode1, &dummy_x, &dummy_y)
+               || !viafb_get_mode(dummy_x, dummy_y)
                || viafb_bpp < 0 || viafb_bpp > 32
                || viafb_bpp1 < 0 || viafb_bpp1 > 32
                || parse_active_dev())
                return -EINVAL;
  
        printk(KERN_INFO
 -       "VIA Graphics Intergration Chipset framebuffer %d.%d initializing\n",
 +       "VIA Graphics Integration Chipset framebuffer %d.%d initializing\n",
               VERSION_MAJOR, VERSION_MINOR);
        return 0;
  }
This page took 0.082999 seconds and 4 git commands to generate.