Linux Input/HID development
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Marcin Niestroj <m.niestroj@grinn-global.com>
Cc: Bastien Nocera <hadess@hadess.net>, Antonio Ospite <ao2@ao2.it>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 1/2] Input: goodix - support gt1151 touchpanel
Date: Wed, 18 Oct 2017 17:47:41 -0700	[thread overview]
Message-ID: <20171019004741.qdnbhkxtkuxnx2uw@dtor-ws> (raw)
In-Reply-To: <929df0d1-b9d9-de8a-3dd0-b95cb5e6be16@grinn-global.com>

On Tue, Oct 17, 2017 at 11:40:01AM +0200, Marcin Niestroj wrote:
> Hi,
> Thanks everyone for review!
> 
> On 14.10.2017 00:58, Dmitry Torokhov wrote:
> > <...snip...>
> > My preference would be to assign constant chip data, such as register,
> > to the relevant device ID structure (I2C or OF or ACPI) and reference it
> > form where it is needed.
> > 
> > struct goodix_chip_data {
> > 	u16	config_addr;
> > };
> > 
> > ...
> > 
> > struct goodix_ts_data {
> > 	...
> > 	const struct goodix_chip_data *chip;
> > 	...
> > };
> > 
> > ...
> > 
> > static const goodix_chip_data gt1x_chip_data = {
> > 	.config_addr	= GOODIX_GT1X_REG_CONFIG_DATA,
> > };
> > 
> > static const goodix_chip_data gt9x_chip_data = {
> > 	.config_addr	= GOODIX_GT9X_REG_CONFIG_DATA,
> > };
> > 
> > static const struct of_device_id goodix_of_match[] = {
> > 	{ .compatible = "goodix,gt1151", .data = &gt1x_chip_data },
> > 	...
> > };
> > 
> > and so on...
> > 
> > Thanks.
> > 
> 
> This looks good to me. Together with config_addr I would put config_len
> to struct goodix_chip_data (and remove cfg_len member from struct
> goodix_ts_data).
> 
> The main problem I have is how to assign goodix_chip_data to a ACPI
> device (I have very little knowledge about ACPI). I do not know from
> where comes 'GDIX1001' ACPI ID and how it corresponds to OF compatible
> strings. Can you help me with that?

Hmm, wait a second... Looking at the driver we can fetch the product ID
form the chip, so we do not really need to put this into OF or ACPI
tables, but rather set up the "chip" pointer dynamically when we probe
the device.

Thanks.

-- 
Dmitry

      reply	other threads:[~2017-10-19  0:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 15:04 [PATCH 1/2] Input: goodix - support gt1151 touchpanel Marcin Niestroj
     [not found] ` <20171012150443.27542-1-m.niestroj-z3quKL4iOrmQ6ZAhV5LmOA@public.gmane.org>
2017-10-12 15:04   ` [PATCH 2/2] Input: goodix - add more entries in i2c_device_id Marcin Niestroj
     [not found]     ` <20171012150443.27542-2-m.niestroj-z3quKL4iOrmQ6ZAhV5LmOA@public.gmane.org>
2017-10-12 18:08       ` Rob Herring
2017-10-12 18:09   ` [PATCH 1/2] Input: goodix - support gt1151 touchpanel Rob Herring
2017-10-13 16:02 ` Antonio Ospite
     [not found]   ` <20171013180221.76b67869cf4eed7eeec3f56f-qKGr9MkilAE@public.gmane.org>
2017-10-13 16:40     ` Bastien Nocera
2017-10-13 22:58       ` Dmitry Torokhov
2017-10-14  4:40         ` Bastien Nocera
2017-10-17  9:40         ` Marcin Niestroj
2017-10-19  0:47           ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171019004741.qdnbhkxtkuxnx2uw@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=ao2@ao2.it \
    --cc=devicetree@vger.kernel.org \
    --cc=hadess@hadess.net \
    --cc=linux-input@vger.kernel.org \
    --cc=m.niestroj@grinn-global.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox