/* read xy_data for all touches for debug */
static int cyttsp4_xy_worker(struct cyttsp4_debug_data *dd)
{
	struct device *dev = &dd->ttsp->dev;
	struct cyttsp4_sysinfo *si = dd->si;
	u8 tt_stat = si->xy_mode[si->si_ofs.tt_stat_ofs];
	u8 num_cur_tch = GET_NUM_TOUCHES(tt_stat);
	uint32_t formated_output;
	int rc;

	mutex_lock(&dd->sysfs_lock);
	dd->interrupt_count++;
	formated_output = dd->formated_output;
	mutex_unlock(&dd->sysfs_lock);

	if (si->si_ofs.num_btns > 0) {
		/* read button diff data */
		rc = cyttsp4_read(dd->ttsp, CY_MODE_OPERATIONAL,
				/*  replace with btn_diff_ofs when that field
				 *  becomes supported in the firmware */
				si->si_ofs.tt_stat_ofs + 1 +
				si->si_ofs.max_tchs * si->si_ofs.tch_rec_size,
				si->btn_rec_data,
				si->si_ofs.num_btns * si->si_ofs.btn_rec_size);
		if (rc < 0) {
			dev_err(dev, "%s: read fail on button regs r=%d\n",
					__func__, rc);
		}
	}

	/* Interrupt */
	pr_info("Interrupt(%u)\n", dd->interrupt_count);

	if (formated_output)
		cyttsp4_debug_formated(dev, dd->pr_buf, si, num_cur_tch);
	else
		/* print data for TTHE */
		cyttsp4_pr_buf_op_mode(dev, dd->pr_buf, si, num_cur_tch);

#ifdef SHOK_SENSOR_DATA_MODE
	/* print data for the sensor monitor */
	if (si->monitor.mntr_status == CY_MNTR_STARTED) {
		cyttsp4_debug_print(dev, dd->pr_buf, si->monitor.sensor_data,
				150, "cyttsp4_sensor_monitor");
	}
#endif

	pr_info("\n");

	dev_vdbg(dev, "%s: done\n", __func__);

	return 0;
}
/* read xy_data for all touches for debug */
static int cyttsp4_xy_worker(struct cyttsp4_debug_data *dd)
{
	struct device *dev = &dd->ttsp->dev;
	struct cyttsp4_sysinfo *si = dd->si;
	u8 tt_stat = si->xy_mode[si->si_ofs.tt_stat_ofs];
	u8 num_cur_rec = GET_NUM_TOUCH_RECORDS(tt_stat);
	uint32_t formated_output;
	int rc;

	mutex_lock(&dd->sysfs_lock);
	dd->interrupt_count++;
	formated_output = dd->formated_output;
	mutex_unlock(&dd->sysfs_lock);

	/* Read command parameters */
	rc = cyttsp4_read(dd->ttsp, CY_MODE_OPERATIONAL,
			si->si_ofs.cmd_ofs + 1,
			&si->xy_mode[si->si_ofs.cmd_ofs + 1],
			si->si_ofs.rep_ofs - si->si_ofs.cmd_ofs - 1);
	if (rc < 0) {
		tp_log_err( "%s: read fail on command parameter regs r=%d\n",
				__func__, rc);
	}

	if (si->si_ofs.num_btns > 0) {
		/* read button diff data */
		rc = cyttsp4_read(dd->ttsp, CY_MODE_OPERATIONAL,
				/*  replace with btn_diff_ofs when that field
				 *  becomes supported in the firmware */
				si->si_ofs.tt_stat_ofs + 1 +
				si->si_ofs.max_tchs * si->si_ofs.tch_rec_size,
				si->btn_rec_data,
				si->si_ofs.num_btns * si->si_ofs.btn_rec_size);
		if (rc < 0) {
			tp_log_err( "%s: read fail on button regs r=%d\n",
					__func__, rc);
		}
	}

	/* Interrupt */
#if 0//huawei 0701
	tp_log_info("Interrupt(%u)\n", dd->interrupt_count);
#endif //huawei 0701
	if (formated_output)
		cyttsp4_debug_formated(dev, dd->pr_buf, si, num_cur_rec);
	else
		/* print data for TTHE */
		cyttsp4_pr_buf_op_mode(dev, dd->pr_buf, si, num_cur_rec);

	if (dd->monitor.mntr_status == CY_MNTR_ENABLED) {
		int offset = (si->si_ofs.max_tchs * si->si_ofs.tch_rec_size)
				+ (si->si_ofs.num_btns
					* si->si_ofs.btn_rec_size)
				+ (si->si_ofs.tt_stat_ofs + 1);
		rc = cyttsp4_read(dd->ttsp, CY_MODE_OPERATIONAL,
				offset, &(dd->monitor.sensor_data[0]), 150);
		if (rc < 0)
			tp_log_err( "%s: read fail on sensor monitor regs r=%d\n",
					__func__, rc);
		/* print data for the sensor monitor */
		cyttsp4_debug_print(dev, dd->pr_buf, dd->monitor.sensor_data,
				150, "cyttsp4_sensor_monitor");
	}

#if 0//huawei 0701
	tp_log_info("\n");
#endif //huawei 0701
	tp_log_debug( "%s: done\n", __func__);

	return 0;
}