mbox series

[v6,0/9] Add Wacom I2C support to rM2

Message ID 20210615103014.798-1-alistair@alistair23.me
Headers show
Series Add Wacom I2C support to rM2 | expand

Message

Alistair June 15, 2021, 10:30 a.m. UTC
Add support to the reMarkable2 (rM2) for the Wacom I2C device.

This is based on the reMarkable Linux fork and with this series I am
able to probe the Wacom digitiser.

Alistair Francis (9):
  dt-bindings: Add Wacom to vendor bindings
  dt-bindings: touchscreen: Initial commit of wacom,generic
  Input: wacom_i2c - Add device tree support to wacom_i2c
  Input: wacom_i2c - Add touchscren properties
  Input: wacom_i2c - Add support for distance and tilt x/y
  Input: wacom_i2c - Clean up the query device fields
  Input: wacom_i2c - Add support for vdd regulator
  ARM: imx_v6_v7_defconfig: Enable Wacom I2C
  ARM: dts: imx7d: remarkable2: add wacom digitizer device

 .../input/touchscreen/wacom,generic.yaml      |  48 ++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 arch/arm/boot/dts/imx7d-remarkable2.dts       |  61 +++++++
 arch/arm/configs/imx_v6_v7_defconfig          |   1 +
 drivers/input/touchscreen/wacom_i2c.c         | 155 ++++++++++++++----
 5 files changed, 233 insertions(+), 34 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/wacom,generic.yaml

Comments

Dmitry Torokhov June 15, 2021, 4:50 p.m. UTC | #1
Hi Alistair,

On Tue, Jun 15, 2021 at 08:30:06PM +1000, Alistair Francis wrote:
> Signed-off-by: Alistair Francis <alistair@alistair23.me>

Please also send DT bindings to Rob Herring <robh+dt@kernel.org> and
devicetree@vger.kernel.org.

> ---
>  Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
> index b868cefc7c55..abd878ff23d5 100644
> --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
> @@ -1236,6 +1236,8 @@ patternProperties:
>      description: Vision Optical Technology Co., Ltd.
>    "^vxt,.*":
>      description: VXT Ltd
> +  "^wacom,.*":
> +    description: Wacom Co., Ltd
>    "^wand,.*":
>      description: Wandbord (Technexion)
>    "^waveshare,.*":
> -- 
> 2.31.1
> 

Thanks.
Dmitry Torokhov June 15, 2021, 4:55 p.m. UTC | #2
On Tue, Jun 15, 2021 at 08:30:08PM +1000, Alistair Francis wrote:
> Allow the wacom-i2c device to be exposed via device tree.
> 
> Signed-off-by: Alistair Francis <alistair@alistair23.me>
> ---
>  drivers/input/touchscreen/wacom_i2c.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
> index 22826c387da5..6053595f2b30 100644
> --- a/drivers/input/touchscreen/wacom_i2c.c
> +++ b/drivers/input/touchscreen/wacom_i2c.c
> @@ -12,6 +12,7 @@
>  #include <linux/slab.h>
>  #include <linux/irq.h>
>  #include <linux/interrupt.h>
> +#include <linux/of.h>
>  #include <asm/unaligned.h>
>  
>  #define WACOM_CMD_QUERY0	0x04
> @@ -241,10 +242,17 @@ static const struct i2c_device_id wacom_i2c_id[] = {
>  };
>  MODULE_DEVICE_TABLE(i2c, wacom_i2c_id);
>  
> +static const struct of_device_id wacom_i2c_of_match_table[] = {
> +	{ .compatible = "wacom,i2c-30" },

What is this compatible?

> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, wacom_i2c_of_match_table);
> +
>  static struct i2c_driver wacom_i2c_driver = {
>  	.driver	= {
>  		.name	= "wacom_i2c",
>  		.pm	= &wacom_i2c_pm,
> +		.of_match_table = wacom_i2c_of_match_table,
>  	},
>  
>  	.probe		= wacom_i2c_probe,
> -- 
> 2.31.1
>
Alistair Francis June 15, 2021, 9:19 p.m. UTC | #3
On Wed, Jun 16, 2021 at 2:55 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Tue, Jun 15, 2021 at 08:30:08PM +1000, Alistair Francis wrote:
> > Allow the wacom-i2c device to be exposed via device tree.
> >
> > Signed-off-by: Alistair Francis <alistair@alistair23.me>
> > ---
> >  drivers/input/touchscreen/wacom_i2c.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
> > index 22826c387da5..6053595f2b30 100644
> > --- a/drivers/input/touchscreen/wacom_i2c.c
> > +++ b/drivers/input/touchscreen/wacom_i2c.c
> > @@ -12,6 +12,7 @@
> >  #include <linux/slab.h>
> >  #include <linux/irq.h>
> >  #include <linux/interrupt.h>
> > +#include <linux/of.h>
> >  #include <asm/unaligned.h>
> >
> >  #define WACOM_CMD_QUERY0     0x04
> > @@ -241,10 +242,17 @@ static const struct i2c_device_id wacom_i2c_id[] = {
> >  };
> >  MODULE_DEVICE_TABLE(i2c, wacom_i2c_id);
> >
> > +static const struct of_device_id wacom_i2c_of_match_table[] = {
> > +     { .compatible = "wacom,i2c-30" },
>
> What is this compatible?

Sorry, I updated it here but missed the previous patch documentation.

It's wacom, connected via I2C and then version 30.

I'll fixup the documentation.

Alistair

>
> > +     {}
> > +};
> > +MODULE_DEVICE_TABLE(of, wacom_i2c_of_match_table);
> > +
> >  static struct i2c_driver wacom_i2c_driver = {
> >       .driver = {
> >               .name   = "wacom_i2c",
> >               .pm     = &wacom_i2c_pm,
> > +             .of_match_table = wacom_i2c_of_match_table,
> >       },
> >
> >       .probe          = wacom_i2c_probe,
> > --
> > 2.31.1
> >
>
> --
> Dmitry