linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>
Subject: Re: Single gpio shared by LED and switch?
Date: Wed, 9 Sep 2015 09:35:07 +0200	[thread overview]
Message-ID: <CAMuHMdUkhWCURDKnpoArerLUEsfUsS2U00tus4uuFvDjA1cRPA@mail.gmail.com> (raw)
In-Reply-To: <55EFDEE7.20201@samsung.com>

Hi Jacek,

On Wed, Sep 9, 2015 at 9:25 AM, Jacek Anaszewski
<j.anaszewski@samsung.com> wrote:
> On 09/08/2015 04:37 PM, Linus Walleij wrote:
>> On Tue, Sep 8, 2015 at 12:51 PM, Jacek Anaszewski
>> <j.anaszewski@samsung.com> wrote:
>>> On 09/07/2015 03:22 PM, Geert Uytterhoeven wrote:
>>>> Something like this?
>>>>
>>>>                        VCC         VCC
>>>>                         |           |
>>>>                         R           R
>>>>                         |           |
>>>>                 __|__   |           |
>>>>             +---o   o---+          _|_
>>>>             |           |          \ /
>>>>             |           |          ---
>>>>            GND          R           |
>>>>                         |           |
>>>>                         |         |-+
>>>>                         |         |<+
>>>> GPIO -----------------+---------|-|
>>>>                                     |
>>>>                                     |
>>>>                                    GND
>>>
>>> You would need also resistor to avoid short-circuit
>>> when the switch is on.
>>
>> There is a resistor AFAICT.
>
> Indeed. For some reason my mind filtered out these 'R'
> characters.

Sorry for the bad drawing, which is a simplified extract from the real
schematic diagram.

>> But consider the GPIO side which is opaque
>> here. When used as input it is often high impedance
>> but when used to drive it is not.
>>
>> Doesn't this mean the output actually has to be
>> open collector (open drain)?

I think the GPIO is just a standard push-pull output in output mode.

> I think that GPIO control register would have to be
> altered to switch between particular modes.
>
> Let's analyze possible modes, assuming that the transistor
> is a bipolar PNP:

Actually it's an N-channel MOSFET.

>>> We'd have to ask Linus if he welcomes drivers for this type
>>> of home-made circuits in mainline. If yes, then probably someone would
>>> have to build the circuit, develop and test the driver on it, and
>>> finally come up with a detailed documentation.
>>> Are you the volunteer? :)
>>
>> Of course he's considering it or he wouldn't write :)

This is not a home-made circuit.
Let's see how it goes when the hardware arrives...

Thanks, now I know no driver exists yet.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

      reply	other threads:[~2015-09-09  7:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 17:00 Single gpio shared by LED and switch? Geert Uytterhoeven
2015-09-07 13:03 ` Jacek Anaszewski
2015-09-07 13:22   ` Geert Uytterhoeven
2015-09-08 10:51     ` Jacek Anaszewski
2015-09-08 14:37       ` Linus Walleij
2015-09-09  7:25         ` Jacek Anaszewski
2015-09-09  7:35           ` Geert Uytterhoeven [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=CAMuHMdUkhWCURDKnpoArerLUEsfUsS2U00tus4uuFvDjA1cRPA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=j.anaszewski@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-leds@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;
as well as URLs for NNTP newsgroup(s).