From: Linus Walleij <linus.walleij@linaro.org>
To: Peter Rosin <peda@axentia.se>
Cc: Alexandre Courbot <gnurou@gmail.com>,
Wolfram Sang <wsa-dev@sang-engineering.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Peter Korsgaard <peter.korsgaard@barco.com>,
Wolfram Sang <wsa@the-dreams.de>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: Getting at gpio- and pinctrl-devices as a consumer
Date: Fri, 25 Nov 2016 14:39:14 +0100 [thread overview]
Message-ID: <CACRpkdbRiT9ZqG23ewTHBDRdHT=1E2ei1qoLUOGr_jd47MNvog@mail.gmail.com> (raw)
In-Reply-To: <45787444-a237-7363-5f03-0cd207cb82c2@axentia.se>
On Fri, Nov 25, 2016 at 10:24 AM, Peter Rosin <peda@axentia.se> wrote:
>[Me]
>> struct device *gpiod_get_backing_device(struct gpio_desc *d);
>>
>> Is simple but is it really what you want?
>
> Well, my first attempt was to simply have a property in the
> devicetree stating that the mux was controlled from the same
> i2c bus it was muxing, but that was shot down because it
> should be possible to deduce this from the implementation (or
> something of that meaning, it was a while ago), which to me
> meant examining the "struct device"-tree.
The problem goes into any subsystem providing resources for
a mux in this case, generally for example it is not OK for a
device to runtime suspend or shut down its regulator or turn off
its clock if it is acting as a mux. GPIO and pin control just happens
to be two resource in this specific case.
> For the gpio_desc it is easy. However, it is worse for the
> pinctrl case.
It is annoying to do this in a sense, because it starts to kill
the abstraction we have created exactly in order to avoid
consumers having to worry much about their providers
internals. No we are opening the can and letting the stuff
out all over the place.
Have you looked into the discussion about device dependencies
in general? Isn't this problem mappable as a subset of that?
This was discussed at length at the last kernel summit:
https://lwn.net/Articles/705852/
See especially Rafael's commit
9ed9895370aedd6032af2a9181c62c394d08223b
to driver core in linux-next
Yours,
Linus Walleij
next prev parent reply other threads:[~2016-11-25 13:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 13:33 [PATCH v2] i2c: i2c-mux-gpio: update mux with gpiod_set_array_value_cansleep Peter Rosin
2016-11-24 15:14 ` Wolfram Sang
2016-11-24 15:45 ` Peter Rosin
2016-11-24 19:52 ` Wolfram Sang
2016-11-24 21:35 ` Getting at gpio- and pinctrl-devices as a consumer Peter Rosin
2016-11-24 23:29 ` Linus Walleij
2016-11-25 9:24 ` Peter Rosin
2016-11-25 13:39 ` Linus Walleij [this message]
2016-11-25 16:19 ` 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='CACRpkdbRiT9ZqG23ewTHBDRdHT=1E2ei1qoLUOGr_jd47MNvog@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=gnurou@gmail.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peda@axentia.se \
--cc=peter.korsgaard@barco.com \
--cc=wsa-dev@sang-engineering.com \
--cc=wsa@the-dreams.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 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).