Exemplo n.º 1
0
static ssize_t set_all_refer_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
{
	int status;
	struct melfas_ts_data *ts = dev_get_drvdata(dev);

	status = check_debug_data(ts);

	return sprintf(buf, "%u\n", status);
}
Exemplo n.º 2
0
static ssize_t
set_all_refer_mode_show(struct device *dev,
			struct device_attribute *attr, char *buf)
{
	int status = 0;
	int i;
	struct melfas_ts_data *ts = dev_get_drvdata(dev);

	if (!tsp_enabled)
		return 0;

	for (i = 0; i < 3; i++) {
		if (!check_debug_data(ts)) {
			status = 0;
			break;
		} else {
			pr_info("[TSP] check_debug_data Error try=%d", i);
			msleep(200);
			melfas_ts_suspend(ts->client, PMSG_SUSPEND);

			msleep(200);
			melfas_ts_resume(ts->client);
			msleep(300);
			status = 1;
		}
	}
	if (!status) {
		for (i = 0; i < X_LINE * Y_LINE; i++) {
			/* out of range */
			if (reference_data[i] < 30) {
				status = 1;
				break;
			}

			if (debug_print) {
				if (0 == i % X_LINE)
					pr_info("[TSP]\n");
				pr_info("[TSP] %5u  ", reference_data[i]);
			}
		}
	} else {
		pr_info
		    ("[TSP] all_refer_show func & check_debug_data error[%d]",
		     status);
		return sprintf(buf, "%u\n", status);
	}

	pr_info("[TSP] all_refer_show func [%d]", status);
	return sprintf(buf, "%u\n", status);
}