All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wang, Kuiying" <kuiying.wang@intel.com>
To: Linus Walleij <linus.walleij@linaro.org>, Joel Stanley <joel@jms.id.au>
Cc: Andrew Jeffery <andrew@aj.id.au>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Andrew Geissler <geissonator@gmail.com>,
	OpenBMC Maillist <openbmc@lists.ozlabs.org>,
	"Mauery, Vernon" <vernon.mauery@intel.com>,
	"Feist, James" <james.feist@intel.com>,
	"Yoo, Jae Hyun" <jae.hyun.yoo@intel.com>,
	"Nguyen, Hai V" <hai.v.nguyen@intel.com>,
	"Khetan, Sharad" <sharad.khetan@intel.com>
Subject: RE: Enable buttons GPIO passthrough
Date: Wed, 16 Jan 2019 14:30:12 +0000	[thread overview]
Message-ID: <959CAFA1E282D14FB901BE9A7BF4E7724E43DAA1@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <CACRpkdazF1GkXcMK3_S_=cmpj086LckjskkDuE9R+FzWPPCmeQ@mail.gmail.com>

Hi Joel,
Do agree to use proposal #1? (extend "passthrough" to the "direction" property of gpio, use  "value" to control it be disabled/enabled.)

All,
Any other comments?

Thanks,
Kwin.


-----Original Message-----
From: Linus Walleij [mailto:linus.walleij@linaro.org] 
Sent: Tuesday, January 15, 2019 8:10 PM
To: Wang, Kuiying <kuiying.wang@intel.com>
Cc: Andrew Jeffery <andrew@aj.id.au>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>; Joel Stanley <joel@jms.id.au>; open list:GPIO SUBSYSTEM <linux-gpio@vger.kernel.org>; Andrew Geissler <geissonator@gmail.com>; OpenBMC Maillist <openbmc@lists.ozlabs.org>; Mauery, Vernon <vernon.mauery@intel.com>; Feist, James <james.feist@intel.com>; Yoo, Jae Hyun <jae.hyun.yoo@intel.com>
Subject: Re: Enable buttons GPIO passthrough

Hi Kwin,

> Based on pinmux to do passthrough is too complex and no reference,

Don't let that discourage you! We are some of the world's most important software engineers in the kernel, and we don't just do the simple stuff, like filling in the blanks guided by previous example, we do the really complicated stuff of inventing the frameworks.

> I have another 2 simple proposals to do button GPIO passthrough as following:
> 1. extend "passthrough" to the "direction" property of gpio, use 
> "value" to control it be disabled/enabled.

This is what I described in my first reply. A .set_config() option.
But it still needs to patch the DT bindings for generic pin config and add a globally uniquie enumerator for this config to pinconf-generic.h since GPIO is reusing these generics, so begin with that in any case.

> 2. extend "value" property of gpio to support the third value "2", 
> which means pass-through is enabled, otherwise passthrough is disabled.

No, sorry, this is the wrong idea.

.set_value() sets the GPIO line as high or low, it is essentially boolean and it is an integer only for historical reasons.

.set_config() is what we use to set up debounce or open drain and such electronic configurations on GPIO lines, and this should be done there, unless Andrew prefers that it is gets done in the pin control driver.

Yours,
Linus Walleij

  reply	other threads:[~2019-01-16 14:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11  8:02 Enable buttons GPIO passthrough Wang, Kuiying
2018-12-13  1:21 ` Joel Stanley
2018-12-24  2:56   ` Wang, Kuiying
2019-01-11  9:01   ` Linus Walleij
2019-01-14  2:59     ` Andrew Jeffery
2019-01-14  8:19       ` Linus Walleij
2019-01-15  7:21         ` Wang, Kuiying
2019-01-15 12:04           ` Linus Walleij
2019-01-15  9:52         ` Wang, Kuiying
2019-01-15 12:09           ` Linus Walleij
2019-01-16 14:30             ` Wang, Kuiying [this message]
2019-01-21 13:09               ` Linus Walleij
2019-01-22 10:39                 ` Wang, Kuiying
2019-01-28 13:25                   ` Linus Walleij
2019-01-31 15:11                     ` Wang, Kuiying
2019-02-08 12:01                       ` Linus Walleij
2019-02-11  4:54                         ` Andrew Jeffery
2019-02-11  8:08                           ` Linus Walleij
2019-02-12  3:04                             ` Wang, Kuiying

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=959CAFA1E282D14FB901BE9A7BF4E7724E43DAA1@shsmsx102.ccr.corp.intel.com \
    --to=kuiying.wang@intel.com \
    --cc=andrew@aj.id.au \
    --cc=geissonator@gmail.com \
    --cc=hai.v.nguyen@intel.com \
    --cc=jae.hyun.yoo@intel.com \
    --cc=james.feist@intel.com \
    --cc=joel@jms.id.au \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=sharad.khetan@intel.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vernon.mauery@intel.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.