diff options
Diffstat (limited to 'drivers/video')
101 files changed, 573 insertions, 383 deletions
diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index a6f7cc0a0883..9a23698b6fe8 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c @@ -265,7 +265,6 @@ static int pm860x_backlight_probe(struct platform_device *pdev) static struct platform_driver pm860x_backlight_driver = { .driver = { .name = "88pm860x-backlight", - .owner = THIS_MODULE, }, .probe = pm860x_backlight_probe, }; diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c index 86234c31d79c..50774e657700 100644 --- a/drivers/video/backlight/aat2870_bl.c +++ b/drivers/video/backlight/aat2870_bl.c @@ -211,7 +211,6 @@ static int aat2870_bl_remove(struct platform_device *pdev) static struct platform_driver aat2870_bl_driver = { .driver = { .name = "aat2870-backlight", - .owner = THIS_MODULE, }, .probe = aat2870_bl_probe, .remove = aat2870_bl_remove, diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index f37097a261a2..dd88ba1d71ce 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c @@ -67,6 +67,7 @@ static int adp5520_bl_set(struct backlight_device *bl, int brightness) static int adp5520_bl_update_status(struct backlight_device *bl) { int brightness = bl->props.brightness; + if (bl->props.power != FB_BLANK_UNBLANK) brightness = 0; @@ -374,7 +375,6 @@ static SIMPLE_DEV_PM_OPS(adp5520_bl_pm_ops, adp5520_bl_suspend, static struct platform_driver adp5520_bl_driver = { .driver = { .name = "adp5520-backlight", - .owner = THIS_MODULE, .pm = &adp5520_bl_pm_ops, }, .probe = adp5520_bl_probe, diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c index be8d83deca7d..71147f4461b8 100644 --- a/drivers/video/backlight/adp8860_bl.c +++ b/drivers/video/backlight/adp8860_bl.c @@ -181,6 +181,7 @@ static int adp8860_clr_bits(struct i2c_client *client, int reg, uint8_t bit_mask static void adp8860_led_work(struct work_struct *work) { struct adp8860_led *led = container_of(work, struct adp8860_led, work); + adp8860_write(led->client, ADP8860_ISC1 - led->id + 1, led->new_brightness >> 1); } @@ -362,6 +363,7 @@ static int adp8860_bl_set(struct backlight_device *bl, int brightness) static int adp8860_bl_update_status(struct backlight_device *bl) { int brightness = bl->props.brightness; + if (bl->props.power != FB_BLANK_UNBLANK) brightness = 0; @@ -499,6 +501,7 @@ static ssize_t adp8860_bl_l1_daylight_max_store(struct device *dev, { struct adp8860_bl *data = dev_get_drvdata(dev); int ret = kstrtoul(buf, 10, &data->cached_daylight_max); + if (ret) return ret; diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c index 251af4d38d86..037e43083343 100644 --- a/drivers/video/backlight/adp8870_bl.c +++ b/drivers/video/backlight/adp8870_bl.c @@ -144,6 +144,7 @@ static int adp8870_read(struct i2c_client *client, int reg, uint8_t *val) static int adp8870_write(struct i2c_client *client, u8 reg, u8 val) { int ret = i2c_smbus_write_byte_data(client, reg, val); + if (ret) dev_err(&client->dev, "failed to write\n"); @@ -195,6 +196,7 @@ static int adp8870_clr_bits(struct i2c_client *client, int reg, uint8_t bit_mask static void adp8870_led_work(struct work_struct *work) { struct adp8870_led *led = container_of(work, struct adp8870_led, work); + adp8870_write(led->client, ADP8870_ISC1 + led->id - 1, led->new_brightness >> 1); } @@ -399,6 +401,7 @@ static int adp8870_bl_set(struct backlight_device *bl, int brightness) static int adp8870_bl_update_status(struct backlight_device *bl) { int brightness = bl->props.brightness; + if (bl->props.power != FB_BLANK_UNBLANK) brightness = 0; @@ -649,6 +652,7 @@ static ssize_t adp8870_bl_l1_daylight_max_store(struct device *dev, { struct adp8870_bl *data = dev_get_drvdata(dev); int ret = kstrtoul(buf, 10, &data->cached_daylight_max); + if (ret) return ret; diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index 4726c8be626f..5f897f99cc9b 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c @@ -325,11 +325,11 @@ static int ams369fg06_power_on(struct ams369fg06 *lcd) if (!pd->reset) { dev_err(lcd->dev, "reset is NULL.\n"); return -EINVAL; - } else { - pd->reset(lcd->ld); - msleep(pd->reset_delay); } + pd->reset(lcd->ld); + msleep(pd->reset_delay); + ret = ams369fg06_ldi_init(lcd); if (ret) { dev_err(lcd->dev, "failed to initialize ldi.\n"); diff --git a/drivers/video/backlight/as3711_bl.c b/drivers/video/backlight/as3711_bl.c index bb1fc45b7549..734a9158946b 100644 --- a/drivers/video/backlight/as3711_bl.c +++ b/drivers/video/backlight/as3711_bl.c @@ -467,7 +467,6 @@ static int as3711_backlight_probe(struct platform_device *pdev) static struct platform_driver as3711_backlight_driver = { .driver = { .name = "as3711-backlight", - .owner = THIS_MODULE, }, .probe = as3711_backlight_probe, }; diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c index 51d18d637e2b..d7c37a8ccd1f 100644 --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c @@ -143,6 +143,7 @@ static void lcdtg_i2c_send_byte(struct corgi_lcd *lcd, uint8_t base, uint8_t data) { int i; + for (i = 0; i < 8; i++) { if (data & 0x80) lcdtg_i2c_send_bit(lcd, base | POWER0_COM_DOUT); diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c index f3fed9ef745f..3e3880fc8c8e 100644 --- a/drivers/video/backlight/cr_bllcd.c +++ b/drivers/video/backlight/cr_bllcd.c @@ -235,6 +235,7 @@ static int cr_backlight_probe(struct platform_device *pdev) static int cr_backlight_remove(struct platform_device *pdev) { struct cr_panel *crp = platform_get_drvdata(pdev); + crp->cr_backlight_device->props.power = FB_BLANK_POWERDOWN; crp->cr_backlight_device->props.brightness = 0; crp->cr_backlight_device->props.max_brightness = 0; diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index 12c5d840c590..f793738f06fb 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c @@ -162,7 +162,6 @@ static int da903x_backlight_probe(struct platform_device *pdev) static struct platform_driver da903x_backlight_driver = { .driver = { .name = "da903x-backlight", - .owner = THIS_MODULE, }, .probe = da903x_backlight_probe, }; diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c index 20d55becaa74..d4bd74bd5070 100644 --- a/drivers/video/backlight/da9052_bl.c +++ b/drivers/video/backlight/da9052_bl.c @@ -173,7 +173,6 @@ static struct platform_driver da9052_wled_driver = { .id_table = da9052_wled_ids, .driver = { .name = "da9052-wled", - .owner = THIS_MODULE, }, }; diff --git a/drivers/video/backlight/ep93xx_bl.c b/drivers/video/backlight/ep93xx_bl.c index 0d1f633c6480..0067931821c6 100644 --- a/drivers/video/backlight/ep93xx_bl.c +++ b/drivers/video/backlight/ep93xx_bl.c @@ -128,7 +128,6 @@ static SIMPLE_DEV_PM_OPS(ep93xxbl_pm_ops, ep93xxbl_suspend, ep93xxbl_resume); static struct platform_driver ep93xxbl_driver = { .driver = { .name = "ep93xx-bl", - .owner = THIS_MODULE, .pm = &ep93xxbl_pm_ops, }, .probe = ep93xxbl_probe, diff --git a/drivers/video/backlight/generic_bl.c b/drivers/video/backlight/generic_bl.c index 5d8d65200db7..67dfb939a514 100644 --- a/drivers/video/backlight/generic_bl.c +++ b/drivers/video/backlight/generic_bl.c @@ -52,24 +52,6 @@ static int genericbl_get_intensity(struct backlight_device *bd) return genericbl_intensity; } -/* - * Called when the battery is low to limit the backlight intensity. - * If limit==0 clear any limit, otherwise limit the intensity - */ -void genericbl_limit_intensity(int limit) -{ - struct backlight_device *bd = generic_backlight_device; - - mutex_lock(&bd->ops_lock); - if (limit) - bd->props.state |= GENERICBL_BATTLOW; - else - bd->props.state &= ~GENERICBL_BATTLOW; - backlight_update_status(generic_backlight_device); - mutex_unlock(&bd->ops_lock); -} -EXPORT_SYMBOL(genericbl_limit_intensity); - static const struct backlight_ops genericbl_ops = { .options = BL_CORE_SUSPENDRESUME, .get_brightness = genericbl_get_intensity, diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index aaead04a2d54..439feb2389a8 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -151,7 +151,6 @@ static struct of_device_id gpio_backlight_of_match[] = { static struct platform_driver gpio_backlight_driver = { .driver = { .name = "gpio-backlight", - .owner = THIS_MODULE, .of_match_table = of_match_ptr(gpio_backlight_of_match), }, .probe = gpio_backlight_probe, diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c index ea67fe199e34..e7f0890cc211 100644 --- a/drivers/video/backlight/ili922x.c +++ b/drivers/video/backlight/ili922x.c @@ -495,17 +495,18 @@ static int ili922x_probe(struct spi_device *spi) "no LCD found: Chip ID 0x%x, ret %d\n", reg, ret); return -ENODEV; - } else { - dev_info(&spi->dev, "ILI%x found, SPI freq %d, mode %d\n", - reg, spi->max_speed_hz, spi->mode); } + dev_info(&spi->dev, "ILI%x found, SPI freq %d, mode %d\n", + reg, spi->max_speed_hz, spi->mode); + ret = ili922x_read_status(spi, ®); if (ret) { dev_err(&spi->dev, "reading RS failed...\n"); return ret; - } else - dev_dbg(&spi->dev, "status: 0x%x\n", reg); + } + + dev_dbg(&spi->dev, "status: 0x%x\n", reg); ili922x_display_init(spi); diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c index 6ce96b4a8796..7e6ff5346892 100644 --- a/drivers/video/backlight/jornada720_bl.c +++ b/drivers/video/backlight/jornada720_bl.c @@ -41,11 +41,11 @@ static int jornada_bl_get_brightness(struct backlight_device *bd) dev_err(&bd->dev, "get brightness timeout\n"); jornada_ssp_end(); return -ETIMEDOUT; - } else { - /* exchange txdummy for value */ - ret = jornada_ssp_byte(TXDUMMY); } + /* exchange txdummy for value */ + ret = jornada_ssp_byte(TXDUMMY); + jornada_ssp_end(); return BL_MAX_BRIGHT - ret; diff --git a/drivers/video/backlight/jornada720_lcd.c b/drivers/video/backlight/jornada720_lcd.c index 228bc319de19..dfa0fa0d5c78 100644 --- a/drivers/video/backlight/jornada720_lcd.c +++ b/drivers/video/backlight/jornada720_lcd.c @@ -27,11 +27,7 @@ static int jornada_lcd_get_power(struct lcd_device *ld) { - /* LDD2 in PPC = LCD POWER */ - if (PPSR & PPC_LDD2) - return FB_BLANK_UNBLANK; /* PW ON */ - else - return FB_BLANK_POWERDOWN; /* PW OFF */ + return PPSR & PPC_LDD2 ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; } static int jornada_lcd_get_contrast(struct lcd_device *ld) diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c index ccb44e8e4927..f71eaf10c4eb 100644 --- a/drivers/video/backlight/ld9040.c +++ b/drivers/video/backlight/ld9040.c @@ -566,11 +566,11 @@ static int ld9040_power_on(struct ld9040 *lcd) if (!pd->reset) { dev_err(lcd->dev, "reset is NULL.\n"); return -EINVAL; - } else { - pd->reset(lcd->ld); - msleep(pd->reset_delay); } + pd->reset(lcd->ld); + msleep(pd->reset_delay); + ret = ld9040_ldi_init(lcd); if (ret) { dev_err(lcd->dev, "failed to initialize ldi.\n"); diff --git a/drivers/video/backlight/lm3533_bl.c b/drivers/video/backlight/lm3533_bl.c index cff1fbe89a1b..0e2337f367b6 100644 --- a/drivers/video/backlight/lm3533_bl.c +++ b/drivers/video/backlight/lm3533_bl.c @@ -397,7 +397,6 @@ static void lm3533_bl_shutdown(struct platform_device *pdev) static struct platform_driver lm3533_bl_driver = { .driver = { .name = "lm3533-backlight", - .owner = THIS_MODULE, .pm = &lm3533_bl_pm_ops, }, .probe = lm3533_bl_probe, diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c index 5f36808d214f..cd50df5807ea 100644 --- a/drivers/video/backlight/lm3639_bl.c +++ b/drivers/video/backlight/lm3639_bl.c @@ -254,7 +254,6 @@ static void lm3639_torch_brightness_set(struct led_classdev *cdev, return; out: dev_err(pchip->dev, "i2c failed to access register\n"); - return; } /* flash */ @@ -293,7 +292,6 @@ static void lm3639_flash_brightness_set(struct led_classdev *cdev, return; out: dev_err(pchip->dev, "i2c failed to access register\n"); - return; } static const struct regmap_config lm3639_regmap = { diff --git a/drivers/video/backlight/lms501kf03.c b/drivers/video/backlight/lms501kf03.c index 77258b7b04be..7e3810308c3e 100644 --- a/drivers/video/backlight/lms501kf03.c +++ b/drivers/video/backlight/lms501kf03.c @@ -232,19 +232,19 @@ static int lms501kf03_power_on(struct lms501kf03 *lcd) if (!pd->power_on) { dev_err(lcd->dev, "power_on is NULL.\n"); return -EINVAL; - } else { - pd->power_on(lcd->ld, 1); - msleep(pd->power_on_delay); } + pd->power_on(lcd->ld, 1); + msleep(pd->power_on_delay); + if (!pd->reset) { dev_err(lcd->dev, "reset is NULL.\n"); return -EINVAL; - } else { - pd->reset(lcd->ld); - msleep(pd->reset_delay); } + pd->reset(lcd->ld); + msleep(pd->reset_delay); + ret = lms501kf03_ldi_init(lcd); if (ret) { dev_err(lcd->dev, "failed to initialize ldi.\n"); diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index dcdd5443efcf..25fb8e3d75b1 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c @@ -268,6 +268,7 @@ static int lp855x_bl_update_status(struct backlight_device *bl) } else if (lp->mode == REGISTER_BASED) { u8 val = bl->props.brightness; + lp855x_write_byte(lp, lp->cfg->reg_brightness, val); } @@ -308,6 +309,7 @@ static ssize_t lp855x_get_chip_id(struct device *dev, struct device_attribute *attr, char *buf) { struct lp855x *lp = dev_get_drvdata(dev); + return scnprintf(buf, PAGE_SIZE, "%s\n", lp->chipname); } diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c index d6c4f6a2d43e..e418d5b1aa55 100644 --- a/drivers/video/backlight/lp8788_bl.c +++ b/drivers/video/backlight/lp8788_bl.c @@ -315,7 +315,6 @@ static struct platform_driver lp8788_bl_driver = { .remove = lp8788_backlight_remove, .driver = { .name = LP8788_DEV_BACKLIGHT, - .owner = THIS_MODULE, }, }; module_platform_driver(lp8788_bl_driver); diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c index 66fa08c920d2..7b738d60ecc2 100644 --- a/drivers/video/backlight/max8925_bl.c +++ b/drivers/video/backlight/max8925_bl.c @@ -197,7 +197,6 @@ static int max8925_backlight_probe(struct platform_device *pdev) static struct platform_driver max8925_backlight_driver = { .driver = { .name = "max8925-backlight", - .owner = THIS_MODULE, }, .probe = max8925_backlight_probe, }; diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index a0dcd88ac74f..546d94df21d5 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c @@ -120,6 +120,7 @@ static int omapbl_update_status(struct backlight_device *dev) static int omapbl_get_intensity(struct backlight_device *dev) { struct omap_backlight *bl = bl_get_data(dev); + return bl->current_intensity; } diff --git a/drivers/video/backlight/ot200_bl.c b/drivers/video/backlight/ot200_bl.c index f5a5202dd79d..3acdb9f646ed 100644 --- a/drivers/video/backlight/ot200_bl.c +++ b/drivers/video/backlight/ot200_bl.c @@ -152,7 +152,6 @@ static int ot200_backlight_remove(struct platform_device *pdev) static struct platform_driver ot200_backlight_driver = { .driver = { .name = "ot200-backlight", - .owner = THIS_MODULE, }, .probe = ot200_backlight_probe, .remove = ot200_backlight_remove, diff --git a/drivers/video/backlight/pandora_bl.c b/drivers/video/backlight/pandora_bl.c index 2e3f82063c03..5d8bb8b20183 100644 --- a/drivers/video/backlight/pandora_bl.c +++ b/drivers/video/backlight/pandora_bl.c @@ -142,7 +142,6 @@ static int pandora_backlight_probe(struct platform_device *pdev) static struct platform_driver pandora_backlight_driver = { .driver = { .name = "pandora-backlight", - .owner = THIS_MODULE, }, .probe = pandora_backlight_probe, }; diff --git a/drivers/video/backlight/pcf50633-backlight.c b/drivers/video/backlight/pcf50633-backlight.c index b95d3b0aaffe..85bd573b6d15 100644 --- a/drivers/video/backlight/pcf50633-backlight.c +++ b/drivers/video/backlight/pcf50633-backlight.c @@ -90,6 +90,7 @@ static int pcf50633_bl_update_status(struct backlight_device *bl) static int pcf50633_bl_get_brightness(struct backlight_device *bl) { struct pcf50633_bl *pcf_bl = bl_get_data(bl); + return pcf_bl->brightness; } diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c index c3d2e209fc8f..872a3bf21faf 100644 --- a/drivers/video/backlight/platform_lcd.c +++ b/drivers/video/backlight/platform_lcd.c @@ -148,7 +148,6 @@ MODULE_DEVICE_TABLE(of, platform_lcd_of_match); static struct platform_driver platform_lcd_driver = { .driver = { .name = "platform-lcd", - .owner = THIS_MODULE, .pm = &platform_lcd_pm_ops, .of_match_table = of_match_ptr(platform_lcd_of_match), }, diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index b85983e97f0a..cb5ae4c08469 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -390,7 +390,6 @@ static const struct dev_pm_ops pwm_backlight_pm_ops = { static struct platform_driver pwm_backlight_driver = { .driver = { .name = "pwm-backlight", - .owner = THIS_MODULE, .pm = &pwm_backlight_pm_ops, .of_match_table = of_match_ptr(pwm_backlight_of_match), }, diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c index f3a65c8940ed..28bfa127fee4 100644 --- a/drivers/video/backlight/s6e63m0.c +++ b/drivers/video/backlight/s6e63m0.c @@ -507,19 +507,19 @@ static int s6e63m0_power_on(struct s6e63m0 *lcd) if (!pd->power_on) { dev_err(lcd->dev, "power_on is NULL.\n"); return -EINVAL; - } else { - pd->power_on(lcd->ld, 1); - msleep(pd->power_on_delay); } + pd->power_on(lcd->ld, 1); + msleep(pd->power_on_delay); + if (!pd->reset) { dev_err(lcd->dev, "reset is NULL.\n"); return -EINVAL; - } else { - pd->reset(lcd->ld); - msleep(pd->reset_delay); } + pd->reset(lcd->ld); + msleep(pd->reset_delay); + ret = s6e63m0_ldi_init(lcd); if (ret) { dev_err(lcd->dev, "failed to initialize ldi.\n"); diff --git a/drivers/video/backlight/tdo24m.c b/drivers/video/backlight/tdo24m.c index 908016fc5829..30afce33ef2a 100644 --- a/drivers/video/backlight/tdo24m.c +++ b/drivers/video/backlight/tdo24m.c @@ -300,12 +300,14 @@ static int tdo24m_power(struct tdo24m *lcd, int power) static int tdo24m_set_power(struct lcd_device *ld, int power) { struct tdo24m *lcd = lcd_get_data(ld); + return tdo24m_power(lcd, power); } static int tdo24m_get_power(struct lcd_device *ld) { struct tdo24m *lcd = lcd_get_data(ld); + return lcd->power; } diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c index 2e04d93aa0ef..61d72bffd402 100644 --- a/drivers/video/backlight/tps65217_bl.c +++ b/drivers/video/backlight/tps65217_bl.c @@ -323,7 +323,6 @@ static int tps65217_bl_probe(struct platform_device *pdev) static struct platform_driver tps65217_bl_driver = { .probe = tps65217_bl_probe, .driver = { - .owner = THIS_MODULE, .name = "tps65217-bl", }, }; diff --git a/drivers/video/backlight/wm831x_bl.c b/drivers/video/backlight/wm831x_bl.c index 8b9455e93069..6eab0d6c262a 100644 --- a/drivers/video/backlight/wm831x_bl.c +++ b/drivers/video/backlight/wm831x_bl.c @@ -111,6 +111,7 @@ static int wm831x_backlight_update_status(struct backlight_device *bl) static int wm831x_backlight_get_brightness(struct backlight_device *bl) { struct wm831x_backlight_data *data = bl_get_data(bl); + return data->current_brightness; } @@ -217,7 +218,6 @@ static int wm831x_backlight_probe(struct platform_device *pdev) static struct platform_driver wm831x_backlight_driver = { .driver = { .name = "wm831x-backlight", - .owner = THIS_MODULE, }, .probe = wm831x_backlight_probe, }; diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c index 61b182bf32a2..dbfe4eecf12e 100644 --- a/drivers/video/console/bitblit.c +++ b/drivers/video/console/bitblit.c @@ -205,7 +205,6 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info, static void bit_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only) { - int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; unsigned int cw = vc->vc_font.width; unsigned int ch = vc->vc_font.height; unsigned int rw = info->var.xres - (vc->vc_cols*cw); @@ -214,7 +213,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info, unsigned int bs = info->var.yres - bh; struct fb_fillrect region; - region.color = attr_bgcol_ec(bgshift, vc, info); + region.color = 0; region.rop = ROP_COPY; if (rw && !bottom_only) { diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 57b1d44acbfe..eb976ee3a02f 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -448,8 +448,10 @@ static int __init fb_console_setup(char *this_opt) return 1; while ((options = strsep(&this_opt, ",")) != NULL) { - if (!strncmp(options, "font:", 5)) + if (!strncmp(options, "font:", 5)) { strlcpy(fontname, options + 5, sizeof(fontname)); + continue; + } if (!strncmp(options, "scrollback:", 11)) { options += 11; @@ -457,13 +459,9 @@ static int __init fb_console_setup(char *this_opt) fbcon_softback_size = simple_strtoul(options, &options, 0); if (*options == 'k' || *options == 'K') { fbcon_softback_size *= 1024; - options++; } - if (*options != ',') - return 1; - options++; - } else - return 1; + } + continue; } if (!strncmp(options, "map:", 4)) { @@ -478,8 +476,7 @@ static int __init fb_console_setup(char *this_opt) fbcon_map_override(); } - - return 1; + continue; } if (!strncmp(options, "vc:", 3)) { @@ -491,7 +488,8 @@ static int __init fb_console_setup(char *this_opt) if (*options++ == '-') last_fb_vc = simple_strtoul(options, &options, 10) - 1; fbcon_is_default = 0; - } + continue; + } if (!strncmp(options, "rotate:", 7)) { options += 7; @@ -499,6 +497,7 @@ static int __init fb_console_setup(char *this_opt) initial_rotation = simple_strtoul(options, &options, 0); if (initial_rotation > 3) initial_rotation = 0; + continue; } } return 1; diff --git a/drivers/video/console/fbcon_ccw.c b/drivers/video/console/fbcon_ccw.c index 41b32ae23dac..5a3cbf6dff4d 100644 --- a/drivers/video/console/fbcon_ccw.c +++ b/drivers/video/console/fbcon_ccw.c @@ -197,9 +197,8 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info, unsigned int bh = info->var.xres - (vc->vc_rows*ch); unsigned int bs = vc->vc_rows*ch; struct fb_fillrect region; - int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; - region.color = attr_bgcol_ec(bgshift,vc,info); + region.color = 0; region.rop = ROP_COPY; if (rw && !bottom_only) { diff --git a/drivers/video/console/fbcon_cw.c b/drivers/video/console/fbcon_cw.c index a93670ef7f89..e7ee44db4e98 100644 --- a/drivers/video/console/fbcon_cw.c +++ b/drivers/video/console/fbcon_cw.c @@ -180,9 +180,8 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info, unsigned int bh = info->var.xres - (vc->vc_rows*ch); unsigned int rs = info->var.yres - rw; struct fb_fillrect region; - int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; - region.color = attr_bgcol_ec(bgshift,vc,info); + region.color = 0; region.rop = ROP_COPY; if (rw && !bottom_only) { diff --git a/drivers/video/console/fbcon_ud.c b/drivers/video/console/fbcon_ud.c index ff0872c0498b..19e3714abfe8 100644 --- a/drivers/video/console/fbcon_ud.c +++ b/drivers/video/console/fbcon_ud.c @@ -227,9 +227,8 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info, unsigned int rw = info->var.xres - (vc->vc_cols*cw); unsigned int bh = info->var.yres - (vc->vc_rows*ch); struct fb_fillrect region; - int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; - region.color = attr_bgcol_ec(bgshift,vc,info); + region.color = 0; region.rop = ROP_COPY; if (rw && !bottom_only) { diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 6e6aa704fe84..517f565b65d7 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -56,7 +56,7 @@ static int cursor_size_lastfrom; static int cursor_size_lastto; static u32 vgacon_xres; static u32 vgacon_yres; -static struct vgastate state; +static struct vgastate vgastate; #define BLANK 0x0020 @@ -400,7 +400,7 @@ static const char *vgacon_startup(void) vga_video_num_lines = screen_info.orig_video_lines; vga_video_num_columns = screen_info.orig_video_cols; - state.vgabase = NULL; + vgastate.vgabase = NULL; if (screen_info.orig_video_mode == 7) { /* Monochrome display */ @@ -851,12 +851,12 @@ static void vga_set_palette(struct vc_data *vc, unsigned char *table) { int i, j; - vga_w(state.vgabase, VGA_PEL_MSK, 0xff); + vga_w(vgastate.vgabase, VGA_PEL_MSK, 0xff); for (i = j = 0; i < 16; i++) { - vga_w(state.vgabase, VGA_PEL_IW, table[i]); - vga_w(state.vgabase, VGA_PEL_D, vc->vc_palette[j++] >> 2); - vga_w(state.vgabase, VGA_PEL_D, vc->vc_palette[j++] >> 2); - vga_w(state.vgabase, VGA_PEL_D, vc->vc_palette[j++] >> 2); + vga_w(vgastate.vgabase, VGA_PEL_IW, table[i]); + vga_w(vgastate.vgabase, VGA_PEL_D, vc->vc_palette[j++] >> 2); + vga_w(vgastate.vgabase, VGA_PEL_D, vc->vc_palette[j++] >> 2); + vga_w(vgastate.vgabase, VGA_PEL_D, vc->vc_palette[j++] >> 2); } } @@ -1008,7 +1008,7 @@ static int vgacon_blank(struct vc_data *c, int blank, int mode_switch) switch (blank) { case 0: /* Unblank */ if (vga_vesa_blanked) { - vga_vesa_unblank(&state); + vga_vesa_unblank(&vgastate); vga_vesa_blanked = 0; } if (vga_palette_blanked) { @@ -1022,7 +1022,7 @@ static int vgacon_blank(struct vc_data *c, int blank, int mode_switch) case 1: /* Normal blanking */ case -1: /* Obsolete */ if (!mode_switch && vga_video_type == VIDEO_TYPE_VGAC) { - vga_pal_blank(&state); + vga_pal_blank(&vgastate); vga_palette_blanked = 1; return 0; } @@ -1034,7 +1034,7 @@ static int vgacon_blank(struct vc_data *c, int blank, int mode_switch) return 1; default: /* VESA blanking */ if (vga_video_type == VIDEO_TYPE_VGAC) { - vga_vesa_blank(&state, blank - 1); + vga_vesa_blank(&vgastate, blank - 1); vga_vesa_blanked = blank; } return 0; @@ -1280,7 +1280,7 @@ static int vgacon_font_set(struct vc_data *c, struct console_font *font, unsigne (charcount != 256 && charcount != 512)) return -EINVAL; - rc = vgacon_do_font_op(&state, font->data, 1, charcount == 512); + rc = vgacon_do_font_op(&vgastate, font->data, 1, charcount == 512); if (rc) return rc; @@ -1299,7 +1299,7 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font) font->charcount = vga_512_chars ? 512 : 256; if (!font->data) return 0; - return vgacon_do_font_op(&state, font->data, 0, vga_512_chars); + return vgacon_do_font_op(&vgastate, font->data, 0, vga_512_chars); } #else diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index e911b9c96e19..c7bf606a8706 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -4,6 +4,7 @@ menuconfig FB tristate "Support for frame buffer devices" + select FB_CMDLINE ---help--- The frame buffer device provides an abstraction for the graphics hardware. It represents the frame buffer of some video hardware and @@ -52,6 +53,9 @@ config FIRMWARE_EDID combination with certain motherboards and monitors are known to suffer from this problem. +config FB_CMDLINE + bool + config FB_DDC tristate depends on FB @@ -2352,10 +2356,11 @@ config FB_MSM config FB_MX3 tristate "MX3 Framebuffer support" depends on FB && MX3_IPU + select BACKLIGHT_CLASS_DEVICE + select BACKLIGHT_LCD_SUPPORT select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT - select BACKLIGHT_CLASS_DEVICE default y help This is a framebuffer device for the i.MX31 LCD Controller. So diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index 1d8bdb92939b..9ec81d46fc57 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -24,9 +24,9 @@ #include <linux/of_device.h> #include <linux/of_gpio.h> #include <video/of_display_timing.h> +#include <linux/regulator/consumer.h> #include <video/videomode.h> -#include <mach/cpu.h> #include <asm/gpio.h> #include <video/atmel_lcdc.h> @@ -60,6 +60,7 @@ struct atmel_lcdfb_info { struct atmel_lcdfb_pdata pdata; struct atmel_lcdfb_config *config; + struct regulator *reg_lcd; }; struct atmel_lcdfb_power_ctrl_gpio { @@ -302,10 +303,24 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo) static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, int on) { + int ret; struct atmel_lcdfb_pdata *pdata = &sinfo->pdata; if (pdata->atmel_lcdfb_power_control) pdata->atmel_lcdfb_power_control(pdata, on); + else if (sinfo->reg_lcd) { + if (on) { + ret = regulator_enable(sinfo->reg_lcd); + if (ret) + dev_err(&sinfo->pdev->dev, + "lcd regulator enable failed: %d\n", ret); + } else { + ret = regulator_disable(sinfo->reg_lcd); + if (ret) + dev_err(&sinfo->pdev->dev, + "lcd regulator disable failed: %d\n", ret); + } + } } static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = { @@ -1195,6 +1210,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) if (!sinfo->config) goto free_info; + sinfo->reg_lcd = devm_regulator_get(&pdev->dev, "lcd"); + if (IS_ERR(sinfo->reg_lcd)) + sinfo->reg_lcd = NULL; + info->flags = ATMEL_LCDFB_FBINFO_DEFAULT; info->pseudo_palette = sinfo->pseudo_palette; info->fbops = &atmel_lcdfb_ops; diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index ff6070170d01..aedf2fbf9bf6 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -324,14 +324,61 @@ struct aty128_meminfo { }; /* various memory configurations */ -static const struct aty128_meminfo sdr_128 = - { 4, 4, 3, 3, 1, 3, 1, 16, 30, 16, "128-bit SDR SGRAM (1:1)" }; -static const struct aty128_meminfo sdr_64 = - { 4, 8, 3, 3, 1, 3, 1, 17, 46, 17, "64-bit SDR SGRAM (1:1)" }; -static const struct aty128_meminfo sdr_sgram = - { 4, 4, 1, 2, 1, 2, 1, 16, 24, 16, "64-bit SDR SGRAM (2:1)" }; -static const struct aty128_meminfo ddr_sgram = - { 4, 4, 3, 3, 2, 3, 1, 16, 31, 16, "64-bit DDR SGRAM" }; +static const struct aty128_meminfo sdr_128 = { + .ML = 4, + .MB = 4, + .Trcd = 3, + .Trp = 3, + .Twr = 1, + .CL = 3, + .Tr2w = 1, + .LoopLatency = 16, + .DspOn = 30, + .Rloop = 16, + .name = "128-bit SDR SGRAM (1:1)", +}; + +static const struct aty128_meminfo sdr_64 = { + .ML = 4, + .MB = 8, + .Trcd = 3, + .Trp = 3, + .Twr = 1, + .CL = 3, + .Tr2w = 1, + .LoopLatency = 17, + .DspOn = 46, + .Rloop = 17, + .name = "64-bit SDR SGRAM (1:1)", +}; + +static const struct aty128_meminfo sdr_sgram = { + .ML = 4, + .MB = 4, + .Trcd = 1, + .Trp = 2, + .Twr = 1, + .CL = 2, + .Tr2w = 1, + .LoopLatency = 16, + .DspOn = 24, + .Rloop = 16, + .name = "64-bit SDR SGRAM (2:1)", +}; + +static const struct aty128_meminfo ddr_sgram = { + .ML = 4, + .MB = 4, + .Trcd = 3, + .Trp = 3, + .Twr = 2, + .CL = 3, + .Tr2w = 1, + .LoopLatency = 16, + .DspOn = 31, + .Rloop = 16, + .name = "64-bit DDR SGRAM", +}; static struct fb_fix_screeninfo aty128fb_fix = { .id = "ATY Rage128", diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c index 40494dbdf519..18600d4e1b3f 100644 --- a/drivers/video/fbdev/au1200fb.c +++ b/drivers/video/fbdev/au1200fb.c @@ -1254,7 +1254,6 @@ static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata) pdata->brightness = 30; } divider = (lcd->pwmdiv & 0x3FFFF) + 1; - hi1 = (lcd->pwmhi >> 16) + 1; hi1 = (((pdata->brightness & 0xFF)+1) * divider >> 8); lcd->pwmhi &= 0xFFFF; lcd->pwmhi |= (hi1 << 16); diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index fdadef979238..080fdd2a70f3 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -218,7 +218,8 @@ static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *i */ static int controlfb_set_par (struct fb_info *info) { - struct fb_info_control *p = (struct fb_info_control *) info; + struct fb_info_control *p = + container_of(info, struct fb_info_control, info); struct fb_par_control par; int err; @@ -258,7 +259,8 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { unsigned int xoffset, hstep; - struct fb_info_control *p = (struct fb_info_control *)info; + struct fb_info_control *p = + container_of(info, struct fb_info_control, info); struct fb_par_control *par = &p->par; /* @@ -309,7 +311,8 @@ static int controlfb_mmap(struct fb_info *info, static int controlfb_blank(int blank_mode, struct fb_info *info) { - struct fb_info_control *p = (struct fb_info_control *) info; + struct fb_info_control *p = + container_of(info, struct fb_info_control, info); unsigned ctrl; ctrl = ld_le32(CNTRL_REG(p,ctrl)); @@ -342,7 +345,8 @@ static int controlfb_blank(int blank_mode, struct fb_info *info) static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { - struct fb_info_control *p = (struct fb_info_control *) info; + struct fb_info_control *p = + container_of(info, struct fb_info_control, info); __u8 r, g, b; if (regno > 255) @@ -833,7 +837,8 @@ static int control_var_to_par(struct fb_var_screeninfo *var, unsigned hperiod, hssync, hsblank, hesync, heblank, piped, heq, hlfln, hserr, vperiod, vssync, vesync, veblank, vsblank, vswin, vewin; unsigned long pixclock; - struct fb_info_control *p = (struct fb_info_control *) fb_info; + struct fb_info_control *p = + container_of(fb_info, struct fb_info_control, info); struct control_regvals *r = &par->regvals; switch (var->bits_per_pixel) { diff --git a/drivers/video/fbdev/core/Makefile b/drivers/video/fbdev/core/Makefile index fa306538dac2..67f28e20a892 100644 --- a/drivers/video/fbdev/core/Makefile +++ b/drivers/video/fbdev/core/Makefile @@ -1,4 +1,5 @@ obj-y += fb_notify.o +obj-$(CONFIG_FB_CMDLINE) += fb_cmdline.o obj-$(CONFIG_FB) += fb.o fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \ modedb.o fbcvt.o diff --git a/drivers/video/fbdev/core/cfbcopyarea.c b/drivers/video/fbdev/core/cfbcopyarea.c index bcb57235fcc7..6d4bfeecee35 100644 --- a/drivers/video/fbdev/core/cfbcopyarea.c +++ b/drivers/video/fbdev/core/cfbcopyarea.c @@ -55,8 +55,8 @@ bitcpy(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, * If you suspect bug in this function, compare it with this simple * memmove implementation. */ - fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, - (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); + memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, + (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); return; #endif @@ -221,8 +221,8 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, * If you suspect bug in this function, compare it with this simple * memmove implementation. */ - fb_memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, - (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); + memmove((char *)dst + ((dst_idx & (bits - 1))) / 8, + (char *)src + ((src_idx & (bits - 1))) / 8, n / 8); return; #endif @@ -324,7 +324,10 @@ bitcpy_rev(struct fb_info *p, unsigned long __iomem *dst, unsigned dst_idx, d0 = d0 << left | d1 >> right; } d0 = fb_rev_pixels_in_long(d0, bswapmask); - FB_WRITEL(comp(d0, FB_READL(dst), first), dst); + if (!first) + FB_WRITEL(d0, dst); + else + FB_WRITEL(comp(d0, FB_READL(dst), first), dst); d0 = d1; dst--; n -= dst_idx+1; diff --git a/drivers/video/fbdev/core/fb_cmdline.c b/drivers/video/fbdev/core/fb_cmdline.c new file mode 100644 index 000000000000..39509ccd92f1 --- /dev/null +++ b/drivers/video/fbdev/core/fb_cmdline.c @@ -0,0 +1,110 @@ +/* + * linux/drivers/video/fb_cmdline.c + * + * Copyright (C) 2014 Intel Corp + * Copyright (C) 1994 Martin Schaller + * + * 2001 - Documented with DocBook + * - Brad Douglas <brad@neruo.com> + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + * + * Authors: + * Vetter <danie.vetter@ffwll.ch> + */ +#include <linux/init.h> +#include <linux/fb.h> + +static char *video_options[FB_MAX] __read_mostly; +static int ofonly __read_mostly; + +const char *fb_mode_option; +EXPORT_SYMBOL_GPL(fb_mode_option); + +/** + * fb_get_options - get kernel boot parameters + * @name: framebuffer name as it would appear in + * the boot parameter line + * (video=<name>:<options>) + * @option: the option will be stored here + * + * NOTE: Needed to maintain backwards compatibility + */ +int fb_get_options(const char *name, char **option) +{ + char *opt, *options = NULL; + int retval = 0; + int name_len = strlen(name), i; + + if (name_len && ofonly && strncmp(name, "offb", 4)) + retval = 1; + + if (name_len && !retval) { + for (i = 0; i < FB_MAX; i++) { + if (video_options[i] == NULL) + continue; + if (!video_options[i][0]) + continue; + opt = video_options[i]; + if (!strncmp(name, opt, name_len) && + opt[name_len] == ':') + options = opt + name_len + 1; + } + } + /* No match, pass global option */ + if (!options && option && fb_mode_option) + options = kstrdup(fb_mode_option, GFP_KERNEL); + if (options && !strncmp(options, "off", 3)) + retval = 1; + + if (option) + *option = options; + + return retval; +} +EXPORT_SYMBOL(fb_get_options); + +/** + * video_setup - process command line options + * @options: string of options + * + * Process command line options for frame buffer subsystem. + * + * NOTE: This function is a __setup and __init function. + * It only stores the options. Drivers have to call + * fb_get_options() as necessary. + * + * Returns zero. + * + */ +static int __init video_setup(char *options) +{ + int i, global = 0; + + if (!options || !*options) + global = 1; + + if (!global && !strncmp(options, "ofonly", 6)) { + ofonly = 1; + global = 1; + } + + if (!global && !strchr(options, ':')) { + fb_mode_option = options; + global = 1; + } + + if (!global) { + for (i = 0; i < FB_MAX; i++) { + if (video_options[i] == NULL) { + video_options[i] = options; + break; + } + } + } + + return 1; +} +__setup("video=", video_setup); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index b5e85f6c1c26..0705d8883ede 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1908,96 +1908,4 @@ int fb_new_modelist(struct fb_info *info) return err; } -static char *video_options[FB_MAX] __read_mostly; -static int ofonly __read_mostly; - -/** - * fb_get_options - get kernel boot parameters - * @name: framebuffer name as it would appear in - * the boot parameter line - * (video=<name>:<options>) - * @option: the option will be stored here - * - * NOTE: Needed to maintain backwards compatibility - */ -int fb_get_options(const char *name, char **option) -{ - char *opt, *options = NULL; - int retval = 0; - int name_len = strlen(name), i; - - if (name_len && ofonly && strncmp(name, "offb", 4)) - retval = 1; - - if (name_len && !retval) { - for (i = 0; i < FB_MAX; i++) { - if (video_options[i] == NULL) - continue; - if (!video_options[i][0]) - continue; - opt = video_options[i]; - if (!strncmp(name, opt, name_len) && - opt[name_len] == ':') - options = opt + name_len + 1; - } - } - /* No match, pass global option */ - if (!options && option && fb_mode_option) - options = kstrdup(fb_mode_option, GFP_KERNEL); - if (options && !strncmp(options, "off", 3)) - retval = 1; - - if (option) - *option = options; - - return retval; -} -EXPORT_SYMBOL(fb_get_options); - -#ifndef MODULE -/** - * video_setup - process command line options - * @options: string of options - * - * Process command line options for frame buffer subsystem. - * - * NOTE: This function is a __setup and __init function. - * It only stores the options. Drivers have to call - * fb_get_options() as necessary. - * - * Returns zero. - * - */ -static int __init video_setup(char *options) -{ - int i, global = 0; - - if (!options || !*options) - global = 1; - - if (!global && !strncmp(options, "ofonly", 6)) { - ofonly = 1; - global = 1; - } - - if (!global && !strchr(options, ':')) { - fb_mode_option = options; - global = 1; - } - - if (!global) { - for (i = 0; i < FB_MAX; i++) { - if (video_options[i] == NULL) { - video_options[i] = options; - break; - } - - } - } - - return 1; -} -__setup("video=", video_setup); -#endif - MODULE_LICENSE("GPL"); diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c index 53444ac19fe0..60c3f0a16341 100644 --- a/drivers/video/fbdev/core/fbsysfs.c +++ b/drivers/video/fbdev/core/fbsysfs.c @@ -485,16 +485,8 @@ static ssize_t show_bl_curve(struct device *device, mutex_lock(&fb_info->bl_curve_mutex); for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8) - len += snprintf(&buf[len], PAGE_SIZE, - "%02x %02x %02x %02x %02x %02x %02x %02x\n", - fb_info->bl_curve[i + 0], - fb_info->bl_curve[i + 1], - fb_info->bl_curve[i + 2], - fb_info->bl_curve[i + 3], - fb_info->bl_curve[i + 4], - fb_info->bl_curve[i + 5], - fb_info->bl_curve[i + 6], - fb_info->bl_curve[i + 7]); + len += snprintf(&buf[len], PAGE_SIZE, "%8ph\n", + fb_info->bl_curve + i); mutex_unlock(&fb_info->bl_curve_mutex); return len; diff --git a/drivers/video/fbdev/core/modedb.c b/drivers/video/fbdev/core/modedb.c index a9a907c440d7..388f7971494b 100644 --- a/drivers/video/fbdev/core/modedb.c +++ b/drivers/video/fbdev/core/modedb.c @@ -29,9 +29,6 @@ #define DPRINTK(fmt, args...) #endif -const char *fb_mode_option; -EXPORT_SYMBOL_GPL(fb_mode_option); - /* * Standard video mode definitions (taken from XFree86) */ diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index b0a950f36970..99acf538a8b8 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -159,7 +159,7 @@ cyber2000_seqw(unsigned int reg, unsigned int val, struct cfb_info *cfb) static void cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - struct cfb_info *cfb = (struct cfb_info *)info; + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); unsigned long dst, col; if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) { @@ -191,7 +191,7 @@ cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) static void cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region) { - struct cfb_info *cfb = (struct cfb_info *)info; + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); unsigned int cmd = CO_CMD_L_PATTERN_FGCOL; unsigned long src, dst; @@ -241,7 +241,7 @@ cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image) static int cyber2000fb_sync(struct fb_info *info) { - struct cfb_info *cfb = (struct cfb_info *)info; + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); int count = 100000; if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) @@ -276,7 +276,7 @@ static int cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { - struct cfb_info *cfb = (struct cfb_info *)info; + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); struct fb_var_screeninfo *var = &cfb->fb.var; u32 pseudo_val; int ret = 1; @@ -758,7 +758,7 @@ cyber2000fb_decode_clock(struct par_info *hw, struct cfb_info *cfb, static int cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - struct cfb_info *cfb = (struct cfb_info *)info; + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); struct par_info hw; unsigned int mem; int err; @@ -861,7 +861,7 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) static int cyber2000fb_set_par(struct fb_info *info) { - struct cfb_info *cfb = (struct cfb_info *)info; + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); struct fb_var_screeninfo *var = &cfb->fb.var; struct par_info hw; unsigned int mem; @@ -971,7 +971,7 @@ static int cyber2000fb_set_par(struct fb_info *info) static int cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { - struct cfb_info *cfb = (struct cfb_info *)info; + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); if (cyber2000fb_update_start(cfb, var)) return -EINVAL; @@ -1007,7 +1007,7 @@ cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) */ static int cyber2000fb_blank(int blank, struct fb_info *info) { - struct cfb_info *cfb = (struct cfb_info *)info; + struct cfb_info *cfb = container_of(info, struct cfb_info, fb); unsigned int sync = 0; int i; diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/intelfb/intelfbhw.c index fbad61da359f..d31ed4e2c46f 100644 --- a/drivers/video/fbdev/intelfb/intelfbhw.c +++ b/drivers/video/fbdev/intelfb/intelfbhw.c @@ -1191,7 +1191,6 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo, vsync_end = vsync_start + var->vsync_len; vtotal = vsync_end + var->upper_margin; vblank_start = vactive; - vblank_end = vtotal; vblank_end = vsync_end + 1; DBG_MSG("V: act %d, ss %d, se %d, tot %d bs %d, be %d\n", @@ -1859,7 +1858,7 @@ void intelfbhw_cursor_init(struct intelfb_info *dinfo) tmp = INREG(CURSOR_CONTROL); tmp &= ~(CURSOR_FORMAT_MASK | CURSOR_GAMMA_ENABLE | CURSOR_ENABLE | CURSOR_STRIDE_MASK); - tmp = CURSOR_FORMAT_3C; + tmp |= CURSOR_FORMAT_3C; OUTREG(CURSOR_CONTROL, tmp); OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.offset << 12); tmp = (64 << CURSOR_SIZE_H_SHIFT) | diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c index 7116c5309c7d..62539ca1cfa9 100644 --- a/drivers/video/fbdev/matrox/matroxfb_base.c +++ b/drivers/video/fbdev/matrox/matroxfb_base.c @@ -1341,19 +1341,57 @@ struct video_board { struct matrox_switch* lowlevel; }; #ifdef CONFIG_FB_MATROX_MILLENIUM -static struct video_board vbMillennium = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGA2064W, &matrox_millennium}; -static struct video_board vbMillennium2 = {0x1000000, 0x0800000, FB_ACCEL_MATROX_MGA2164W, &matrox_millennium}; -static struct video_board vbMillennium2A = {0x1000000, 0x0800000, FB_ACCEL_MATROX_MGA2164W_AGP, &matrox_millennium}; +static struct video_board vbMillennium = { + .maxvram = 0x0800000, + .maxdisplayable = 0x0800000, + .accelID = FB_ACCEL_MATROX_MGA2064W, + .lowlevel = &matrox_millennium +}; + +static struct video_board vbMillennium2 = { + .maxvram = 0x1000000, + .maxdisplayable = 0x0800000, + .accelID = FB_ACCEL_MATROX_MGA2164W, + .lowlevel = &matrox_millennium +}; + +static struct video_board vbMillennium2A = { + .maxvram = 0x1000000, + .maxdisplayable = 0x0800000, + .accelID = FB_ACCEL_MATROX_MGA2164W_AGP, + .lowlevel = &matrox_millennium +}; #endif /* CONFIG_FB_MATROX_MILLENIUM */ #ifdef CONFIG_FB_MATROX_MYSTIQUE -static struct video_board vbMystique = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGA1064SG, &matrox_mystique}; +static struct video_board vbMystique = { + .maxvram = 0x0800000, + .maxdisplayable = 0x0800000, + .accelID = FB_ACCEL_MATROX_MGA1064SG, + .lowlevel = &matrox_mystique +}; #endif /* CONFIG_FB_MATROX_MYSTIQUE */ #ifdef CONFIG_FB_MATROX_G -static struct video_board vbG100 = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGAG100, &matrox_G100}; -static struct video_board vbG200 = {0x1000000, 0x1000000, FB_ACCEL_MATROX_MGAG200, &matrox_G100}; +static struct video_board vbG100 = { + .maxvram = 0x0800000, + .maxdisplayable = 0x0800000, + .accelID = FB_ACCEL_MATROX_MGAG100, + .lowlevel = &matrox_G100 +}; + +static struct video_board vbG200 = { + .maxvram = 0x1000000, + .maxdisplayable = 0x1000000, + .accelID = FB_ACCEL_MATROX_MGAG200, + .lowlevel = &matrox_G100 +}; /* from doc it looks like that accelerator can draw only to low 16MB :-( Direct accesses & displaying are OK for whole 32MB */ -static struct video_board vbG400 = {0x2000000, 0x1000000, FB_ACCEL_MATROX_MGAG400, &matrox_G100}; +static struct video_board vbG400 = { + .maxvram = 0x2000000, + .maxdisplayable = 0x1000000, + .accelID = FB_ACCEL_MATROX_MGAG400, + .lowlevel = &matrox_G100 +}; #endif #define DEVF_VIDEO64BIT 0x0001 diff --git a/drivers/video/fbdev/matrox/matroxfb_maven.c b/drivers/video/fbdev/matrox/matroxfb_maven.c index ee41a0f276b2..bf5ce04f9aea 100644 --- a/drivers/video/fbdev/matrox/matroxfb_maven.c +++ b/drivers/video/fbdev/matrox/matroxfb_maven.c @@ -201,21 +201,23 @@ struct matrox_pll_ctl { }; static const struct matrox_pll_features2 maven1000_pll = { - 50000000, - 300000000, - 5, 128, - 3, 32, - 3 + .vco_freq_min = 50000000, + .vco_freq_max = 300000000, + .feed_div_min = 5, + .feed_div_max = 128, + .in_div_min = 3, + .in_div_max = 32, + .post_shift_max = 3 }; static const struct matrox_pll_ctl maven_PAL = { - 540000, - 50 + .ref_freq = 540000, + .den = 50 }; static const struct matrox_pll_ctl maven_NTSC = { - 450450, /* 27027000/60 == 27000000/59.94005994 */ - 60 + .ref_freq = 450450, /* 27027000/60 == 27000000/59.94005994 */ + .den = 60 }; static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll, diff --git a/drivers/video/fbdev/msm/msm_fb.c b/drivers/video/fbdev/msm/msm_fb.c index 1374803fbcd9..2979d7e72126 100644 --- a/drivers/video/fbdev/msm/msm_fb.c +++ b/drivers/video/fbdev/msm/msm_fb.c @@ -569,8 +569,13 @@ static int msmfb_probe(struct platform_device *pdev) mutex_init(&msmfb->panel_init_lock); init_waitqueue_head(&msmfb->frame_wq); INIT_WORK(&msmfb->resume_work, power_on_panel); - msmfb->black = kzalloc(msmfb->fb->var.bits_per_pixel*msmfb->xres, - GFP_KERNEL); + msmfb->black = devm_kzalloc(&pdev->dev, + msmfb->fb->var.bits_per_pixel*msmfb->xres, + GFP_KERNEL); + if (!msmfb->black) { + ret = -ENOMEM; + goto error_register_framebuffer; + } printk(KERN_INFO "msmfb_probe() installing %d x %d panel\n", msmfb->xres, msmfb->yres); @@ -589,6 +594,8 @@ static int msmfb_probe(struct platform_device *pdev) msmfb->sleeping = WAKING; + platform_set_drvdata(pdev, msmfb); + return 0; error_register_framebuffer: @@ -598,9 +605,23 @@ error_setup_fbmem: return ret; } +static int msmfb_remove(struct platform_device *pdev) +{ + struct msmfb_info *msmfb; + + msmfb = platform_get_drvdata(pdev); + + unregister_framebuffer(msmfb->fb); + iounmap(msmfb->fb->screen_base); + framebuffer_release(msmfb->fb); + + return 0; +} + static struct platform_driver msm_panel_driver = { /* need to write remove */ .probe = msmfb_probe, + .remove = msmfb_remove, .driver = {.name = "msm_panel"}, }; diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c index c645a0a0c341..23ec781e9a61 100644 --- a/drivers/video/fbdev/mx3fb.c +++ b/drivers/video/fbdev/mx3fb.c @@ -461,8 +461,7 @@ static void sdc_disable_channel(struct mx3fb_info *mx3_fbi) spin_unlock_irqrestore(&mx3fb->lock, flags); - mx3_fbi->txd->chan->device->device_control(mx3_fbi->txd->chan, - DMA_TERMINATE_ALL, 0); + dmaengine_terminate_all(mx3_fbi->txd->chan); mx3_fbi->txd = NULL; mx3_fbi->cookie = -EINVAL; } @@ -1179,7 +1178,7 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var, /* * We enable the End of Frame interrupt, which will free a tx-descriptor, - * which we will need for the next device_prep_slave_sg(). The + * which we will need for the next dmaengine_prep_slave_sg(). The * IRQ-handler will disable the IRQ again. */ init_completion(&mx3_fbi->flip_cmpl); diff --git a/drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c b/drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c index 5ee3b5505f7f..91921665b98b 100644 --- a/drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c +++ b/drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c @@ -301,6 +301,8 @@ static const struct of_device_id tvc_of_match[] = { {}, }; +MODULE_DEVICE_TABLE(of, tvc_of_match); + static struct platform_driver tvc_connector_driver = { .probe = tvc_probe, .remove = __exit_p(tvc_remove), @@ -308,6 +310,7 @@ static struct platform_driver tvc_connector_driver = { .name = "connector-analog-tv", .owner = THIS_MODULE, .of_match_table = tvc_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/displays-new/connector-dvi.c b/drivers/video/fbdev/omap2/displays-new/connector-dvi.c index 74de2bc50c4f..2dfb6e5ff0cc 100644 --- a/drivers/video/fbdev/omap2/displays-new/connector-dvi.c +++ b/drivers/video/fbdev/omap2/displays-new/connector-dvi.c @@ -391,6 +391,7 @@ static struct platform_driver dvi_connector_driver = { .name = "connector-dvi", .owner = THIS_MODULE, .of_match_table = dvic_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c index 131c6e260898..7b25967a91eb 100644 --- a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c +++ b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c @@ -437,6 +437,7 @@ static struct platform_driver hdmi_connector_driver = { .name = "connector-hdmi", .owner = THIS_MODULE, .of_match_table = hdmic_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c b/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c index b4e9a42a79e6..47ee7cdee1c5 100644 --- a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c +++ b/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c @@ -298,6 +298,7 @@ static struct platform_driver tfp410_driver = { .name = "tfp410", .owner = THIS_MODULE, .of_match_table = tfp410_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c index c891d8f84cb2..c4abd56dd846 100644 --- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c +++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c @@ -461,6 +461,7 @@ static struct platform_driver tpd_driver = { .name = "tpd12s015", .owner = THIS_MODULE, .of_match_table = tpd_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c index 3636b61dc9b4..a9c3dcf0f6b5 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c @@ -327,6 +327,7 @@ static struct platform_driver panel_dpi_driver = { .name = "panel-dpi", .owner = THIS_MODULE, .of_match_table = panel_dpi_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dsi-cm.c b/drivers/video/fbdev/omap2/displays-new/panel-dsi-cm.c index d6f14e8717e8..899cb1ab523d 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-dsi-cm.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-dsi-cm.c @@ -1378,6 +1378,7 @@ static struct platform_driver dsicm_driver = { .name = "panel-dsi-cm", .owner = THIS_MODULE, .of_match_table = dsicm_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c b/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c index cc5b5124e0b4..27d4fcfa1824 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c @@ -394,6 +394,7 @@ static struct spi_driver lb035q02_spi_driver = { .name = "panel_lgphilips_lb035q02", .owner = THIS_MODULE, .of_match_table = lb035q02_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c b/drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c index 3595f111aa35..ccf3f4f3c703 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c @@ -424,6 +424,7 @@ static struct spi_driver nec_8048_driver = { .owner = THIS_MODULE, .pm = NEC_8048_PM_OPS, .of_match_table = nec_8048_of_match, + .suppress_bind_attrs = true, }, .probe = nec_8048_probe, .remove = nec_8048_remove, diff --git a/drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c b/drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c index f1f72ce50a17..234142cc3764 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c @@ -410,6 +410,7 @@ static struct platform_driver sharp_ls_driver = { .name = "panel-sharp-ls037v7dw01", .owner = THIS_MODULE, .of_match_table = sharp_ls_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/fbdev/omap2/displays-new/panel-sony-acx565akm.c index 617f8d2f5127..337ccc5c0f5e 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-sony-acx565akm.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-sony-acx565akm.c @@ -904,6 +904,7 @@ static struct spi_driver acx565akm_driver = { .name = "acx565akm", .owner = THIS_MODULE, .of_match_table = acx565akm_of_match, + .suppress_bind_attrs = true, }, .probe = acx565akm_probe, .remove = acx565akm_remove, diff --git a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c b/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c index 728808bcceeb..fbba0b8ca871 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c @@ -500,6 +500,7 @@ static struct spi_driver td028ttec1_spi_driver = { .name = "panel-tpo-td028ttec1", .owner = THIS_MODULE, .of_match_table = td028ttec1_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c b/drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c index de78ab0caaa8..5aba76bca25a 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c @@ -673,6 +673,7 @@ static struct spi_driver tpo_td043_spi_driver = { .owner = THIS_MODULE, .pm = &tpo_td043_spi_pm, .of_match_table = tpo_td043_of_match, + .suppress_bind_attrs = true, }, .probe = tpo_td043_probe, .remove = tpo_td043_remove, diff --git a/drivers/video/fbdev/omap2/dss/apply.c b/drivers/video/fbdev/omap2/dss/apply.c index 0a0b084ce65d..663ccc3bf4e5 100644 --- a/drivers/video/fbdev/omap2/dss/apply.c +++ b/drivers/video/fbdev/omap2/dss/apply.c @@ -1132,6 +1132,8 @@ static void dss_mgr_disable_compat(struct omap_overlay_manager *mgr) if (!mp->enabled) goto out; + wait_pending_extra_info_updates(); + if (!mgr_manual_update(mgr)) dispc_mgr_disable_sync(mgr->id); diff --git a/drivers/video/fbdev/omap2/dss/dispc-compat.c b/drivers/video/fbdev/omap2/dss/dispc-compat.c index 83779c2b292a..633c461fbc6e 100644 --- a/drivers/video/fbdev/omap2/dss/dispc-compat.c +++ b/drivers/video/fbdev/omap2/dss/dispc-compat.c @@ -634,13 +634,14 @@ void dispc_mgr_disable_sync(enum omap_channel channel) WARN_ON(1); } +static inline void dispc_irq_wait_handler(void *data, u32 mask) +{ + complete((struct completion *)data); +} + int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, unsigned long timeout) { - void dispc_irq_wait_handler(void *data, u32 mask) - { - complete((struct completion *)data); - } int r; DECLARE_COMPLETION_ONSTACK(completion); diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c index be053aa80880..0e9a74bb9fc2 100644 --- a/drivers/video/fbdev/omap2/dss/dispc.c +++ b/drivers/video/fbdev/omap2/dss/dispc.c @@ -3290,8 +3290,11 @@ static void dispc_dump_regs(struct seq_file *s) DUMPREG(i, DISPC_OVL_FIFO_SIZE_STATUS); DUMPREG(i, DISPC_OVL_ROW_INC); DUMPREG(i, DISPC_OVL_PIXEL_INC); + if (dss_has_feature(FEAT_PRELOAD)) DUMPREG(i, DISPC_OVL_PRELOAD); + if (dss_has_feature(FEAT_MFLAG)) + DUMPREG(i, DISPC_OVL_MFLAG_THRESHOLD); if (i == OMAP_DSS_GFX) { DUMPREG(i, DISPC_OVL_WINDOW_SKIP); @@ -3312,10 +3315,6 @@ static void dispc_dump_regs(struct seq_file *s) } if (dss_has_feature(FEAT_ATTR2)) DUMPREG(i, DISPC_OVL_ATTRIBUTES2); - if (dss_has_feature(FEAT_PRELOAD)) - DUMPREG(i, DISPC_OVL_PRELOAD); - if (dss_has_feature(FEAT_MFLAG)) - DUMPREG(i, DISPC_OVL_MFLAG_THRESHOLD); } #undef DISPC_REG @@ -3843,6 +3842,7 @@ static struct platform_driver omap_dispchw_driver = { .owner = THIS_MODULE, .pm = &dispc_pm_ops, .of_match_table = dispc_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/dss/dispc.h b/drivers/video/fbdev/omap2/dss/dispc.h index 78edb449c763..3043d6e0a5f9 100644 --- a/drivers/video/fbdev/omap2/dss/dispc.h +++ b/drivers/video/fbdev/omap2/dss/dispc.h @@ -101,8 +101,7 @@ DISPC_FIR_COEF_V2_OFFSET(n, i)) #define DISPC_OVL_PRELOAD(n) (DISPC_OVL_BASE(n) + \ DISPC_PRELOAD_OFFSET(n)) -#define DISPC_OVL_MFLAG_THRESHOLD(n) (DISPC_OVL_BASE(n) + \ - DISPC_MFLAG_THRESHOLD_OFFSET(n)) +#define DISPC_OVL_MFLAG_THRESHOLD(n) DISPC_MFLAG_THRESHOLD_OFFSET(n) /* DISPC up/downsampling FIR filter coefficient structure */ struct dispc_coef { diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c index 9368972d6962..4a3363dae74a 100644 --- a/drivers/video/fbdev/omap2/dss/dpi.c +++ b/drivers/video/fbdev/omap2/dss/dpi.c @@ -720,6 +720,7 @@ static struct platform_driver omap_dpi_driver = { .driver = { .name = "omapdss_dpi", .owner = THIS_MODULE, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/dss/dsi.c b/drivers/video/fbdev/omap2/dss/dsi.c index 56b92444c54f..0793bc67a275 100644 --- a/drivers/video/fbdev/omap2/dss/dsi.c +++ b/drivers/video/fbdev/omap2/dss/dsi.c @@ -1603,7 +1603,7 @@ int dsi_pll_set_clock_div(struct platform_device *dsidev, } else if (dss_has_feature(FEAT_DSI_PLL_SELFREQDCO)) { f = cinfo->clkin4ddr < 1000000000 ? 0x2 : 0x4; - l = FLD_MOD(l, f, 4, 1); /* PLL_SELFREQDCO */ + l = FLD_MOD(l, f, 3, 1); /* PLL_SELFREQDCO */ } l = FLD_MOD(l, 1, 13, 13); /* DSI_PLL_REFEN */ @@ -2571,7 +2571,10 @@ static int dsi_sync_vc_vp(struct platform_device *dsidev, int channel) { struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); DECLARE_COMPLETION_ONSTACK(completion); - struct dsi_packet_sent_handler_data vp_data = { dsidev, &completion }; + struct dsi_packet_sent_handler_data vp_data = { + .dsidev = dsidev, + .completion = &completion + }; int r = 0; u8 bit; @@ -2617,7 +2620,10 @@ static void dsi_packet_sent_handler_l4(void *data, u32 mask) static int dsi_sync_vc_l4(struct platform_device *dsidev, int channel) { DECLARE_COMPLETION_ONSTACK(completion); - struct dsi_packet_sent_handler_data l4_data = { dsidev, &completion }; + struct dsi_packet_sent_handler_data l4_data = { + .dsidev = dsidev, + .completion = &completion + }; int r = 0; r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, @@ -5748,6 +5754,7 @@ static struct platform_driver omap_dsihw_driver = { .owner = THIS_MODULE, .pm = &dsi_pm_ops, .of_match_table = dsi_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c index 6daeb7ed44c6..14bcd6c43f72 100644 --- a/drivers/video/fbdev/omap2/dss/dss.c +++ b/drivers/video/fbdev/omap2/dss/dss.c @@ -966,6 +966,7 @@ static struct platform_driver omap_dsshw_driver = { .owner = THIS_MODULE, .pm = &dss_pm_ops, .of_match_table = dss_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c index 6a8550cf43e5..9a8713ca090c 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/dss/hdmi4.c @@ -781,6 +781,7 @@ static struct platform_driver omapdss_hdmihw_driver = { .owner = THIS_MODULE, .pm = &hdmi_pm_ops, .of_match_table = hdmi_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c index 32d02ec34d23..169b764bb9d4 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi5.c +++ b/drivers/video/fbdev/omap2/dss/hdmi5.c @@ -806,6 +806,7 @@ static struct platform_driver omapdss_hdmihw_driver = { .owner = THIS_MODULE, .pm = &hdmi_pm_ops, .of_match_table = hdmi_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/dss/hdmi_pll.c b/drivers/video/fbdev/omap2/dss/hdmi_pll.c index 54df12a8d744..6d92bb32fe51 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi_pll.c +++ b/drivers/video/fbdev/omap2/dss/hdmi_pll.c @@ -124,16 +124,15 @@ static int hdmi_pll_config(struct hdmi_pll_data *pll) r = FLD_MOD(r, 0x0, 14, 14); /* PHY_CLKINEN de-assert during locking */ r = FLD_MOD(r, fmt->refsel, 22, 21); /* REFSEL */ - if (fmt->dcofreq) { - /* divider programming for frequency beyond 1000Mhz */ - REG_FLD_MOD(pll->base, PLLCTRL_CFG3, fmt->regsd, 17, 10); + if (fmt->dcofreq) r = FLD_MOD(r, 0x4, 3, 1); /* 1000MHz and 2000MHz */ - } else { + else r = FLD_MOD(r, 0x2, 3, 1); /* 500MHz and 1000MHz */ - } hdmi_write_reg(pll->base, PLLCTRL_CFG2, r); + REG_FLD_MOD(pll->base, PLLCTRL_CFG3, fmt->regsd, 17, 10); + r = hdmi_read_reg(pll->base, PLLCTRL_CFG4); r = FLD_MOD(r, fmt->regm2, 24, 18); r = FLD_MOD(r, fmt->regmf, 17, 0); @@ -144,8 +143,8 @@ static int hdmi_pll_config(struct hdmi_pll_data *pll) /* wait for bit change */ if (hdmi_wait_for_bit_change(pll->base, PLLCTRL_PLL_GO, - 0, 0, 1) != 1) { - DSSERR("PLL GO bit not set\n"); + 0, 0, 0) != 0) { + DSSERR("PLL GO bit not clearing\n"); return -ETIMEDOUT; } diff --git a/drivers/video/fbdev/omap2/dss/manager-sysfs.c b/drivers/video/fbdev/omap2/dss/manager-sysfs.c index 37b59fe28dc8..a7414fb12830 100644 --- a/drivers/video/fbdev/omap2/dss/manager-sysfs.c +++ b/drivers/video/fbdev/omap2/dss/manager-sysfs.c @@ -44,6 +44,13 @@ static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf) dssdev->name : "<none>"); } +static int manager_display_match(struct omap_dss_device *dssdev, void *data) +{ + const char *str = data; + + return sysfs_streq(dssdev->name, str); +} + static ssize_t manager_display_store(struct omap_overlay_manager *mgr, const char *buf, size_t size) { @@ -52,17 +59,12 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr, struct omap_dss_device *dssdev = NULL; struct omap_dss_device *old_dssdev; - int match(struct omap_dss_device *dssdev, void *data) - { - const char *str = data; - return sysfs_streq(dssdev->name, str); - } - if (buf[size-1] == '\n') --len; if (len > 0) - dssdev = omap_dss_find_device((void *)buf, match); + dssdev = omap_dss_find_device((void *)buf, + manager_display_match); if (len > 0 && dssdev == NULL) return -EINVAL; diff --git a/drivers/video/fbdev/omap2/dss/rfbi.c b/drivers/video/fbdev/omap2/dss/rfbi.c index c8a81a2b879c..878273f58839 100644 --- a/drivers/video/fbdev/omap2/dss/rfbi.c +++ b/drivers/video/fbdev/omap2/dss/rfbi.c @@ -1044,6 +1044,7 @@ static struct platform_driver omap_rfbihw_driver = { .name = "omapdss_rfbi", .owner = THIS_MODULE, .pm = &rfbi_pm_ops, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/dss/sdi.c b/drivers/video/fbdev/omap2/dss/sdi.c index 911dcc9173a6..4c9c46d4ea60 100644 --- a/drivers/video/fbdev/omap2/dss/sdi.c +++ b/drivers/video/fbdev/omap2/dss/sdi.c @@ -377,6 +377,7 @@ static struct platform_driver omap_sdi_driver = { .driver = { .name = "omapdss_sdi", .owner = THIS_MODULE, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/dss/venc.c b/drivers/video/fbdev/omap2/dss/venc.c index 21d81113962b..d077d8a75ddc 100644 --- a/drivers/video/fbdev/omap2/dss/venc.c +++ b/drivers/video/fbdev/omap2/dss/venc.c @@ -966,6 +966,7 @@ static struct platform_driver omap_venchw_driver = { .owner = THIS_MODULE, .pm = &venc_pm_ops, .of_match_table = venc_of_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c index ec2d132c782d..ce8a70570756 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c @@ -273,16 +273,16 @@ static struct omapfb_colormode omapfb_colormodes[] = { }, }; +static bool cmp_component(struct fb_bitfield *f1, struct fb_bitfield *f2) +{ + return f1->length == f2->length && + f1->offset == f2->offset && + f1->msb_right == f2->msb_right; +} + static bool cmp_var_to_colormode(struct fb_var_screeninfo *var, struct omapfb_colormode *color) { - bool cmp_component(struct fb_bitfield *f1, struct fb_bitfield *f2) - { - return f1->length == f2->length && - f1->offset == f2->offset && - f1->msb_right == f2->msb_right; - } - if (var->bits_per_pixel == 0 || var->red.length == 0 || var->blue.length == 0 || @@ -1833,14 +1833,13 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev) if (fbdev == NULL) return; - for (i = 0; i < fbdev->num_fbs; i++) { - struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[i]); - int j; + for (i = 0; i < fbdev->num_overlays; i++) { + struct omap_overlay *ovl = fbdev->overlays[i]; - for (j = 0; j < ofbi->num_overlays; j++) { - struct omap_overlay *ovl = ofbi->overlays[j]; - ovl->disable(ovl); - } + ovl->disable(ovl); + + if (ovl->manager) + ovl->unset_manager(ovl); } for (i = 0; i < fbdev->num_fbs; i++) @@ -2619,7 +2618,7 @@ err0: return r; } -static int __exit omapfb_remove(struct platform_device *pdev) +static int omapfb_remove(struct platform_device *pdev) { struct omapfb2_device *fbdev = platform_get_drvdata(pdev); @@ -2636,7 +2635,7 @@ static int __exit omapfb_remove(struct platform_device *pdev) static struct platform_driver omapfb_driver = { .probe = omapfb_probe, - .remove = __exit_p(omapfb_remove), + .remove = omapfb_remove, .driver = { .name = "omapfb", .owner = THIS_MODULE, @@ -2651,6 +2650,7 @@ module_param_named(mirror, def_mirror, bool, 0); module_platform_driver(omapfb_driver); +MODULE_ALIAS("platform:omapfb"); MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>"); MODULE_DESCRIPTION("OMAP2/3 Framebuffer"); MODULE_LICENSE("GPL v2"); diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c index 167cffff3d4e..7c74f58fc101 100644 --- a/drivers/video/fbdev/pvr2fb.c +++ b/drivers/video/fbdev/pvr2fb.c @@ -1001,7 +1001,7 @@ static int pvr2_get_param(const struct pvr2_params *p, const char *s, int val, for (i = 0 ; i < size ; i++ ) { if (s != NULL) { - if (!strnicmp(p[i].name, s, strlen(s))) + if (!strncasecmp(p[i].name, s, strlen(s))) return p[i].val; } else { if (p[i].val == val) diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index 1ecd9cec2921..a5acca88fa63 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -138,7 +138,7 @@ static int pxafb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue, u_int trans, struct fb_info *info) { - struct pxafb_info *fbi = (struct pxafb_info *)info; + struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); u_int val; if (regno >= fbi->palette_size) @@ -183,7 +183,7 @@ static int pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int trans, struct fb_info *info) { - struct pxafb_info *fbi = (struct pxafb_info *)info; + struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); unsigned int val; int ret = 1; @@ -456,7 +456,7 @@ static int pxafb_adjust_timing(struct pxafb_info *fbi, */ static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - struct pxafb_info *fbi = (struct pxafb_info *)info; + struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); struct pxafb_mach_info *inf = dev_get_platdata(fbi->dev); int err; @@ -494,7 +494,7 @@ static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) */ static int pxafb_set_par(struct fb_info *info) { - struct pxafb_info *fbi = (struct pxafb_info *)info; + struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); struct fb_var_screeninfo *var = &info->var; if (var->bits_per_pixel >= 16) @@ -533,7 +533,7 @@ static int pxafb_set_par(struct fb_info *info) static int pxafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { - struct pxafb_info *fbi = (struct pxafb_info *)info; + struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); struct fb_var_screeninfo newvar; int dma = DMA_MAX + DMA_BASE; @@ -566,7 +566,7 @@ static int pxafb_pan_display(struct fb_var_screeninfo *var, */ static int pxafb_blank(int blank, struct fb_info *info) { - struct pxafb_info *fbi = (struct pxafb_info *)info; + struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); int i; switch (blank) { @@ -725,7 +725,7 @@ static struct pxafb_layer_ops ofb_ops[] = { static int overlayfb_open(struct fb_info *info, int user) { - struct pxafb_layer *ofb = (struct pxafb_layer *)info; + struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb); /* no support for framebuffer console on overlay */ if (user == 0) @@ -743,7 +743,7 @@ static int overlayfb_open(struct fb_info *info, int user) static int overlayfb_release(struct fb_info *info, int user) { - struct pxafb_layer *ofb = (struct pxafb_layer*) info; + struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb); if (ofb->usage == 1) { ofb->ops->disable(ofb); @@ -760,7 +760,7 @@ static int overlayfb_release(struct fb_info *info, int user) static int overlayfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - struct pxafb_layer *ofb = (struct pxafb_layer *)info; + struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb); struct fb_var_screeninfo *base_var = &ofb->fbi->fb.var; int xpos, ypos, pfor, bpp; @@ -836,7 +836,7 @@ static int overlayfb_check_video_memory(struct pxafb_layer *ofb) static int overlayfb_set_par(struct fb_info *info) { - struct pxafb_layer *ofb = (struct pxafb_layer *)info; + struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb); struct fb_var_screeninfo *var = &info->var; int xpos, ypos, pfor, bpp, ret; diff --git a/drivers/video/fbdev/riva/riva_hw.c b/drivers/video/fbdev/riva/riva_hw.c index 78fdbf5178d7..8bdf37f3013b 100644 --- a/drivers/video/fbdev/riva/riva_hw.c +++ b/drivers/video/fbdev/riva/riva_hw.c @@ -430,7 +430,6 @@ static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state, nv3_arb_in int mmisses, gmisses, vmisses, eburst_size, mburst_size; int refresh_cycle; - refresh_cycle = 0; refresh_cycle = 2*(state->mclk_khz/state->pclk_khz) + 5; mmisses = 2; if (state->mem_aligned) gmisses = 2; diff --git a/drivers/video/fbdev/s3c2410fb.c b/drivers/video/fbdev/s3c2410fb.c index 43c63a4f3178..e350eb57f11d 100644 --- a/drivers/video/fbdev/s3c2410fb.c +++ b/drivers/video/fbdev/s3c2410fb.c @@ -601,12 +601,12 @@ static int s3c2410fb_debug_store(struct device *dev, if (len < 1) return -EINVAL; - if (strnicmp(buf, "on", 2) == 0 || - strnicmp(buf, "1", 1) == 0) { + if (strncasecmp(buf, "on", 2) == 0 || + strncasecmp(buf, "1", 1) == 0) { debug = 1; dev_dbg(dev, "s3c2410fb: Debug On"); - } else if (strnicmp(buf, "off", 3) == 0 || - strnicmp(buf, "0", 1) == 0) { + } else if (strncasecmp(buf, "off", 3) == 0 || + strncasecmp(buf, "0", 1) == 0) { debug = 0; dev_dbg(dev, "s3c2410fb: Debug Off"); } else { diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 580c444ec301..9690216d38ff 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -268,7 +268,8 @@ static int sa1100fb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue, u_int trans, struct fb_info *info) { - struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; + struct sa1100fb_info *fbi = + container_of(info, struct sa1100fb_info, fb); u_int val, ret = 1; if (regno < fbi->palette_size) { @@ -289,7 +290,8 @@ static int sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int trans, struct fb_info *info) { - struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; + struct sa1100fb_info *fbi = + container_of(info, struct sa1100fb_info, fb); unsigned int val; int ret = 1; @@ -366,7 +368,8 @@ static inline unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo static int sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; + struct sa1100fb_info *fbi = + container_of(info, struct sa1100fb_info, fb); int rgbidx; if (var->xres < MIN_XRES) @@ -433,7 +436,8 @@ static void sa1100fb_set_visual(struct sa1100fb_info *fbi, u32 visual) */ static int sa1100fb_set_par(struct fb_info *info) { - struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; + struct sa1100fb_info *fbi = + container_of(info, struct sa1100fb_info, fb); struct fb_var_screeninfo *var = &info->var; unsigned long palette_mem_size; @@ -526,7 +530,8 @@ sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con, */ static int sa1100fb_blank(int blank, struct fb_info *info) { - struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; + struct sa1100fb_info *fbi = + container_of(info, struct sa1100fb_info, fb); int i; dev_dbg(fbi->dev, "sa1100fb_blank: blank=%d\n", blank); @@ -555,7 +560,8 @@ static int sa1100fb_blank(int blank, struct fb_info *info) static int sa1100fb_mmap(struct fb_info *info, struct vm_area_struct *vma) { - struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; + struct sa1100fb_info *fbi = + container_of(info, struct sa1100fb_info, fb); unsigned long off = vma->vm_pgoff << PAGE_SHIFT; if (off < info->fix.smem_len) { diff --git a/drivers/video/fbdev/sh_mobile_hdmi.c b/drivers/video/fbdev/sh_mobile_hdmi.c index 9a33ee0413fb..7c72a3f02056 100644 --- a/drivers/video/fbdev/sh_mobile_hdmi.c +++ b/drivers/video/fbdev/sh_mobile_hdmi.c @@ -281,6 +281,7 @@ struct sh_hdmi { u8 edid_block_addr; u8 edid_segment_nr; u8 edid_blocks; + int irq; struct clk *hdmi_clk; struct device *dev; struct delayed_work edid_work; @@ -1299,6 +1300,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev) hdmi->dev = &pdev->dev; hdmi->entity.owner = THIS_MODULE; hdmi->entity.ops = &sh_hdmi_ops; + hdmi->irq = irq; hdmi->hdmi_clk = clk_get(&pdev->dev, "ick"); if (IS_ERR(hdmi->hdmi_clk)) { @@ -1415,12 +1417,11 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev) { struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev)); struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - int irq = platform_get_irq(pdev, 0); snd_soc_unregister_codec(&pdev->dev); /* No new work will be scheduled, wait for running ISR */ - free_irq(irq, hdmi); + free_irq(hdmi->irq, hdmi); /* Wait for already scheduled work */ cancel_delayed_work_sync(&hdmi->edid_work); pm_runtime_put(&pdev->dev); @@ -1435,10 +1436,49 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev) return 0; } +static int sh_hdmi_suspend(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev)); + + disable_irq(hdmi->irq); + /* Wait for already scheduled work */ + cancel_delayed_work_sync(&hdmi->edid_work); + return 0; +} + +static int sh_hdmi_resume(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct sh_mobile_hdmi_info *pdata = dev_get_platdata(dev); + struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev)); + + /* Re-init interrupt polarity */ + if (pdata->flags & HDMI_OUTPUT_PUSH_PULL) + hdmi_bit_set(hdmi, 0x02, 0x02, HDMI_SYSTEM_CTRL); + + if (pdata->flags & HDMI_OUTPUT_POLARITY_HI) + hdmi_bit_set(hdmi, 0x01, 0x01, HDMI_SYSTEM_CTRL); + + /* Re-init htop1 */ + if (hdmi->htop1) + sh_hdmi_htop1_init(hdmi); + + /* Now it's safe to enable interrupts again */ + enable_irq(hdmi->irq); + return 0; +} + +static const struct dev_pm_ops sh_hdmi_pm_ops = { + .suspend = sh_hdmi_suspend, + .resume = sh_hdmi_resume, +}; + static struct platform_driver sh_hdmi_driver = { .remove = __exit_p(sh_hdmi_remove), .driver = { .name = "sh-mobile-hdmi", + .pm = &sh_hdmi_pm_ops, }, }; diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c index a89e3cafd5ad..295e0dedaf1f 100644 --- a/drivers/video/fbdev/sis/init301.c +++ b/drivers/video/fbdev/sis/init301.c @@ -1714,7 +1714,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */ } else { SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 802; - SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRS = 112; + SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; SiS_Pr->PanelVCLKIdx300 = VCLK81_300; SiS_Pr->PanelVCLKIdx315 = VCLK81_315; diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c index 3f12a2dd959a..e5d11b1892e8 100644 --- a/drivers/video/fbdev/sis/sis_main.c +++ b/drivers/video/fbdev/sis/sis_main.c @@ -162,7 +162,7 @@ static void sisfb_search_mode(char *name, bool quiet) return; } - if(!strnicmp(name, sisbios_mode[MODE_INDEX_NONE].name, strlen(name))) { + if(!strncasecmp(name, sisbios_mode[MODE_INDEX_NONE].name, strlen(name))) { if(!quiet) printk(KERN_ERR "sisfb: Mode 'none' not supported anymore. Using default.\n"); @@ -201,7 +201,7 @@ static void sisfb_search_mode(char *name, bool quiet) i = 0; j = 0; while(sisbios_mode[i].mode_no[0] != 0) { - if(!strnicmp(nameptr, sisbios_mode[i++].name, strlen(nameptr))) { + if(!strncasecmp(nameptr, sisbios_mode[i++].name, strlen(nameptr))) { if(sisfb_fstn) { if(sisbios_mode[i-1].mode_no[1] == 0x50 || sisbios_mode[i-1].mode_no[1] == 0x56 || @@ -262,7 +262,7 @@ sisfb_search_crt2type(const char *name) if(name == NULL) return; while(sis_crt2type[i].type_no != -1) { - if(!strnicmp(name, sis_crt2type[i].name, strlen(sis_crt2type[i].name))) { + if(!strncasecmp(name, sis_crt2type[i].name, strlen(sis_crt2type[i].name))) { sisfb_crt2type = sis_crt2type[i].type_no; sisfb_tvplug = sis_crt2type[i].tvplug_no; sisfb_crt2flags = sis_crt2type[i].flags; @@ -289,7 +289,7 @@ sisfb_search_tvstd(const char *name) return; while(sis_tvtype[i].type_no != -1) { - if(!strnicmp(name, sis_tvtype[i].name, strlen(sis_tvtype[i].name))) { + if(!strncasecmp(name, sis_tvtype[i].name, strlen(sis_tvtype[i].name))) { sisfb_tvstd = sis_tvtype[i].type_no; break; } @@ -308,12 +308,12 @@ sisfb_search_specialtiming(const char *name) if(name == NULL) return; - if(!strnicmp(name, "none", 4)) { + if(!strncasecmp(name, "none", 4)) { sisfb_specialtiming = CUT_FORCENONE; printk(KERN_DEBUG "sisfb: Special timing disabled\n"); } else { while(mycustomttable[i].chipID != 0) { - if(!strnicmp(name,mycustomttable[i].optionName, + if(!strncasecmp(name,mycustomttable[i].optionName, strlen(mycustomttable[i].optionName))) { sisfb_specialtiming = mycustomttable[i].SpecialID; found = true; @@ -3952,68 +3952,68 @@ static int __init sisfb_setup(char *options) if(!(*this_opt)) continue; - if(!strnicmp(this_opt, "off", 3)) { + if(!strncasecmp(this_opt, "off", 3)) { sisfb_off = 1; - } else if(!strnicmp(this_opt, "forcecrt2type:", 14)) { + } else if(!strncasecmp(this_opt, "forcecrt2type:", 14)) { /* Need to check crt2 type first for fstn/dstn */ sisfb_search_crt2type(this_opt + 14); - } else if(!strnicmp(this_opt, "tvmode:",7)) { + } else if(!strncasecmp(this_opt, "tvmode:",7)) { sisfb_search_tvstd(this_opt + 7); - } else if(!strnicmp(this_opt, "tvstandard:",11)) { + } else if(!strncasecmp(this_opt, "tvstandard:",11)) { sisfb_search_tvstd(this_opt + 11); - } else if(!strnicmp(this_opt, "mode:", 5)) { + } else if(!strncasecmp(this_opt, "mode:", 5)) { sisfb_search_mode(this_opt + 5, false); - } else if(!strnicmp(this_opt, "vesa:", 5)) { + } else if(!strncasecmp(this_opt, "vesa:", 5)) { sisfb_search_vesamode(simple_strtoul(this_opt + 5, NULL, 0), false); - } else if(!strnicmp(this_opt, "rate:", 5)) { + } else if(!strncasecmp(this_opt, "rate:", 5)) { sisfb_parm_rate = simple_strtoul(this_opt + 5, NULL, 0); - } else if(!strnicmp(this_opt, "forcecrt1:", 10)) { + } else if(!strncasecmp(this_opt, "forcecrt1:", 10)) { sisfb_forcecrt1 = (int)simple_strtoul(this_opt + 10, NULL, 0); - } else if(!strnicmp(this_opt, "mem:",4)) { + } else if(!strncasecmp(this_opt, "mem:",4)) { sisfb_parm_mem = simple_strtoul(this_opt + 4, NULL, 0); - } else if(!strnicmp(this_opt, "pdc:", 4)) { + } else if(!strncasecmp(this_opt, "pdc:", 4)) { sisfb_pdc = simple_strtoul(this_opt + 4, NULL, 0); - } else if(!strnicmp(this_opt, "pdc1:", 5)) { + } else if(!strncasecmp(this_opt, "pdc1:", 5)) { sisfb_pdca = simple_strtoul(this_opt + 5, NULL, 0); - } else if(!strnicmp(this_opt, "noaccel", 7)) { + } else if(!strncasecmp(this_opt, "noaccel", 7)) { sisfb_accel = 0; - } else if(!strnicmp(this_opt, "accel", 5)) { + } else if(!strncasecmp(this_opt, "accel", 5)) { sisfb_accel = -1; - } else if(!strnicmp(this_opt, "noypan", 6)) { + } else if(!strncasecmp(this_opt, "noypan", 6)) { sisfb_ypan = 0; - } else if(!strnicmp(this_opt, "ypan", 4)) { + } else if(!strncasecmp(this_opt, "ypan", 4)) { sisfb_ypan = -1; - } else if(!strnicmp(this_opt, "nomax", 5)) { + } else if(!strncasecmp(this_opt, "nomax", 5)) { sisfb_max = 0; - } else if(!strnicmp(this_opt, "max", 3)) { + } else if(!strncasecmp(this_opt, "max", 3)) { sisfb_max = -1; - } else if(!strnicmp(this_opt, "userom:", 7)) { + } else if(!strncasecmp(this_opt, "userom:", 7)) { sisfb_userom = (int)simple_strtoul(this_opt + 7, NULL, 0); - } else if(!strnicmp(this_opt, "useoem:", 7)) { + } else if(!strncasecmp(this_opt, "useoem:", 7)) { sisfb_useoem = (int)simple_strtoul(this_opt + 7, NULL, 0); - } else if(!strnicmp(this_opt, "nocrt2rate", 10)) { + } else if(!strncasecmp(this_opt, "nocrt2rate", 10)) { sisfb_nocrt2rate = 1; - } else if(!strnicmp(this_opt, "scalelcd:", 9)) { + } else if(!strncasecmp(this_opt, "scalelcd:", 9)) { unsigned long temp = 2; temp = simple_strtoul(this_opt + 9, NULL, 0); if((temp == 0) || (temp == 1)) { sisfb_scalelcd = temp ^ 1; } - } else if(!strnicmp(this_opt, "tvxposoffset:", 13)) { + } else if(!strncasecmp(this_opt, "tvxposoffset:", 13)) { int temp = 0; temp = (int)simple_strtol(this_opt + 13, NULL, 0); if((temp >= -32) && (temp <= 32)) { sisfb_tvxposoffset = temp; } - } else if(!strnicmp(this_opt, "tvyposoffset:", 13)) { + } else if(!strncasecmp(this_opt, "tvyposoffset:", 13)) { int temp = 0; temp = (int)simple_strtol(this_opt + 13, NULL, 0); if((temp >= -32) && (temp <= 32)) { sisfb_tvyposoffset = temp; } - } else if(!strnicmp(this_opt, "specialtiming:", 14)) { + } else if(!strncasecmp(this_opt, "specialtiming:", 14)) { sisfb_search_specialtiming(this_opt + 14); - } else if(!strnicmp(this_opt, "lvdshl:", 7)) { + } else if(!strncasecmp(this_opt, "lvdshl:", 7)) { int temp = 4; temp = simple_strtoul(this_opt + 7, NULL, 0); if((temp >= 0) && (temp <= 3)) { @@ -4022,9 +4022,9 @@ static int __init sisfb_setup(char *options) } else if(this_opt[0] >= '0' && this_opt[0] <= '9') { sisfb_search_mode(this_opt, true); #if !defined(__i386__) && !defined(__x86_64__) - } else if(!strnicmp(this_opt, "resetcard", 9)) { + } else if(!strncasecmp(this_opt, "resetcard", 9)) { sisfb_resetcard = 1; - } else if(!strnicmp(this_opt, "videoram:", 9)) { + } else if(!strncasecmp(this_opt, "videoram:", 9)) { sisfb_videoram = simple_strtoul(this_opt + 9, NULL, 0); #endif } else { @@ -5830,7 +5830,7 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ivideo->cardnumber++; } - strncpy(ivideo->myid, chipinfo->chip_name, 30); + strlcpy(ivideo->myid, chipinfo->chip_name, sizeof(ivideo->myid)); ivideo->warncount = 0; ivideo->chip_id = pdev->device; diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index c2c8eb668784..9e74e8fbe074 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -1187,9 +1187,9 @@ static ssize_t sm501fb_crtsrc_store(struct device *dev, if (len < 1) return -EINVAL; - if (strnicmp(buf, "crt", 3) == 0) + if (strncasecmp(buf, "crt", 3) == 0) head = HEAD_CRT; - else if (strnicmp(buf, "panel", 5) == 0) + else if (strncasecmp(buf, "panel", 5) == 0) head = HEAD_PANEL; else return -EINVAL; diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c index cfe8a2f905c5..86621fabbb8b 100644 --- a/drivers/video/fbdev/stifb.c +++ b/drivers/video/fbdev/stifb.c @@ -918,7 +918,7 @@ static int stifb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { - struct stifb_info *fb = (struct stifb_info *) info; + struct stifb_info *fb = container_of(info, struct stifb_info, info); u32 color; if (regno >= NR_PALETTE) @@ -978,7 +978,7 @@ stifb_setcolreg(u_int regno, u_int red, u_int green, static int stifb_blank(int blank_mode, struct fb_info *info) { - struct stifb_info *fb = (struct stifb_info *) info; + struct stifb_info *fb = container_of(info, struct stifb_info, info); int enable = (blank_mode == 0) ? ENABLE : DISABLE; switch (fb->id) { diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index 77b890e4d296..046d51d83d74 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1528,11 +1528,8 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, } if (total_len > 5) { - pr_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \ - "%02x %02x %02x %02x %02x %02x %02x\n", - total_len, desc[0], - desc[1], desc[2], desc[3], desc[4], desc[5], desc[6], - desc[7], desc[8], desc[9], desc[10]); + pr_info("vendor descriptor length:%x data:%11ph\n", total_len, + desc); if ((desc[0] != total_len) || /* descriptor length */ (desc[1] != 0x5f) || /* vendor descriptor type */ diff --git a/drivers/video/fbdev/valkyriefb.c b/drivers/video/fbdev/valkyriefb.c index 97cb9bd1d1dd..275fb98236d3 100644 --- a/drivers/video/fbdev/valkyriefb.c +++ b/drivers/video/fbdev/valkyriefb.c @@ -136,7 +136,8 @@ static struct fb_ops valkyriefb_ops = { /* Sets the video mode according to info->var */ static int valkyriefb_set_par(struct fb_info *info) { - struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info; + struct fb_info_valkyrie *p = + container_of(info, struct fb_info_valkyrie, info); volatile struct valkyrie_regs __iomem *valkyrie_regs = p->valkyrie_regs; struct fb_par_valkyrie *par = info->par; struct valkyrie_regvals *init; @@ -194,7 +195,8 @@ valkyriefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) */ static int valkyriefb_blank(int blank_mode, struct fb_info *info) { - struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info; + struct fb_info_valkyrie *p = + container_of(info, struct fb_info_valkyrie, info); struct fb_par_valkyrie *par = info->par; struct valkyrie_regvals *init = par->init; @@ -226,7 +228,8 @@ static int valkyriefb_blank(int blank_mode, struct fb_info *info) static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { - struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info; + struct fb_info_valkyrie *p = + container_of(info, struct fb_info_valkyrie, info); volatile struct cmap_regs __iomem *cmap_regs = p->cmap_regs; struct fb_par_valkyrie *par = info->par; @@ -263,10 +266,10 @@ static inline int valkyrie_vram_reqd(int video_mode, int color_mode) static void set_valkyrie_clock(unsigned char *params) { +#ifdef CONFIG_ADB_CUDA struct adb_request req; int i; -#ifdef CONFIG_ADB_CUDA for (i = 0; i < 3; ++i) { cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC, 0x50, i + 1, params[i]); @@ -465,7 +468,8 @@ static int valkyrie_var_to_par(struct fb_var_screeninfo *var, { int vmode, cmode; struct valkyrie_regvals *init; - struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) fb_info; + struct fb_info_valkyrie *p = + container_of(fb_info, struct fb_info_valkyrie, info); if (mac_var_to_vmode(var, &vmode, &cmode) != 0) { printk(KERN_ERR "valkyriefb: can't do %dx%dx%d.\n", diff --git a/drivers/video/fbdev/vermilion/vermilion.c b/drivers/video/fbdev/vermilion/vermilion.c index 048a66640b03..5f930aeccf1f 100644 --- a/drivers/video/fbdev/vermilion/vermilion.c +++ b/drivers/video/fbdev/vermilion/vermilion.c @@ -481,7 +481,6 @@ static int vml_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) default: err = -ENODEV; goto out_err_1; - break; } info = &vinfo->info; diff --git a/drivers/video/fbdev/via/via-gpio.c b/drivers/video/fbdev/via/via-gpio.c index e408679081ab..6f433b8cee12 100644 --- a/drivers/video/fbdev/via/via-gpio.c +++ b/drivers/video/fbdev/via/via-gpio.c @@ -270,7 +270,7 @@ static int viafb_gpio_probe(struct platform_device *platdev) static int viafb_gpio_remove(struct platform_device *platdev) { unsigned long flags; - int ret = 0, i; + int i; #ifdef CONFIG_PM viafb_pm_unregister(&viafb_gpio_pm_hooks); @@ -280,11 +280,7 @@ static int viafb_gpio_remove(struct platform_device *platdev) * Get unregistered. */ if (viafb_gpio_config.gpio_chip.ngpio > 0) { - ret = gpiochip_remove(&viafb_gpio_config.gpio_chip); - if (ret) { /* Somebody still using it? */ - printk(KERN_ERR "Viafb: GPIO remove failed\n"); - return ret; - } + gpiochip_remove(&viafb_gpio_config.gpio_chip); } /* * Disable the ports. @@ -294,7 +290,7 @@ static int viafb_gpio_remove(struct platform_device *platdev) viafb_gpio_disable(viafb_gpio_config.active_gpios[i]); viafb_gpio_config.gpio_chip.ngpio = 0; spin_unlock_irqrestore(&viafb_gpio_config.vdev->reg_lock, flags); - return ret; + return 0; } static struct platform_driver via_gpio_driver = { diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c index 901014bbc821..09dc44736c1a 100644 --- a/drivers/video/fbdev/xen-fbfront.c +++ b/drivers/video/fbdev/xen-fbfront.c @@ -684,12 +684,13 @@ static const struct xenbus_device_id xenfb_ids[] = { { "" } }; -static DEFINE_XENBUS_DRIVER(xenfb, , +static struct xenbus_driver xenfb_driver = { + .ids = xenfb_ids, .probe = xenfb_probe, .remove = xenfb_remove, .resume = xenfb_resume, .otherend_changed = xenfb_backend_changed, -); +}; static int __init xenfb_init(void) { diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index 5c098d5b4043..32d8275e4c88 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c @@ -233,8 +233,7 @@ struct display_timings *of_get_display_timings(struct device_node *np) return disp; timingfail: - if (native_mode) - of_node_put(native_mode); + of_node_put(native_mode); display_timings_release(disp); disp = NULL; entryfail: |