Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fe3748b authored by Vevek Venkatesan's avatar Vevek Venkatesan
Browse files

input: touchscreen: hxchipset: add display dependency



Add display dependency for chip init in hxchipset driver,
as it is TDDI controller.

Change-Id: Ia278d971d11b432f1e387170a0ca0b3966cb84e1
Signed-off-by: default avatarVevek Venkatesan <vevekv@codeaurora.org>
parent 0850edf3
Loading
Loading
Loading
Loading
+6 −27
Original line number Diff line number Diff line
@@ -1890,23 +1890,23 @@ static void himax_update_register(struct work_struct *work)
#endif

#ifdef CONFIG_DRM
static void himax_fb_register(struct work_struct *work)
int himax_fb_register(struct himax_ts_data *ts)
{
	int ret = 0;
	struct himax_ts_data *ts = container_of(work, struct himax_ts_data, work_att.work);

	I(" %s in\n", __func__);
	ts->fb_notif.notifier_call = fb_notifier_callback;
	ret = msm_drm_register_client(&ts->fb_notif);
	if (ret)
		E(" Unable to register fb_notifier: %d\n", ret);

	return ret;
}

#elif defined CONFIG_FB
static void himax_fb_register(struct work_struct *work)
int himax_fb_register(struct himax_ts_data *ts)
{
	int ret = 0;
	struct himax_ts_data *ts = container_of(work, struct himax_ts_data, work_att.work);

	I(" %s in\n", __func__);
	ts->fb_notif.notifier_call = fb_notifier_callback;
@@ -1914,6 +1914,8 @@ static void himax_fb_register(struct work_struct *work)

	if (ret)
		E(" Unable to register fb_notifier: %d\n", ret);

	return ret;
}
#endif

@@ -2070,20 +2072,6 @@ int himax_chip_common_init(void)
		goto err_input_register_device_failed;
	}

#if defined(CONFIG_DRM) || defined(CONFIG_FB)

	ts->himax_att_wq = create_singlethread_workqueue("HMX_ATT_request");

	if (!ts->himax_att_wq) {
		E(" allocate syn_att_wq failed\n");
		err = -ENOMEM;
		goto err_get_intr_bit_failed;
	}

	INIT_DELAYED_WORK(&ts->work_att, himax_fb_register);
	queue_delayed_work(ts->himax_att_wq, &ts->work_att, msecs_to_jiffies(15000));
#endif

#ifdef HX_SMART_WAKEUP
	ts->SMWP_enable = 0;
	wakeup_source_init(&ts->ts_SMWP_wake_src, WAKE_LOCK_SUSPEND, HIMAX_common_NAME);
@@ -2148,11 +2136,6 @@ remove_proc_entry(HIMAX_PROC_TOUCH_FOLDER, NULL);
#ifdef HX_SMART_WAKEUP
	wakeup_source_trash(&ts->ts_SMWP_wake_src);
#endif
#if defined(CONFIG_FB) || defined(CONFIG_DRM)
err_get_intr_bit_failed:
	cancel_delayed_work_sync(&ts->work_att);
	destroy_workqueue(ts->himax_att_wq);
#endif
err_input_register_device_failed:
	input_free_device(ts->input_dev);
err_detect_failed:
@@ -2217,13 +2200,9 @@ void himax_chip_common_deinit(void)
#ifdef CONFIG_DRM
	if (msm_drm_unregister_client(&ts->fb_notif))
		E("Error occurred while unregistering fb_notifier.\n");
	cancel_delayed_work_sync(&ts->work_att);
	destroy_workqueue(ts->himax_att_wq);
#elif defined(CONFIG_FB)
	if (fb_unregister_client(&ts->fb_notif))
		E("Error occurred while unregistering fb_notifier.\n");
	cancel_delayed_work_sync(&ts->work_att);
	destroy_workqueue(ts->himax_att_wq);
#endif
	input_free_device(ts->input_dev);
#ifdef HX_ZERO_FLASH
+3 −3
Original line number Diff line number Diff line
@@ -259,6 +259,7 @@ struct himax_report_data {
};

struct himax_ts_data {
	bool initialized;
	bool suspended;
	atomic_t suspend_mode;
	uint8_t x_channel;
@@ -320,10 +321,8 @@ struct himax_ts_data {

	int in_self_test;

#if defined(CONFIG_FB)
#if defined(CONFIG_FB) || defined(CONFIG_DRM)
	struct notifier_block fb_notif;
	struct workqueue_struct *himax_att_wq;
	struct delayed_work work_att;
#elif defined(CONFIG_HAS_EARLYSUSPEND)
	struct early_suspend early_suspend;
#endif
@@ -474,6 +473,7 @@ extern int himax_chip_common_suspend(struct himax_ts_data *ts);
extern int himax_chip_common_resume(struct himax_ts_data *ts);
extern int himax_chip_common_init(void);
extern void himax_chip_common_deinit(void);
extern int himax_fb_register(struct himax_ts_data *ts);
extern int himax_input_register(struct himax_ts_data *ts);
extern void himax_ts_work(struct himax_ts_data *ts);
extern enum hrtimer_restart himax_ts_timer_func(struct hrtimer *timer);
+21 −1
Original line number Diff line number Diff line
@@ -658,6 +658,11 @@ int fb_notifier_callback(struct notifier_block *self, unsigned long event, void

		switch (*blank) {
		case MSM_DRM_BLANK_UNBLANK:
			if (!ts->initialized) {
				if (himax_chip_common_init())
					return 0;
				ts->initialized = true;
			}
			himax_common_resume(&ts->client->dev);
			break;
		case MSM_DRM_BLANK_POWERDOWN:
@@ -689,6 +694,11 @@ int fb_notifier_callback(struct notifier_block *self, unsigned long event, void

		switch (*blank) {
		case FB_BLANK_UNBLANK:
			if (!ts->initialized) {
				if (himax_chip_common_init())
					return 0;
				ts->initialized = true;
			}
			himax_common_resume(&ts->client->dev);
			break;
		case FB_BLANK_POWERDOWN:
@@ -731,8 +741,18 @@ int himax_chip_common_probe(struct i2c_client *client, const struct i2c_device_i
	mutex_init(&ts->rw_lock);
	private_ts = ts;

	ret = himax_chip_common_init();
	/*
	 * ts chip initialization is deferred till FB_UNBLACK event;
	 * probe is considered pending till then.
	 */
	ts->initialized = false;
#if defined(CONFIG_FB) || defined(CONFIG_DRM)
	ret = himax_fb_register(ts);
	if (ret)
		goto err_fb_notify_reg_failed;
#endif

err_fb_notify_reg_failed:
err_alloc_data_failed:
err_check_functionality_failed: