Skip to contentSkip to conversation

Add himax hx83102d touchscreen support

PATCH New Henri Ommer 1 participant 4 messages Dec 1

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover Add himax hx83102d touchscreen support

Hi everyone,

this patch series adds bindings and driver modifications to support the himax hx83102d touchscreen used for example in the Samsung Galaxy A20e and Motorola moto e7 plus. Also adds support for himax touchscreens without a reset GPIO.

Tested on: Samsung Galaxy A20e

Henri Ommer (3):
input: himax_hx83112b: Make reset optional
input: himax_hx83112b: Add hx83102d support
dt-bindings: touchscreen: trivial-touch: Add hx83102d

 .../input/touchscreen/trivial-touch.yaml        |  4 ++--
 drivers/input/touchscreen/himax_hx83112b.c      | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)
Signature · 3 lines
Best regards,

Henri
#1 lore raw

PATCH v3 1/3 input: himax_hx83112b: Make reset optional

Some versions of Himax touchscreen chips do not have a reset GPIO. In the downstream driver these chips are only reset for firmware flashes. Since firmware flashes aren't implemented in this driver, resets can be skipped.

---
 drivers/input/touchscreen/himax_hx83112b.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/input/touchscreen/himax_hx83112b.c +8 -1
index 345ece27fe74..d9d57ebf5123 100644
@@ -132,6 +132,13 @@ static int himax_bus_read(struct himax_ts_data *ts, u32 address, void *dst,
 
 static void himax_reset(struct himax_ts_data *ts)
 {
+	/* 
+	 * TODO: Replace with software reset when firmware updates are
+	 * 		 implemented.
+	 */
+	if (!ts->gpiod_rst)
+		return;
+
 	gpiod_set_value_cansleep(ts->gpiod_rst, 1);
 
 	/* Delay copied from downstream driver */
@@ -349,7 +356,7 @@ static int himax_probe(struct i2c_client *client)
 		return error;
 	}
 
-	ts->gpiod_rst = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	ts->gpiod_rst = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
 	error = PTR_ERR_OR_ZERO(ts->gpiod_rst);
 	if (error) {
 		dev_err(dev, "Failed to get reset GPIO: %d\n", error);
Signature · 1 line
Changes in v3: Shorter comment
#2 lore raw

PATCH v3 2/3 input: himax_hx83112b: Add hx83102d support

In reply to Henri Ommer

The core functionality of the hx83102d is software-compatible with the hx83112b. As with the hx83112b, firmware flashing is unimplemented.

Tested on: Samsung Galaxy A20e (SM-A202F)

---
 drivers/input/touchscreen/himax_hx83112b.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/input/touchscreen/himax_hx83112b.c +8 -0
index d9d57ebf5123..e38e707011b8 100644
@@ -406,6 +406,12 @@ static const struct himax_chip hx83100a_chip = {
 	.read_events = hx83100a_read_events,
 };
 
+static const struct himax_chip hx83102d_chip = {
+	.id = 0x83102d,
+	.check_id = himax_check_product_id,
+	.read_events = himax_read_events,
+};
+
 static const struct himax_chip hx83112b_chip = {
 	.id = 0x83112b,
 	.check_id = himax_check_product_id,
@@ -414,6 +420,7 @@ static const struct himax_chip hx83112b_chip = {
 
 static const struct i2c_device_id himax_ts_id[] = {
 	{ .name = "hx83100a", .driver_data = (kernel_ulong_t)&hx83100a_chip },
+	{ .name = "hx83102d", .driver_data = (kernel_ulong_t)&hx83102d_chip },
 	{ .name = "hx83112b", .driver_data = (kernel_ulong_t)&hx83112b_chip },
 	{ /* sentinel */ }
 };
@@ -422,6 +429,7 @@ MODULE_DEVICE_TABLE(i2c, himax_ts_id);
 #ifdef CONFIG_OF
 static const struct of_device_id himax_of_match[] = {
 	{ .compatible = "himax,hx83100a", .data = &hx83100a_chip },
+	{ .compatible = "himax,hx83102d", .data = &hx83102d_chip },
 	{ .compatible = "himax,hx83112b", .data = &hx83112b_chip },
 	{ /* sentinel */ }
 };
Signature · 1 line
Changes in v3: Remove copyright
#3 lore raw

PATCH v3 3/3 dt-bindings: touchscreen: trivial-touch: Add hx83102d

In reply to Henri Ommer

Adds the Himax hx83102d touchscreen chip compatible string. The hx83102d is mostly software-compatible with the hx83112b.

---
 .../devicetree/bindings/input/touchscreen/trivial-touch.yaml  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml +2 -2
index 6316a8d32f39..d0ee79ba096d 100644
@@ -16,9 +16,9 @@ properties:
       - azoteq,iqs550
       - azoteq,iqs572
       - azoteq,iqs525
-      # Himax hx83100a touchscreen controller
+      # The Himax hx83100a, hx83102d and hx83112b touchscreen controllers
       - himax,hx83100a
-      # Himax hx83112b touchscreen controller
+      - himax,hx83102d
       - himax,hx83112b
       # Hynitron cstxxx series touchscreen controller
       - hynitron,cst340
Signature · 1 line
Changes in v3: Commit wording