diff options
author | Felix Kaechele <felix@kaechele.ca> | 2024-06-20 17:50:03 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2024-07-09 02:22:50 +0300 |
commit | 05eab5456b24230a30b65bcd6793937cb84d3de8 (patch) | |
tree | 552d12b2c346ef62e97517eb076d993dd1f19c2a /drivers/input | |
parent | a742e61dbb7198b51af772c7b80ed81ed298a88f (diff) | |
download | linux-05eab5456b24230a30b65bcd6793937cb84d3de8.tar.xz |
Input: himax_hx83112b - use more descriptive register defines
Himax uses an AHB-style bus to communicate with different parts of the
display driver and touch controller system.
Use more descriptive names for the register and address defines.
The names were taken from a driver submission for the similar HX83102J
chip.
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Link: https://lore.kernel.org/all/TY0PR06MB561105A3386E9D76F429110D9E0F2@TY0PR06MB5611.apcprd06.prod.outlook.com/
Link: https://lore.kernel.org/r/20240620145019.156187-3-felix@kaechele.ca
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/himax_hx83112b.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/input/touchscreen/himax_hx83112b.c b/drivers/input/touchscreen/himax_hx83112b.c index bafabd06dabc..d6c4a68eac23 100644 --- a/drivers/input/touchscreen/himax_hx83112b.c +++ b/drivers/input/touchscreen/himax_hx83112b.c @@ -24,12 +24,14 @@ #define HIMAX_MAX_POINTS 10 -#define HIMAX_REG_CFG_SET_ADDR 0x00 -#define HIMAX_REG_CFG_INIT_READ 0x0c -#define HIMAX_REG_CFG_READ_VALUE 0x08 -#define HIMAX_REG_READ_EVENT 0x30 +#define HIMAX_AHB_ADDR_BYTE_0 0x00 +#define HIMAX_AHB_ADDR_RDATA_BYTE_0 0x08 +#define HIMAX_AHB_ADDR_ACCESS_DIRECTION 0x0c +#define HIMAX_AHB_ADDR_EVENT_STACK 0x30 -#define HIMAX_CFG_PRODUCT_ID 0x900000d0 +#define HIMAX_AHB_CMD_ACCESS_DIRECTION_READ 0x00 + +#define HIMAX_REG_ADDR_ICID 0x900000d0 #define HIMAX_INVALID_COORD 0xffff @@ -67,15 +69,16 @@ static int himax_read_config(struct himax_ts_data *ts, u32 address, u32 *dst) { int error; - error = regmap_write(ts->regmap, HIMAX_REG_CFG_SET_ADDR, address); + error = regmap_write(ts->regmap, HIMAX_AHB_ADDR_BYTE_0, address); if (error) return error; - error = regmap_write(ts->regmap, HIMAX_REG_CFG_INIT_READ, 0x0); + error = regmap_write(ts->regmap, HIMAX_AHB_ADDR_ACCESS_DIRECTION, + HIMAX_AHB_CMD_ACCESS_DIRECTION_READ); if (error) return error; - error = regmap_read(ts->regmap, HIMAX_REG_CFG_READ_VALUE, dst); + error = regmap_read(ts->regmap, HIMAX_AHB_ADDR_RDATA_BYTE_0, dst); if (error) return error; @@ -101,7 +104,7 @@ static int himax_read_product_id(struct himax_ts_data *ts, u32 *product_id) { int error; - error = himax_read_config(ts, HIMAX_CFG_PRODUCT_ID, product_id); + error = himax_read_config(ts, HIMAX_REG_ADDR_ICID, product_id); if (error) return error; @@ -235,7 +238,7 @@ static int himax_handle_input(struct himax_ts_data *ts) int error; struct himax_event event; - error = regmap_raw_read(ts->regmap, HIMAX_REG_READ_EVENT, &event, + error = regmap_raw_read(ts->regmap, HIMAX_AHB_ADDR_EVENT_STACK, &event, sizeof(event)); if (error) { dev_err(&ts->client->dev, "Failed to read input event: %d\n", |