static int truly_tft240240_probe(struct platform_device *pdev) { int ret; struct truly_tft240240_data *dev; dev = kzalloc(sizeof(struct truly_tft240240_data), GFP_KERNEL); if (!dev) return -ENOMEM; dev->ctrl = pdev->dev.platform_data; if (dev->ctrl == NULL) { dev_info(&pdev->dev, "no platform data!"); return -EINVAL; } dev_set_drvdata(&pdev->dev, dev); dev->lcd = lcd_device_register("truly_tft240240_slcd", &pdev->dev, dev, &truly_tft240240_ops); if (IS_ERR(dev->lcd)) { ret = PTR_ERR(dev->lcd); dev->lcd = NULL; dev_info(&pdev->dev, "lcd device register error: %d\n", ret); } else { dev_info(&pdev->dev, "lcd device(TRULY TFT240240) register success\n"); } if (dev->ctrl->power_on) { dev->ctrl->power_on(dev->lcd, 1); dev->lcd_power = FB_BLANK_UNBLANK; } dev->lcd_vcc_reg = regulator_get(NULL,"lcd_3v3"); regulator_enable(dev->lcd_vcc_reg); return 0; }
static int __devinit corgi_lcd_probe(struct spi_device *spi) { struct backlight_properties props; struct corgi_lcd_platform_data *pdata = spi->dev.platform_data; struct corgi_lcd *lcd; int ret = 0; if (pdata == NULL) { dev_err(&spi->dev, "platform data not available\n"); return -EINVAL; } lcd = kzalloc(sizeof(struct corgi_lcd), GFP_KERNEL); if (!lcd) { dev_err(&spi->dev, "failed to allocate memory\n"); return -ENOMEM; } lcd->spi_dev = spi; lcd->lcd_dev = lcd_device_register("corgi_lcd", &spi->dev, lcd, &corgi_lcd_ops); if (IS_ERR(lcd->lcd_dev)) { ret = PTR_ERR(lcd->lcd_dev); goto err_free_lcd; } lcd->power = FB_BLANK_POWERDOWN; lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA; memset(&props, 0, sizeof(struct backlight_properties)); <<<<<<< HEAD
int samsung_display_sysfs_create( struct platform_device *pdev, struct platform_device *msm_fb_dev, char *panel_name) { int ret; struct lcd_device *lcd_device; if ((!pdev) || (!msm_fb_dev)) return -ENODEV; if (!panel_name) return -EFAULT; set_panel_name(panel_name, strnlen(panel_name, MAX_PANEL_NAME)); get_platform_data(msm_fb_dev); lcd_device = lcd_device_register("panel", &pdev->dev, NULL, &display_props); if (IS_ERR(lcd_device)) { ret = PTR_ERR(lcd_device); printk(KERN_ERR "lcd : failed to register device\n"); return ret; } ret = sysfs_create_file(&lcd_device->dev.kobj, &dev_attr_lcd_type.attr); if (ret) printk(KERN_ERR "sysfs create fail - %s\n", dev_attr_lcd_type.attr.name); return 0; }
static int s6e3hf2_probe(struct dsim_device *dsim) { int ret = 0; struct panel_private *priv = &dsim->priv; dsim->lcd = lcd_device_register("panel", dsim->dev, NULL, NULL); if (IS_ERR(dsim->lcd)) { pr_err("failed to register lcd device\n"); ret = PTR_ERR(dsim->lcd); goto probe_err; } priv->bd = backlight_device_register("panel", dsim->dev, &dsim->priv, &s6e3hf2_backlight_ops, NULL); if (IS_ERR(priv->bd)) { pr_err("failed to register backlight device\n"); ret = PTR_ERR(priv->bd); goto probe_err; } priv->bd->props.max_brightness = MAX_BRIGHTNESS; priv->bd->props.brightness = DEFAULT_BRIGHTNESS; probe_err: return ret; }
static int __devinit corgi_lcd_probe(struct spi_device *spi) { struct corgi_lcd_platform_data *pdata = spi->dev.platform_data; struct corgi_lcd *lcd; int ret = 0; if (pdata == NULL) { dev_err(&spi->dev, "platform data not available\n"); return -EINVAL; } lcd = kzalloc(sizeof(struct corgi_lcd), GFP_KERNEL); if (!lcd) { dev_err(&spi->dev, "failed to allocate memory\n"); return -ENOMEM; } lcd->spi_dev = spi; lcd->lcd_dev = lcd_device_register("corgi_lcd", &spi->dev, lcd, &corgi_lcd_ops); if (IS_ERR(lcd->lcd_dev)) { ret = PTR_ERR(lcd->lcd_dev); goto err_free_lcd; } lcd->power = FB_BLANK_POWERDOWN; lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA; lcd->bl_dev = backlight_device_register("corgi_bl", &spi->dev, lcd, &corgi_bl_ops); if (IS_ERR(lcd->bl_dev)) { ret = PTR_ERR(lcd->bl_dev); goto err_unregister_lcd; } lcd->bl_dev->props.max_brightness = pdata->max_intensity; lcd->bl_dev->props.brightness = pdata->default_intensity; lcd->bl_dev->props.power = FB_BLANK_UNBLANK; ret = setup_gpio_backlight(lcd, pdata); if (ret) goto err_unregister_bl; lcd->kick_battery = pdata->kick_battery; dev_set_drvdata(&spi->dev, lcd); corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK); backlight_update_status(lcd->bl_dev); lcd->limit_mask = pdata->limit_mask; the_corgi_lcd = lcd; return 0; err_unregister_bl: backlight_device_unregister(lcd->bl_dev); err_unregister_lcd: lcd_device_unregister(lcd->lcd_dev); err_free_lcd: kfree(lcd); return ret; }
static int ams_delta_panel_probe(struct platform_device *pdev) { struct lcd_device *lcd_device = NULL; #ifdef CONFIG_LCD_CLASS_DEVICE int ret; lcd_device = lcd_device_register("omapfb", &pdev->dev, NULL, &ams_delta_lcd_ops); if (IS_ERR(lcd_device)) { ret = PTR_ERR(lcd_device); dev_err(&pdev->dev, "failed to register device\n"); return ret; } platform_set_drvdata(pdev, lcd_device); lcd_device->props.max_contrast = AMS_DELTA_MAX_CONTRAST; #endif ams_delta_lcd_set_contrast(lcd_device, AMS_DELTA_DEFAULT_CONTRAST); ams_delta_lcd_set_power(lcd_device, FB_BLANK_UNBLANK); omapfb_register_panel(&ams_delta_panel); return 0; }
/* * ubicom32lcdpower_probe */ static int ubicom32lcdpower_probe(struct platform_device *pdev) { const struct ubicom32lcdpower_platform_data *pdata = pdev->dev.platform_data; struct ubicom32lcdpower_data *ud; struct lcd_device *lcddev; int retval; /* * Check to see if we have any platform data, if we don't have a LCD to control */ if (!pdata) { return -ENODEV; } /* * Allocate our private data */ ud = kzalloc(sizeof(struct ubicom32lcdpower_data), GFP_KERNEL); if (!ud) { return -ENOMEM; } ud->pdata = pdata; /* * Request our GPIOs */ retval = gpio_request(pdata->vgh_gpio, "vgh"); if (retval) { dev_err(&pdev->dev, "Failed to allocate vgh GPIO\n"); goto fail_gpio; } /* * Register our lcd device */ lcddev = lcd_device_register(DRIVER_NAME, &pdev->dev, ud, &ubicom32lcdpower_ops); if (IS_ERR(lcddev)) { retval = PTR_ERR(lcddev); goto fail; } ud->lcddev = lcddev; platform_set_drvdata(pdev, ud); ubicom32lcdpower_set_power(lcddev, FB_BLANK_UNBLANK); printk(KERN_INFO DRIVER_NAME ": LCD driver started\n"); return 0; fail: gpio_free(pdata->vgh_gpio); fail_gpio: platform_set_drvdata(pdev, NULL); kfree(ud); return retval; }
static int __devinit lcd_pwrctrl_probe(struct platform_device *pdev) { struct lcd_pwrctrl *lp; struct lcd_pwrctrl_data *pdata = pdev->dev.platform_data; struct device *dev = &pdev->dev; int err; #ifdef CONFIG_OF if (dev->of_node) { pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) { dev_err(dev, "memory allocation for pdata failed\n"); return -ENOMEM; } lcd_pwrctrl_parse_dt(dev, pdata); } #endif if (!pdata) { dev_err(dev, "platform data not available\n"); return -EINVAL; } lp = devm_kzalloc(dev, sizeof(struct lcd_pwrctrl), GFP_KERNEL); if (!lp) { dev_err(dev, "memory allocation failed for private data\n"); return -ENOMEM; } err = gpio_request(pdata->gpio, "LCD-nRESET"); if (err) { dev_err(dev, "gpio [%d] request failed\n", pdata->gpio); return err; } /* * If power to lcd and/or lcd interface is controlled using a regulator, * get the handle to the regulator for later use during power switching. */ lp->regulator = devm_regulator_get(dev, "vcc-lcd"); if (IS_ERR(lp->regulator)) dev_info(dev, "could not find regulator\n"); lp->dev = dev; lp->pdata = pdata; lp->lcd = lcd_device_register(dev_name(dev), dev, lp, &lcd_pwrctrl_ops); if (IS_ERR(lp->lcd)) { dev_err(dev, "cannot register lcd device\n"); gpio_free(pdata->gpio); return PTR_ERR(lp->lcd); } platform_set_drvdata(pdev, lp); lcd_pwrctrl_set_power(lp->lcd, FB_BLANK_NORMAL); return 0; }
static int cr_backlight_probe(struct platform_device *pdev) { struct cr_panel *crp; u8 dev_en; crp = kzalloc(sizeof(*crp), GFP_KERNEL); if (crp == NULL) return -ENOMEM; lpc_dev = pci_get_device(PCI_VENDOR_ID_INTEL, CRVML_DEVICE_LPC, NULL); if (!lpc_dev) { printk("INTEL CARILLO RANCH LPC not found.\n"); return -ENODEV; } pci_read_config_byte(lpc_dev, CRVML_REG_GPIOEN, &dev_en); if (!(dev_en & CRVML_GPIOEN_BIT)) { printk(KERN_ERR "Carillo Ranch GPIO device was not enabled.\n"); pci_dev_put(lpc_dev); return -ENODEV; } crp->cr_backlight_device = backlight_device_register("cr-backlight", &pdev->dev, NULL, &cr_backlight_ops); if (IS_ERR(crp->cr_backlight_device)) { pci_dev_put(lpc_dev); return PTR_ERR(crp->cr_backlight_device); } crp->cr_lcd_device = lcd_device_register("cr-lcd", &pdev->dev, NULL &cr_lcd_ops); if (IS_ERR(crp->cr_lcd_device)) { pci_dev_put(lpc_dev); return PTR_ERR(crp->cr_backlight_device); } pci_read_config_dword(lpc_dev, CRVML_REG_GPIOBAR, &gpio_bar); gpio_bar &= ~0x3F; crp->cr_backlight_device->props.power = FB_BLANK_UNBLANK; crp->cr_backlight_device->props.brightness = 0; crp->cr_backlight_device->props.max_brightness = 0; cr_backlight_set_intensity(crp->cr_backlight_device); cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_UNBLANK); platform_set_drvdata(pdev, crp); return 0; }
static int ili922x_probe(struct spi_device *spi) { struct ili922x *ili; struct lcd_device *lcd; int ret; u16 reg = 0; ili = devm_kzalloc(&spi->dev, sizeof(*ili), GFP_KERNEL); if (!ili) { dev_err(&spi->dev, "cannot alloc priv data\n"); return -ENOMEM; } ili->spi = spi; spi_set_drvdata(spi, ili); /* check if the device is connected */ ret = ili922x_read(spi, REG_DRIVER_CODE_READ, ®); if (ret || ((reg & ILITEK_DEVICE_ID_MASK) != ILITEK_DEVICE_ID)) { dev_err(&spi->dev, "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); } 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); ili922x_display_init(spi); ili->power = FB_BLANK_POWERDOWN; lcd = lcd_device_register("ili922xlcd", &spi->dev, ili, &ili922x_ops); if (IS_ERR(lcd)) { dev_err(&spi->dev, "cannot register LCD\n"); return PTR_ERR(lcd); } ili->ld = lcd; spi_set_drvdata(spi, ili); ili922x_lcd_power(ili, FB_BLANK_UNBLANK); return 0; }
static int aximx5_lcd_probe(struct platform_device *dev) { struct mediaq11xx_base *mq_base = dev->dev.platform_data; mqfb_lcd_device = lcd_device_register ("mq11xx_fb0", mq_base, &mq11xx_fb0_lcd); if (IS_ERR (mqfb_lcd_device)) { return PTR_ERR (mqfb_lcd_device); } return 0; }
static int dsim_panel_probe(struct dsim_device *dsim) { int ret = 0; struct panel_private *panel = &dsim->priv; #if defined(CONFIG_EXYNOS_DECON_MDNIE_LITE) u16 coordinate[2] = {0, }; #endif dsim->lcd = lcd_device_register("panel", dsim->dev, &dsim->priv, NULL); if (IS_ERR(dsim->lcd)) { dsim_err("%s : faield to register lcd device\n", __func__); ret = PTR_ERR(dsim->lcd); goto probe_err; } ret = dsim_backlight_probe(dsim); if (ret) { dsim_err("%s : failed to prbe backlight driver\n", __func__); goto probe_err; } panel->lcdConnected = PANEL_CONNECTED; panel->state = PANEL_STATE_RESUMED; panel->temperature = NORMAL_TEMPERATURE; panel->acl_enable = 0; panel->current_acl = 0; panel->auto_brightness = 0; panel->siop_enable = 0; panel->current_hbm = 0; panel->current_vint = 0; mutex_init(&panel->lock); #ifdef CONFIG_EXYNOS_DECON_LCD_MCD panel->mcd_on = 0; #endif if (panel->ops->probe) { ret = panel->ops->probe(dsim); if (ret) { dsim_err("%s : failed to probe panel\n", __func__); goto probe_err; } } #if defined(CONFIG_EXYNOS_DECON_LCD_SYSFS) lcd_init_sysfs(dsim); #endif #if defined(CONFIG_EXYNOS_DECON_MDNIE_LITE) coordinate[0] = (u16)panel->coordinate[0]; coordinate[1] = (u16)panel->coordinate[1]; mdnie_register(&dsim->lcd->dev, dsim, (mdnie_w)mdnie_lite_send_seq, (mdnie_r)mdnie_lite_read, coordinate, &tune_info); #endif probe_err: return ret; }
static int __devinit lms283gf05_probe(struct spi_device *spi) { struct lms283gf05_state *st; struct lms283gf05_pdata *pdata = spi->dev.platform_data; struct lcd_device *ld; int ret = 0; if (pdata != NULL) { ret = gpio_request(pdata->reset_gpio, "LMS285GF05 RESET"); if (ret) return ret; ret = gpio_direction_output(pdata->reset_gpio, !pdata->reset_inverted); if (ret) goto err; } st = kzalloc(sizeof(struct lms283gf05_state), GFP_KERNEL); if (st == NULL) { dev_err(&spi->dev, "No memory for device state\n"); ret = -ENOMEM; goto err; } ld = lcd_device_register("lms283gf05", &spi->dev, st, &lms_ops); if (IS_ERR(ld)) { ret = PTR_ERR(ld); goto err2; } st->spi = spi; st->ld = ld; dev_set_drvdata(&spi->dev, st); /* kick in the LCD */ if (pdata) lms283gf05_reset(pdata->reset_gpio, pdata->reset_inverted); lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq)); return 0; err2: kfree(st); err: if (pdata != NULL) gpio_free(pdata->reset_gpio); return ret; }
static int __devinit mipi_hx8389b_lcd_probe(struct platform_device *pdev) { struct platform_device *pthisdev = NULL; #if defined(CONFIG_LCD_CLASS_DEVICE) struct lcd_device *lcd_device; int ret; #endif #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) struct backlight_device *bd; #endif pr_debug("%s\n", __func__); pthisdev = msm_fb_add_device(pdev); mutex_init(&dsi_tx_mutex); #if defined(CONFIG_LCD_CLASS_DEVICE) lcd_device = lcd_device_register("panel", &pdev->dev, NULL, &mipi_lcd_props); if (IS_ERR(lcd_device)) { int ret = PTR_ERR(lcd_device); printk(KERN_ERR "lcd : failed to register device\n"); return ret; } ret = sysfs_create_file(&lcd_device->dev.kobj, &dev_attr_lcd_type.attr); if (ret) { pr_info("sysfs create fail-%s\n", dev_attr_lcd_type.attr.name); } #endif #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) bd = backlight_device_register("panel", &lcd_device->dev, NULL, NULL, NULL); if (IS_ERR(bd)) { ret = PTR_ERR(bd); pr_info("backlight : failed to register device\n"); return ret; } #endif #if defined(CONFIG_MDNIE_LITE_TUNING) /* mdnie sysfs create */ init_mdnie_class(); #endif return 0; }
static int h3600_lcd_probe (struct platform_device *pdev) { if (! machine_is_h3600 ()) return -ENODEV; h3600_lcd_device = lcd_device_register("sa1100fb", NULL, &h3600_lcd_ops); if (IS_ERR (h3600_lcd_device)) return PTR_ERR (h3600_lcd_device); h3600_lcd_set_power (h3600_lcd_device, 0); sa1100fb_lcd_power = __h3600_lcd_power; return 0; }
static int s6e3hf2_wqhd_probe(struct dsim_device *dsim) { int ret = 0; struct panel_private *priv = &dsim->priv; dsim_info("%s was called\n", __func__); dsim->lcd = lcd_device_register("panel", dsim->dev, &dsim->priv, NULL); if (IS_ERR(dsim->lcd)) { pr_err("failed to register lcd device\n"); ret = PTR_ERR(dsim->lcd); goto probe_err; } priv->bd = backlight_device_register("panel", dsim->dev, &dsim->priv, &s6e3hf2_wqhd_backlight_ops, NULL); if (IS_ERR(priv->bd)) { pr_err("failed to register backlight device\n"); ret = PTR_ERR(priv->bd); goto probe_err; } priv->bd->props.max_brightness = MAX_PLATFORM_BRIGHTNESS; priv->bd->props.brightness = DEFAULT_PLATFORM_BRIGHTNESS; /*Todo need to rearrange below value */ priv->lcdConnected = PANEL_CONNECTED; priv->state = PANEL_STATE_ACTIVE; priv->power = FB_BLANK_UNBLANK; priv->temperature = NORMAL_TEMPERATURE; priv->acl_enable= 0; priv->current_acl = 0; priv->auto_brightness = 0; priv->siop_enable = 0; priv->current_hbm = 0; mutex_init(&priv->lock); #if defined(CONFIG_EXYNOS_DECON_LCD_SYSFS) lcd_init_sysfs(dsim); #endif dsim_panel_probe(dsim); #if defined(CONFIG_EXYNOS_DECON_MDNIE_LITE) mdnie_register(&dsim->lcd->dev, dsim, (mdnie_w)s6e3hf2_send_seq, (mdnie_r)s6e3hf2_read); #endif probe_err: return ret; }
static int __devinit crd080ti01_40nm01_probe(struct platform_device *pdev) { int ret; struct crd080ti01_40nm01_data *dev; dev = kzalloc(sizeof(struct crd080ti01_40nm01_data), GFP_KERNEL); if (!dev) return -ENOMEM; dev->pdata = pdev->dev.platform_data; dev_set_drvdata(&pdev->dev, dev); dev->lcd_vcc_reg = regulator_get(NULL, "vlcd"); if (IS_ERR(dev->lcd_vcc_reg)) { dev_err(&pdev->dev, "failed to get regulator vlcd\n"); return PTR_ERR(dev->lcd_vcc_reg); } if (dev->pdata->gpio_lr) gpio_request(dev->pdata->gpio_lr, "left_to_right "); if (dev->pdata->gpio_ud) gpio_request(dev->pdata->gpio_ud, "up_to_down"); if (dev->pdata->gpio_selb) gpio_request(dev->pdata->gpio_selb, "mode_select"); if (dev->pdata->gpio_stbyb) gpio_request(dev->pdata->gpio_stbyb, "standby_mode"); if (dev->pdata->gpio_rest) gpio_request(dev->pdata->gpio_rest, "reset"); crd080ti01_40nm01_on(dev); printk("register lcd panel : crd080ti01_40nm01-lcd\n"); dev->lcd = lcd_device_register("crd080ti01_40nm01-lcd", &pdev->dev, dev, &crd080ti01_40nm01_ops); if (IS_ERR(dev->lcd)) { ret = PTR_ERR(dev->lcd); dev->lcd = NULL; dev_info(&pdev->dev, "lcd device register error: %d\n", ret); } else { dev_info(&pdev->dev, "lcd device register success\n"); } return 0; }
static int ls040b3sx01_probe(struct mipi_dsim_lcd_device *dsim_dev) { struct ls040b3sx01_info *lcd = NULL; struct lcd_platform_data *ddi_pd; lcd = kzalloc(sizeof(struct ls040b3sx01_info), GFP_KERNEL); if (!lcd) { dev_err(&dsim_dev->dev, "failed to allocate ls040b3sx01 structure.\n"); return -ENOMEM; } lcd->dsim_dev = dsim_dev; lcd->ddi_pd = ddi_pd = (struct lcd_platform_data *)dsim_dev->platform_data; lcd->init_param = ls040b3sx01_params; if (IS_ERR_OR_NULL(lcd->ddi_pd)) pr_err("%s: ddi_pd is NULL\n", __func__); lcd->dev = &dsim_dev->dev; dev_set_drvdata(&dsim_dev->dev, lcd); lcd->ld = lcd_device_register("ls040b3sx01", lcd->dev, lcd, &ls040b3sx01_lcd_ops); if (IS_ERR(lcd->ld)) { dev_err(lcd->dev, "failed to register lcd ops.\n"); goto err_dev_register; } /* lcd power on */ if (ddi_pd->power_on) ddi_pd->power_on(lcd->ld, true); /* lcd reset */ if (ddi_pd->reset) ddi_pd->reset(lcd->ld); lcd->state = LCD_DISPLAY_SLEEP_IN; pr_info("ls040b3sx01_probe finish\n"); return 0; err_dev_register: kfree(lcd); return -1; }
static int himalaya_lcd_probe( struct platform_device *dev ) { int ret; himalaya_boardid=himalaya_get_boardid(); printk("Himalaya Board ID 0x%x\n", himalaya_boardid); himalaya_lcd_device = lcd_device_register("w100fb", (void *)&himalaya_fb_info, &himalaya_lcd_props); if (IS_ERR(himalaya_lcd_device)) { return PTR_ERR(himalaya_lcd_device); } ret = platform_device_register( &himalaya_fb_device ); // TODO: return ret; }
static int roverp5p_fp_probe (struct device *dev) { struct mediaq11xx_base *mq_base = (struct mediaq11xx_base *)dev->platform_data; mqfb_backlight_device = backlight_device_register ("mq11xx_fb0", mq_base, &mq11xx_fb0_bl); if (IS_ERR (mqfb_backlight_device)) return PTR_ERR (mqfb_backlight_device); mqfb_lcd_device = lcd_device_register ("mq11xx_fb0", mq_base, &mq11xx_fb0_lcd); if (IS_ERR (mqfb_lcd_device)) { backlight_device_unregister (mqfb_backlight_device); return PTR_ERR (mqfb_lcd_device); } return 0; }
static int auo_a043fl01v2_probe(struct platform_device *pdev) { struct auo_a043fl01v2_data *dev; dev = kzalloc(sizeof(struct auo_a043fl01v2_data), GFP_KERNEL); if (!dev) return -ENOMEM; dev->pdata = pdev->dev.platform_data; dev_set_drvdata(&pdev->dev, dev); auo_a043fl01v2_on(dev); dev->lcd = lcd_device_register("auo_a043fl01v2-lcd", &pdev->dev, dev, &auo_a043fl01v2_ops); return 0; }
static int aximx3_lcd_init (void) { if (! machine_is_aximx3 ()) return -ENODEV; set_pxa_fb_info(&aximx3_fb_info); pxafb_lcd_device = lcd_device_register("pxafb", NULL, &aximx3_lcd_properties); if (IS_ERR (pxafb_lcd_device)) return PTR_ERR (pxafb_lcd_device); pxafb_backlight_device = backlight_device_register("pxafb", NULL, &aximx3_backlight_properties); if (IS_ERR (pxafb_backlight_device)) { lcd_device_unregister (pxafb_lcd_device); return PTR_ERR (pxafb_backlight_device); } return 0; }
static int __init s6c1372_probe(struct platform_device *pdev) { struct s6c1372_lcd *lcd; int ret = 0; lcd = kzalloc(sizeof(struct s6c1372_lcd), GFP_KERNEL); if (!lcd) { pr_err("failed to allocate for lcd\n"); ret = -ENOMEM; goto err_alloc; } lcd->ld = lcd_device_register("panel", &pdev->dev, lcd, &s6c1372_ops); if (IS_ERR(lcd->ld)) { pr_err("failed to register lcd device\n"); ret = PTR_ERR(lcd->ld); goto out_free_lcd; } lcd->lcd_pd = pdev->dev.platform_data; if (IS_ERR(lcd->lcd_pd)) { pr_err("no platform data for lcd, cannot attach\n"); ret = PTR_ERR(lcd->lcd_pd); goto out_free_lcd; } lcd->power = 1; ret = device_create_file(&lcd->ld->dev, &dev_attr_lcd_type); if (ret < 0) dev_err(&lcd->ld->dev, "failed to add sysfs entries\n"); dev_set_drvdata(&pdev->dev, lcd); dev_info(&lcd->ld->dev, "lcd panel driver has been probed.\n"); return 0; out_free_lcd: kfree(lcd); return ret; err_alloc: return ret; }
static int ams_delta_panel_probe(struct platform_device *pdev) { struct lcd_device *lcd_device = NULL; int ret; gpiod_vblen = devm_gpiod_get(&pdev->dev, "vblen", GPIOD_OUT_LOW); if (IS_ERR(gpiod_vblen)) { ret = PTR_ERR(gpiod_vblen); dev_err(&pdev->dev, "VBLEN GPIO request failed (%d)\n", ret); return ret; } gpiod_ndisp = devm_gpiod_get(&pdev->dev, "ndisp", GPIOD_OUT_LOW); if (IS_ERR(gpiod_ndisp)) { ret = PTR_ERR(gpiod_ndisp); dev_err(&pdev->dev, "NDISP GPIO request failed (%d)\n", ret); return ret; } #ifdef CONFIG_LCD_CLASS_DEVICE lcd_device = lcd_device_register("omapfb", &pdev->dev, NULL, &ams_delta_lcd_ops); if (IS_ERR(lcd_device)) { ret = PTR_ERR(lcd_device); dev_err(&pdev->dev, "failed to register device\n"); return ret; } platform_set_drvdata(pdev, lcd_device); lcd_device->props.max_contrast = AMS_DELTA_MAX_CONTRAST; #endif ams_delta_lcd_set_contrast(lcd_device, AMS_DELTA_DEFAULT_CONTRAST); ams_delta_lcd_set_power(lcd_device, FB_BLANK_UNBLANK); omapfb_register_panel(&ams_delta_panel); return 0; }
static int lms283gf05_probe(struct spi_device *spi) { struct lms283gf05_state *st; struct lms283gf05_pdata *pdata = spi->dev.platform_data; struct lcd_device *ld; int ret = 0; if (pdata != NULL) { ret = devm_gpio_request_one(&spi->dev, pdata->reset_gpio, GPIOF_DIR_OUT | (!pdata->reset_inverted ? GPIOF_INIT_HIGH : GPIOF_INIT_LOW), "LMS285GF05 RESET"); if (ret) return ret; } st = devm_kzalloc(&spi->dev, sizeof(struct lms283gf05_state), GFP_KERNEL); if (st == NULL) { dev_err(&spi->dev, "No memory for device state\n"); return -ENOMEM; } ld = lcd_device_register("lms283gf05", &spi->dev, st, &lms_ops); if (IS_ERR(ld)) return PTR_ERR(ld); st->spi = spi; st->ld = ld; dev_set_drvdata(&spi->dev, st); /* kick in the LCD */ if (pdata) lms283gf05_reset(pdata->reset_gpio, pdata->reset_inverted); lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq)); return 0; }
static int __devinit platform_lcd_probe(struct platform_device *pdev) { struct plat_lcd_data *pdata; struct platform_lcd *plcd; struct device *dev = &pdev->dev; int err; pdata = pdev->dev.platform_data; if (!pdata) { dev_err(dev, "no platform data supplied\n"); return -EINVAL; } plcd = kzalloc(sizeof(struct platform_lcd), GFP_KERNEL); if (!plcd) { dev_err(dev, "no memory for state\n"); return -ENOMEM; } plcd->us = dev; plcd->pdata = pdata; plcd->lcd = lcd_device_register(dev_name(dev), dev, plcd, &platform_lcd_ops); if (IS_ERR(plcd->lcd)) { dev_err(dev, "cannot register lcd device\n"); err = PTR_ERR(plcd->lcd); goto err_mem; } platform_set_drvdata(pdev, plcd); platform_lcd_set_power(plcd->lcd, FB_BLANK_NORMAL); return 0; err_mem: kfree(plcd); return err; }
static int jornada_lcd_probe(struct platform_device *pdev) { struct lcd_device *lcd_device; int ret; lcd_device = lcd_device_register(S1D_DEVICENAME, &pdev->dev, NULL, &jornada_lcd_props); if (IS_ERR(lcd_device)) { ret = PTR_ERR(lcd_device); printk(KERN_ERR "lcd : failed to register device\n"); return ret; } platform_set_drvdata(pdev, lcd_device); /* lets set our default values */ jornada_lcd_set_contrast(lcd_device, LCD_DEF_CONTRAST); jornada_lcd_set_power(lcd_device, FB_BLANK_UNBLANK); /* give it some time to startup */ msleep(100); return 0; }
static int __devinit mipi_nt35510_lcd_probe(struct platform_device *pdev) { struct platform_device *msm_fb_pdev; struct lcd_device *lcd_device; int ret; DPRINT("%s\n", __func__); if (pdev->id == 0) { mipi_nt35510_pdata = pdev->dev.platform_data; return 0; } /* * save returned struct platform_device pointer * as we later need to get msm_fb_data_type */ msm_fb_pdev = msm_fb_add_device(pdev); /* struct lcd_device now has needed platform data */ lcd_device = lcd_device_register("panel", &pdev->dev, platform_get_drvdata(msm_fb_pdev), &mipi_lcd_props); if (IS_ERR(lcd_device)) { ret = PTR_ERR(lcd_device); printk(KERN_ERR "lcd : failed to register device\n"); return ret; } ret = sysfs_create_file(&lcd_device->dev.kobj, &dev_attr_lcd_type.attr); if (ret) printk(KERN_ERR "sysfs create fail - %s\n", dev_attr_lcd_type.attr.name); return 0; }
int picolcd_init_lcd(struct picolcd_data *data, struct hid_report *report) { struct device *dev = &data->hdev->dev; struct lcd_device *ldev; if (!report) return -ENODEV; if (report->maxfield != 1 || report->field[0]->report_count != 1 || report->field[0]->report_size != 8) { dev_err(dev, "unsupported CONTRAST report"); return -EINVAL; } ldev = lcd_device_register(dev_name(dev), dev, data, &picolcd_lcdops); if (IS_ERR(ldev)) { dev_err(dev, "failed to register LCD\n"); return PTR_ERR(ldev); } ldev->props.max_contrast = 0x0ff; data->lcd_contrast = 0xe5; data->lcd = ldev; picolcd_set_contrast(ldev, 0xe5); return 0; }
static int __devinit mipi_novatek_disp_probe(struct platform_device *pdev) { struct platform_device *msm_fb_added_dev; #if defined(CONFIG_LCD_CLASS_DEVICE) struct lcd_device *lcd_device; int ret; #endif #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) struct backlight_device *bd; #endif msd.dstat.acl_on = false; is_lcd_on = LCD_STATUS_ON; if (pdev->id == 0) { msd.mipi_novatek_disp_pdata = pdev->dev.platform_data; #ifdef CONFIG_SAMSUNG_CMC624 if (samsung_has_cmc624()) { printk(KERN_DEBUG "Is_There_cmc624 : CMC624 is there!!!!"); samsung_cmc624_init(); } else { printk(KERN_DEBUG "Is_There_cmc624 : CMC624 is not there!!!!"); } #endif return 0; } msm_fb_added_dev = msm_fb_add_device(pdev); #if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_LCD_CLASS_DEVICE) msd.msm_pdev = msm_fb_added_dev; #endif #if defined(CONFIG_HAS_EARLYSUSPEND) msd.early_suspend.suspend = mipi_novatek_disp_early_suspend; msd.early_suspend.resume = mipi_novatek_disp_late_resume; msd.early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN; register_early_suspend(&msd.early_suspend); #endif #if defined(CONFIG_LCD_CLASS_DEVICE) lcd_device = lcd_device_register("panel", &pdev->dev, NULL, &mipi_novatek_disp_props); if (IS_ERR(lcd_device)) { ret = PTR_ERR(lcd_device); printk(KERN_ERR "lcd : failed to register device\n"); return ret; } #ifdef WA_FOR_FACTORY_MODE sysfs_remove_file(&lcd_device->dev.kobj, &dev_attr_lcd_power.attr); ret = sysfs_create_file(&lcd_device->dev.kobj, &dev_attr_lcd_power.attr); if (ret) { pr_info("sysfs create fail-%s\n", dev_attr_lcd_power.attr.name); } #endif ret = sysfs_create_file(&lcd_device->dev.kobj, &dev_attr_lcd_type.attr); if (ret) { pr_info("sysfs create fail-%s\n", dev_attr_lcd_type.attr.name); } ret = sysfs_create_file(&lcd_device->dev.kobj, &dev_attr_gamma_mode.attr); if (ret) { pr_info("sysfs create fail-%s\n", dev_attr_gamma_mode.attr.name); } ret = sysfs_create_file(&lcd_device->dev.kobj, &dev_attr_power_reduce.attr); if (ret) { pr_info("sysfs create fail-%s\n", dev_attr_power_reduce.attr.name); } #if defined(CONFIG_MACH_MELIUS) ret = sysfs_create_file(&lcd_device->dev.kobj, &dev_attr_siop_enable.attr); if (ret) { pr_info("sysfs create fail-%s\n", dev_attr_siop_enable.attr.name); } #endif #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) bd = backlight_device_register("panel", &lcd_device->dev, NULL, NULL, NULL); if (IS_ERR(bd)) { ret = PTR_ERR(bd); pr_info("backlight : failed to register device\n"); return ret; } ret = sysfs_create_file(&bd->dev.kobj, &dev_attr_auto_brightness.attr); if (ret) { pr_info("sysfs create fail-%s\n", dev_attr_auto_brightness.attr.name); } #endif #endif #ifdef CONFIG_SAMSUNG_CMC624 if (samsung_has_cmc624()) { ret = cmc624_sysfs_init(); if (ret < 0) pr_debug("CMC624 sysfs initialize FAILED\n"); } else #if defined(CONFIG_FB_MDP4_ENHANCE) init_mdnie_class(); #endif #endif pr_debug("%s:Display probe completed\n", __func__); return 0; }