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

Commit bf5d79ae authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "input: touchscreen: Replace macros used inside the functions"

parents f9c62c23 4ffb7c37
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ Optional properties:
				It is a four tuple consisting of min x,
				min y, max x and max y values.
 - goodix,i2c-pull-up	: To specify pull up is required.
 - goodix,no-force-update	: To specify force update is allowed.
 - goodix,force-update	: To specify force update is allowed.
 - goodix,enable-power-off	: Power off touchscreen during suspend.
 - goodix,button-map	: Button map of key codes. The number of key codes
				depend on panel.
@@ -52,6 +52,12 @@ Optional properties:
 - goodix,cfg-data5	: Touch screen controller config data group 5. Ask vendor
				to provide that.
 - goodix,fw-name	: Touch screen controller firmware file name.
 - goodix,slide-wakeup	: To specify slide-wakeup property is enabled or not.
 - goodix,dbl-clk-wakeup	: To specify dbl-clk-wakeup property is enabled or not.
 - goodix,change-x2y	: To specify change-x2y property is enabled or not.
 - goodix,driver-send-cfg	: To specify driver-send-cfg property is enabled or not.
 - goodix,have-touch-key	: To specify have-touch-key property is enabled or not.
 - goodix,with-pen	: To specify with-pen property is enabled or not.
Example:
i2c@f9927000 {
		goodix@5d {
@@ -87,5 +93,7 @@ i2c@f9927000 {
				FF FF FF FF FF FF FF 22 22 22
				22 22 22 FF 07 01];
			goodix,fw_name = "gtp_fw.bin";
			goodix,have-touch-key;
			goodix,driver-send-cfg;
		};
};
+511 −313

File changed.

Preview size limit exceeded, changes collapsed.

+14 −19
Original line number Diff line number Diff line
/* drivers/input/touchscreen/gt9xx.h
 *
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 *
 * Linux Foundation chooses to take subject only to the GPLv2 license
 * terms, and distributes only under these terms.
@@ -56,13 +56,19 @@ struct goodix_ts_platform_data {
	u32 panel_miny;
	u32 panel_maxx;
	u32 panel_maxy;
	bool no_force_update;
	bool force_update;
	bool i2c_pull_up;
	bool enable_power_off;
	size_t config_data_len[GOODIX_MAX_CFG_GROUP];
	u8 *config_data[GOODIX_MAX_CFG_GROUP];
	u32 button_map[MAX_BUTTONS];
	u8 num_button;
	bool have_touch_key;
	bool driver_send_cfg;
	bool change_x2y;
	bool with_pen;
	bool slide_wakeup;
	bool dbl_clk_wakeup;
};
struct goodix_ts_data {
	spinlock_t irq_lock;
@@ -78,6 +84,7 @@ struct goodix_ts_data {
	s32 use_irq;
	u16 abs_x_max;
	u16 abs_y_max;
	u16 addr;
	u8  max_touch_num;
	u8  int_trigger_type;
	u8  green_wake_mode;
@@ -92,6 +99,8 @@ struct goodix_ts_data {
	u8  fw_error;
	bool power_on;
	struct mutex lock;
	bool fw_loading;
	bool force_update;
	struct regulator *avdd;
	struct regulator *vdd;
	struct regulator *vcc_i2c;
@@ -108,21 +117,7 @@ extern u16 total_len;

/***************************PART1:ON/OFF define*******************************/
#define GTP_CUSTOM_CFG			0
#define GTP_CHANGE_X2Y			0
#define GTP_DRIVER_SEND_CFG		1
#define GTP_HAVE_TOUCH_KEY		1

/* auto updated by head_fw_array in gt9xx_firmware.h,
 * function together with CONFIG_GT9XX_TOUCHPANEL_UPDATE */
#define GTP_HEADER_FW_UPDATE	0

#define GTP_ESD_PROTECT			0
#define GTP_WITH_PEN			0

/* This cannot work when enable-power-off is on */
#define GTP_SLIDE_WAKEUP		0
/* double-click wakeup, function together with GTP_SLIDE_WAKEUP */
#define GTP_DBL_CLK_WAKEUP		0

#define GTP_IRQ_TAB            {\
				IRQ_TYPE_EDGE_RISING,\
@@ -180,6 +175,8 @@ extern u16 total_len;
/* HIGH: 0x28/0x29, LOW: 0xBA/0xBB */
#define GTP_I2C_ADDRESS_HIGH	0x14
#define GTP_I2C_ADDRESS_LOW	0x5D
#define GTP_VALID_ADDR_START	0x8040
#define GTP_VALID_ADDR_END	0x8177

#define CFG_GROUP_LEN(p_cfg_grp) (sizeof(p_cfg_grp) / sizeof(p_cfg_grp[0]))

@@ -220,11 +217,9 @@ s32 init_wr_node(struct i2c_client *client);
void uninit_wr_node(void);
#endif

#ifdef CONFIG_GT9XX_TOUCHPANEL_UPDATE
extern u8 gup_init_update_proc(struct goodix_ts_data *ts);
u8 gup_init_update_proc(struct goodix_ts_data *ts);
s32 gup_enter_update_mode(struct i2c_client *client);
void gup_leave_update_mode(struct i2c_client *client);
s32 gup_update_proc(void *dir);
extern struct i2c_client  *i2c_connect_client;
#endif
#endif /* _GOODIX_GT9XX_H_ */
+9 −30
Original line number Diff line number Diff line
@@ -36,11 +36,6 @@
#include <linux/workqueue.h>
#include <linux/kernel.h>

#if GTP_HEADER_FW_UPDATE
#include <linux/namei.h>
#include <linux/mount.h>
#endif

#define FIRMWARE_NAME_LEN_MAX		256

#define GUP_REG_HW_INFO             0x4220
@@ -636,26 +631,6 @@ static s8 gup_update_config(struct i2c_client *client,
	return ret;
}

#if GTP_HEADER_FW_UPDATE
static u32 gup_get firmware_file(struct i2c_client,
		struct st_update_msg *msg, u8 *path)
{
	if (sizeiof(header_fw_array) < (FW_HEAD_LENGTH +
				FW_SECTION_LENGTH * 4 +
				FW_DSP_ISP_LENGTH +
				FW_DSP_LENGTH +
				FW_BOOT_LENGTH)) {
		dev_err(&client->dev,
			"INVALID header_fw_array!");
		return -EINVAL;
	}
	msg->fw_data = (u8 *)header_fw_array;
	msg->fw_len = sizeof(header_fw_array);
	dev_dbg(&client->dev, "Found firmware from header file, len=%d",
		msg->fw_len);
	return 0;
}
#else
static s32 gup_get_firmware_file(struct i2c_client *client,
		struct st_update_msg *msg, u8 *path)
{
@@ -685,7 +660,6 @@ static s32 gup_get_firmware_file(struct i2c_client *client,
	release_firmware(fw);
	return 0;
}
#endif

static u8 gup_check_firmware_name(struct i2c_client *client,
					u8 **path_p)
@@ -1453,11 +1427,16 @@ s32 gup_update_proc(void *dir)
		goto file_fail;
	}

	if (ts->force_update) {
		dev_dbg(&ts->client->dev, "Enter force update.");
	} else {
		ret = gup_enter_update_judge(ts->client, &fw_head);
		if (ret == FAIL) {
		pr_err("Check *.bin file fail.");
			dev_err(&ts->client->dev,
					"Check *.bin file fail.");
			goto file_fail;
		}
	}

	ts->enter_update = 1;
	gtp_irq_disable(ts);