All of lore.kernel.org
 help / color / mirror / Atom feed
From: stigge@antcom.de (Roland Stigge)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/6 v14] gpio: Add block gpio to several gpio drivers
Date: Sun, 27 Jan 2013 14:48:46 +0100	[thread overview]
Message-ID: <5105303E.5050007@antcom.de> (raw)
In-Reply-To: <CAOY=C6F0ExS1gtmA=4QMzXUMRjAH5o7K9KDwTjdU-dYHA1fF=g@mail.gmail.com>

On 27/01/13 13:18, Stijn Devriendt wrote:
>>> In my patch, I go out of the way of this kind of thing for a simple reason:
>>> You may generate incorrect timing by doing this.
>>
>> You are right, certain things like synchronous on+off is not really
>> possible.
>>
>> However, the above at least supports switching on simulaneously, and
>> switching off simultaneously, which is an improvement in certain cases
>> (and this certain hardware part doesn't support more). Maybe this
>> certain driver behaviour can be documented even better than just in the
>> driver source.
>>
> 
> The question here is: do you expect a user of the block-GPIO API to
> go look into the base-driver code to see what will be supported?
> 
> In my version of the patch this means:
> - do not provide a single GPIO-block that crosses multiple base-drivers
> - only provide gpio_block_get/set for GPIO drivers that support the complete
> operation in a single go. (for example, in the above example there would be
> no gpio_block_set() function)
> 
> Perhaps the best approach is to make this explicit: Allow drivers to expose
> their capabilities wrt timing and allow users to request strict-timing or
> loose-timing. Loose-timing allows multiple gpio-drivers to be combined and
> allows drivers with separate set/clear, hi/lo registers to be used.

Interesting idea. However, it will be difficult to agree on good metrics
here. As Mark Brown pointed out, even when hardware seems to support
"simultaneousness" by registers, this doesn't actually mean that voltage
levels are switched simultaneously wrt. sub-nanosecond timing.

Also, it depends on further wiring between the actually supported GPIO
hardware chip and the integrated device's I/O connections.

Resulting in scenarios where GPIO chips (in terms of Linux drivers)
without explicit I/O set registers (e.g., set/clear regs) could be "more
simultaneous" than those having explicit I/O regs but hardware wiring
leading to bad "simultaneousness" behaviour.

Questionable if the kernel could address those details.

> Of course, for a first version you may as well leave it out. Perhaps the
> use-cases for cross-GPIO-driver blocks are not worth the extra complexity
> as of today?

I actually started the current block gpio patches to support this kind
of use case. :-)

Roland

WARNING: multiple messages have this Message-ID (diff)
From: Roland Stigge <stigge@antcom.de>
To: Stijn Devriendt <highguy@gmail.com>
Cc: gregkh@linuxfoundation.org, grant.likely@secretlab.ca,
	linus.walleij@linaro.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, w.sang@pengutronix.de,
	jbe@pengutronix.de, plagnioj@jcrosoft.com,
	broonie@opensource.wolfsonmicro.com, daniel-gl@gmx.net,
	rmallon@gmail.com, sr@denx.de, wg@grandegger.com,
	mark.rutland@arm.com, nicolas.ferre@atmel.com
Subject: Re: [PATCH 6/6 v14] gpio: Add block gpio to several gpio drivers
Date: Sun, 27 Jan 2013 14:48:46 +0100	[thread overview]
Message-ID: <5105303E.5050007@antcom.de> (raw)
In-Reply-To: <CAOY=C6F0ExS1gtmA=4QMzXUMRjAH5o7K9KDwTjdU-dYHA1fF=g@mail.gmail.com>

On 27/01/13 13:18, Stijn Devriendt wrote:
>>> In my patch, I go out of the way of this kind of thing for a simple reason:
>>> You may generate incorrect timing by doing this.
>>
>> You are right, certain things like synchronous on+off is not really
>> possible.
>>
>> However, the above at least supports switching on simulaneously, and
>> switching off simultaneously, which is an improvement in certain cases
>> (and this certain hardware part doesn't support more). Maybe this
>> certain driver behaviour can be documented even better than just in the
>> driver source.
>>
> 
> The question here is: do you expect a user of the block-GPIO API to
> go look into the base-driver code to see what will be supported?
> 
> In my version of the patch this means:
> - do not provide a single GPIO-block that crosses multiple base-drivers
> - only provide gpio_block_get/set for GPIO drivers that support the complete
> operation in a single go. (for example, in the above example there would be
> no gpio_block_set() function)
> 
> Perhaps the best approach is to make this explicit: Allow drivers to expose
> their capabilities wrt timing and allow users to request strict-timing or
> loose-timing. Loose-timing allows multiple gpio-drivers to be combined and
> allows drivers with separate set/clear, hi/lo registers to be used.

Interesting idea. However, it will be difficult to agree on good metrics
here. As Mark Brown pointed out, even when hardware seems to support
"simultaneousness" by registers, this doesn't actually mean that voltage
levels are switched simultaneously wrt. sub-nanosecond timing.

Also, it depends on further wiring between the actually supported GPIO
hardware chip and the integrated device's I/O connections.

Resulting in scenarios where GPIO chips (in terms of Linux drivers)
without explicit I/O set registers (e.g., set/clear regs) could be "more
simultaneous" than those having explicit I/O regs but hardware wiring
leading to bad "simultaneousness" behaviour.

Questionable if the kernel could address those details.

> Of course, for a first version you may as well leave it out. Perhaps the
> use-cases for cross-GPIO-driver blocks are not worth the extra complexity
> as of today?

I actually started the current block gpio patches to support this kind
of use case. :-)

Roland

  reply	other threads:[~2013-01-27 13:48 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 12:06 [PATCH 0/6 v14] gpio: Add block GPIO Roland Stigge
2013-01-22 12:06 ` Roland Stigge
2013-01-22 12:06 ` [PATCH 1/6 v14] gpio: Add a block GPIO API to gpiolib Roland Stigge
2013-01-22 12:06   ` Roland Stigge
2013-01-27 13:19   ` Stijn Devriendt
2013-01-27 13:19     ` Stijn Devriendt
2013-01-27 13:58     ` Roland Stigge
2013-01-27 13:58       ` Roland Stigge
2013-01-28 11:30       ` Stijn Devriendt
2013-01-28 11:30         ` Stijn Devriendt
2013-01-31 20:56         ` Linus Walleij
2013-01-31 20:56           ` Linus Walleij
2013-01-22 12:06 ` [PATCH 2/6 v14] gpio: Add sysfs support to block GPIO API Roland Stigge
2013-01-22 12:06   ` Roland Stigge
2013-01-22 12:06 ` [PATCH 3/6 v14] gpio: Add userland device interface to block GPIO Roland Stigge
2013-01-22 12:06   ` Roland Stigge
2013-01-23  1:03   ` Jonathan Corbet
2013-01-23  1:03     ` Jonathan Corbet
2013-01-23 18:47     ` Roland Stigge
2013-01-23 18:47       ` Roland Stigge
2013-01-24  9:13   ` Alexander Stein
2013-01-24  9:13     ` Alexander Stein
2013-01-22 12:06 ` [PATCH 4/6 v14] gpiolib: Fix default attributes for class Roland Stigge
2013-01-22 12:06   ` Roland Stigge
2013-01-22 12:06 ` [PATCH 5/6 v14] gpio: Add device tree support to block GPIO API Roland Stigge
2013-01-22 12:06   ` Roland Stigge
2013-01-27 13:07   ` Stijn Devriendt
2013-01-27 13:07     ` Stijn Devriendt
2013-01-27 14:29     ` Roland Stigge
2013-01-27 14:29       ` Roland Stigge
2013-01-28 11:39       ` Stijn Devriendt
2013-01-28 11:39         ` Stijn Devriendt
2013-01-28 12:29         ` Roland Stigge
2013-01-28 12:29           ` Roland Stigge
2013-01-22 12:06 ` [PATCH 6/6 v14] gpio: Add block gpio to several gpio drivers Roland Stigge
2013-01-22 12:06   ` Roland Stigge
2013-01-24 12:02   ` Stijn Devriendt
2013-01-24 12:02     ` Stijn Devriendt
2013-01-24 12:17     ` Mark Brown
2013-01-24 12:17       ` Mark Brown
2013-01-24 12:19     ` Roland Stigge
2013-01-24 12:19       ` Roland Stigge
2013-01-27 12:18       ` Stijn Devriendt
2013-01-27 12:18         ` Stijn Devriendt
2013-01-27 13:48         ` Roland Stigge [this message]
2013-01-27 13:48           ` Roland Stigge
2013-01-28 11:27           ` Stijn Devriendt
2013-01-28 11:27             ` Stijn Devriendt

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=5105303E.5050007@antcom.de \
    --to=stigge@antcom.de \
    --cc=linux-arm-kernel@lists.infradead.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.