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

Commit 26348a70 authored by Fei Mao's avatar Fei Mao
Browse files

input: touchscreen: clean kernel log for ST touch



To fix an issue which ST touch only works after resume device, make touch
senses on at end of touch driver's probe process.
To remove some kernel console output for debug, replace with "logError(0".
Only keep essential log to show touch driver is ready.

Change-Id: I52e04c6784d741374b8af3fcee434c34f97ed2ab
Signed-off-by: default avatarFei Mao <feim1@codeaurora.org>
parent 043b53f2
Loading
Loading
Loading
Loading
+30 −31
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ static ssize_t fts_fwupdate_store(struct device *dev,
	ret = flash_burn(fwD, mode, !mode);

	if (ret < OK && ret != (ERROR_FW_NO_UPDATE | ERROR_FLASH_BURN_FAILED))
		logError(1, "%s flashProcedure: ERROR %02X\n",
		logError(0, "%s flashProcedure: ERROR %02X\n",
			tag, ERROR_FLASH_PROCEDURE);
	logError(0, "%s flashing procedure Finished!\n", tag);

@@ -3020,9 +3020,9 @@ static void fts_status_event_handler(struct fts_ts_info *info,
	case FTS_WATER_MODE_ON:
	case FTS_WATER_MODE_OFF:
	default:
		logError(1, "%s %s Received unhandled status event = ",
		logError(0, "%s %s Received unhandled status event = ",
			tag, __func__);
		logError(1, "%02X %02X %02X %02X %02X %02X %02X %02X\n",
		logError(0, "%02X %02X %02X %02X %02X %02X %02X %02X\n",
			event[0], event[1], event[2], event[3], event[4],
			event[5], event[6], event[7]);
		break;
@@ -3324,12 +3324,12 @@ static int fts_interrupt_install(struct fts_ts_info *info)
	error = fts_disableInterrupt();

#ifdef FTS_USE_POLLING_MODE
	logError(1, "%s Polling Mode\n");
	logError(0, "%s Polling Mode\n");
	hrtimer_init(&info->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
	info->timer.function = fts_timer_func;
	hrtimer_start(&info->timer, ktime_set(1, 0), HRTIMER_MODE_REL);
#else
	logError(1, "%s Interrupt Mode\n", tag);
	logError(0, "%s Interrupt Mode\n", tag);
	if (request_irq(info->client->irq, fts_interrupt_handler,
		IRQF_TRIGGER_LOW, info->client->name, info)) {
		logError(1, "%s Request irq failed\n", tag);
@@ -3397,14 +3397,14 @@ int fts_chip_powercycle(struct fts_ts_info *info)
{
	int error = 0;

	logError(1, "%s %s: Power Cycle Starting...\n", tag, __func__);
	logError(0, "%s %s: Power Cycle Starting...\n", tag, __func__);

	/**
	 * if IRQ pin is short with DVDD a call to
	 * the ISR will triggered when the regulator is turned off
	 */

	logError(1, "%s %s: Disabling IRQ...\n", tag, __func__);
	logError(0, "%s %s: Disabling IRQ...\n", tag, __func__);
	disable_irq_nosync(info->client->irq);
	if (info->pwr_reg) {
		error = regulator_disable(info->pwr_reg);
@@ -3456,9 +3456,9 @@ int fts_chip_powercycle(struct fts_ts_info *info)

	release_all_touches(info);

	logError(1, "%s %s: Enabling IRQ...\n", tag, __func__);
	logError(0, "%s %s: Enabling IRQ...\n", tag, __func__);
	enable_irq(info->client->irq);
	logError(1, "%s %s: Power Cycle Finished! ERROR CODE = %08x\n",
	logError(0, "%s %s: Power Cycle Finished! ERROR CODE = %08x\n",
		tag, __func__, error);
	setSystemResettedUp(1);
	setSystemResettedDown(1);
@@ -3469,7 +3469,7 @@ int fts_chip_powercycle2(struct fts_ts_info *info, unsigned long sleep)
{
	int error = 0;

	logError(1, "%s %s: Power Cycle Starting...\n", tag, __func__);
	logError(0, "%s %s: Power Cycle Starting...\n", tag, __func__);

	if (info->pwr_reg) {
		error = regulator_disable(info->pwr_reg);
@@ -3524,7 +3524,7 @@ int fts_chip_powercycle2(struct fts_ts_info *info, unsigned long sleep)
	/*before reset clear all slot */
	release_all_touches(info);

	logError(1, "%s %s: Power Cycle Finished! ERROR CODE = %08x\n",
	logError(0, "%s %s: Power Cycle Finished! ERROR CODE = %08x\n",
		tag, __func__, error);
	setSystemResettedUp(1);
	setSystemResettedDown(1);
@@ -3536,13 +3536,13 @@ static int fts_init_afterProbe(struct fts_ts_info *info)
	int error = 0;

	/* system reset */
	error = cleanUp(0);
	error = cleanUp(1);

	/* enable the features and the sensing */
	error |= fts_mode_handler(info, 0);

	/* enable the interrupt */
	error |= fts_enableInterrupt();
	/* error |= fts_enableInterrupt(); */

#if defined(CONFIG_FB_MSM)
	error |= fb_register_client(&info->notifier);
@@ -4183,13 +4183,13 @@ static int fts_probe(struct i2c_client *client,
	int retval;
	int skip_5_1 = 0;

	logError(1, "%s %s: driver probe begin!\n", tag, __func__);
	logError(0, "%s %s: driver probe begin!\n", tag, __func__);

	logError(1, "%s SET I2C Functionality and Dev INFO:\n", tag);
	logError(0, "%s SET I2C Functionality and Dev INFO:\n", tag);
	openChannel(client);
	/* logError(1, "%s driver ver. %s (built on %s, %s)\n", tag,*/
	/*      FTS_TS_DRV_VERSION, __DATE__, __TIME__);*/
	 logError(1, "%s driver ver. %s (built on)\n", tag, FTS_TS_DRV_VERSION);
	 logError(0, "%s driver ver. %s (built on)\n", tag, FTS_TS_DRV_VERSION);

	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
		logError(1, "%s Unsupported I2C functionality\n", tag);
@@ -4209,7 +4209,7 @@ static int fts_probe(struct i2c_client *client,
	info->client = client;

	i2c_set_clientdata(client, info);
	logError(1, "%s i2c address: %x\n", tag, client->addr);
	logError(0, "%s i2c address: %x\n", tag, client->addr);
	info->dev = &info->client->dev;
	if (dp) {
		info->bdata = devm_kzalloc(&client->dev,
@@ -4223,7 +4223,7 @@ static int fts_probe(struct i2c_client *client,
		parse_dt(&client->dev, info->bdata);
	}

	logError(1, "%s SET Regulators:\n", tag);
	logError(0, "%s SET Regulators:\n", tag);
	retval = fts_get_reg(info, true);
	if (retval < 0) {
		logError(1, "%s ERROR: %s: Failed to get regulators\n",
@@ -4238,7 +4238,7 @@ static int fts_probe(struct i2c_client *client,
		goto ProbeErrorExit_2;
	}

	logError(1, "%s SET GPIOS:\n", tag);
	logError(0, "%s SET GPIOS:\n", tag);
	retval = fts_set_gpio(info);
	if (retval < 0) {
		logError(1, "%s %s: ERROR Failed to set up GPIO's\n",
@@ -4257,15 +4257,7 @@ static int fts_probe(struct i2c_client *client,
		goto ProbeErrorExit_3;
	}

	error = fts_init_afterProbe(info);
	if (error < OK) {
		logError(1,
			"%s Cannot initialize the hardware device ERROR %08X\n",
			tag, error);
		goto ProbeErrorExit_3;
	}

	logError(1, "%s SET Event Handler:\n", tag);
	logError(0, "%s SET Event Handler:\n", tag);
	/*wake_lock_init(&info->wakelock, WAKE_LOCK_SUSPEND, "fts_tp");*/
	wakeup_source_init(&info->wakeup_source, "fts_tp");
	/*info->event_wq = create_singlethread_workqueue("fts-event-queue");*/
@@ -4282,7 +4274,7 @@ static int fts_probe(struct i2c_client *client,
	INIT_WORK(&info->resume_work, fts_resume_work);
	INIT_WORK(&info->suspend_work, fts_suspend_work);

	logError(1, "%s SET Input Device Property:\n", tag);
	logError(0, "%s SET Input Device Property:\n", tag);
	/*info->dev = &info->client->dev;*/
	info->input_dev = input_allocate_device();
	if (!info->input_dev) {
@@ -4384,7 +4376,7 @@ static int fts_probe(struct i2c_client *client,
#endif

	/* init hardware device */
	logError(1, "%s Device Initialization:\n", tag);
	logError(0, "%s Device Initialization:\n", tag);
	error = fts_init(info);
	if (error < OK) {
		logError(1, "%s Cannot initialize the device ERROR %08X\n",
@@ -4416,7 +4408,7 @@ static int fts_probe(struct i2c_client *client,
		/*goto ProbeErrorExit_6;*/
	/*}*/

	logError(1, "%s SET Device File Nodes:\n", tag);
	logError(0, "%s SET Device File Nodes:\n", tag);
	/* sysfs stuff */
	info->attrs.attrs = fts_attr_group;
	error = sysfs_create_group(&client->dev.kobj, &info->attrs);
@@ -4472,6 +4464,13 @@ static int fts_probe(struct i2c_client *client,
	}
#endif

	error = fts_init_afterProbe(info);
	if (error < OK) {
		logError(1,
			"%s Cannot initialize the hardware device ERROR %08X\n",
			tag, error);
		goto ProbeErrorExit_11;
	}
	logError(1, "%s Probe Finished!\n", tag);
	return OK;

+20 −20
Original line number Diff line number Diff line
@@ -575,12 +575,12 @@ int readChipInfo(int doRequest)
	ftsInfo.u8_ftsaVer = data[index++];
	ftsInfo.u8_tchRptVer = data[index++];

	logError(1, "%s External Release =  ", tag);
	logError(0, "%s External Release =  ", tag);
	for (i = 0; i < EXTERNAL_RELEASE_INFO_SIZE; i++) {
		ftsInfo.u8_extReleaseInfo[i] = data[index++];
		logError(1, "%02X ", ftsInfo.u8_extReleaseInfo[i]);
		logError(0, "%02X ", ftsInfo.u8_extReleaseInfo[i]);
	}
	logError(1, "\n");
	logError(0, "\n");

	for (i = 0; i < sizeof(ftsInfo.u8_custInfo); i++)
		ftsInfo.u8_custInfo[i] = data[index++];
@@ -606,10 +606,10 @@ int readChipInfo(int doRequest)
	index += 2;

	ftsInfo.u8_scrForceLen = data[index++];
	logError(1, "%s Force Len = %d\n", tag, ftsInfo.u8_scrForceLen);
	logError(0, "%s Force Len = %d\n", tag, ftsInfo.u8_scrForceLen);

	ftsInfo.u8_scrSenseLen = data[index++];
	logError(1, "%s Sense Len = %d\n", tag, ftsInfo.u8_scrSenseLen);
	logError(0, "%s Sense Len = %d\n", tag, ftsInfo.u8_scrSenseLen);

	for (i = 0; i < 8; i++)
		ftsInfo.u64_scrForceEn[i] = data[index++];
@@ -618,7 +618,7 @@ int readChipInfo(int doRequest)
		ftsInfo.u64_scrSenseEn[i] = data[index++];

	ftsInfo.u8_msKeyLen = data[index++];
	logError(1, "%s MS Key Len = %d\n", tag, ftsInfo.u8_msKeyLen);
	logError(0, "%s MS Key Len = %d\n", tag, ftsInfo.u8_msKeyLen);

	for (i = 0; i < 8; i++)
		ftsInfo.u64_msKeyForceEn[i] = data[index++];
@@ -627,7 +627,7 @@ int readChipInfo(int doRequest)
		ftsInfo.u64_msKeySenseEn[i] = data[index++];

	ftsInfo.u8_ssKeyLen = data[index++];
	logError(1, "%s SS Key Len = %d\n", tag, ftsInfo.u8_ssKeyLen);
	logError(0, "%s SS Key Len = %d\n", tag, ftsInfo.u8_ssKeyLen);

	for (i = 0; i < 8; i++)
		ftsInfo.u64_ssKeyForceEn[i] = data[index++];
@@ -647,25 +647,25 @@ int readChipInfo(int doRequest)


	ftsInfo.u8_msScrConfigTuneVer = data[index++];
	logError(1, "%s CFG MS TUNING VERSION = %02X\n",
	logError(0, "%s CFG MS TUNING VERSION = %02X\n",
		tag, ftsInfo.u8_msScrConfigTuneVer);
	ftsInfo.u8_msScrLpConfigTuneVer = data[index++];
	ftsInfo.u8_msScrHwulpConfigTuneVer = data[index++];
	ftsInfo.u8_msKeyConfigTuneVer = data[index++];
	ftsInfo.u8_ssTchConfigTuneVer = data[index++];
	logError(1, "%s CFG SS TUNING VERSION = %02X\n",
	logError(0, "%s CFG SS TUNING VERSION = %02X\n",
		tag, ftsInfo.u8_ssTchConfigTuneVer);
	ftsInfo.u8_ssKeyConfigTuneVer = data[index++];
	ftsInfo.u8_ssHvrConfigTuneVer = data[index++];
	ftsInfo.u8_frcTchConfigTuneVer = data[index++];
	ftsInfo.u8_msScrCxmemTuneVer = data[index++];
	logError(1, "%s CX MS TUNING VERSION = %02X\n",
	logError(0, "%s CX MS TUNING VERSION = %02X\n",
		tag, ftsInfo.u8_msScrCxmemTuneVer);
	ftsInfo.u8_msScrLpCxmemTuneVer = data[index++];
	ftsInfo.u8_msScrHwulpCxmemTuneVer = data[index++];
	ftsInfo.u8_msKeyCxmemTuneVer = data[index++];
	ftsInfo.u8_ssTchCxmemTuneVer = data[index++];
	logError(1, "%s CX SS TUNING VERSION = %02X\n",
	logError(0, "%s CX SS TUNING VERSION = %02X\n",
		tag, ftsInfo.u8_ssTchCxmemTuneVer);
	ftsInfo.u8_ssKeyCxmemTuneVer = data[index++];
	ftsInfo.u8_ssHvrCxmemTuneVer = data[index++];
@@ -675,7 +675,7 @@ int readChipInfo(int doRequest)
				((data[index + 1] & 0x000000FF) << 8) +
				(data[index] & 0x000000FF);
	index += 4;
	logError(1, "%s MP SIGNATURE = %08X\n", tag, ftsInfo.u32_mpPassFlag);
	logError(0, "%s MP SIGNATURE = %08X\n", tag, ftsInfo.u32_mpPassFlag);
	ftsInfo.u32_featEn = ((data[index + 3] & 0x000000FF) << 24) +
				((data[index + 2] & 0x000000FF) << 16) +
				((data[index + 1] & 0x000000FF) << 8) +
@@ -686,31 +686,31 @@ int readChipInfo(int doRequest)
				((data[index + 1] & 0x000000FF) << 8) +
				(data[index] & 0x000000FF);
	index += 4;
	logError(1, "%s FEATURES = %08X\n", tag, ftsInfo.u32_echoEn);
	logError(0, "%s FEATURES = %08X\n", tag, ftsInfo.u32_echoEn);
	ftsInfo.u8_sideTchConfigTuneVer = data[index++];
	ftsInfo.u8_sideTchCxmemTuneVer = data[index++];
	ftsInfo.u8_sideTchForceLen = data[index++];
	logError(1, "%s Side Touch Force Len = %d\n",
	logError(0, "%s Side Touch Force Len = %d\n",
		tag, ftsInfo.u8_sideTchForceLen);
	ftsInfo.u8_sideTchSenseLen = data[index++];
	logError(1, "%s Side Touch Sense Len = %d\n",
	logError(0, "%s Side Touch Sense Len = %d\n",
		tag, ftsInfo.u8_sideTchSenseLen);
	for (i = 0; i < 8; i++)
		ftsInfo.u64_sideTchForceEn[i] = data[index++];
	for (i = 0; i < 8; i++)
		ftsInfo.u64_sideTchSenseEn[i] = data[index++];
	ftsInfo.u8_errSign = data[index++];
	logError(1, "%s ERROR SIGNATURE = %02X\n", tag, ftsInfo.u8_errSign);
	logError(0, "%s ERROR SIGNATURE = %02X\n", tag, ftsInfo.u8_errSign);
	if (ftsInfo.u8_errSign == ERROR_SIGN_HEAD) {
		logError(1, "%s Correct Error Signature found!\n", tag);
		logError(0, "%s Correct Error Signature found!\n", tag);
		u8ToU16(&data[index], &ftsInfo.u16_errOffset);
	} else {
		logError(1, "%s Error Signature NOT FOUND!\n", tag);
		ftsInfo.u16_errOffset = INVALID_ERROR_OFFS;
	}
	logError(1, "%s ERROR OFFSET = %04X\n", tag, ftsInfo.u16_errOffset);
	logError(0, "%s ERROR OFFSET = %04X\n", tag, ftsInfo.u16_errOffset);
	index += 2;
	logError(1, "%s Parsed %d bytes!\n", tag, index);
	logError(0, "%s Parsed %d bytes!\n", tag, index);


	if (index != CHIP_INFO_SIZE + 3) {
@@ -720,7 +720,7 @@ int readChipInfo(int doRequest)
		return ERROR_OP_NOT_ALLOW;
	}

	logError(1, "%s Chip Info Read DONE!\n", tag);
	logError(0, "%s Chip Info Read DONE!\n", tag);
	return OK;

FAIL:
+3 −4
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ int dumpErrorInfo(void)
			tag,  __func__, ret);
		return ret;
	}
	logError(1, "%s %s: Error Info =\n", tag, __func__);
	logError(0, "%s %s: Error Info =\n", tag, __func__);
	u8ToU32(data, &sign);
	if (sign != ERROR_SIGNATURE)
		logError(1, "%s %s:Wrong Signature! Data may be invalid!\n",
@@ -147,7 +147,7 @@ int errorHandler(u8 *event, int size)
		return ERROR_OP_NOT_ALLOW;
	}

	logError(1, "%s %s: Starting handling...\n", tag, __func__);
	logError(0, "%s %s: Starting handling...\n", tag, __func__);
	//TODO: write an error log for undefinied command subtype 0xBA
	switch (event[1]) {
	case EVENT_TYPE_ESD_ERROR:	//esd
@@ -251,8 +251,7 @@ int errorHandler(u8 *event, int size)
		break;

	default:
		logError(1,
		"%s %s: No Action taken!\n", tag, __func__);
		logError(0,  "%s %s: No Action taken!\n", tag, __func__);
	break;
	}
	logError(1, "%s %s: handling Finished! res = %08X\n",
+11 −6
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ int getFWdata(const char *pathToFile, u8 **data, int *size, int from)
	struct device *dev = NULL;
	int res;

	logError(1, "%s %s starting...\n", tag, __func__);
	logError(0, "%s %s starting...\n", tag, __func__);
	switch (from) {
#ifdef FW_H_FILE
	case 1:
@@ -139,7 +139,7 @@ int getFWdata(const char *pathToFile, u8 **data, int *size, int from)
		memcpy(*data, (u8 *)FW_ARRAY_NAME, (*size));
		break;
#endif
	default:
	case 2:
		logError(1, "%s Read FW from BIN file!\n", tag);
		dev = getDev();

@@ -160,7 +160,7 @@ int getFWdata(const char *pathToFile, u8 **data, int *size, int from)
				memcpy(*data, (u8 *)fw->data, (*size));
				release_firmware(fw);
			} else {
				logError(1, "%s %s:No File found! ERROR %08X\n",
				logError(0, "%s %s:No File found! ERROR %08X\n",
					tag, __func__, ERROR_FILE_NOT_FOUND);
				return ERROR_FILE_NOT_FOUND;
			}
@@ -169,8 +169,13 @@ int getFWdata(const char *pathToFile, u8 **data, int *size, int from)
			tag, __func__, ERROR_OP_NOT_ALLOW);
			return ERROR_OP_NOT_ALLOW;
		}
		break;
	default:
		return ERROR_OP_NOT_ALLOW;
		/* break; */
	}
	logError(1, "%s %s:Finshed!\n", tag, __func__);

	logError(0, "%s %s:Finshed!\n", tag, __func__);
	return OK;
}

@@ -183,7 +188,7 @@ int readFwFile(const char *path, struct Firmware *fw, int keep_cx)

	res = getFWdata(path, &orig_data, &orig_size, LOAD_FW_FROM);
	if (res < OK) {
		logError(1, "%s %s:impossible retrieve FW... ERROR %08X\n",
		logError(0, "%s %s:impossible retrieve FW... ERROR %08X\n",
			tag, __func__, ERROR_MEMH_READ);

		return (res | ERROR_MEMH_READ);
@@ -208,7 +213,7 @@ int flashProcedure(const char *path, int force, int keep_cx)
	logError(0, "%s Reading Fw file...\n", tag);
	res = readFwFile(path, &fw, keep_cx);
	if (res < OK) {
		logError(1, "%s %s: ERROR %02X\n",
		logError(0, "%s %s: ERROR %02X\n",
			tag, __func__, (res | ERROR_FLASH_PROCEDURE));
		kfree(fw.data);
		return (res | ERROR_FLASH_PROCEDURE);
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ int openChannel(struct i2c_client *clt)
{
	client = clt;
	I2CSAD = clt->addr;
	logError(1, "%s %s: SAD: %02X\n", tag, __func__, I2CSAD);
	logError(0, "%s %s: SAD: %02X\n", tag, __func__, I2CSAD);
	return OK;
}

Loading