From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jeff LaBundy <jeff@labundy.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 v8 2/2] input: touchscreen: Add support for Azoteq IQS550/572/525
Date: Sun, 28 Apr 2019 10:31:36 -0700 [thread overview]
Message-ID: <20190428173136.GA44908@dtor-ws> (raw)
In-Reply-To: <1554613272-10757-2-git-send-email-jeff@labundy.com>
Hi Jeff,
On Sun, Apr 07, 2019 at 12:01:12AM -0500, Jeff LaBundy wrote:
> +static void iqs5xx_reset(struct i2c_client *client)
> +{
> + struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client);
> +
> + gpiod_set_value_cansleep(iqs5xx->reset_gpio, 0);
> + usleep_range(200, 300);
> +
> + gpiod_set_value_cansleep(iqs5xx->reset_gpio, 1);
I believe we need to switch these statements around:
gpiod_set_value_cansleep(iqs5xx->reset_gpio, 1);
usleep_range(200, 300);
gpiod_set_value_cansleep(iqs5xx->reset_gpio, 0);
so that you activate reset line, wait, and then release it. GPIOD deals
with logical signals, with 1 being active and 0 beig inactive. If reset
line is active low (it typically us) then it shoudl be described as such
in DTS and then gpiod API will take care of converting "1" logical
active to "0" actual value being output.
> +
> +static irqreturn_t iqs5xx_irq(int irq, void *data)
> +{
> + struct iqs5xx_private *iqs5xx = (struct iqs5xx_private *)data;
> + struct iqs5xx_touch_data *touch_data;
> + struct i2c_client *client = iqs5xx->client;
> + struct input_dev *input = iqs5xx->input;
> + int error, i;
> + u8 buf[sizeof(*touch_data) * IQS5XX_NUM_CONTACTS];
Given that iqs5xx_touch_data is packed, can't we do
struct iqs5xx_touch_data touch_data[IQS5XX_NUM_CONTACTS];
instead?
No need to resubmit if you agree, I can make changes on my side before
applying.
I also noticed that you are overusing ARRAY_SIZE(): in several cases you
used it instead of sizeof() for supplying size of a buffer to transfer
functions. While the result will not change, from logical POW you are
not interested in number of elements in an array there, you want the
total size of data structure that just happens to be an array.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2019-04-28 17:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-07 5:01 [PATCH v8 1/2] dt-bindings: input: touchscreen: iqs5xx: Add bindings Jeff LaBundy
2019-04-07 5:01 ` [PATCH v8 2/2] input: touchscreen: Add support for Azoteq IQS550/572/525 Jeff LaBundy
2019-04-26 0:08 ` Jeff LaBundy
2019-04-28 17:31 ` Dmitry Torokhov [this message]
2019-04-28 22:15 ` Jeff LaBundy
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=20190428173136.GA44908@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=jeff@labundy.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).