Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1137075pxb; Fri, 22 Jan 2021 08:02:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwv/POv98qO2VEWgGHp6O6zM8MnGpNvX7Odm1uUyzCxBEaKV2sou5NtaBy9hbn/B3a3r632 X-Received: by 2002:a50:998f:: with SMTP id m15mr3804992edb.342.1611331350027; Fri, 22 Jan 2021 08:02:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611331350; cv=none; d=google.com; s=arc-20160816; b=0fLBCz/mnV+TVMG3Tq0TARTNkg03v3Gtcvjsu6XY1ktAVVmpY/vKoYmkxf5KO8i2Kr zDe08gwWkWQJ17lteUKw/mcI3ZFpHAFXMT1/kf0zp3CWMgIxAuPWNOh1WR8XaujaRpRG sDVS0ZtFNU9uHqqgYAJI6nTx95ywGGoXMaB6/lp4LFYtcE0Qcj/nvWfvWL3bHZSxFDFz l19EEMtoGZrujT4SDmdCl1l434PU+MbHqWZXZOBUeo9EzV05Uio5poo4hZ1Wf3kOAn50 xTCHTpFwEo/WnWWjx566jIi7eQvXf7P/3K2XHKN5zhX7mN7PCm80XLOrDxDZ13QssKS9 PniA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=JcL3X6pZRJbwnBz1A3gNB8j5dNXpOkeoO8nisURDIqY=; b=L76YqE/dsuDHEEq1Hww0Qiqas8CFdfAcv57vt5LUd1/UQtpeXOLo8OEEg1CgqdeDpE 9MCIdeMCsk8O923Ro+68PYgPtw69hzdbmQ9W9I3pdQJ3Ygw9XAh4kzbfMK21z4vnAePN 9FldBADd+HbCRxnoEWwj8C8+ptVrFxuw2u7Jl49fhfWFlSLyTB3vQCwhvluO6seKJwP9 GdIHnnGqW4g/3bFiXojUcu5UvGqRc4kL18mApHgTPliafH3FyUUejEkspcERYH0wQPBi kf7S2OQD7cEDvSMPy6QIbZ20cmcn5EFTttBWLcicjxnuSdHyKjVMYZq4NFmlPnd5fO3v mDAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si3008359ejm.210.2021.01.22.08.02.04; Fri, 22 Jan 2021 08:02:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729087AbhAVQBQ (ORCPT + 99 others); Fri, 22 Jan 2021 11:01:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729246AbhAVP6o (ORCPT ); Fri, 22 Jan 2021 10:58:44 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97AB4C0613D6 for ; Fri, 22 Jan 2021 07:58:04 -0800 (PST) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2yox-0001iz-WF; Fri, 22 Jan 2021 16:58:00 +0100 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1l2yox-0000vm-JO; Fri, 22 Jan 2021 16:57:59 +0100 Date: Fri, 22 Jan 2021 16:57:59 +0100 From: Marco Felsch To: Alistair Francis Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, alistair23@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/6] input/touchscreen: Add device tree support to wacom_i2c Message-ID: <20210122155759.zkpmbskjoewvhpcx@pengutronix.de> References: <20210121065643.342-1-alistair@alistair23.me> <20210121065643.342-3-alistair@alistair23.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210121065643.342-3-alistair@alistair23.me> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 16:50:30 up 51 days, 5:56, 28 users, load average: 0.17, 0.11, 0.05 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-01-20 22:56, Alistair Francis wrote: > Allow the wacom-i2c device to be exposed via device tree. You did a lot more than exposing. > Signed-off-by: Alistair Francis > --- > .../input/touchscreen/wacom,wacom-i2c.yaml | 4 ++++ > drivers/input/touchscreen/wacom_i2c.c | 16 ++++++++++++++++ > 2 files changed, 20 insertions(+) > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml b/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml > index b36d22cd20a2..06ad5ee561af 100644 > --- a/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml > +++ b/Documentation/devicetree/bindings/input/touchscreen/wacom,wacom-i2c.yaml > @@ -22,6 +22,9 @@ properties: > interrupts: > maxItems: 1 > > + vdd-supply: > + maxItems: 1 > + Unrelated change. > required: > - compatible > - reg > @@ -40,5 +43,6 @@ examples: > reg = <0x9>; > interrupt-parent = <&gpio1>; > interrupts = <9 IRQ_TYPE_LEVEL_LOW>; > + vdd-supply = <®_touch>; Dito. > }; > }; > diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c > index 1afc6bde2891..ec6e0aff8deb 100644 > --- a/drivers/input/touchscreen/wacom_i2c.c > +++ b/drivers/input/touchscreen/wacom_i2c.c > @@ -11,7 +11,9 @@ > #include > #include > #include > +#include Unrelated change. > #include > +#include > #include > > #define WACOM_CMD_QUERY0 0x04 > @@ -32,6 +34,7 @@ struct wacom_features { > struct wacom_i2c { > struct i2c_client *client; > struct input_dev *input; > + struct touchscreen_properties props; > u8 data[WACOM_QUERY_SIZE]; > bool prox; > int tool; > @@ -187,6 +190,7 @@ static int wacom_i2c_probe(struct i2c_client *client, > __set_bit(BTN_STYLUS2, input->keybit); > __set_bit(BTN_TOUCH, input->keybit); > > + touchscreen_parse_properties(input, true, &wac_i2c->props); Unrelated change, please move it into a sepreate patch. > input_set_abs_params(input, ABS_X, 0, features.x_max, 0, 0); > input_set_abs_params(input, ABS_Y, 0, features.y_max, 0, 0); > input_set_abs_params(input, ABS_PRESSURE, > @@ -214,6 +218,7 @@ static int wacom_i2c_probe(struct i2c_client *client, > } > > i2c_set_clientdata(client, wac_i2c); > + Unrelated change. > return 0; > > err_free_irq: > @@ -262,10 +267,21 @@ static const struct i2c_device_id wacom_i2c_id[] = { > }; > MODULE_DEVICE_TABLE(i2c, wacom_i2c_id); > > +#ifdef CONFIG_OF This #ifdef can be removed using the __maybe_unused macro. > +static const struct of_device_id wacom_i2c_of_match_table[] = { > + { .compatible = "wacom,wacom-i2c" }, IMHO "wacom,wacom-i2c" is not good maybe: - "wacom,generic" if you don't know the device, or - "wacom,XYZ" where XYZ belongs to the real device name. > + {} > +}; > +MODULE_DEVICE_TABLE(of, wacom_i2c_of_match_table); > +#endif > + > static struct i2c_driver wacom_i2c_driver = { > .driver = { > .name = "wacom_i2c", > .pm = &wacom_i2c_pm, > +#ifdef CONFIG_OF > + .of_match_table = of_match_ptr(wacom_i2c_of_match_table), > +#endif No need for this #ifdef. Regards, Marco > }, > > .probe = wacom_i2c_probe, > -- > 2.29.2 > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |