Skip to contentSkip to conversation

Input: goodix-berlin - Add sysfs interface for reading and writing touch IC registers

PATCH Superseded Charles Wang 2 participants 3 messages May 13, 2024 – May 14, 2024

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Input: goodix-berlin - Add sysfs interface for reading and writing touch IC registers

Export a sysfs interface that would allow reading and writing touchscreen IC registers. With this interface many things can be done in usersapce such as firmware updates. An example tool that utilizes this interface for performing firmware updates can be found at [1].

[1] https://github.com/goodix/fwupdate_for_berlin_linux

---
Changes in v2:
- use dev_groups to manager device attributes.
- use dev_get_regmap to make show/store functions generic.
- v1: https://lore.kernel.org/all/[email protected]/

---
 drivers/input/touchscreen/goodix_berlin.h     |  1 +
 .../input/touchscreen/goodix_berlin_core.c    | 42 +++++++++++++++++++
 drivers/input/touchscreen/goodix_berlin_i2c.c |  1 +
 drivers/input/touchscreen/goodix_berlin_spi.c |  1 +
 4 files changed, 45 insertions(+)
drivers/input/touchscreen/goodix_berlin.h +1 -0
index 1fd77eb69..38b6f9ddb 100644
@@ -20,5 +20,6 @@ int goodix_berlin_probe(struct device *dev, int irq, const struct input_id *id,
 			struct regmap *regmap);
 
 extern const struct dev_pm_ops goodix_berlin_pm_ops;
+extern const struct attribute_group *goodix_berlin_groups[];
 
 #endif
drivers/input/touchscreen/goodix_berlin_core.c +42 -0

48 lines not on this page · raw message

drivers/input/touchscreen/goodix_berlin_i2c.c +1 -0
index 6ed9aa808..b5f48315c 100644
@@ -64,6 +64,7 @@ static struct i2c_driver goodix_berlin_i2c_driver = {
 		.name = "goodix-berlin-i2c",
 		.of_match_table = goodix_berlin_i2c_of_match,
 		.pm = pm_sleep_ptr(&goodix_berlin_pm_ops),
+		.dev_groups = goodix_berlin_groups,
 	},
 	.probe = goodix_berlin_i2c_probe,
 	.id_table = goodix_berlin_i2c_id,
drivers/input/touchscreen/goodix_berlin_spi.c +1 -0
index 4cc557da0..fe5739097 100644
@@ -167,6 +167,7 @@ static struct spi_driver goodix_berlin_spi_driver = {
 		.name = "goodix-berlin-spi",
 		.of_match_table = goodix_berlin_spi_of_match,
 		.pm = pm_sleep_ptr(&goodix_berlin_pm_ops),
+		.dev_groups = goodix_berlin_groups,
 	},
 	.probe = goodix_berlin_spi_probe,
 	.id_table = goodix_berlin_spi_ids,
Signature · 1 line
2.43.0
maintainer
#1 lore raw

Hi Charles,

drivers/input/touchscreen/goodix_berlin_core.c static void goodix_berlin_power_off_act(void *data) · line 715

Quoted 5 lines · Charles Wang
drivers/input/touchscreen/goodix_berlin_core.c +5 -0
+
+const struct attribute_group *goodix_berlin_groups[] = {
+	&goodix_berlin_attr_group,
+	NULL,
+};

This symbol needs to be exportedsymbol needs to be exported..

Thanks.

Signature · 1 line
Dmitry
#2 lore raw
Quoted 11 lines · Dmitry Torokhov

Hi Charles,

drivers/input/touchscreen/goodix_berlin_core.c static void goodix_berlin_power_off_act(void *data) · line 715

Quoted 5 lines · Charles Wang
drivers/input/touchscreen/goodix_berlin_core.c +5 -0
+
+const struct attribute_group *goodix_berlin_groups[] = {
+	&goodix_berlin_attr_group,
+	NULL,
+};

This symbol needs to be exportedsymbol needs to be exported..

Ack

Thanks

Charles