Skip to content

Commit

Permalink
webcamd: Add support for EGALAX USB touchscreens.
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Petter Selasky <hps@selasky.org>
  • Loading branch information
hselasky committed May 22, 2021
1 parent 833dc88 commit 816f17a
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 3 deletions.
7 changes: 5 additions & 2 deletions build/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2088,9 +2088,9 @@
#undef CONFIG_TOUCHSCREEN_EETI /* n */
#define CONFIG_TOUCHSCREEN_EETI_IS_MODULE 0
#define CONFIG_TOUCHSCREEN_EETI_IS_ENABLED 0
#undef CONFIG_TOUCHSCREEN_EGALAX /* n */
#define CONFIG_TOUCHSCREEN_EGALAX /* y */
#define CONFIG_TOUCHSCREEN_EGALAX_IS_MODULE 0
#define CONFIG_TOUCHSCREEN_EGALAX_IS_ENABLED 0
#define CONFIG_TOUCHSCREEN_EGALAX_IS_ENABLED 1
#undef CONFIG_TOUCHSCREEN_EGALAX_SERIAL /* n */
#define CONFIG_TOUCHSCREEN_EGALAX_SERIAL_IS_MODULE 0
#define CONFIG_TOUCHSCREEN_EGALAX_SERIAL_IS_ENABLED 0
Expand Down Expand Up @@ -2307,6 +2307,9 @@
#define CONFIG_TOUCHSCREEN_USB_COMPOSITE /* y */
#define CONFIG_TOUCHSCREEN_USB_COMPOSITE_IS_MODULE 0
#define CONFIG_TOUCHSCREEN_USB_COMPOSITE_IS_ENABLED 1
#define CONFIG_TOUCHSCREEN_USB_EGALAX /* y */
#define CONFIG_TOUCHSCREEN_USB_EGALAX_IS_MODULE 0
#define CONFIG_TOUCHSCREEN_USB_EGALAX_IS_ENABLED 1
#undef CONFIG_TOUCHSCREEN_WACOM_I2C /* n */
#define CONFIG_TOUCHSCREEN_WACOM_I2C_IS_MODULE 0
#define CONFIG_TOUCHSCREEN_WACOM_I2C_IS_ENABLED 0
Expand Down
2 changes: 2 additions & 0 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -494,12 +494,14 @@ CONFIG_TABLET_USB_KBTAB=y
CONFIG_TABLET_USB_PEGASUS=y
CONFIG_TABLET_USB_WACOM=y
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
CONFIG_TOUCHSCREEN_USB_EGALAX=y
#CONFIG_TOUCHSCREEN_SUR40=y
CONFIG_TOUCHSCREEN_3M=y
CONFIG_TOUCHSCREEN_COMPOSITE=y
CONFIG_TOUCHSCREEN_DMC_TSC10=y
CONFIG_TOUCHSCREEN_E2I=y
CONFIG_TOUCHSCREEN_EASYTOUCH=y
CONFIG_TOUCHSCREEN_EGALAX=y
CONFIG_TOUCHSCREEN_ETT_TC45USB=y
CONFIG_TOUCHSCREEN_ETURBO=y
CONFIG_TOUCHSCREEN_GENERAL_TOUCH=y
Expand Down
2 changes: 2 additions & 0 deletions config_input.in
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,14 @@ CONFIG_TABLET_USB_KBTAB=y
CONFIG_TABLET_USB_PEGASUS=y
CONFIG_TABLET_USB_WACOM=y
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
CONFIG_TOUCHSCREEN_USB_EGALAX=y
#CONFIG_TOUCHSCREEN_SUR40=y
CONFIG_TOUCHSCREEN_3M=y
CONFIG_TOUCHSCREEN_COMPOSITE=y
CONFIG_TOUCHSCREEN_DMC_TSC10=y
CONFIG_TOUCHSCREEN_E2I=y
CONFIG_TOUCHSCREEN_EASYTOUCH=y
CONFIG_TOUCHSCREEN_EGALAX=y
CONFIG_TOUCHSCREEN_ETT_TC45USB=y
CONFIG_TOUCHSCREEN_ETURBO=y
CONFIG_TOUCHSCREEN_GENERAL_TOUCH=y
Expand Down
1 change: 0 additions & 1 deletion kernel/linux_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,6 @@ extern unsigned long clear_user(void *uptr, unsigned long n);

#define RPM_ACTIVE 0
#define RPM_SUSPENDED 0
#define SET_RUNTIME_PM_OPS(...)

#define ilog2(n) \
( \
Expand Down
1 change: 1 addition & 0 deletions kernel/linux_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ void *devm_kmemdup(struct device *, const void *, size_t, gfp_t);
void devm_kfree(struct device *dev, void *ptr);
int devm_add_action(struct device *, void (*)(void *), void *);
int devm_add_action_or_reset(struct device *, void (*action)(void *), void *);
#define devm_request_threaded_irq(...) -EOPNOTSUPP
struct clk *devm_clk_get(struct device *, const char *);
void *dev_get_drvdata(const struct device *dev);
void dev_set_drvdata(struct device *dev, void *data);
Expand Down
4 changes: 4 additions & 0 deletions kernel/linux_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ struct vfsmount;
#define LINUX_VMA_MAX 128

#define SET_SYSTEM_SLEEP_PM_OPS(...)
#define SET_RUNTIME_PM_OPS(...)
#define SIMPLE_DEV_PM_OPS(name, ...) \
const struct dev_pm_ops __maybe_unused name = { }

struct dev_pm_ops {
};

Expand Down
54 changes: 54 additions & 0 deletions patches/0001-Linux-kernel-patches-for-webcamd.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1209,3 +1209,57 @@ index 9a61c28ed3ae..94cc0a7cb0a5 100644
--
2.29.2

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 83ac8c128192..b5717c4f8cd0 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -24,7 +24,9 @@
#include <linux/slab.h>
#include <linux/bitops.h>
#include <linux/input/mt.h>
+#if IS_ENABLED(CONFIG_OF)
#include <linux/of_gpio.h>
+#endif

/*
* Mouse Mode: some panel may configure the controller to mouse mode,
@@ -119,6 +121,7 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id)
/* wake up controller by an falling edge of interrupt gpio. */
static int egalax_wake_up_device(struct i2c_client *client)
{
+#if IS_ENABLED(CONFIG_OF)
struct device_node *np = client->dev.of_node;
int gpio;
int ret;
@@ -147,6 +150,9 @@ static int egalax_wake_up_device(struct i2c_client *client)
gpio_free(gpio);

return 0;
+#else
+ return -ENODEV;
+#endif
}

static int egalax_firmware_version(struct i2c_client *client)
@@ -260,17 +266,21 @@ static int __maybe_unused egalax_ts_resume(struct device *dev)

static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume);

+#if IS_ENABLED(CONFIG_OF)
static const struct of_device_id egalax_ts_dt_ids[] = {
{ .compatible = "eeti,egalax_ts" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, egalax_ts_dt_ids);
+#endif

static struct i2c_driver egalax_ts_driver = {
.driver = {
.name = "egalax_ts",
.pm = &egalax_ts_pm_ops,
+#if IS_ENABLED(CONFIG_OF)
.of_match_table = egalax_ts_dt_ids,
+#endif
},
.id_table = egalax_ts_id,
.probe = egalax_ts_probe,

0 comments on commit 816f17a

Please sign in to comment.