mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: <linux-kernel@vger.kernel.org>
Cc: Peter Rosin <peda@axentia.se>,
	Linus Walleij <linus.walleij@linaro.org>,
	Andrey Smirnov <andrew.smirnov@gmail.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	<linux-gpio@vger.kernel.org>
Subject: [PATCH 0/2] pinctrl: sx150x: set multiple pins at once
Date: Tue, 22 Nov 2016 17:06:00 +0100	[thread overview]
Message-ID: <1479830762-1839-1-git-send-email-peda@axentia.se> (raw)

Hi!

I have only tested this on an 8-bit sx1502, so I'm uncertain if
the there needs to be locking for this to work as intended for
the bigger chips with an oscio pin? Probably.

So, I didn't add (or rather, removed) these lines at the end of
sx150x_gpio_set_multiple() and made the op optional instead.

	if (*mask & pctl->oscio_mask)
		sx150x_gpio_oscio_set(pctl, *bits & pctl->oscio_mask);

I mean, what happens if there are two users writing multiple pins
where one of the pins is the oscio pin, and this happens concurrently?
I get the feeling that there is nothing stopping interleaving in that
case, and you could end up with the desired values from user 1 for the
normal pins, and the desired value for the oscio pin from user 2.

But for the easy case (no oscio) where the existing regmap locking
holds, this is a nice speedup and desired behaviour without a lot
of individual pin changes.

Cheers,
Peter

Peter Rosin (2):
  pinctrl: sx150x: various spelling fixes and some white-space cleanup
  pinctrl: sx150x: support setting multiple pins at once

 drivers/pinctrl/pinctrl-sx150x.c | 50 ++++++++++++++++++++++++++++------------
 1 file changed, 35 insertions(+), 15 deletions(-)

-- 
2.1.4

             reply	other threads:[~2016-11-22 16:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 16:06 Peter Rosin [this message]
2016-11-22 16:06 ` [PATCH 1/2] pinctrl: sx150x: various spelling fixes and some white-space cleanup Peter Rosin
2016-11-23  9:13   ` Neil Armstrong
2016-11-22 16:06 ` [PATCH 2/2] pinctrl: sx150x: support setting multiple pins at once Peter Rosin
2016-11-23  9:17   ` Neil Armstrong
2016-11-23  9:20 ` [PATCH 0/2] pinctrl: sx150x: set " Neil Armstrong
2016-11-23  9:39   ` Peter Rosin

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=1479830762-1839-1-git-send-email-peda@axentia.se \
    --to=peda@axentia.se \
    --cc=andrew.smirnov@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=narmstrong@baylibre.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®