示例#1
0
static int __devexit ite661x_remove(struct i2c_client *client)
{
	fb_unregister_client(&nb);
	DisableAudioOutput();
	DisableVideoOutput();
	return 0;
}
static void  s5p_dp_shutdown(struct platform_device *pdev)
{
	struct s5p_dp_device *dp = platform_get_drvdata(pdev);
	struct s5p_dp_platdata *pdata = dp->dev->platform_data;

#ifdef CONFIG_S5P_DP_PSR
	mutex_lock(&dp->lock);
	dp->user_disabled = true;
	fb_unregister_client(&dp->notifier);
	mutex_unlock(&dp->lock);
#endif
	lcd_device_unregister(dp->lcd);

	if (pdata->backlight_off)
		pdata->backlight_off();

	if (pdata->lcd_off)
		pdata->lcd_off();

	s5p_dp_disable(dp);

	free_irq(dp->irq, dp);
	iounmap(dp->reg_base);
	clk_put(dp->clock);

	release_mem_region(dp->res->start, resource_size(dp->res));

	pm_runtime_disable(dp->dev);

	kfree(dp);
}
示例#3
0
void __exit mdss_dsi_status_exit(void)
{
	fb_unregister_client(&pstatus_data->fb_notifier);
	cancel_delayed_work_sync(&pstatus_data->check_status);
	kfree(pstatus_data);
	pr_debug("%s: DSI ctrl status work queue removed\n", __func__);
}
static int __devexit s5p_dp_remove(struct platform_device *pdev)
{
	struct s5p_dp_device *dp = platform_get_drvdata(pdev);

#ifdef CONFIG_S5P_DP_PSR
	mutex_lock(&dp->lock);
	fb_unregister_client(&dp->notifier);
	mutex_unlock(&dp->lock);
#endif

	free_irq(dp->irq, dp);

	lcd_device_unregister(dp->lcd);

	s5p_dp_disable(dp);

	iounmap(dp->reg_base);
	clk_put(dp->clock);

	release_mem_region(dp->res->start, resource_size(dp->res));

	pm_runtime_disable(dp->dev);

	kfree(dp);

	return 0;
}
示例#5
0
文件: am200epd.c 项目: E-LLP/n900
static int __init am200_init(void)
{
	int ret;

	/* before anything else, we request notification for any fb
	 * creation events */
	fb_register_client(&am200_fb_notif);

	/* request our platform independent driver */
	request_module("metronomefb");

	am200_device = platform_device_alloc("metronomefb", -1);
	if (!am200_device)
		return -ENOMEM;

	/* the am200_board that will be seen by metronomefb is a copy */
	platform_device_add_data(am200_device, &am200_board,
					sizeof(am200_board));

	/* this _add binds metronomefb to am200. metronomefb refcounts am200 */
	ret = platform_device_add(am200_device);

	if (ret) {
		platform_device_put(am200_device);
		fb_unregister_client(&am200_fb_notif);
		return ret;
	}

	am200_presetup_fb();

	return 0;
}
示例#6
0
static int __devexit lcd_remove(struct device *dev)
{
	fb_unregister_client(&nb);
	lcd_poweroff();
	regulator_put(io_reg);
	regulator_put(core_reg);

	return 0;
}
static int __devexit lcd_spi_remove(struct spi_device *spi)
{
	fb_unregister_client(&nb);
	lcd_poweroff();
	regulator_put(io_reg, &spi->dev);
	regulator_put(core_reg, &spi->dev);

	return 0;
}
示例#8
0
int __devexit at91sam9x5_video_remove(struct platform_device *pdev)
{
	struct at91sam9x5_video_priv *priv = platform_get_drvdata(pdev);

	fb_unregister_client(&priv->fb_notifier);
	at91sam9x5_video_unregister(priv);
	kfree(priv);

	return 0;
}
示例#9
0
static int __devexit ch7026_remove(struct i2c_client *client)
{
	fb_unregister_client(&nb);
	lcd_poweroff();
	regulator_put(io_reg);
	regulator_put(core_reg);
	regulator_put(analog_reg);

	return 0;
}
示例#10
0
/*!
 * Shut down the voutera
 *
 * @param vout      structure vout_data *
 *
 * @return status  0 Success
 */
static int mxc_v4l2out_streamoff(vout_data * vout)
{
	int i, retval = 0;
	unsigned long lock_flag = 0;

	if (!vout)
		return -EINVAL;

	if (vout->state == STATE_STREAM_OFF) {
		return 0;
	}

	spin_lock_irqsave(&g_lock, lock_flag);

	del_timer(&vout->output_timer);
	pp_enable(0);		/* Disable PP */

	if (vout->state == STATE_STREAM_ON) {
		vout->state = STATE_STREAM_STOPPING;
	}

	spin_unlock_irqrestore(&g_lock, lock_flag);

	vout->ready_q.head = vout->ready_q.tail = 0;
	vout->done_q.head = vout->done_q.tail = 0;
	for (i = 0; i < vout->buffer_cnt; i++) {
		vout->v4l2_bufs[i].flags = 0;
		vout->v4l2_bufs[i].timestamp.tv_sec = 0;
		vout->v4l2_bufs[i].timestamp.tv_usec = 0;
	}

	vout->state = STATE_STREAM_OFF;

	if (vout->v4l2_fb.flags == V4L2_FBUF_FLAG_OVERLAY) {
		struct fb_gwinfo gwinfo;

		/* Disable graphic window */
		gwinfo.enabled = 0;
		mx2_gw_set(&gwinfo);
	}
#ifdef CONFIG_VIDEO_MXC_OUTPUT_FBSYNC
	if (vout->tear_protection == TEARING_PROTECTION_ACTIVE) {
		g_output_fb = -1;
		g_fb_enabled = 0;
		g_pp_ready = 0;
		fb_unregister_client(&fb_event_notifier);
		mx2fb_unregister_client(&mx2fb_event_notifier);
	}
#endif

	mxc_free_buffers(vout->display_bufs, vout->display_bufs_vaddr,
			 2, vout->sdc_fg_buf_size);

	return retval;
}
示例#11
0
static int tve_remove(struct platform_device *pdev)
{
	if (enabled) {
		clk_disable(tve.clk);
		enabled = 0;
	}
	free_irq(tve.irq, pdev);
	device_remove_file(&pdev->dev, &dev_attr_headphone);
	fb_unregister_client(&nb);
	return 0;
}
示例#12
0
static enum PVRSRV_ERROR DisableLFBEventNotification(struct OMAPLFB_DEVINFO
								   *psDevInfo)
{
	int res;

	res = fb_unregister_client(&psDevInfo->sLINNotifBlock);
	if (res != 0) {
		printk(KERN_WARNING DRIVER_PREFIX
		       ": fb_unregister_client failed (%d)", res);
		return PVRSRV_ERROR_GENERIC;
	}

	return PVRSRV_OK;
}
static void __exit ppm_lcmoff_policy_exit(void)
{
	FUNC_ENTER(FUNC_LV_POLICY);

#ifdef CONFIG_HAS_EARLYSUSPEND
	unregister_early_suspend(&ppm_lcmoff_es_handler);
#else
	fb_unregister_client(&ppm_lcmoff_fb_notifier);
#endif

	ppm_main_unregister_policy(&lcmoff_policy);

	FUNC_EXIT(FUNC_LV_POLICY);
}
static int __devexit sii902x_remove(struct i2c_client *client)
{
	struct fsl_mxc_lcd_platform_data *plat = sii902x.client->dev.platform_data;

	dev_dbg(&sii902x.pdev->dev, "%s\n", __func__);

	fb_unregister_client(&nb);
	sii902x_poweroff();

	/* Release HDMI pins */
	if (plat->put_pins)
		plat->put_pins();

	return 0;
}
static int __devexit lcd_remove(struct platform_device *pdev)
{
	struct mxc_lcd_platform_data *plat = pdev->dev.platform_data;

	fb_unregister_client(&nb);
	lcd_poweroff();
	if (io_reg)
		regulator_put(io_reg);
	if (core_reg)
		regulator_put(core_reg);

	if (plat->put_pins)
		plat->put_pins();

	return 0;
}
示例#16
0
文件: ldb.c 项目: AvalueAES/rev-sa01
static void ldb_disp_deinit(struct mxc_dispdrv_handle *disp)
{
	struct ldb_data *ldb = mxc_dispdrv_getdata(disp);
	int i;

	writel(0, ldb->control_reg);

	for (i = 0; i < 2; i++) {
		clk_disable(ldb->setting[i].ldb_di_clk);
		clk_put(ldb->setting[i].ldb_di_clk);
	}

	fb_unregister_client(&ldb->nb);

	iounmap(ldb->reg);
}
示例#17
0
static int pwm_backlight_remove(struct platform_device *pdev)
{
	struct platform_pwm_backlight_data *data = pdev->dev.platform_data;
	struct backlight_device *bl = platform_get_drvdata(pdev);
	struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev);

	fb_unregister_client(&pb->notifier);

	backlight_device_unregister(bl);
	pwm_config(pb->pwm, 0, pb->period);
	pwm_disable(pb->pwm);
	pwm_free(pb->pwm);
	kfree(pb);
	if (data->exit)
		data->exit(&pdev->dev);
	return 0;
}
示例#18
0
static void adv739x_disp_deinit(struct mxc_dispdrv_handle *disp)
{
	struct adv739x_data *adv739x = mxc_dispdrv_getdata(disp);
	struct fsl_mxc_lcd_platform_data *plat = adv739x->client->dev.platform_data;

	if (adv739x->client->irq)
		free_irq(adv739x->client->irq, adv739x);

	fb_unregister_client(&adv739x->nb);

	adv739x_poweroff(adv739x);

	/* Release pins */
	if (plat->put_pins)
		plat->put_pins();

	platform_device_unregister(adv739x->pdev);
}
static int __devexit hall_sensor_remove(struct platform_device *pdev)
{
	struct hall_sensor_data *hsdata = platform_get_drvdata(pdev);

	cancel_delayed_work_sync(&hsdata->state_delay_work);
	fb_unregister_client(&hsdata->fb_notif);
	switch_dev_unregister(&hsdata->sdev);
	free_irq(hsdata->irq, hsdata);
	if (gpio_is_valid(hsdata->irq_gpio))
		gpio_free(hsdata->irq_gpio);
	input_unregister_device(hsdata->input_dev);
	input_free_device(hsdata->input_dev);
	disable_irq_wake(hsdata->irq);
	device_init_wakeup(&pdev->dev, HALL_WAKEUP_DISABLE);
	devm_kfree(&pdev->dev, (void *)hsdata);

	return 0;
}
示例#20
0
static void hua_ts_device_remove(struct hua_input_device *dev)
{
	struct hua_ts_device *ts = (struct hua_ts_device *)dev;
	struct hua_input_chip *chip = dev->chip;
	struct hua_input_core *core = chip->core;

#ifdef CONFIG_HAS_EARLYSUSPEND
	unregister_early_suspend(&ts->early_suspend);
#elif defined(CONFIG_FB) && defined(CONFIG_HUAMOBILE_USE_FB_NOTIFILER)
	fb_unregister_client(&ts->fb_notifier);
#else
	unregister_pm_notifier(&ts->pm_notifier);
#endif

	sysfs_remove_files(&dev->misc_dev.dev->kobj, hua_ts_device_attributes);
	hua_input_remove_sysfs_files(&core->prop_kobj, &hua_ts_board_properties_attr, 1);
	kfree(hua_ts_board_properties_attr.attr.name);
	hua_input_remove_kobject(&core->prop_kobj);
}
示例#21
0
static int ldb_remove(struct platform_device *pdev)
{
	int i;

	__raw_writel(0, ldb.control_reg);

	for (i = 0; i < 2; i++) {
		if (ldb.ch_working[i]) {
			ldb.ldb_di_clk[i] = clk_get(NULL,
					    i ? "ldb_di1_clk" : "ldb_di0_clk");
			clk_disable(ldb.ldb_di_clk[i]);
			clk_put(ldb.ldb_di_clk[i]);
			ldb.ch_working[i] = false;
		}
	}

	fb_unregister_client(&nb);
	return 0;
}
/* Disable Linux Framebuffer event notification */
OMAPLFB_ERROR OMAPLFBDisableLFBEventNotification(OMAPLFB_DEVINFO *psDevInfo)
{
	int res;

#ifdef CONFIG_HAS_EARLYSUSPEND
	unregister_early_suspend(&psDevInfo->sEarlySuspend);
#endif

	/* Unregister for Framebuffer events */
	res = fb_unregister_client(&psDevInfo->sLINNotifBlock);
	if (res != 0)
	{
		printk(KERN_ERR DRIVER_PREFIX
			": %s: Device %u: fb_unregister_client failed (%d)\n", __FUNCTION__, psDevInfo->uiFBDevID, res);
		return (OMAPLFB_ERROR_GENERIC);
	}

	OMAPLFBAtomicBoolSet(&psDevInfo->sBlanked, OMAPLFB_FALSE);

	return (OMAPLFB_OK);
}
static int kcal_ctrl_remove(struct platform_device *pdev)
{
	struct kcal_lut_data *lut_data = platform_get_drvdata(pdev);

	device_remove_file(&pdev->dev, &dev_attr_kcal);
	device_remove_file(&pdev->dev, &dev_attr_kcal_min);
	device_remove_file(&pdev->dev, &dev_attr_kcal_enable);
	device_remove_file(&pdev->dev, &dev_attr_kcal_invert);
	device_remove_file(&pdev->dev, &dev_attr_kcal_sat);
	device_remove_file(&pdev->dev, &dev_attr_kcal_hue);
	device_remove_file(&pdev->dev, &dev_attr_kcal_val);
	device_remove_file(&pdev->dev, &dev_attr_kcal_cont);

#if defined(CONFIG_MMI_PANEL_NOTIFICATIONS)
	mmi_panel_unregister_notifier(&lut_data->panel_nb);
#elif defined(CONFIG_FB)
	fb_unregister_client(&lut_data->panel_nb);
#endif

	return 0;
}
static int bu21150_remove(struct spi_device *client)
{
	struct bu21150_data *ts = spi_get_drvdata(client);
	int i;

	mutex_destroy(&ts->mutex_wake);
	if (ts->wake_up)
		device_init_wakeup(&client->dev, 0);

	for (i = 0; i < ARRAY_SIZE(bu21150_prop_attrs); i++)
		sysfs_remove_file(ts->bu21150_obj,
					&bu21150_prop_attrs[i].attr);
	kobject_put(ts->bu21150_obj);
	fb_unregister_client(&ts->fb_notif);
	misc_deregister(&g_bu21150_misc_device);
	bu21150_power_enable(ts, false);
	bu21150_regulator_config(ts, false);
	free_irq(client->irq, ts);
	mutex_destroy(&ts->mutex_frame);
	bu21150_pin_enable(ts, false);
	kfree(ts);

	return 0;
}
示例#25
0
static int lm3630_probe(struct i2c_client *client,
			const struct i2c_device_id *id)
{
	struct lm3630_platform_data *pdata;
	struct lm3630_device *dev;
	struct backlight_device *bl_dev;
	struct backlight_properties props;
	struct device_node *dev_node = client->dev.of_node;
	int ret = 0;

	dev = kzalloc(sizeof(struct lm3630_device), GFP_KERNEL);
	if (!dev) {
		pr_err("%s: failed to allocate lm3630_device\n", __func__);
		return -ENOMEM;
	}

	if (dev_node) {
		ret = lm3630_parse_dt(dev_node, dev);
		if (ret) {
			pr_err("%s: failed to parse dt\n", __func__);
			goto err_parse_dt;
		}
	} else {
		pdata = client->dev.platform_data;
		if (pdata == NULL) {
			pr_err("%s: no platform data\n", __func__);
			goto err_parse_dt;
		}

		dev->en_gpio = pdata->en_gpio;
		dev->boost_ctrl_reg = pdata->boost_ctrl_reg;
		dev->bank_sel = pdata->bank_sel;
		dev->linear_map = pdata->linear_map;
		dev->max_current = pdata->max_current;
		dev->min_brightness = pdata->min_brightness;
		dev->default_brightness = pdata->default_brightness;
		dev->max_brightness = pdata->max_brightness;
		dev->pwm_enable = pdata->pwm_enable;
		dev->blmap_size = pdata->blmap_size;
		if (dev->blmap_size)
			dev->blmap = pdata->blmap;
	}

	/* initialize register values for hw reset */
	lm3630_set_init_values(dev);

	memset(&props, 0, sizeof(struct backlight_properties));
	props.type = BACKLIGHT_RAW;
	props.max_brightness = dev->max_brightness;

	bl_dev = backlight_device_register(I2C_BL_NAME, &client->dev,
			NULL, &lm3630_bl_ops, &props);
	if (IS_ERR(bl_dev)) {
		pr_err("%s: failed to register backlight\n", __func__);
		ret = PTR_ERR(bl_dev);
		goto err_bl_dev_reg;
	}

#ifdef CONFIG_MACH_LGE
	/* HACK: disable fb notifier unless off-mode charge */
	if (lge_get_boot_mode() != LGE_BOOT_MODE_CHARGER)
		fb_unregister_client(&bl_dev->fb_notif);
#endif

	bl_dev->props.max_brightness = dev->max_brightness;
	bl_dev->props.brightness = dev->default_brightness;
	bl_dev->props.power = FB_BLANK_UNBLANK;
	dev->bl_dev = bl_dev;
	dev->client = client;
	i2c_set_clientdata(client, dev);

	if (gpio_is_valid(dev->en_gpio)) {
		ret = gpio_request_one(dev->en_gpio, GPIOF_OUT_INIT_HIGH,
					"lm3630_en");
		if (ret) {
			pr_err("%s: failed to request en_gpio\n", __func__);
			goto err_gpio_request;
		}
	}

	ret = device_create_file(&client->dev,
			&dev_attr_lm3630_level);
	if (ret) {
		pr_err("%s: failed to create sysfs level\n", __func__);
		goto err_create_sysfs_level;
	}

	ret = lm3630_create_debugfs_entries(dev);
	if (ret) {
		pr_err("%s: lm3630_create_debugfs_entries failed\n", __func__);
		goto err_create_debugfs;
	}

	lm3630_dev = dev;

	pr_info("%s: lm3630 probed\n", __func__);
	return 0;

err_create_debugfs:
	device_remove_file(&client->dev, &dev_attr_lm3630_level);
err_create_sysfs_level:
	if (gpio_is_valid(dev->en_gpio))
		gpio_free(dev->en_gpio);
err_gpio_request:
	backlight_device_unregister(bl_dev);
err_bl_dev_reg:
	if (dev_node && dev->blmap)
		kfree(dev->blmap);
err_parse_dt:
	kfree(dev);
	return ret;
}
static int __devinit hall_sensor_probe(struct platform_device *pdev)
{
	struct hall_sensor_data *hsdata = pdev->dev.platform_data;
	struct input_dev *input_dev;
	int err = 0;

	if (pdev->dev.of_node) {
		hsdata = devm_kzalloc(&pdev->dev, sizeof(struct hall_sensor_data),
					GFP_KERNEL);
		if (!hsdata) {
			dev_err(&pdev->dev, "[Hall] Failed to allocate memory");
			return -ENOMEM;
		}

		err = hall_sensor_parse_dt(&pdev->dev, hsdata);
		if (err)
			goto err_free_mem;
	}

	if (!hsdata)
		return -EINVAL;

	hsdata->dev = &pdev->dev;

	input_dev = input_allocate_device();
	if (input_dev == NULL) {
		dev_err(&pdev->dev, "[Hall] Failed to allocate input device\n");
		goto err_free_mem;
	}

	input_dev->name = DRIVER_NAME;
	input_dev->dev.parent = &pdev->dev;
	input_dev->id.bustype = BUS_HOST;

	__set_bit(EV_KEY, input_dev->evbit);
	__set_bit(KEY_POWER, input_dev->keybit);

	spin_lock_init(&hsdata->lock);
	wake_lock_init(&hsdata->irq_wake_lock, WAKE_LOCK_SUSPEND, DRIVER_NAME);

	hsdata->input_dev = input_dev;

	err = input_register_device(input_dev);
	if (err) {
		dev_err(&pdev->dev, "[Hall] Failed to register input device\n");
		goto err_free_input_dev;
	}

	/* GPIO irq */
	err = gpio_request(hsdata->irq_gpio, "hall-irq-gpio");
	if (err) {
		dev_err(&pdev->dev, "[Hall] Failed to request irq gpio\n");
		goto err_unregister_input;
	}

	err = gpio_direction_input(hsdata->irq_gpio);
	if (err) {
		dev_err(&pdev->dev, "[Hall] Unable to set direction for irq gpio %d\n",
				hsdata->irq_gpio);
		goto err_free_irq_gpio;
	}

	err = request_threaded_irq(hsdata->irq, NULL, hall_sensor_irq_handler,
								hsdata->irq_gpio_flags, DRIVER_NAME,
								hsdata);
	if (err) {
		dev_err(&pdev->dev, "[Hall] Failed to request irq %d\n", hsdata->irq);
		goto err_free_irq_gpio;
	}

	hsdata->sdev.print_state = switch_print_state;
	hsdata->sdev.name = SENSOR_NAME;
	hsdata->sdev.print_name = switch_print_name;
	err = switch_dev_register(&hsdata->sdev);
	if (err) {
		dev_err(&pdev->dev, "[Hall] Register switch device failed\n");
		goto err_free_irq;
	}

#if defined(CONFIG_FB)
	hsdata->fb_notif.notifier_call = hall_fb_notifier_callback;
	err = fb_register_client(&hsdata->fb_notif);
	if (err) {
		dev_err(&pdev->dev, "[Hall] Failed to register fb_notifier:%d\n", err);
		goto err_unregister_switch;
	}
#endif

	err = sysfs_create_group(&hsdata->sdev.dev->kobj, &hall_sensor_attr_group);
	if (err) {
		dev_err(&pdev->dev, "[Hall] Failed to create sysfs group:%d\n", err);
		goto err_unregister_fb;
	}

	dev_set_drvdata(&pdev->dev, hsdata);
	INIT_DELAYED_WORK(&hsdata->state_delay_work, hall_sensor_work);

	/* default enable wakeup feature */
	hsdata->wakeup_enable = true;
	device_init_wakeup(&pdev->dev, HALL_WAKEUP_ENABLE);
	enable_irq_wake(hsdata->irq);

	hsdev = hsdata;

	return 0;

err_unregister_fb:
	fb_unregister_client(&hsdata->fb_notif);
err_unregister_switch:
	switch_dev_unregister(&hsdata->sdev);
err_free_irq:
	free_irq(hsdata->irq, hsdata);
err_free_irq_gpio:
	if (gpio_is_valid(hsdata->irq_gpio))
		gpio_free(hsdata->irq_gpio);
err_unregister_input:
	input_unregister_device(hsdata->input_dev);
err_free_input_dev:
	if (input_dev)
		input_free_device(input_dev);
err_free_mem:
	devm_kfree(&pdev->dev, (void *)hsdata);
	return err;
}
static int kcal_ctrl_probe(struct platform_device *pdev)
{
	int ret;
	struct kcal_lut_data *lut_data;

	lut_data = devm_kzalloc(&pdev->dev, sizeof(*lut_data), GFP_KERNEL);
	if (!lut_data) {
		pr_err("%s: failed to allocate memory for lut_data\n",
			__func__);
		return -ENOMEM;
	}

	platform_set_drvdata(pdev, lut_data);

	lut_data->enable = 0x1;
	lut_data->red = DEF_PCC;
	lut_data->green = DEF_PCC;
	lut_data->blue = DEF_PCC;
	lut_data->minimum = 0x23;
	lut_data->invert = 0x0;
	lut_data->hue = 0x0;
	lut_data->sat = DEF_PA;
	lut_data->val = DEF_PA;
	lut_data->cont = DEF_PA;

	lut_data->queue_changes = false;

	mdss_mdp_kcal_update_pcc(lut_data);
	mdss_mdp_kcal_update_pa(lut_data);
	mdss_mdp_kcal_update_igc(lut_data);

#if defined(CONFIG_MMI_PANEL_NOTIFICATIONS)
	lut_data->panel_nb.display_on = mdss_mdp_kcal_update_queue;
	lut_data->panel_nb.dev = &pdev->dev;
	ret = mmi_panel_register_notifier(&lut_data->panel_nb);
	if (ret) {
		pr_err("%s: unable to register MMI notifier\n", __func__);
		return ret;
	}
#elif defined(CONFIG_FB)
	lut_data->dev = pdev->dev;
	lut_data->panel_nb.notifier_call = fb_notifier_callback;
	ret = fb_register_client(&lut_data->panel_nb);
	if (ret) {
		pr_err("%s: unable to register fb notifier\n", __func__);
		return ret;
	}
#endif

	ret = device_create_file(&pdev->dev, &dev_attr_kcal);
	ret |= device_create_file(&pdev->dev, &dev_attr_kcal_min);
	ret |= device_create_file(&pdev->dev, &dev_attr_kcal_enable);
	ret |= device_create_file(&pdev->dev, &dev_attr_kcal_invert);
	ret |= device_create_file(&pdev->dev, &dev_attr_kcal_sat);
	ret |= device_create_file(&pdev->dev, &dev_attr_kcal_hue);
	ret |= device_create_file(&pdev->dev, &dev_attr_kcal_val);
	ret |= device_create_file(&pdev->dev, &dev_attr_kcal_cont);
	if (ret) {
		pr_err("%s: unable to create sysfs entries\n", __func__);
		goto out_notifier;
	}

	return 0;

out_notifier:
#if defined(CONFIG_MMI_PANEL_NOTIFICATIONS)
	mmi_panel_unregister_notifier(&lut_data->panel_nb);
#elif defined(CONFIG_FB)
	fb_unregister_client(&lut_data->panel_nb);
#endif
	return ret;
}
示例#28
0
static void check_dsi_ctrl_status(struct work_struct *work)
{
	struct dsi_status_data *pdsi_status = NULL;
	struct mdss_panel_data *pdata = NULL;
	struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
	struct mdss_overlay_private *mdp5_data = NULL;
	struct mdss_mdp_ctl *ctl = NULL;
	int ret = 0;

	pdsi_status = container_of(to_delayed_work(work),
		struct dsi_status_data, check_status);
	if (!pdsi_status) {
		pr_err("%s: DSI status data not available\n", __func__);
		return;
	}

  //patch + case1481899 mayu 3.27
	if(!pdsi_status->mfd){
	  pr_err("%s:mfd is NULL \n",__func__);
	  return;
	}
  //patch - case1481899 mayu 3.27
	pdata = dev_get_platdata(&pdsi_status->mfd->pdev->dev);
	if (!pdata) {
		pr_err("%s: Panel data not available\n", __func__);
		return;
	}

	ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
							panel_data);
	if (!ctrl_pdata || !ctrl_pdata->check_status) {
		pr_err("%s: DSI ctrl or status_check callback not available\n",
								__func__);
		return;
	}

//+++duguowei,crash if no lcd
	if(ctrl_pdata->panel_name == NULL || !strcmp("",ctrl_pdata->panel_name)){
		fb_unregister_client(&pstatus_data->fb_notifier);
		cancel_delayed_work_sync(&pstatus_data->check_status);
		kfree(pstatus_data);
		pr_debug("%s: DSI ctrl status work queue removed\n", __func__);
		return;
	}
//---duguowei,crash if no lcd
	mdp5_data = mfd_to_mdp5_data(pdsi_status->mfd);
	ctl = mfd_to_ctl(pdsi_status->mfd);

	if (ctl->shared_lock)
		mutex_lock(ctl->shared_lock);
	mutex_lock(&mdp5_data->ov_lock);

	if (pdsi_status->mfd->shutdown_pending) {
		mutex_unlock(&mdp5_data->ov_lock);
		if (ctl->shared_lock)
			mutex_unlock(ctl->shared_lock);
		pr_err("%s: DSI turning off, avoiding BTA status check\n",
							__func__);
		return;
	}

	/*
	 * For the command mode panels, we return pan display
	 * IOCTL on vsync interrupt. So, after vsync interrupt comes
	 * and when DMA_P is in progress, if the panel stops responding
	 * and if we trigger BTA before DMA_P finishes, then the DSI
	 * FIFO will not be cleared since the DSI data bus control
	 * doesn't come back to the host after BTA. This may cause the
	 * display reset not to be proper. Hence, wait for DMA_P done
	 * for command mode panels before triggering BTA.
	 */
	if (ctl->wait_pingpong)
		ctl->wait_pingpong(ctl, NULL);

	pr_debug("%s: DSI ctrl wait for ping pong done\n", __func__);

	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON, false);
	ret = ctrl_pdata->check_status(ctrl_pdata);
	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);

	mutex_unlock(&mdp5_data->ov_lock);
	if (ctl->shared_lock)
		mutex_unlock(ctl->shared_lock);

	if ((pdsi_status->mfd->panel_power_on)) {
		if (ret > 0) {
			schedule_delayed_work(&pdsi_status->check_status,
				msecs_to_jiffies(pdsi_status->check_interval));
		} else {
#ifdef CONFIG_ZTEMT_NE501_LCD
			if (mipi_lcd_esd_command(ctrl_pdata)) {
				char *envp[2] = {"PANEL_ALIVE=0", NULL};
				pdata->panel_info.panel_dead = true;
				ret = kobject_uevent_env(
					&pdsi_status->mfd->fbi->dev->kobj,
								KOBJ_CHANGE, envp);
				pr_err("%s: Panel has gone bad, sending uevent - %s\n",
								__func__, envp[0]);
				printk("default reset panel\n");
			}
#else
			char *envp[2] = {"PANEL_ALIVE=0", NULL};
			pdata->panel_info.panel_dead = true;
			ret = kobject_uevent_env(
				&pdsi_status->mfd->fbi->dev->kobj,
							KOBJ_CHANGE, envp);
			pr_err("%s: Panel has gone bad, sending uevent - %s\n",
							__func__, envp[0]);
#endif
		}
	}
}
static void remove_info_data(struct sdchg_info_nochip_t *info)
{
	//struct sdchg_info_personal_t *pData = info->pData;

	fb_unregister_client(&info->fb_nb);
}
示例#30
0
static void tsp_unregister_fb(struct melfas_ts_data *ts)
{
	fb_unregister_client(&ts->fb_notif);
}