All of lore.kernel.org
 help / color / mirror / Atom feed
From: rishi gupta <gupt21@gmail.com>
To: Jiri Kosina <jikos@kernel.org>,
	Tobias Junghans <tobias.junghans@inhub.de>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	gavin@matician.com
Cc: "open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
	Ezio Melotti <ezio.melotti@gmail.com>
Subject: Re: [PATCH 1/2] HID: mcp2221: enable HID I/O during probe
Date: Wed, 6 Apr 2022 08:54:19 -0700	[thread overview]
Message-ID: <CALUj-gt6m=oJY4N8D5Mr7pHU0CDz9SzTwLbJkry3XQKr0+sg6A@mail.gmail.com> (raw)
In-Reply-To: <20210818152743.163929-1-tobias.junghans@inhub.de>

Thanks Tobias for the patch!

Reviewed-by: Rishi Gupta <gupt21@gmail.com>


On Wed, Aug 18, 2021 at 8:28 AM Tobias Junghans
<tobias.junghans@inhub.de> wrote:
>
> devm_gpiochip_add_data() calls the gpio_chip->get_direction handler
> for each line, resulting in device I/O in mcp_gpio_get_direction().
> However unless hid_device_io_start() is called, mcp2221_raw_event()
> is not called during probe, causing mcp_gpio_get_direction() to time
> out. This fixes that probing takes 12 seconds to complete.
>
> Signed-off-by: Tobias Junghans <tobias.junghans@inhub.de>
> ---
>  drivers/hid/hid-mcp2221.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c
> index 4211b9839209..8e54173b195c 100644
> --- a/drivers/hid/hid-mcp2221.c
> +++ b/drivers/hid/hid-mcp2221.c
> @@ -895,7 +895,10 @@ static int mcp2221_probe(struct hid_device *hdev,
>         mcp->gc->can_sleep = 1;
>         mcp->gc->parent = &hdev->dev;
>
> +       hid_device_io_start(hdev);
>         ret = devm_gpiochip_add_data(&hdev->dev, mcp->gc, mcp);
> +       hid_device_io_stop(hdev);
> +
>         if (ret)
>                 goto err_gc;
>
> --
> 2.25.1
>

      parent reply	other threads:[~2022-04-06 17:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 15:27 [PATCH 1/2] HID: mcp2221: enable HID I/O during probe Tobias Junghans
2021-08-18 15:27 ` [PATCH 2/2] HID: mcp2221: configure GP pins for GPIO function Tobias Junghans
     [not found]   ` <CALUj-gtmN70HwzvtsO7rss0LXboFC0h9Dgfakt6UEvC_6FdAwA@mail.gmail.com>
2021-08-20  7:18     ` Tobias Junghans
2021-08-30  9:11       ` rishi gupta
2021-08-30 13:09         ` Tobias Junghans
2021-08-30 13:17           ` rishi gupta
2021-08-30 13:30             ` Tobias Junghans
2021-09-02  7:13               ` rishi gupta
2021-09-16 23:13   ` Linus Walleij
2021-09-19 10:42     ` rishi gupta
2021-09-24 17:36       ` Jim Posen
2022-04-06 15:54 ` rishi gupta [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='CALUj-gt6m=oJY4N8D5Mr7pHU0CDz9SzTwLbJkry3XQKr0+sg6A@mail.gmail.com' \
    --to=gupt21@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=ezio.melotti@gmail.com \
    --cc=gavin@matician.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=tobias.junghans@inhub.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.