All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Davide Hug <d@videhug.ch>,
	linux-hwmon@vger.kernel.org, Jean Delvare <jdelvare@suse.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Grygorii Strashko <grygorii.strashko@ti.com>
Subject: Re: hwmon/sht15: gpio irq problem
Date: Fri, 8 Sep 2017 23:27:57 +0200	[thread overview]
Message-ID: <CACRpkdaUtxLW9JkxuigXqWZ=H5Fin6_ePeLStyTS-qUQxdZ9ng@mail.gmail.com> (raw)
In-Reply-To: <20170907151053.GA15047@roeck-us.net>

On Thu, Sep 7, 2017 at 5:10 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> On Wed, Sep 06, 2017 at 11:50:01PM +0200, Davide Hug wrote:

>>   - Which solution is preferable?
>
> Neither. If the gpio subsystem does not support interrupts on
> bidirectional gpio pins, it sould really refuse to change direction
> on a pin which has an interrupt assigned to it.

I think this needs to be fixed properly in gpio, but I just can't
see the solution.

It's essentially IRQ on an open drain line I think?
(I tried to explain basic open drain concepts in
Documentation/gpio/driver.txt as I understand them.)

Since open drain is a bit "in-between" it should (I guess) be allowed
to have IRQs on them even if they are output for a while,
but then I guess they should be masked/unmasked in the
irqchip part of the driver at the same time.

Maybe part of the problem is simply that the line is not set up as
open drain in the hardware? We have open drain flags for
device trees and board files using the new descriptor
infrastructure.

Davide can you investigate using the opendrain flag when
requesting the line?

Maybe the driver needs to be converted to use GPIO
descriptors first though :/

Also: which GPIO controller is this used with, so I can check
how/if it supports open drain?

Yours,
Linus Walleij

  reply	other threads:[~2017-09-08 21:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06 21:50 hwmon/sht15: gpio irq problem Davide Hug
2017-09-07 15:10 ` Guenter Roeck
2017-09-08 21:27   ` Linus Walleij [this message]
2017-09-08 22:38     ` 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='CACRpkdaUtxLW9JkxuigXqWZ=H5Fin6_ePeLStyTS-qUQxdZ9ng@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=d@videhug.ch \
    --cc=grygorii.strashko@ti.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=tglx@linutronix.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.