All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martyn Welch <martyn.welch@collabora.co.uk>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Johan Hovold <johan@kernel.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Karl Palsson <karlp@tweak.net.au>,
	Konstantin Shkolnyy <Konstantin.Shkolnyy@silabs.com>,
	Peter Senna Tschudin <peter.senna@collabora.com>
Subject: Re: [PATCH v6 1/1] USB: serial: cp210x: Adding GPIO support for CP2105
Date: Fri, 7 Oct 2016 18:02:40 +0100	[thread overview]
Message-ID: <20161007170240.GB355@hermes.home> (raw)
In-Reply-To: <20161007153126.GA355@hermes.home>

On Fri, Oct 07, 2016 at 04:31:26PM +0100, Martyn Welch wrote:
> Also, if an output can only be open-drain, attempting to set the pin as
> push-pull succeeds because gpiolib (currently) assumes that a pin can
> always be p-p and doesn't even check the return value of it's call to
> .set_single_ended:
> 
> 
>                /* Make sure to disable open drain/source hardware, if any */
>                 if (gc->set_single_ended)
>                         gc->set_single_ended(gc,
>                                              gpio_chip_hwgpio(desc),
>                                              LINE_MODE_PUSH_PULL);
> 
> 
> This is clearly a separate issue.
> 

A bit of testing also show that a "open-drain only" output will succeed when
an open-source output driven high is requested. Rather than having a pin
pulled hard to VCC, we have a pin pulled to VCC via a resistor and thus
(if there are other devices connected to the pin pulling to GND via a
resistor, which would kinda stand to reason given the pin is being
configured for open-source mode) we have the signal floating at a voltage
determined by the effect of the two sets of resistors acting as a voltage
divider.

Martyn

  reply	other threads:[~2016-10-07 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23 22:50 [PATCH v6 1/1] USB: serial: cp210x: Adding GPIO support for CP2105 Martyn Welch
2016-10-04 12:13 ` Linus Walleij
2016-10-07 15:31   ` Martyn Welch
2016-10-07 17:02     ` Martyn Welch [this message]
2016-10-10  9:24     ` Linus Walleij

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=20161007170240.GB355@hermes.home \
    --to=martyn.welch@collabora.co.uk \
    --cc=Konstantin.Shkolnyy@silabs.com \
    --cc=gnurou@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=karlp@tweak.net.au \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.senna@collabora.com \
    /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.