Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configs/sx8m_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ CONFIG_KEYBOARD_CROS_EC=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ATMEL_MXT=m
CONFIG_TOUCHSCREEN_EXC3000=m
CONFIG_TOUCHSCREEN_GOODIX=m
CONFIG_TOUCHSCREEN_GOODIX=y
CONFIG_TOUCHSCREEN_EDT_FT5X06=m
CONFIG_TOUCHSCREEN_FTS=m
CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_I2C=m
Expand Down
7 changes: 1 addition & 6 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ARTNUM_FILE="/etc/ultimaker_firmware"
TARGET_DTS="cgtsx8m-ultimain5.dtb"
UC32_DTS="ulticontroller3.2-lvds-800x320.dtb"
UC4_DTS="ulticontroller4.0-lvds-1024x600.dtb"
UC4_INV_DTS="ulticontroller4.1-lvds-1024x600.dtb"

if [ "$1" = "configure" ]; then
# During the bootstrap configuration stage, if the kernel is configured
Expand All @@ -26,14 +25,10 @@ if [ "$1" = "configure" ]; then
echo "-> Setting Ulticontroller 3.2 LVDS device tree."
ln -sf "${UC32_DTS}" "/boot/${TARGET_DTS}"
;;
227380 | 105*)
227380 | 105* | 109*)
echo "-> Setting Ulticontroller 4.0 LVDS device tree."
ln -sf "${UC4_DTS}" "/boot/${TARGET_DTS}"
;;
109*)
echo "-> Setting Ulticontroller 4.0 LVDS Inverted device tree."
ln -sf "${UC4_INV_DTS}" "/boot/${TARGET_DTS}"
;;
# Fallback to the larger screen
*)
echo "-> Falling back to Ulticontroller 4.0 LVDS device tree."
Expand Down
3 changes: 1 addition & 2 deletions dts/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

We have 3 device trees, one for each display currently supported by **Ultimainboard 5**:

- *Ulticontroller 4.1-lvds-1024x600.dts (NGP Protos): `ulticontroller4.1-lvds-1024x600.dts`
- *Ulticontroller 4.0 at 1024x600 (Factor 4, Falcon): `ulticontroller4.0-lvds-1024x600.dts`
- *Ulticontroller 4.0 at 1024x600 (Factor 4, Factor 4+, NGP): `ulticontroller4.0-lvds-1024x600.dts`
- *Ultricontroller 3.2 LVDS* at 800x600 (S6 and S8): `ulticontroller3.2-lvds-800x320.dts`

Both device trees sources includes the Ultimainboard 5 device tree: `ultimainboard5-lvds.dtsi`.
Expand Down
7 changes: 7 additions & 0 deletions dts/ulticontroller4.0-lvds-1024x600.dts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
touchscreen-inverted-x;
touchscreen-inverted-y;
};
panel_touchscreen_ngp: gt928@5d {
compatible = "goodix,gt911";
reg = <0x5d>;
reset-gpios = <&panel_gpio 3 GPIO_ACTIVE_LOW>;
touchscreen-size-x = <1024>;
touchscreen-size-y = <600>;
};

panel_gpio: pca9536@41 {
compatible = "nxp,pca9536";
Expand Down
13 changes: 0 additions & 13 deletions dts/ulticontroller4.1-lvds-1024x600.dts

This file was deleted.

2 changes: 1 addition & 1 deletion linux
102 changes: 102 additions & 0 deletions patches/0005-Add-polled-touch-goodix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index a3e8a51c914495..252dcae039f8d5 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -44,9 +44,11 @@
#define GOODIX_HAVE_KEY BIT(4)
#define GOODIX_BUFFER_STATUS_TIMEOUT 20

-#define RESOLUTION_LOC 1
-#define MAX_CONTACTS_LOC 5
-#define TRIGGER_LOC 6
+#define RESOLUTION_LOC 1
+#define MAX_CONTACTS_LOC 5
+#define TRIGGER_LOC 6
+
+#define GOODIX_POLL_INTERVAL_MS 17 /* 17ms = 60fps */

/* Our special handling for GPIO accesses through ACPI is x86 specific */
#if defined CONFIG_X86 && defined CONFIG_ACPI
@@ -497,6 +499,14 @@ static void goodix_process_events(struct goodix_ts_data *ts)
input_sync(ts->input_dev);
}

+static void goodix_ts_work_i2c_poll(struct input_dev *input)
+{
+ struct goodix_ts_data *ts = input_get_drvdata(input);
+
+ goodix_process_events(ts);
+ goodix_i2c_write_u8(ts->client, GOODIX_READ_COOR_ADDR, 0);
+}
+
/**
* goodix_ts_irq_handler - The IRQ handler
*
@@ -513,13 +523,29 @@ static irqreturn_t goodix_ts_irq_handler(int irq, void *dev_id)
return IRQ_HANDLED;
}

+static void goodix_enable_irq(struct goodix_ts_data *ts)
+{
+ if (ts->client->irq)
+ enable_irq(ts->client->irq);
+}
+
+static void goodix_disable_irq(struct goodix_ts_data *ts)
+{
+ if (ts->client->irq)
+ disable_irq(ts->client->irq);
+}
+
static void goodix_free_irq(struct goodix_ts_data *ts)
{
- devm_free_irq(&ts->client->dev, ts->client->irq, ts);
+ if (ts->client->irq)
+ devm_free_irq(&ts->client->dev, ts->client->irq, ts);
}

static int goodix_request_irq(struct goodix_ts_data *ts)
{
+ if (!ts->client->irq)
+ return 0;
+
return devm_request_threaded_irq(&ts->client->dev, ts->client->irq,
NULL, goodix_ts_irq_handler,
ts->irq_flags, ts->client->name, ts);
@@ -1219,6 +1245,18 @@ static int goodix_configure_dev(struct goodix_ts_data *ts)
return error;
}

+ input_set_drvdata(ts->input_dev, ts);
+
+ if (!ts->client->irq) {
+ error = input_setup_polling(ts->input_dev, goodix_ts_work_i2c_poll);
+ if (error) {
+ dev_err(&ts->client->dev,
+ "could not set up polling mode, %d\n", error);
+ return error;
+ }
+ input_set_poll_interval(ts->input_dev, GOODIX_POLL_INTERVAL_MS);
+ }
+
error = input_register_device(ts->input_dev);
if (error) {
dev_err(&ts->client->dev,
@@ -1422,7 +1460,7 @@ static int goodix_suspend(struct device *dev)

/* We need gpio pins to suspend/resume */
if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_NONE) {
- disable_irq(client->irq);
+ goodix_disable_irq(ts);
return 0;
}

@@ -1466,7 +1504,7 @@ static int goodix_resume(struct device *dev)
int error;

if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_NONE) {
- enable_irq(client->irq);
+ goodix_enable_irq(ts);
return 0;
}

Loading