From: Jiri Kosina <jkosina@suse.cz>
To: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Cc: Antonio Borneo <borneo.antonio@gmail.com>,
linux-input <linux-input@vger.kernel.org>,
David Barksdale <dbarksdale@uplogix.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] HID: cp2112: fix gpio value in gpio_direction_output
Date: Mon, 7 Jul 2014 17:07:59 +0200 (CEST) [thread overview]
Message-ID: <alpine.LNX.2.00.1407071707490.1655@pobox.suse.cz> (raw)
In-Reply-To: <CAN+gG=GM9FqZJwJF0G41E9oWEjcWDeavd=kfZ9qcXvoAkmUdpA@mail.gmail.com>
On Mon, 7 Jul 2014, Benjamin Tissoires wrote:
> > CP2112 does not offer an atomic method to set both gpio
> > direction and value.
> > Also it does not permit to set gpio value before putting
> > gpio in output. In fact, accordingly to Silicon Labs
> > AN495, Rev. 0.2, cpt. 4.4, the HID report to set gpio
> > values "does not affect any pins that are not configured
> > as outputs".
> >
> > This is confirmed on evaluation board CP2112-EK.
> > With current driver, after execute:
> > echo in > /sys/class/gpio/gpio248/direction
> > echo low > /sys/class/gpio/gpio248/direction
> > gpio output is still high. Only after a following
> > echo low > /sys/class/gpio/gpio248/direction
> > gpio output gets low.
> >
> > Fix driver by changing order of operations; first set
> > direction then set value.
> >
> > The drawback of this new sequence is that we can have
> > a pulse on gpio pin when direction is changed from
> > input to output-low, but this cannot be avoided on
> > current CP2112.
>
> In this case, does keeping the first cp2112_gpio_set() before setting
> the output direction prevents the pulse?
> If so, then you can just keep the current code, and simply add the
> cp2112_gpio_set() at the end of cp2112_gpio_direction_output().
>
> In both case, this is:
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
I am queuing this for 3.17, thanks.
--
Jiri Kosina
SUSE Labs
next prev parent reply other threads:[~2014-07-07 15:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-29 6:13 [PATCH] HID: cp2112: fix gpio value in gpio_direction_output Antonio Borneo
2014-07-07 14:03 ` Benjamin Tissoires
2014-07-07 15:07 ` Jiri Kosina [this message]
2014-07-07 16:01 ` Antonio Borneo
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=alpine.LNX.2.00.1407071707490.1655@pobox.suse.cz \
--to=jkosina@suse.cz \
--cc=benjamin.tissoires@gmail.com \
--cc=borneo.antonio@gmail.com \
--cc=dbarksdale@uplogix.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.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