All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Frank Rowand <frowand.list@gmail.com>
Cc: Michael Walle <michael@walle.cc>,
	Rob Herring <robh+dt@kernel.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Robin Murphy <robin.murphy@arm.com>,
	GregKroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [RFC] MFD's relationship with Device Tree (OF)
Date: Thu, 25 Jun 2020 07:13:02 +0100	[thread overview]
Message-ID: <20200625061302.GK954398@dell> (raw)
In-Reply-To: <0e9e25cc-b3f2-926a-31dd-c6fafa7d581b@gmail.com>

On Wed, 24 Jun 2020, Frank Rowand wrote:
> On 2020-06-22 16:03, Michael Walle wrote:
> > Am 2020-06-14 12:26, schrieb Michael Walle:
> >> Hi Rob,
> >>
> >> Am 2020-06-10 00:03, schrieb Rob Herring:
> >> [..]
> >>> Yes, we should use 'reg' whenever possible. If we don't have 'reg',
> >>> then you shouldn't have a unit-address either and you can simply match
> >>> on the node name (standard DT driver matching is with compatible,
> >>> device_type, and node name (w/o unit-address)). We've generally been
> >>> doing 'classname-N' when there's no 'reg' to do 'classname@N'.
> >>> Matching on 'classname-N' would work with node name matching as only
> >>> unit-addresses are stripped.
> >>
> >> This still keeps me thinking. Shouldn't we allow the (MFD!) device
> >> driver creator to choose between "classname@N" and "classname-N".
> >> In most cases N might not be made up, but it is arbitrarily chosen;
> >> for example you've chosen the bank for the ab8500 reg. It is not
> >> a defined entity, like an I2C address if your parent is an I2C bus,
> >> or a SPI chip select, or the memory address in case of MMIO. Instead
> >> the device driver creator just chooses some "random" property from
> >> the datasheet; another device creator might have chosen another
> >> property. Wouldn't it make more sense, to just say this MFD provides
> >> N pwm devices and the subnodes are matching based on pwm-{0,1..N-1}?
> >> That would also be the logical consequence of the current MFD sub
> >> device to OF node matching code, which just supports N=1.

It's funny.  You reiterate things like "arbitrarily chosen" and
"randomly chosen from the datasheet" but yet your suggestion is just
that.  The only difference is that you wish to place the numerical
differentiator in the node name, rather than the reg property.  Worse
still, you are suggesting that you wish to just enumerate them off
sequentially from some arbitrary base (likely 0).

I don't know of many cases off, the top of my head at least, where
this is a problem.  As you've mentioned, in the case of the AB8500,
the bank is used which is semantically how the devices are actually
addressed.  It's not random, it's physical.

How are the identical devices addressed/identified/differentiated
from each other on your H/W?  You must have a way of saying "I want
PWM X to act in a different way from PWM Y".  What is 'X' and 'Y' in
your datasheet?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree <devicetree@vger.kernel.org>,
	GregKroah-Hartman <gregkh@linuxfoundation.org>,
	Mark Brown <broonie@kernel.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Michael Walle <michael@walle.cc>,
	Rob Herring <robh+dt@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC] MFD's relationship with Device Tree (OF)
Date: Thu, 25 Jun 2020 07:13:02 +0100	[thread overview]
Message-ID: <20200625061302.GK954398@dell> (raw)
In-Reply-To: <0e9e25cc-b3f2-926a-31dd-c6fafa7d581b@gmail.com>

On Wed, 24 Jun 2020, Frank Rowand wrote:
> On 2020-06-22 16:03, Michael Walle wrote:
> > Am 2020-06-14 12:26, schrieb Michael Walle:
> >> Hi Rob,
> >>
> >> Am 2020-06-10 00:03, schrieb Rob Herring:
> >> [..]
> >>> Yes, we should use 'reg' whenever possible. If we don't have 'reg',
> >>> then you shouldn't have a unit-address either and you can simply match
> >>> on the node name (standard DT driver matching is with compatible,
> >>> device_type, and node name (w/o unit-address)). We've generally been
> >>> doing 'classname-N' when there's no 'reg' to do 'classname@N'.
> >>> Matching on 'classname-N' would work with node name matching as only
> >>> unit-addresses are stripped.
> >>
> >> This still keeps me thinking. Shouldn't we allow the (MFD!) device
> >> driver creator to choose between "classname@N" and "classname-N".
> >> In most cases N might not be made up, but it is arbitrarily chosen;
> >> for example you've chosen the bank for the ab8500 reg. It is not
> >> a defined entity, like an I2C address if your parent is an I2C bus,
> >> or a SPI chip select, or the memory address in case of MMIO. Instead
> >> the device driver creator just chooses some "random" property from
> >> the datasheet; another device creator might have chosen another
> >> property. Wouldn't it make more sense, to just say this MFD provides
> >> N pwm devices and the subnodes are matching based on pwm-{0,1..N-1}?
> >> That would also be the logical consequence of the current MFD sub
> >> device to OF node matching code, which just supports N=1.

It's funny.  You reiterate things like "arbitrarily chosen" and
"randomly chosen from the datasheet" but yet your suggestion is just
that.  The only difference is that you wish to place the numerical
differentiator in the node name, rather than the reg property.  Worse
still, you are suggesting that you wish to just enumerate them off
sequentially from some arbitrary base (likely 0).

I don't know of many cases off, the top of my head at least, where
this is a problem.  As you've mentioned, in the case of the AB8500,
the bank is used which is semantically how the devices are actually
addressed.  It's not random, it's physical.

How are the identical devices addressed/identified/differentiated
from each other on your H/W?  You must have a way of saying "I want
PWM X to act in a different way from PWM Y".  What is 'X' and 'Y' in
your datasheet?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-06-25  6:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 11:01 [RFC] MFD's relationship with Device Tree (OF) Lee Jones
2020-06-09 11:01 ` Lee Jones
2020-06-09 14:19 ` Andy Shevchenko
2020-06-09 14:19   ` Andy Shevchenko
2020-06-09 19:04   ` Lee Jones
2020-06-09 19:04     ` Lee Jones
2020-06-09 22:03 ` Rob Herring
2020-06-09 22:03   ` Rob Herring
2020-06-10  6:43   ` Lee Jones
2020-06-10  6:43     ` Lee Jones
2020-06-14 10:26   ` Michael Walle
2020-06-14 10:26     ` Michael Walle
2020-06-22 21:03     ` Michael Walle
2020-06-24 21:01       ` Frank Rowand
2020-06-24 21:01         ` Frank Rowand
2020-06-25  6:13         ` Lee Jones [this message]
2020-06-25  6:13           ` Lee Jones
2020-06-25 11:05           ` Michael Walle
2020-06-25 11:05             ` Michael Walle
2020-06-12  4:07 ` Frank Rowand
2020-06-12  4:07   ` Frank Rowand
2020-06-12  6:22   ` Lee Jones
2020-06-12  6:22     ` Lee Jones
2020-06-12  4:10 ` Frank Rowand
2020-06-12  4:10   ` Frank Rowand

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=20200625061302.GK954398@dell \
    --to=lee.jones@linaro.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=michael@walle.cc \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.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 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.