All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arend van Spriel <arend@broadcom.com>
To: Olof Johansson <olof@lixom.net>
Cc: Mark Brown <broonie@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Tomasz Figa <tomasz.figa@gmail.com>, Chen-Yu Tsai <wens@csie.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Chris Ball <chris@printf.net>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	devicetree <devicetree@vger.kernel.org>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Fabio Estevam <festevam@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
	Jyri Sarha <jsarha@ti.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: RFC: representing sdio devices oob interrupt, clks, etc. in device tree
Date: Tue, 27 May 2014 22:27:43 +0200	[thread overview]
Message-ID: <5384F53F.4020408@broadcom.com> (raw)
In-Reply-To: <20140527185535.GB27420@quad.lixom.net>

On 05/27/14 20:55, Olof Johansson wrote:
> On Tue, May 27, 2014 at 06:53:26PM +0100, Mark Brown wrote:
>> On Tue, May 27, 2014 at 03:50:33PM +0200, Ulf Hansson wrote:
>>
>>> To describe the HW in DT, the embedded SDIO card (actually it could be
>>> any type of embedded card) shall be modelled as a child node to the
>>> mmc host in DT. Similar to what you have proposed, but with the
>>> difference that the child node _must_ contain a DT compatible string,
>>> which means a "powerup-driver" can be probed.
>>
>>> Yes, I understand we might need one DT compatible string per board,
>>> but that's because we need to model the hardware - and it differs.
>>
>>> To clarify my view, we do need a "powerup-driver" and the primary
>>> reason is that we must not model "power up sequences" within DT.
>>> Typically I see the "powerup-driver" as a simple platform driver
>>> attached to the platform bus, but I that could of course differ.
>>
>> This then either conflicts with cases where we need to describe the
>> actual contents of the slot with a compatible string or means that the
>> SDIO driver needs to handle powerup sequencing since we should be
>> binding to the first compatible we find.  If the host controller driver
>> and/or subsystem is going to deal with the powering up it's not clear
>> that it specifically needs to be the compatible property that's used
>> to determine the powerup method, it could just be a boolean or a
>> 'power-method = blah' property (where blah is one of a series of strings
>> defining methods).  Alternatively we could have separate nodes for the
>> slot and SDIO device but that feels meh.  What's the hard requirement
>> for it to specifically be a compatible property?
>
> +1. Just because we have a subnode in a device tree, we don't have to have
> a driver bind against it. The MMC core code could go down into the subnodes,
> find a "power-method =<foo>" property and go ahead and parse the rest of it.
> There's no requirement that we do this through the Linux driver model of
> probe(), etc.

I prefer a power-method property over compatible matching. The fact that 
the subnode has a compatible string and properties for the device driver 
should not matter.

>>> The slot will be the first level of child node under the mmc host,
>>> then each slot may have a child node which models the embedded card.
>>> But, let's leave that discussion for now. :-)
>>
>> OK, that's the separate node for the slot and device.
>>
>>> Powerup driver's ->probe():
>>> Typically the "powerup driver" will need to register a few callback
>>> functions towards the mmc core. Typically at mmc_of_parse(), those
>>> callbacks will have to be connected to a particular mmc host.
>>
>>> I would like to see three different callbacks, mirroring each of the
>>> mmc_ios power_mode states MMC_POWER_OFF|UP|ON.
>>
>>> The power up sequence, performed by the mmc core:
>>> The mmc_power_up|off functions, will invoke the registered "powerup
>>> driver's" callbacks if they exists for the particular host it operates
>>> on.
>>
>> There's also the need for the SDIO device to be able to get at the
>> resources provided and actively work with them at runtime if it wants to
>> manage things more actively (partial poweroff for low power states or
>> managing clock rates for example).
>
> Again, I think it gets overly complicated by using a full driver for the
> power management. Abstracted out into something separate and scalable
> as number of devices grow? Sure, definitely. As a driver? Not convinced.

I think somewhere in the thread Hans already indicated the term 'driver' 
was a misnomer. While monitoring the discussion I was wondering whether 
this type of power-up sequence handling is specific to mmc/sdio or could 
it also apply to say spi, i2c, or whatever. In other words, could the 
power-up sequence code be placed in drivers/of code.

Regards,
Arend

WARNING: multiple messages have this Message-ID (diff)
From: arend@broadcom.com (Arend van Spriel)
To: linux-arm-kernel@lists.infradead.org
Subject: RFC: representing sdio devices oob interrupt, clks, etc. in device tree
Date: Tue, 27 May 2014 22:27:43 +0200	[thread overview]
Message-ID: <5384F53F.4020408@broadcom.com> (raw)
In-Reply-To: <20140527185535.GB27420@quad.lixom.net>

On 05/27/14 20:55, Olof Johansson wrote:
> On Tue, May 27, 2014 at 06:53:26PM +0100, Mark Brown wrote:
>> On Tue, May 27, 2014 at 03:50:33PM +0200, Ulf Hansson wrote:
>>
>>> To describe the HW in DT, the embedded SDIO card (actually it could be
>>> any type of embedded card) shall be modelled as a child node to the
>>> mmc host in DT. Similar to what you have proposed, but with the
>>> difference that the child node _must_ contain a DT compatible string,
>>> which means a "powerup-driver" can be probed.
>>
>>> Yes, I understand we might need one DT compatible string per board,
>>> but that's because we need to model the hardware - and it differs.
>>
>>> To clarify my view, we do need a "powerup-driver" and the primary
>>> reason is that we must not model "power up sequences" within DT.
>>> Typically I see the "powerup-driver" as a simple platform driver
>>> attached to the platform bus, but I that could of course differ.
>>
>> This then either conflicts with cases where we need to describe the
>> actual contents of the slot with a compatible string or means that the
>> SDIO driver needs to handle powerup sequencing since we should be
>> binding to the first compatible we find.  If the host controller driver
>> and/or subsystem is going to deal with the powering up it's not clear
>> that it specifically needs to be the compatible property that's used
>> to determine the powerup method, it could just be a boolean or a
>> 'power-method = blah' property (where blah is one of a series of strings
>> defining methods).  Alternatively we could have separate nodes for the
>> slot and SDIO device but that feels meh.  What's the hard requirement
>> for it to specifically be a compatible property?
>
> +1. Just because we have a subnode in a device tree, we don't have to have
> a driver bind against it. The MMC core code could go down into the subnodes,
> find a "power-method =<foo>" property and go ahead and parse the rest of it.
> There's no requirement that we do this through the Linux driver model of
> probe(), etc.

I prefer a power-method property over compatible matching. The fact that 
the subnode has a compatible string and properties for the device driver 
should not matter.

>>> The slot will be the first level of child node under the mmc host,
>>> then each slot may have a child node which models the embedded card.
>>> But, let's leave that discussion for now. :-)
>>
>> OK, that's the separate node for the slot and device.
>>
>>> Powerup driver's ->probe():
>>> Typically the "powerup driver" will need to register a few callback
>>> functions towards the mmc core. Typically at mmc_of_parse(), those
>>> callbacks will have to be connected to a particular mmc host.
>>
>>> I would like to see three different callbacks, mirroring each of the
>>> mmc_ios power_mode states MMC_POWER_OFF|UP|ON.
>>
>>> The power up sequence, performed by the mmc core:
>>> The mmc_power_up|off functions, will invoke the registered "powerup
>>> driver's" callbacks if they exists for the particular host it operates
>>> on.
>>
>> There's also the need for the SDIO device to be able to get at the
>> resources provided and actively work with them at runtime if it wants to
>> manage things more actively (partial poweroff for low power states or
>> managing clock rates for example).
>
> Again, I think it gets overly complicated by using a full driver for the
> power management. Abstracted out into something separate and scalable
> as number of devices grow? Sure, definitely. As a driver? Not convinced.

I think somewhere in the thread Hans already indicated the term 'driver' 
was a misnomer. While monitoring the discussion I was wondering whether 
this type of power-up sequence handling is specific to mmc/sdio or could 
it also apply to say spi, i2c, or whatever. In other words, could the 
power-up sequence code be placed in drivers/of code.

Regards,
Arend

  reply	other threads:[~2014-05-27 20:27 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22  9:49 RFC: representing sdio devices oob interrupt, clks, etc. in device tree Hans de Goede
2014-05-22  9:49 ` Hans de Goede
2014-05-22 10:23 ` Chen-Yu Tsai
2014-05-22 10:23   ` Chen-Yu Tsai
2014-05-22 11:38   ` Hans de Goede
2014-05-22 11:38     ` Hans de Goede
2014-05-22 17:20     ` Tomasz Figa
2014-05-22 17:20       ` Tomasz Figa
2014-05-23  9:13       ` Hans de Goede
2014-05-23  9:13         ` Hans de Goede
2014-05-23 11:22         ` Mark Brown
2014-05-23 11:22           ` Mark Brown
2014-05-23 11:50           ` Hans de Goede
2014-05-23 11:50             ` Hans de Goede
2014-05-23 13:21             ` Arend van Spriel
2014-05-23 13:21               ` Arend van Spriel
2014-05-23 13:28               ` Hans de Goede
2014-05-23 13:28                 ` Hans de Goede
2014-05-23 14:54                 ` Arend van Spriel
2014-05-23 14:54                   ` Arend van Spriel
2014-05-24 10:10                   ` Hans de Goede
2014-05-24 10:10                     ` Hans de Goede
2014-05-23 16:27             ` Mark Brown
2014-05-23 16:27               ` Mark Brown
2014-05-24 10:06               ` Hans de Goede
2014-05-24 10:06                 ` Hans de Goede
2014-05-25 12:34                 ` Mark Brown
2014-05-25 12:34                   ` Mark Brown
2014-05-25 19:20                   ` Hans de Goede
2014-05-25 19:20                     ` Hans de Goede
2014-05-26  7:51                     ` Arend van Spriel
2014-05-26  7:51                       ` Arend van Spriel
2014-05-26  7:59                       ` Chen-Yu Tsai
2014-05-26  7:59                         ` Chen-Yu Tsai
2014-05-26  8:07                         ` Hans de Goede
2014-05-26  8:07                           ` Hans de Goede
2014-05-26  9:08                           ` Arend van Spriel
2014-05-26  9:08                             ` Arend van Spriel
2014-05-26 10:38                     ` Mark Brown
2014-05-26 10:38                       ` Mark Brown
2014-05-26 11:12                       ` Hans de Goede
2014-05-26 11:12                         ` Hans de Goede
2014-05-26 14:22                         ` Mark Brown
2014-05-26 14:22                           ` Mark Brown
2014-05-26 14:59                           ` Hans de Goede
2014-05-26 14:59                             ` Hans de Goede
2014-05-26 16:07                             ` Ulf Hansson
2014-05-26 16:07                               ` Ulf Hansson
2014-05-26 16:14                               ` Mark Brown
2014-05-26 16:14                                 ` Mark Brown
2014-05-26 17:55                               ` Hans de Goede
2014-05-26 17:55                                 ` Hans de Goede
2014-05-27 13:50                                 ` Ulf Hansson
2014-05-27 13:50                                   ` Ulf Hansson
2014-05-27 17:53                                   ` Mark Brown
2014-05-27 17:53                                     ` Mark Brown
2014-05-27 18:55                                     ` Olof Johansson
2014-05-27 18:55                                       ` Olof Johansson
2014-05-27 20:27                                       ` Arend van Spriel [this message]
2014-05-27 20:27                                         ` Arend van Spriel
2014-05-28  8:43                                       ` Ulf Hansson
2014-05-28  8:43                                         ` Ulf Hansson
2014-05-28  8:19                                     ` Ulf Hansson
2014-05-28  8:19                                       ` Ulf Hansson
2014-05-28 11:03                                       ` Mark Brown
2014-05-28 11:03                                         ` Mark Brown
2014-06-03 10:57                                         ` Ulf Hansson
2014-06-03 10:57                                           ` Ulf Hansson
2014-06-04 15:55                                           ` Mark Brown
2014-06-04 15:55                                             ` Mark Brown
2014-06-09 14:07                                             ` Ulf Hansson
2014-06-09 14:07                                               ` Ulf Hansson
2014-05-28  9:42                                   ` Hans de Goede
2014-05-28  9:42                                     ` Hans de Goede
2014-05-28 10:12                                     ` Arend van Spriel
2014-05-28 10:12                                       ` Arend van Spriel
2014-05-28 10:27                                       ` Hans de Goede
2014-05-28 10:27                                         ` Hans de Goede
2014-05-28 11:47                                     ` Tomasz Figa
2014-05-28 11:47                                       ` Tomasz Figa
     [not found]                                       ` <5385CCE6.9070204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-05-28 16:43                                         ` Mark Brown
2014-05-28 16:43                                           ` Mark Brown
2014-05-30  8:17                                           ` Hans de Goede
2014-05-30  8:17                                             ` Hans de Goede
2014-06-03 10:14                                     ` Ulf Hansson
2014-06-03 10:14                                       ` Ulf Hansson
2014-06-03 11:07                                       ` Hans de Goede
2014-06-03 11:07                                         ` Hans de Goede
2014-06-03 12:58                                         ` Ulf Hansson
2014-06-03 12:58                                           ` Ulf Hansson
2014-06-03 13:06                                           ` Hans de Goede
2014-06-03 13:06                                             ` Hans de Goede
2014-06-03 13:28                                             ` Ulf Hansson
2014-06-03 13:28                                               ` Ulf Hansson
2014-05-27 15:47                                 ` Mark Brown
2014-05-27 15:47                                   ` Mark Brown
2014-05-23 13:34       ` Ulf Hansson
2014-05-23 13:34         ` Ulf Hansson
2014-05-23 16:47       ` Olof Johansson
2014-05-23 16:47         ` Olof Johansson
2014-05-24 10:09         ` Hans de Goede
2014-05-24 10:09           ` Hans de Goede

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=5384F53F.4020408@broadcom.com \
    --to=arend@broadcom.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=chris@printf.net \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=jsarha@ti.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=maxime.ripard@free-electrons.com \
    --cc=olof@lixom.net \
    --cc=s.hauer@pengutronix.de \
    --cc=tomasz.figa@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wens@csie.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.