U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/6] dm: core: Allow multiple drivers to bind for a single node
Date: Mon, 20 Mar 2017 08:08:34 +0100	[thread overview]
Message-ID: <20170320070834.2p2z7b5nlmmb25wn@lukather> (raw)
In-Reply-To: <CAPnjgZ2ud8pWPYmvadF5AXZfsBeFWn0VA8ZopngPigs02dRw3w@mail.gmail.com>

On Sun, Mar 12, 2017 at 02:21:35PM -0600, Simon Glass wrote:
> Hi,
> 
> On 3 March 2017 at 03:52, Dr. Philipp Tomsich
> <philipp.tomsich@theobroma-systems.com> wrote:
> > Hi Simon,
> >
> > On 03 Mar 2017, at 05:52, Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Philipp,
> >
> > On 22 February 2017 at 13:47, Philipp Tomsich
> > <philipp.tomsich@theobroma-systems.com> wrote:
> >
> > Currently, driver binding stops once it encounters the first
> > compatible driver that doesn't refuse to bind. However, there are
> > cases where a single node will need to be handled by multiple driver
> > classes. For those cases we provide a configurable option to continue
> > to bind after the first driver has been found.
> >
> > The first use cases for this are from the DM conversion of the sunxi
> > (Allwinner) architecture:
> > * pinctrl (UCLASS_PINCTRL) and gpio (UCLASS_GPIO) drivers need to
> >   bind against a single node
> > * clock (UCLASS_CLK) and reset (UCLASS_RESET) drivers also need to
> >   bind against a single node
> >
> >
> > Does linux work this way? Another approach would be to have a separate
> > MISC driver with two children, one pinctrl, one clk.
> >
> >
> > The linux CLK driver creates and registers a reset-controller; the PINCTRL
> > driver
> > does the same with the gpio-controller. Similar code to do this is easily
> > possible in
> > U-Boot … see sunxi_pctrl_bind_gpio(…) in [PATCH v2 1/6] of this series.
> >
> > However, binding multiple times makes for much simpler code and allows to
> > keep
> > driver data in separate drivers.
> 
> My question was more whether Linux registers multiple drivers with one
> device node. It's just not something I expected.

It does, but it's not really what we're doing in the linux driver. It
has one driver, with one device, but registering into multiple
frameworks.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170320/13f2e446/attachment.sig>

  parent reply	other threads:[~2017-03-20  7:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22 20:47 [U-Boot] [PATCH v2 0/6] sunxi: DM pinctrl implementation Philipp Tomsich
2017-02-22 20:47 ` [U-Boot] [PATCH v2 1/6] sunxi: add pinctrl (UCLASS_PINCTRL) support for sunxi Philipp Tomsich
2017-02-22 23:18   ` Maxime Ripard
2017-02-23  3:54     ` Chen-Yu Tsai
2017-02-23 18:10       ` Maxime Ripard
2017-02-22 20:47 ` [U-Boot] [PATCH v2 2/6] dm: core: Allow multiple drivers to bind for a single node Philipp Tomsich
2017-03-03  4:52   ` Simon Glass
2017-03-03 10:52     ` Dr. Philipp Tomsich
2017-03-12 20:21       ` Simon Glass
2017-03-13  8:40         ` Heiko Stübner
2017-03-20  7:08         ` Maxime Ripard [this message]
2017-03-22 13:05           ` Simon Glass
2017-02-22 20:47 ` [U-Boot] [PATCH v2 3/6] sunxi: CONFIG_DM_ALLOW_MULTIPLE_DRIVERS for gpio/pinctrl binding Philipp Tomsich
2017-02-22 20:47 ` [U-Boot] [PATCH v2 4/6] defconfig: lynx: enable CONFIG_DM_ALLOW_MULTIPLE_DRIVERS Philipp Tomsich
2017-02-22 23:19   ` Maxime Ripard
2017-02-22 20:47 ` [U-Boot] [PATCH v2 5/6] sun50i: dts: add r_pio node and pinconfig entries into r_pio and pio Philipp Tomsich
2017-02-22 20:47 ` [U-Boot] [PATCH v2 6/6] sun50i: dts: update DTS to avoid warnings Philipp Tomsich
2017-02-22 23:20   ` Maxime Ripard
2017-02-22 23:24     ` Dr. Philipp Tomsich

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=20170320070834.2p2z7b5nlmmb25wn@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=u-boot@lists.denx.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