From: Lars-Peter Clausen <lars@metafoo.de>
To: Peter Rosin <peda@axentia.se>, linux-kernel@vger.kernel.org
Cc: Wolfram Sang <wsa@the-dreams.de>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Jonathan Corbet <corbet@lwn.net>, Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
linux-iio@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v3 0/7] mux controller abstraction and iio/i2c muxes
Date: Tue, 22 Nov 2016 21:58:12 +0100 [thread overview]
Message-ID: <b132143c-259b-6ed2-58c5-b223cc2e72df@metafoo.de> (raw)
In-Reply-To: <1479734235-18837-1-git-send-email-peda@axentia.se>
On 11/21/2016 02:17 PM, Peter Rosin wrote:
[...]
> I have a piece of hardware that is using the same 3 GPIO pins
> to control four 8-way muxes. Three of them control ADC lines
> to an ADS1015 chip with an iio driver, and the last one
> controls the SDA line of an i2c bus. We have some deployed
> code to handle this, but you do not want to see it or ever
> hear about it. I'm not sure why I even mention it. Anyway,
> the situation has nagged me to no end for quite some time.
>
> So, after first getting more intimate with the i2c muxing code
> and later discovering the drivers/iio/inkern.c file and
> writing a couple of drivers making use of it, I came up with
> what I think is an acceptable solution; add a generic mux
> controller driver (and subsystem) that is shared between all
> instances, and combine that with an iio mux driver and a new
> generic i2c mux driver. The new i2c mux I called "simple"
> since it is only hooking the i2c muxing and the new mux
> controller (much like the alsa simple card driver does for ASoC).
While abstracting this properly is all nice and good and the way it should
be done, but it also adds a lot of complexity and the devicetree adds a lot
of restrictions on what can actually be represented.
There is a certain point where the fabric on a PCB becomes so complex that
it deserves to be a device on its own (like the audio fabric drivers).
Especially when the hardware is built with a certain application in mind and
the driver is supposed to impose policy which reflects this application. The
latter can often not properly be described with the primitives the
devicetree can offer.
And I think your setup is very borderline what can be done in a declarative
way only and it adds a lot of complexity over a more imperative solution in
form of a driver. I think it is worth investigating about having a driver
that is specific to your fabric and handles the interdependencies of the
discrete components.
next prev parent reply other threads:[~2016-11-22 20:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-21 13:17 Peter Rosin
2016-11-21 13:17 ` [PATCH v3 1/7] dt-bindings: document devicetree bindings for mux-controllers and mux-gpio Peter Rosin
2016-11-21 13:17 ` [PATCH v3 2/7] misc: minimal mux subsystem and gpio-based mux controller Peter Rosin
2016-11-21 13:17 ` [PATCH v3 3/7] iio: inkern: api for manipulating ext_info of iio channels Peter Rosin
2016-11-21 13:17 ` [PATCH v3 4/7] dt-bindings: iio: iio-mux: document iio-mux bindings Peter Rosin
2016-11-21 13:17 ` [PATCH v3 5/7] iio: multiplexer: new iio category and iio-mux driver Peter Rosin
2016-11-21 14:33 ` kbuild test robot
2016-11-21 13:17 ` [PATCH v3 6/7] dt-bindings: i2c: i2c-mux-simple: document i2c-mux-simple bindings Peter Rosin
2016-11-21 13:17 ` [PATCH v3 7/7] i2c: i2c-mux-simple: new driver Peter Rosin
2016-11-22 20:58 ` Lars-Peter Clausen [this message]
2016-11-23 11:47 ` [PATCH v3 0/7] mux controller abstraction and iio/i2c muxes Peter Rosin
2016-11-27 12:00 ` Jonathan Cameron
2016-11-29 16:02 ` Peter Rosin
2016-12-03 10:11 ` Jonathan Cameron
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=b132143c-259b-6ed2-58c5-b223cc2e72df@metafoo.de \
--to=lars@metafoo.de \
--cc=arnd@arndb.de \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=peda@axentia.se \
--cc=pmeerw@pmeerw.net \
--cc=robh+dt@kernel.org \
--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
all inboxes | Powered by JetHome®