From: Martyn Welch <martyn.welch@collabora.co.uk>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Johan Hovold <johan@kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: CP2105 GPIO Pins
Date: Thu, 14 Jan 2016 09:52:38 +0000 [thread overview]
Message-ID: <56976FE6.1010209@collabora.co.uk> (raw)
In-Reply-To: <CACRpkdZrADtOetNQ6j8GvHuAkdxYz-q-4JgBY6xDTWK=sK7KmA@mail.gmail.com>
On 14/01/16 09:24, Linus Walleij wrote:
> On Wed, Jan 13, 2016 at 5:10 PM, Martyn Welch
> <martyn.welch@collabora.co.uk> wrote:
>> On 13/01/16 14:58, Linus Walleij wrote:
>>>
>>> (Adding Johan Hovold, serial-usb-maintainer)
>>>
>>> On Fri, Jan 8, 2016 at 12:14 PM, Martyn Welch
>>> <martyn.welch@collabora.co.uk> wrote:
>>>
>>>> I'm working on adding support to the cp210x driver for the optional GPIO
>>>> pins available on Silicon Labs CP2105 USB to serial bridge.
>>>
>>>
>>> Do you have a data sheet?
>>
>> Yes.
>
> So can you share it or is it online somewhere?
>
FWIW, It's online:
https://www.silabs.com/Support%20Documents/TechnicalDocs/CP2105.pdf
Unfortunately it isn't particularly informative when it comes to the
gpio, though they do provide a driver (which uses custom ioctls in the
serial device, ick) and a user space test application that gives a good
idea of how to drive it (well, how to toggle all of the bits
simultaneously anyway).
For the vendor specific stuff, they provide further code to enable the
manufacturing programming which makes use of that. With a little bit of
digging I was able to ascertain what codes were sent to retrieve the
information I required and which bits of the returned value were
important for my use case.
Martyn
>>> I don't get it? Do you mean that the two serial ports will be able on
>>> some serial port pins and then *also* on these extra pins in this
>>> case, or do you mean that this is the only way for the serial
>>> lines to get out of the chip?
>>
>> You loose DTR, DSR, DCD and RI on each serial port when GPIO is enabled on
>> that port. Two of these pins on one port and 3 on the other become GPIO.
>> Both serial ports are still available, but only provide TX, RX, RTS and CTS
>> (which is more than enough for a lot of uses).
>
> OK modem signals go out the window and instead these pins
> are used for GPIO, because noone is using modems any more.
> Makes perfect sense.
>
>>> In any case, multiplexing is really a task for the pin control
>>> framework, if you desire to switch this muxing at runtime.
>>
>> You can't do it at runtime. The choice is programmed into a PROM, typically
>> at manufacture time (OEM, not chip) and can't be reverted.
>
> OK then you should just go with the manufacturing setup
> and you probably do not need pin control at all.
>
>>> OK how do you determine this then?
>>
>> There are some vendor specific USB calls that can be used to determine this.
>
> OK fair enough.
>
>>> Isn't it possible to read/query the PROM about the settings?
>
> And I guess that is what it does.
>
> Looking forward to the patch :)
>
> Yours,
> Linus Walleij
>
prev parent reply other threads:[~2016-01-14 9:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-08 11:14 CP2105 GPIO Pins Martyn Welch
2016-01-13 14:58 ` Linus Walleij
2016-01-13 16:10 ` Martyn Welch
2016-01-14 9:24 ` Linus Walleij
2016-01-14 9:52 ` Martyn Welch [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=56976FE6.1010209@collabora.co.uk \
--to=martyn.welch@collabora.co.uk \
--cc=johan@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@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 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.