devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff LaBundy <jeff@labundy.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: devicetree@vger.kernel.org, linux-input@vger.kernel.org,
	rydberg@bitmath.org, robh+dt@kernel.org, mark.rutland@arm.com
Subject: Re: [PATCH v6 2/2] input: touchscreen: Add support for Azoteq IQS550/572/525
Date: Mon, 18 Feb 2019 20:05:49 -0600	[thread overview]
Message-ID: <20190219020549.GA2531@labundy.com> (raw)
In-Reply-To: <20190218064054.GA242714@dtor-ws>

Hi Dmitry,

Many thanks for your kind review. All of your comments sound great
to me; would just like to provide some background behind the first
one before spinning a v7 (comments below).

On Sun, Feb 17, 2019 at 10:40:54PM -0800, Dmitry Torokhov wrote:
> Hi Jeff,
> 
> On Sun, Feb 10, 2019 at 04:39:54PM -0600, Jeff LaBundy wrote:
> > This patch adds support for the Azoteq IQS550/572/525 family of
> > trackpad/touchscreen controllers.
> > 
> > The driver has been tested with an IQS550EV02 evaluation board. A
> > demonstration of the driver's capabilities is available here:
> > 
> > https://youtu.be/sRNNx4XZBts
> 
> A few comments:
> 
> - we have request_ihex_firmware that requests and validates biary
>   representation of ihex into the kernel. There is not really a good
>   reason to parse text ihex in kernel.
>   There is idex2bin in ./firmware to convert it.

Agreed on all counts; using request_ihex_firmware was my original
intent. However the vendor's ihex format is slightly nonstandard in
that the checksum field is not calculated for every record, and the
EOF record contains a nonzero address (0xFFFF), both of which cause
ihex2bin to produce an error.

This means the vendor's firmware would have to be passed through a
second (custom) fixup tool before being converted yet again with
ihex2bin. Therefore I (reluctantly) made the decision to handle the
vendor's semi-custom ihex format in the driver directly.

If that's a deal breaker, I'm happy to adopt request_ihex_firmware
and contact the vendor to suggest that their configuration tool is
updated to export true ihex files. However, there is no guarantee
as to when/if that would happen, and it seems I would need to offer
said fixup tool in the meantime (which I can certainly do).

Let me know if that background changes your mind, or if you would
still like to see this changed (either way works for me).

> - I would recommend against doing this whole business of automatic
>   uprevving and updating firmware on probe. The controller mees to have
>   persistent firmware, so just check whether the device comes up in
>   bootloader or normal mode, and if it is in bootloader mode simply
>   forego creating and registering input device and wait for the
>   userspace to update firmware ad fix it up.
>   Not having to deal with firmware on probe will also allow compiling
>   the driver into the kernel (vs being a module) as firmware loading is
>   not normally available until after root filesystem is mounted.

Agreed on all counts; I like that idea much better.

> - firmware update is usually keyed off device model, not DT name.

Agreed; I wasn't sold on my original method.

My new plan is to let user space specify the name of the firmware, as
the vendor's configuration tool appends some customer-specific revision
information to the exported file's name that customers may opt to keep.

> > +static int iqs5xx_read_burst(struct i2c_client *client,
> > +				u16 reg, u8 *val8, u8 len)
> 
> If you make val8 void * you won't need to cast.

Thanks for the tip; will do.

> > +
> > +static int iqs5xx_write_burst(struct i2c_client *client,
> > +				u16 reg, u8 *val8, u8 len)
> 
> const void *.

Thanks for the tip; will do.

> > +	error = devm_request_threaded_irq(&client->dev, client->irq,
> > +			NULL, iqs5xx_irq,
> > +			IRQF_ONESHOT | IRQF_TRIGGER_RISING,
> 
> Please do not specify IRQ trigger, let it come from device tree, so only
> use IRQF_ONESHOT.

Agreed; will do.

> By the way, I'd recommend using level interrupts so you never miss the
> edge.

Sounds good; I will update the example in the bindings doc to reflect.

> Thanks.
> 
> -- 
> Dmitry
> 

  reply	other threads:[~2019-02-19  2:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-10 22:39 [PATCH v6 1/2] dt-bindings: input: touchscreen: iqs5xx: Add bindings Jeff LaBundy
2019-02-10 22:39 ` [PATCH v6 2/2] input: touchscreen: Add support for Azoteq IQS550/572/525 Jeff LaBundy
2019-02-18  6:40   ` Dmitry Torokhov
2019-02-19  2:05     ` Jeff LaBundy [this message]
2019-02-19  8:13       ` Dmitry Torokhov

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=20190219020549.GA2531@labundy.com \
    --to=jeff@labundy.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rydberg@bitmath.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;
as well as URLs for NNTP newsgroup(s).