linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anshul Dalal <anshulusr@gmail.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH 2/2] input: add Adafruit Seesaw Gamepad driver
Date: Sat, 7 Oct 2023 21:43:03 +0530	[thread overview]
Message-ID: <2281f924-30d1-41c5-b105-d8d28aada5b2@gmail.com> (raw)
In-Reply-To: <a49deeb6-728c-4527-8399-57c52214e1d3@linaro.org>

Hello Krzysztof,
Thank you very much for the review, I am planning to address the changes
in my next patch series though I had a question.

On 10/7/23 20:26, Krzysztof Kozlowski wrote:
> On 07/10/2023 16:40, Anshul Dalal wrote:
>> +
>> +static int seesaw_probe(struct i2c_client *client)
>> +{
>> +	int err;
>> +	struct seesaw_gamepad *private;
>> +	unsigned char register_reset[] = { SEESAW_STATUS_BASE,
>> +					   SEESAW_STATUS_SWRST, 0xFF };
>> +	unsigned char get_hw_id[] = { SEESAW_STATUS_BASE, SEESAW_STATUS_HW_ID };
>> +
>> +	err = i2c_master_send(client, register_reset, sizeof(register_reset));
>> +	if (err < 0)
>> +		return err;
>> +	if (err != sizeof(register_reset))
>> +		return -EIO;
>> +	mdelay(10);
> 
> Why 10? This should be explained somehow in the code.

The reason for the delay is to ensure the register reset process is
finished before going further. The reference Arduino driver from the
manufacturer also had a delay for the same amount though my hardware
unit worked fine till 5ms delay. Is there some kernel abstraction I
could use to indicate a short delay or will the previous explanation in
a comment above the line do?

Best wishes,
Anshul

  reply	other threads:[~2023-10-07 16:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-07 14:40 [PATCH 1/2] dt-bindings: Add bindings for Adafruit Seesaw Gamepad Anshul Dalal
2023-10-07 14:40 ` [PATCH 2/2] input: add Adafruit Seesaw Gamepad driver Anshul Dalal
2023-10-07 14:56   ` Krzysztof Kozlowski
2023-10-07 16:13     ` Anshul Dalal [this message]
2023-10-08 10:25       ` Krzysztof Kozlowski
2023-10-07 14:52 ` [PATCH 1/2] dt-bindings: Add bindings for Adafruit Seesaw Gamepad Krzysztof Kozlowski
2023-10-07 15:23 ` Rob Herring

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=2281f924-30d1-41c5-b105-d8d28aada5b2@gmail.com \
    --to=anshulusr@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=robh+dt@kernel.org \
    --cc=skhan@linuxfoundation.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).