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

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

Merge "input: touchscreen: hxchipset: cut down kernel print"

parents b0fad5c5 c9a3d0ad
Loading
Loading
Loading
Loading
+37 −26
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ static ssize_t himax_HSEN_write(struct file *file, const char __user *buff, size
		return -EINVAL;

	g_core_fp.fp_set_HSEN_enable(ts->HSEN_enable, ts->suspended);
	I("%s: HSEN_enable = %d.\n", __func__, ts->HSEN_enable);
	D("%s: HSEN_enable = %d.\n", __func__, ts->HSEN_enable);
	return len;
}

@@ -449,8 +449,9 @@ int himax_input_register(struct himax_ts_data *ts)
	input_mt_init_slots(ts->input_dev, ts->nFinger_support);
#endif
#endif
	I("input_set_abs_params: mix_x %d, max_x %d, min_y %d, max_y %d\n",
	  ts->pdata->abs_x_min, ts->pdata->abs_x_max, ts->pdata->abs_y_min, ts->pdata->abs_y_max);
	D("input_set_abs_params: mix_x %d, max_x %d, min_y %d, max_y %d\n",
		ts->pdata->abs_x_min, ts->pdata->abs_x_max,
		ts->pdata->abs_y_min, ts->pdata->abs_y_max);
	input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, ts->pdata->abs_x_min, ts->pdata->abs_x_max, ts->pdata->abs_x_fuzz, 0);
	input_set_abs_params(ts->input_dev, ABS_MT_POSITION_Y, ts->pdata->abs_y_min, ts->pdata->abs_y_max, ts->pdata->abs_y_fuzz, 0);
	input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, ts->pdata->abs_pressure_min, ts->pdata->abs_pressure_max, ts->pdata->abs_pressure_fuzz, 0);
@@ -467,7 +468,7 @@ int himax_input_register(struct himax_ts_data *ts)
	ret = INPUT_REGISTER_FAIL;

input_device_fail:
	I("%s, input device register fail!\n", __func__);
	E("%s, input device register fail\n", __func__);
	return ret;
}

@@ -489,7 +490,11 @@ static void calcDataSize(uint8_t finger_num)
		ts_data->x_channel + ts_data->y_channel) / ts_data->raw_data_frame_size +
		(((uint32_t)ts_data->x_channel * ts_data->y_channel +
		ts_data->x_channel + ts_data->y_channel) % ts_data->raw_data_frame_size) ? 1 : 0;
	I("%s: coord_data_size: %d, area_data_size:%d, raw_data_frame_size:%d, raw_data_nframes:%d", __func__, ts_data->coord_data_size, ts_data->area_data_size, ts_data->raw_data_frame_size, ts_data->raw_data_nframes);

	D("%s: coord_data_size:%d, area_data_size:%d\n", __func__,
		ts_data->coord_data_size, ts_data->area_data_size);
	D("%s: raw_data_frame_size:%d, raw_data_nframes:%d\n", __func__,
		ts_data->raw_data_frame_size, ts_data->raw_data_nframes);
}

static void calculate_point_number(void)
@@ -569,7 +574,7 @@ static int i_update_FW(void)

static int himax_loadSensorConfig(struct himax_i2c_platform_data *pdata)
{
	I("%s: initialization complete\n", __func__);
	D("%s: initialization complete\n", __func__);
	return NO_ERR;
}

@@ -870,8 +875,15 @@ int himax_report_data_init(void)
		hx_touch_data->rawdata_frame_size = (ic_data->HX_TX_NUM * ic_data->HX_RX_NUM + ic_data->HX_TX_NUM + ic_data->HX_RX_NUM) / hx_touch_data->rawdata_size + 1;


	I("%s: rawdata_frame_size = %d ", __func__, hx_touch_data->rawdata_frame_size);
	I("%s: ic_data->HX_MAX_PT:%d, hx_raw_cnt_max:%d, hx_raw_cnt_rmd:%d, g_hx_rawdata_size:%d, hx_touch_data->touch_info_size:%d\n", __func__, ic_data->HX_MAX_PT, hx_touch_data->raw_cnt_max, hx_touch_data->raw_cnt_rmd, hx_touch_data->rawdata_size, hx_touch_data->touch_info_size);
	D("%s: rawdata_frame_size = %d",
		__func__, hx_touch_data->rawdata_frame_size);

	D("%s: ic_data->HX_MAX_PT:%d, hx_raw_cnt_max:%d, hx_raw_cnt_rmd:%d\n",
		__func__, ic_data->HX_MAX_PT, hx_touch_data->raw_cnt_max,
		hx_touch_data->raw_cnt_rmd);
	D("%s: g_hx_rawdata_size:%d, hx_touch_data->touch_info_size:%d\n",
		__func__, hx_touch_data->rawdata_size,
		hx_touch_data->touch_info_size);
	hx_touch_data->hx_coord_buf = kzalloc(sizeof(uint8_t) * (hx_touch_data->touch_info_size), GFP_KERNEL);

	if (hx_touch_data->hx_coord_buf == NULL)
@@ -934,7 +946,6 @@ void himax_cable_detect_func(bool force_renew)
	connect_status = USB_detect_flag;/* upmu_is_chr_det(); */
	ts = private_ts;

	/* I("Touch: cable status=%d, cable_config=%p, usb_connected=%d\n", connect_status, ts->cable_config, ts->usb_connected); */
	if (ts->cable_config) {
		if (((!!connect_status) != ts->usb_connected) || force_renew) {
			if (!!connect_status) {
@@ -1193,7 +1204,7 @@ static int himax_err_ctrl(struct himax_ts_data *ts, uint8_t *buf, int ts_path, i
	if (HX_HW_RESET_ACTIVATE) {
		/* drop 1st interrupts after chip reset */
		HX_HW_RESET_ACTIVATE = 0;
		I("[HX_HW_RESET_ACTIVATE]:%s: Back from reset, ready to serve.\n", __func__);
		D(":%s: Back from reset, ready to serve.\n", __func__);
		ts_status = HX_RST_OK;
		goto END_FUNCTION;
	}
@@ -1277,7 +1288,6 @@ int himax_parse_report_points(struct himax_ts_data *ts, int ts_path, int ts_stat
	if (g_ts_dbg != 0)
		I("%s: start!\n", __func__);


	ts->old_finger = ts->pre_finger_mask;
	ts->pre_finger_mask = 0;
	hx_touch_data->finger_num = hx_touch_data->hx_coord_buf[ts->coordInfoSize - 4] & 0x0F;
@@ -1313,7 +1323,7 @@ int himax_parse_report_points(struct himax_ts_data *ts, int ts_path, int ts_stat

			if (!ts->first_pressed) {
				ts->first_pressed = 1;
				I("S1@%d, %d\n", x, y);
				D("S1@%d, %d\n", x, y);
			}

			ts->pre_finger_data[loop_i][0] = x;
@@ -1328,7 +1338,8 @@ int himax_parse_report_points(struct himax_ts_data *ts, int ts_path, int ts_stat

			if (loop_i == 0 && ts->first_pressed == 1) {
				ts->first_pressed = 2;
				I("E1@%d, %d\n", ts->pre_finger_data[0][0], ts->pre_finger_data[0][1]);
				D("E1@%d, %d\n", ts->pre_finger_data[0][0],
					ts->pre_finger_data[0][1]);
			}
		}
	}
@@ -1808,7 +1819,7 @@ void himax_ts_work(struct himax_ts_data *ts)
		goto END_FUNCTION;

GET_TOUCH_FAIL:
	I("%s: Now reset the Touch chip.\n", __func__);
	E("%s: Now reset the Touch chip.\n", __func__);
#ifdef HX_RST_PIN_FUNC
	g_core_fp.fp_ic_reset(false, true);
#endif
@@ -1894,7 +1905,7 @@ int himax_fb_register(struct himax_ts_data *ts)
{
	int ret = 0;

	I(" %s in\n", __func__);
	D(" %s in\n", __func__);
	ts->fb_notif.notifier_call = drm_notifier_callback;
	ret = msm_drm_register_client(&ts->fb_notif);
	if (ret)
@@ -1908,7 +1919,7 @@ int himax_fb_register(struct himax_ts_data *ts)
{
	int ret = 0;

	I(" %s in\n", __func__);
	D(" %s in\n", __func__);
	ts->fb_notif.notifier_call = fb_notifier_callback;
	ret = fb_register_client(&ts->fb_notif);

@@ -1936,14 +1947,14 @@ int himax_chip_common_init(void)
	struct himax_ts_data *ts = private_ts;
	struct himax_i2c_platform_data *pdata;

	I("PDATA START\n");
	D("PDATA START\n");
	pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
	if (pdata == NULL) { /* Allocate Platform data space */
		err = -ENOMEM;
		goto err_dt_platform_data_fail;
	}

	I("ic_data START\n");
	D("ic_data START\n");
	ic_data = kzalloc(sizeof(*ic_data), GFP_KERNEL);
	if (ic_data == NULL) { /* Allocate IC data space */
		err = -ENOMEM;
@@ -1958,7 +1969,7 @@ int himax_chip_common_init(void)
	}

	if (himax_parse_dt(ts, pdata) < 0) {
		I(" pdata is NULL for DT\n");
		E(" pdata is NULL for DT\n");
		err = -ECANCELED;
		goto err_alloc_dt_pdata_failed;
	}
@@ -2048,7 +2059,7 @@ int himax_chip_common_init(void)
	ts->nFinger_support = ic_data->HX_MAX_PT;
	/* calculate the i2c data size */
	calcDataSize(ts->nFinger_support);
	I("%s: calcDataSize complete\n", __func__);
	D("%s: calcDataSize complete\n", __func__);
#ifdef CONFIG_OF
	ts->pdata->abs_pressure_min        = 0;
	ts->pdata->abs_pressure_max        = 200;
@@ -2067,7 +2078,7 @@ int himax_chip_common_init(void)
#else
	ts->protocol_type = PROTOCOL_TYPE_B;
#endif
	I("%s: Use Protocol Type %c\n", __func__,
	D("%s: Use Protocol Type %c\n", __func__,
	  ts->protocol_type == PROTOCOL_TYPE_A ? 'A' : 'B');

	ret = himax_input_register(ts);
@@ -2245,7 +2256,7 @@ int himax_chip_common_suspend(struct himax_ts_data *ts)
	}

	ts->suspended = true;
	I("%s: enter\n", __func__);
	D("%s: enter\n", __func__);

	if (debug_data != NULL && debug_data->flash_dump_going == true) {
		I("[himax] %s: Flash dump is going, reject suspend\n", __func__);
@@ -2285,16 +2296,16 @@ int himax_chip_common_suspend(struct himax_ts_data *ts)
	if (ts->pdata->powerOff3V3 && ts->pdata->power)
		ts->pdata->power(0);

	I("%s: END\n", __func__);
	D("%s: END\n", __func__);
	return 0;
}

int himax_chip_common_resume(struct himax_ts_data *ts)
{
	I("%s: enter\n", __func__);
	D("%s: enter\n", __func__);

	if (ts->suspended == false) {
		I("%s: It had entered resume, skip this step\n", __func__);
		D("%s: It had entered resume, skip this step\n", __func__);
		return 0;
	}
	ts->suspended = false;
@@ -2314,6 +2325,6 @@ int himax_chip_common_resume(struct himax_ts_data *ts)
	g_core_fp.fp_resume_ic_action();
	himax_int_enable(1);

	I("%s: END\n", __func__);
	D("%s: END\n", __func__);
	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -2913,7 +2913,7 @@ int himax_debug_init(void)
	struct himax_ts_data *ts = private_ts;
	int err = 0;

	I("%s:Enter\n", __func__);
	D("%s:Enter\n", __func__);

	if (ts == NULL) {
		E("%s: ts struct is NULL\n", __func__);
+9 −7
Original line number Diff line number Diff line
@@ -92,7 +92,8 @@ static bool hx83112_sense_off(void)
		 *=====================
		 */
		g_core_fp.fp_register_read(pic_op->addr_cs_central_state, FOUR_BYTE_ADDR_SZ, tmp_data, 0);
		I("%s: Check enter_save_mode data[0]=%X\n", __func__, tmp_data[0]);
		D("%s: Check enter_save_mode data[0]=%X\n",
			__func__, tmp_data[0]);

		if (tmp_data[0] == 0x0C) {
			/*
@@ -167,7 +168,8 @@ static bool hx83112_chip_detect(void)

			I("%s:IC name = %s\n", __func__, private_ts->chip_name);

			I("Himax IC package %x%x%x in\n", tmp_data[3], tmp_data[2], tmp_data[1]);
			D("Himax IC package %x%x%x in\n",
				tmp_data[3], tmp_data[2], tmp_data[1]);
			ret_data = true;
			break;
		}
@@ -184,7 +186,7 @@ static void hx83112_chip_init(void)
{

	private_ts->chip_cell_type = CHIP_IS_IN_CELL;
	I("%s:IC cell type = %d\n",  __func__,  private_ts->chip_cell_type);
	D("%s:IC cell type = %d\n",  __func__,  private_ts->chip_cell_type);
	IC_CHECKSUM = HX_TP_BIN_CHECKSUM_CRC;
	/* Himax: Set FW and CFG Flash Address */
	FW_VER_MAJ_FLASH_ADDR  = 49157;  /* 0x00C005 */
@@ -211,7 +213,7 @@ static void hx83112_chip_init(void)
#ifdef CONFIG_CHIP_DTCFG
static int himax_hx83112_probe(struct platform_device *pdev)
{
	I("%s:Enter\n", __func__);
	D("%s:Enter\n", __func__);
	g_core_fp.fp_chip_detect = hx83112_chip_detect;
	g_core_fp.fp_chip_init = hx83112_chip_init;
	return 0;
@@ -246,7 +248,7 @@ static struct platform_driver himax_hx83112_driver = {

static int __init himax_hx83112_init(void)
{
	I("%s\n", __func__);
	D("%s\n", __func__);
	platform_driver_register(&himax_hx83112_driver);
	return 0;
}
@@ -259,7 +261,7 @@ static void __exit himax_hx83112_exit(void)
#else
static int himax_hx83112_probe(void)
{
	I("%s:Enter\n", __func__);
	D("%s:Enter\n", __func__);

	g_core_fp.fp_chip_detect = hx83112_chip_detect;
	g_core_fp.fp_chip_init = hx83112_chip_init;
@@ -278,7 +280,7 @@ static int __init himax_hx83112_init(void)
{
	int ret = 0;

	I("%s\n", __func__);
	D("%s\n", __func__);
	ret = himax_hx83112_probe();
	return 0;
}
+37 −32
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ static void himax_mcu_sense_on(uint8_t FlashMode)
	uint8_t tmp_data[FOUR_BYTE_DATA_SZ];
	int retry = 0;

	I("Enter %s\n", __func__);
	D("Enter %s\n", __func__);
	g_core_fp.fp_interface_on();
	g_core_fp.fp_register_write(pfw_op->addr_ctrl_fw_isr,
		sizeof(pfw_op->data_clear), pfw_op->data_clear, false);
@@ -406,7 +406,8 @@ static bool himax_mcu_sense_off(void)
		 *======================
		 */
		g_core_fp.fp_register_read(pic_op->addr_cs_central_state, FOUR_BYTE_ADDR_SZ, tmp_data, 0);
		I("%s: Check enter_save_mode data[0]=%X\n", __func__, tmp_data[0]);
		D("%s: Check enter_save_mode data[0]=%X\n",
			__func__, tmp_data[0]);

		if (tmp_data[0] == 0x0C) {
			/*
@@ -472,7 +473,7 @@ static void himax_mcu_suspend_ic_action(void)

static void himax_mcu_power_on_init(void)
{
	I("%s:\n", __func__);
	D("%s:\n", __func__);
	g_core_fp.fp_touch_information();
	/* RawOut select initial */
	g_core_fp.fp_register_write(pfw_op->addr_raw_out_sel, sizeof(pfw_op->data_clear), pfw_op->data_clear, false);
@@ -877,7 +878,7 @@ static void himax_mcu_read_FW_ver(void)

		if ((data[1] == 0x3A && data[0] == 0xA3)
			|| (data_2[1] == 0x72 && data_2[0] == 0xC0)) {
			I("reload OK!\n");
			D("reload OK!\n");
			reload_status = 1;
			break;
		} else if (retry == 0) {
@@ -895,12 +896,13 @@ static void himax_mcu_read_FW_ver(void)
		retry--;
		msleep(20);
		if (retry % 10 == 0)
			I("reload fail ,delay 10ms retry=%d\n", retry);
			E("reload fail ,delay 10ms retry=%d\n", retry);

	}

	I("%s : data[0]=0x%2.2X,data[1]=0x%2.2X,data_2[0]=0x%2.2X,data_2[1]=0x%2.2X\n", __func__, data[0], data[1], data_2[0], data_2[1]);
	I("reload_status=%d\n", reload_status);
	D("%s:data[]={0x%2.2X, 0x%2.2X}, data_2[]={0x%2.2X, 0x%2.2X}\n",
		__func__, data[0], data[1], data_2[0], data_2[1]);
	D("reload_status=%d\n", reload_status);
	/*
	 *=====================================
	 * Read FW version : 0x1000_7004  but 05,06 are the real addr for FW Version
@@ -910,19 +912,19 @@ static void himax_mcu_read_FW_ver(void)
	g_core_fp.fp_register_read(pfw_op->addr_fw_ver_addr, FOUR_BYTE_DATA_SZ, data, 0);
	ic_data->vendor_panel_ver =  data[0];
	ic_data->vendor_fw_ver = data[1] << 8 | data[2];
	I("PANEL_VER : %X\n", ic_data->vendor_panel_ver);
	I("FW_VER : %X\n", ic_data->vendor_fw_ver);
	D("PANEL_VER : %X\n", ic_data->vendor_panel_ver);
	D("FW_VER : %X\n", ic_data->vendor_fw_ver);
	g_core_fp.fp_register_read(pfw_op->addr_fw_cfg_addr, FOUR_BYTE_DATA_SZ, data, 0);
	ic_data->vendor_config_ver = data[2] << 8 | data[3];
	/* I("CFG_VER : %X\n",ic_data->vendor_config_ver); */
	ic_data->vendor_touch_cfg_ver = data[2];
	I("TOUCH_VER : %X\n", ic_data->vendor_touch_cfg_ver);
	D("TOUCH_VER : %X\n", ic_data->vendor_touch_cfg_ver);
	ic_data->vendor_display_cfg_ver = data[3];
	I("DISPLAY_VER : %X\n", ic_data->vendor_display_cfg_ver);
	D("DISPLAY_VER : %X\n", ic_data->vendor_display_cfg_ver);
	g_core_fp.fp_register_read(pfw_op->addr_fw_vendor_addr, FOUR_BYTE_DATA_SZ, data, 0);
	ic_data->vendor_cid_maj_ver = data[2];
	ic_data->vendor_cid_min_ver = data[3];
	I("CID_VER : %X\n", (ic_data->vendor_cid_maj_ver << 8 | ic_data->vendor_cid_min_ver));
	D("CID_VER : %X\n", (data[2] << 8 | data[3]));
}

static bool himax_mcu_read_event_stack(uint8_t *buf, uint8_t length)
@@ -956,10 +958,10 @@ static void himax_mcu_return_event_stack(void)
	int retry = 20, i;
	uint8_t tmp_data[FOUR_BYTE_DATA_SZ];

	I("%s:entering\n", __func__);
	D("%s:entering\n", __func__);

	do {
		I("now %d times\n!", retry);
		D("now %d times\n!", retry);

		for (i = 0; i < FOUR_BYTE_DATA_SZ; i++)
			tmp_data[i] = psram_op->addr_rawdata_end[i];
@@ -970,7 +972,7 @@ static void himax_mcu_return_event_stack(void)
		msleep(20);
	} while ((tmp_data[1] != psram_op->addr_rawdata_end[1] && tmp_data[0] != psram_op->addr_rawdata_end[0]) && retry > 0);

	I("%s: End of setting!\n", __func__);
	D("%s: End of setting!\n", __func__);
}

static bool himax_mcu_calculateChecksum(bool change_iref)
@@ -1041,7 +1043,7 @@ static void himax_mcu_irq_switch(int switch_on)
static int himax_mcu_assign_sorting_mode(uint8_t *tmp_data)
{

	I("%s:Now tmp_data[3]=0x%02X,tmp_data[2]=0x%02X,tmp_data[1]=0x%02X,tmp_data[0]=0x%02X\n",
	D("%s:Now tmp[3]=0x%02X, tmp[2]=0x%02X, tmp[1]=0x%02X, tmp[0]=0x%02X\n",
		__func__, tmp_data[3], tmp_data[2], tmp_data[1], tmp_data[0]);
	g_core_fp.fp_flash_write_burst(pfw_op->addr_sorting_mode_en, tmp_data);

@@ -1050,9 +1052,8 @@ static int himax_mcu_assign_sorting_mode(uint8_t *tmp_data)

static int himax_mcu_check_sorting_mode(uint8_t *tmp_data)
{

	g_core_fp.fp_register_read(pfw_op->addr_sorting_mode_en, FOUR_BYTE_DATA_SZ, tmp_data, 0);
	I("%s: tmp_data[0]=%x,tmp_data[1]=%x\n", __func__, tmp_data[0], tmp_data[1]);
	D("%s: tmp[0]=%x,tmp[1]=%x\n", __func__, tmp_data[0], tmp_data[1]);

	return NO_ERR;
}
@@ -1065,7 +1066,7 @@ static int himax_mcu_switch_mode(int mode)
	int result = -1;
	int retry = 200;

	I("%s: Entering\n", __func__);
	D("%s: Entering\n", __func__);

	if (mode == 0) {
		/* normal mode */
@@ -1114,14 +1115,15 @@ static int himax_mcu_switch_mode(int mode)
	g_core_fp.fp_sense_on(0x01);

	while (retry != 0) {
		I("[%d] %s Read\n", retry, __func__);
		D("[%d] %s Read\n", retry, __func__);
		/* tmp_addr[3] = 0x10; tmp_addr[2] = 0x00; tmp_addr[1] = 0x7F; tmp_addr[0] = 0x04; */
		g_core_fp.fp_check_sorting_mode(tmp_data);
		msleep(100);
		I("mode_read_cmd(0)=0x%2.2X,mode_read_cmd(1)=0x%2.2X\n", tmp_data[0], tmp_data[1]);
		D("mode_read_cmd(0)=0x%2.2X,mode_read_cmd(1)=0x%2.2X\n",
			tmp_data[0], tmp_data[1]);

		if (tmp_data[0] == mode_read_cmd && tmp_data[1] == mode_read_cmd) {
			I("Read OK!\n");
			D("Read OK!\n");
			result = 0;
			break;
		}
@@ -1262,7 +1264,7 @@ static bool himax_mcu_block_erase(int start_addr, int length)
		}
	}

	I("%s:END\n", __func__);
	D("%s:END\n", __func__);
	return true;
}

@@ -1626,7 +1628,7 @@ static void himax_mcu_get_DSRAM_data(uint8_t *info_data, bool DSRAM_Flag)
#ifdef CORE_DRIVER
static bool himax_mcu_detect_ic(void)
{
	I("%s: use default incell detect.\n", __func__);
	D("%s: use default incell detect.\n", __func__);

	return 0;
}
@@ -1634,14 +1636,14 @@ static bool himax_mcu_detect_ic(void)

static void himax_mcu_init_ic(void)
{
	I("%s: use default incell init.\n", __func__);
	D("%s: use default incell init.\n", __func__);
}


#ifdef HX_RST_PIN_FUNC
static void himax_mcu_pin_reset(void)
{
	I("%s: Now reset the Touch chip.\n", __func__);
	D("%s: Now reset the Touch chip.\n", __func__);
	himax_rst_gpio_set(private_ts->rst_gpio, 0);
	msleep(20);
	himax_rst_gpio_set(private_ts->rst_gpio, 1);
@@ -1653,7 +1655,8 @@ static void himax_mcu_ic_reset(uint8_t loadconfig, uint8_t int_off)
	struct himax_ts_data *ts = private_ts;

	HX_HW_RESET_ACTIVATE = 1;
	I("%s,status: loadconfig=%d,int_off=%d\n", __func__, loadconfig, int_off);
	D("%s, status: loadconfig=%d, int_off=%d\n",
		__func__, loadconfig, int_off);

	if (ts->rst_gpio >= 0) {
		if (int_off)
@@ -1745,9 +1748,11 @@ static void himax_mcu_touch_information(void)
	ic_data->HX_XY_REVERSE = FIX_HX_XY_REVERSE;
	ic_data->HX_INT_IS_EDGE = FIX_HX_INT_IS_EDGE;
#endif
	I("%s:HX_RX_NUM =%d,HX_TX_NUM =%d,HX_MAX_PT=%d\n", __func__, ic_data->HX_RX_NUM, ic_data->HX_TX_NUM, ic_data->HX_MAX_PT);
	I("%s:HX_XY_REVERSE =%d,HX_Y_RES =%d,HX_X_RES=%d\n", __func__, ic_data->HX_XY_REVERSE, ic_data->HX_Y_RES, ic_data->HX_X_RES);
	I("%s:HX_INT_IS_EDGE =%d\n", __func__, ic_data->HX_INT_IS_EDGE);
	D("%s:HX_RX_NUM =%d,HX_TX_NUM =%d,HX_MAX_PT=%d\n", __func__,
		ic_data->HX_RX_NUM, ic_data->HX_TX_NUM, ic_data->HX_MAX_PT);
	D("%s:HX_XY_REVERSE =%d,HX_Y_RES =%d,HX_X_RES=%d\n", __func__,
		ic_data->HX_XY_REVERSE, ic_data->HX_Y_RES, ic_data->HX_X_RES);
	D("%s:HX_INT_IS_EDGE =%d\n", __func__, ic_data->HX_INT_IS_EDGE);
}

static void himax_mcu_reload_config(void)
@@ -2464,7 +2469,7 @@ static void himax_mcu_fp_init(void)

void himax_mcu_in_cmd_struct_init(void)
{
	I("%s: Entering!\n", __func__);
	D("%s: Entering!\n", __func__);
	g_core_cmd_op = kzalloc(sizeof(struct himax_core_command_operation), GFP_KERNEL);
	if (!g_core_cmd_op)
		return;
@@ -2581,7 +2586,7 @@ void himax_in_parse_assign_cmd(uint32_t addr, uint8_t *cmd, int len)

void himax_mcu_in_cmd_init(void)
{
	I("%s: Entering!\n", __func__);
	D("%s: Entering!\n", __func__);
#ifdef CORE_IC
	himax_in_parse_assign_cmd(ic_adr_ahb_addr_byte_0, pic_op->addr_ahb_addr_byte_0, sizeof(pic_op->addr_ahb_addr_byte_0));
	himax_in_parse_assign_cmd(ic_adr_ahb_rdata_byte_0, pic_op->addr_ahb_rdata_byte_0, sizeof(pic_op->addr_ahb_rdata_byte_0));
+28 −25
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ void himax_vk_parser(struct device_node *dt,

	node = of_parse_phandle(dt, "virtualkey", 0);
	if (node == NULL) {
		I(" DT-No vk info in DT");
		D(" DT-No vk info in DT");
		return;
	}

@@ -115,8 +115,9 @@ int himax_parse_dt(struct himax_ts_data *ts, struct himax_i2c_platform_data *pda
	if (of_property_read_u32_array(dt, "himax,panel-coords", coords, coords_size) == 0) {
		pdata->abs_x_min = coords[0], pdata->abs_x_max = coords[1];
		pdata->abs_y_min = coords[2], pdata->abs_y_max = coords[3];
		I(" DT-%s:panel-coords = %d, %d, %d, %d\n", __func__, pdata->abs_x_min,
		  pdata->abs_x_max, pdata->abs_y_min, pdata->abs_y_max);
		D(" DT-%s:panel-coords = %d, %d, %d, %d\n", __func__,
			pdata->abs_x_min, pdata->abs_x_max,
			pdata->abs_y_min, pdata->abs_y_max);
	}

	prop = of_find_property(dt, "himax,display-coords", NULL);
@@ -137,24 +138,25 @@ int himax_parse_dt(struct himax_ts_data *ts, struct himax_i2c_platform_data *pda

	pdata->screenWidth  = coords[1];
	pdata->screenHeight = coords[3];
	I(" DT-%s:display-coords = (%d, %d)", __func__, pdata->screenWidth,
	D(" DT-%s:display-coords = (%d, %d)", __func__, pdata->screenWidth,
		pdata->screenHeight);
	pdata->gpio_irq = of_get_named_gpio(dt, "himax,irq-gpio", 0);

	if (!gpio_is_valid(pdata->gpio_irq))
		I(" DT:gpio_irq value is not valid\n");
		E(" DT:gpio_irq value is not valid\n");

	pdata->gpio_reset = of_get_named_gpio(dt, "himax,rst-gpio", 0);

	if (!gpio_is_valid(pdata->gpio_reset))
		I(" DT:gpio_rst value is not valid\n");
		E(" DT:gpio_rst value is not valid\n");

	pdata->gpio_3v3_en = of_get_named_gpio(dt, "himax,3v3-gpio", 0);

	if (!gpio_is_valid(pdata->gpio_3v3_en))
		I(" DT:gpio_3v3_en value is not valid\n");
		D(" DT:gpio_3v3_en value is not valid\n");

	I(" DT:gpio_irq=%d, gpio_rst=%d, gpio_3v3_en=%d", pdata->gpio_irq, pdata->gpio_reset, pdata->gpio_3v3_en);
	D(" DT:gpio_irq=%d, gpio_rst=%d, gpio_3v3_en=%d",
		pdata->gpio_irq, pdata->gpio_reset, pdata->gpio_3v3_en);

	if (of_property_read_u32(dt, "himax,report_type", &data) == 0) {
		pdata->protocol_type = data;
@@ -188,7 +190,7 @@ int himax_bus_read(uint8_t command, uint8_t *data, uint32_t length, uint8_t toRe
	};

	if (length > HX_REPORT_SZ * 2) {
		E("%s: data length too large %d!\n", __func__, length);
		I("%s: data length too large %d\n", __func__, length);
		buf = kmalloc(length, GFP_KERNEL);
		if (!buf) {
			E("%s: failed realloc buf %d\n", __func__, length);
@@ -240,7 +242,7 @@ int himax_bus_write(uint8_t command, uint8_t *data, uint32_t length, uint8_t toR
	};

	if (length + 1 > HX_REPORT_SZ * 2) {
		E("%s: data length too large %d!\n", __func__, length + 1);
		I("%s: data length too large %d\n", __func__, length + 1);
		buf = kmalloc(length + 1, GFP_KERNEL);
		if (!buf) {
			E("%s: failed realloc buf %d\n", __func__, length + 1);
@@ -297,7 +299,7 @@ int himax_bus_master_write(uint8_t *data, uint32_t length, uint8_t toRetry)
	};

	if (length > HX_REPORT_SZ * 2) {
		E("%s: data length too large %d!\n", __func__, length);
		I("%s: data length too large %d\n", __func__, length);
		buf = kmalloc(length, GFP_KERNEL);
		if (!buf) {
			E("%s: failed realloc buf %d\n", __func__, length);
@@ -347,7 +349,7 @@ void himax_int_enable(int enable)
		private_ts->irq_enabled = 0;
	}

	I("irq_enable_count = %d", irq_enable_count);
	D("irq_enable_count = %d", irq_enable_count);
}

#ifdef HX_RST_PIN_FUNC
@@ -613,10 +615,10 @@ int himax_int_register_trigger(void)
	struct i2c_client *client = private_ts->client;

	if (ic_data->HX_INT_IS_EDGE) {
		I("%s edge triiger falling\n ", __func__);
		D("%s edge triiger falling\n ", __func__);
		ret = request_threaded_irq(client->irq, NULL, himax_ts_thread, IRQF_TRIGGER_FALLING | IRQF_ONESHOT, client->name, ts);
	} else {
		I("%s level trigger low\n ", __func__);
		D("%s level trigger low\n ", __func__);
		ret = request_threaded_irq(client->irq, NULL, himax_ts_thread, IRQF_TRIGGER_LOW | IRQF_ONESHOT, client->name, ts);
	}

@@ -647,7 +649,8 @@ int himax_ts_register_interrupt(void)
		if (ret == 0) {
			ts->irq_enabled = 1;
			irq_enable_count = 1;
			I("%s: irq enabled at qpio: %d\n", __func__, client->irq);
			D("%s: irq enabled at qpio: %d\n",
				__func__, client->irq);
#ifdef HX_SMART_WAKEUP
			irq_set_irq_wake(client->irq, 1);
#endif
@@ -675,7 +678,7 @@ static int himax_common_suspend(struct device *dev)
{
	struct himax_ts_data *ts = dev_get_drvdata(dev);

	I("%s: enter\n", __func__);
	D("%s: enter\n", __func__);
	himax_chip_common_suspend(ts);
	return 0;
}
@@ -684,7 +687,7 @@ static int himax_common_resume(struct device *dev)
{
	struct himax_ts_data *ts = dev_get_drvdata(dev);

	I("%s: enter\n", __func__);
	D("%s: enter\n", __func__);
	himax_chip_common_resume(ts);
	return 0;
}
@@ -703,7 +706,7 @@ int drm_notifier_callback(struct notifier_block *self,
	if (!evdata || (evdata->id != 0))
		return 0;

	I("DRM  %s\n", __func__);
	D("DRM  %s\n", __func__);

	if (evdata->data && event == MSM_DRM_EVENT_BLANK && ts && ts->client) {
		blank = evdata->data;
@@ -739,7 +742,7 @@ int fb_notifier_callback(struct notifier_block *self,
	if (!evdata || (evdata->id != 0))
		return 0;

	I("FB  %s\n", __func__);
	D("FB  %s\n", __func__);

	if (evdata && evdata->data && event == FB_EVENT_BLANK && ts &&
		ts->client) {
@@ -772,7 +775,7 @@ int himax_chip_common_probe(struct i2c_client *client, const struct i2c_device_i
	int ret = 0;
	struct himax_ts_data *ts;

	I("%s:Enter\n", __func__);
	D("%s:Enter\n", __func__);

	/* Check I2C functionality */
	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
@@ -867,7 +870,7 @@ static struct i2c_driver himax_common_driver = {

static int __init himax_common_init(void)
{
	I("Himax common touch panel driver init\n");
	D("Himax common touch panel driver init\n");
	i2c_add_driver(&himax_common_driver);

	return 0;