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

Commit a8a9b363 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: input: touchscreen: fix i2c error when suspend"

parents f25756e3 8581a62c
Loading
Loading
Loading
Loading
+22 −15
Original line number Diff line number Diff line
@@ -3526,14 +3526,12 @@ static int fts_interrupt_install(struct fts_ts_info *info)
	hrtimer_start(&info->timer, ktime_set(1, 0), HRTIMER_MODE_REL);
#else
	logError(0, "%s Interrupt Mode\n", tag);
	if (request_irq(info->client->irq, fts_interrupt_handler,
		IRQF_TRIGGER_LOW, info->client->name, info)) {
	if (request_threaded_irq(info->client->irq, NULL, fts_interrupt_handler,
		IRQF_TRIGGER_LOW | IRQF_ONESHOT, info->client->name, info)) {
		logError(1, "%s Request irq failed\n", tag);
		kfree(info->event_dispatch_table);
		error = -EBUSY;
	} /*else {*/
	/*error = fts_enableInterrupt();*/
	/*}*/
	}
#endif
	return error;
}
@@ -3558,6 +3556,21 @@ static void fts_interrupt_enable(struct fts_ts_info *info)
#else
	enable_irq(info->client->irq);
#endif
	/* enable the touch IC irq */
	fts_enableInterrupt();
}

static void fts_interrupt_disable(struct fts_ts_info *info)
{
	/* disable the touch IC irq */
	fts_disableInterrupt();

#ifdef FTS_USE_POLLING_MODE
	hrtimer_cancel(&info->timer);
#else
	disable_irq(info->client->irq);
#endif

}

static int fts_init(struct fts_ts_info *info)
@@ -4041,11 +4054,6 @@ static void fts_resume_work(struct work_struct *work)

	__pm_wakeup_event(&info->wakeup_source, HZ);

	if (fts_enable_reg(info, true) < 0) {
		logError(1, "%s %s: ERROR Failed to enable regulators\n",
			tag, __func__);
	}

	if (info->ts_pinctrl) {
		/*
		 * Pinctrl handle is optional. If pinctrl handle is found
@@ -4060,10 +4068,11 @@ static void fts_resume_work(struct work_struct *work)
	}

	info->resume_bit = 1;

	fts_system_reset();
#ifdef USE_NOISE_PARAM
	readNoiseParameters(noise_params);
#endif
	fts_system_reset();

#ifdef USE_NOISE_PARAM
	writeNoiseParameters(noise_params);
@@ -4075,7 +4084,7 @@ static void fts_resume_work(struct work_struct *work)

	info->sensor_sleep = false;

	fts_enableInterrupt();
	fts_interrupt_enable(info);
}


@@ -4091,11 +4100,10 @@ static void fts_suspend_work(struct work_struct *work)

	fts_mode_handler(info, 0);

	fts_interrupt_disable(info);
	release_all_touches(info);
	info->sensor_sleep = true;

	fts_enableInterrupt();

	if (info->ts_pinctrl) {
		/*
		 * Pinctrl handle is optional. If pinctrl handle is found
@@ -4109,7 +4117,6 @@ static void fts_suspend_work(struct work_struct *work)
		}
	}

	fts_enable_reg(info, false);
}


+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@


/**** FEATURES USED IN THE IC ***/
#define PHONE_KEY /*enable the keys*/
/* #define PHONE_KEY enable the keys */

#define PHONE_GESTURE /*allow to use the gestures*/
#ifdef PHONE_GESTURE
+2 −4
Original line number Diff line number Diff line
@@ -122,8 +122,7 @@ ssize_t fts_i2c_wr_store(struct device *dev, struct device_attribute *attr,
	ret = sscanf(buf, "%x %x %x %x %x %x %x %x %x ",
		(data + 8), (data), (data + 1), (data + 2), (data + 3),
		(data + 4), (data + 5), (data + 6), (data + 7));
	if (ret != 9)
		return -EINVAL;

	byte_count = data[8];

	/**
@@ -251,8 +250,7 @@ ssize_t fts_i2c_read_store(struct device *dev, struct device_attribute *attr,
	ret = sscanf(buf, "%x %x %x %x %x %x %x %x %x ",
		(data + 8), (data), (data + 1), (data + 2), (data + 3),
		(data + 4), (data + 5), (data + 6), (data + 7));
	if (ret != 9)
		return -EINVAL;

	byte_count = data[8];

	if (byte_count > 8) {