linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: iio: bmc150_magn: Document missing compatibles
@ 2020-06-17 10:12 Krzysztof Kozlowski
  2020-06-20 15:40 ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2020-06-17 10:12 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Rob Herring, linux-iio, devicetree,
	linux-kernel
  Cc: Krzysztof Kozlowski, stable

The driver supports also BMC156B and BMM150B so document the compatibles
for these devices.

Fixes: 9d75db36df14 ("iio: magn: Add support for BMM150 magnetometer")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---

The fixes tag is not accurate but at least offer some backporting.
---
 .../devicetree/bindings/iio/magnetometer/bmc150_magn.txt     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt b/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
index fd5fca90fb39..7469073022db 100644
--- a/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
+++ b/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
@@ -4,7 +4,10 @@ http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS00
 
 Required properties:
 
-  - compatible : should be "bosch,bmc150_magn"
+  - compatible : should be one of:
+                 "bosch,bmc150_magn"
+                 "bosch,bmc156_magn"
+                 "bosch,bmm150_magn"
   - reg : the I2C address of the magnetometer
 
 Optional properties:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: iio: bmc150_magn: Document missing compatibles
  2020-06-17 10:12 [PATCH] dt-bindings: iio: bmc150_magn: Document missing compatibles Krzysztof Kozlowski
@ 2020-06-20 15:40 ` Jonathan Cameron
  2020-06-22  5:19   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2020-06-20 15:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Rob Herring, linux-iio, devicetree, linux-kernel, stable

On Wed, 17 Jun 2020 12:12:59 +0200
Krzysztof Kozlowski <krzk@kernel.org> wrote:

> The driver supports also BMC156B and BMM150B so document the compatibles
> for these devices.
> 
> Fixes: 9d75db36df14 ("iio: magn: Add support for BMM150 magnetometer")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> ---
> 
> The fixes tag is not accurate but at least offer some backporting.

I'm not sure we generally bother backporting a missing section of binding
documentation. Particularly as this doc isn't in yaml yet so it's not
as though any automated checking is likely to be occurring.

Rob, any views on backporting this sort of missing id addition?

One side comment here is that the devices that are magnetometers only
should never have had the _magn prefix in their compatibles. We only
do that for devices in incorporating several sensors in one package
(like the bmc150) where we have multiple drivers for the different
sensors incorporated. We are too late to fix that now though.  It
may make sense to mark the _magn variants deprecated though and
add the ones without the _magn postfix.

> ---
>  .../devicetree/bindings/iio/magnetometer/bmc150_magn.txt     | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt b/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
> index fd5fca90fb39..7469073022db 100644
> --- a/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
> +++ b/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
> @@ -4,7 +4,10 @@ http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS00
>  
>  Required properties:
>  
> -  - compatible : should be "bosch,bmc150_magn"
> +  - compatible : should be one of:
> +                 "bosch,bmc150_magn"
> +                 "bosch,bmc156_magn"
> +                 "bosch,bmm150_magn"
>    - reg : the I2C address of the magnetometer
>  
>  Optional properties:


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: iio: bmc150_magn: Document missing compatibles
  2020-06-20 15:40 ` Jonathan Cameron
@ 2020-06-22  5:19   ` Krzysztof Kozlowski
  2020-06-27 14:57     ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2020-06-22  5:19 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Rob Herring, linux-iio, devicetree, linux-kernel, stable

On Sat, Jun 20, 2020 at 04:40:49PM +0100, Jonathan Cameron wrote:
> On Wed, 17 Jun 2020 12:12:59 +0200
> Krzysztof Kozlowski <krzk@kernel.org> wrote:
> 
> > The driver supports also BMC156B and BMM150B so document the compatibles
> > for these devices.
> > 
> > Fixes: 9d75db36df14 ("iio: magn: Add support for BMM150 magnetometer")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > 
> > ---
> > 
> > The fixes tag is not accurate but at least offer some backporting.
> 
> I'm not sure we generally bother backporting a missing section of binding
> documentation. Particularly as this doc isn't in yaml yet so it's not
> as though any automated checking is likely to be occurring.
> 
> Rob, any views on backporting this sort of missing id addition?
> 
> One side comment here is that the devices that are magnetometers only
> should never have had the _magn prefix in their compatibles. We only
> do that for devices in incorporating several sensors in one package
> (like the bmc150) where we have multiple drivers for the different
> sensors incorporated. We are too late to fix that now though.  It
> may make sense to mark the _magn variants deprecated though and
> add the ones without the _magn postfix.

I can add proper compatibles and mark these as deprecated but actually
the driver should not have additional compatibles in first place - all
devices are just compatible with bosch,bmc150.

Therefore I can just add one new compatible: "bosch,bmc156" and mark the
last two deprecated.

Best regards,
Krzysztof


> 
> > ---
> >  .../devicetree/bindings/iio/magnetometer/bmc150_magn.txt     | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt b/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
> > index fd5fca90fb39..7469073022db 100644
> > --- a/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
> > +++ b/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
> > @@ -4,7 +4,10 @@ http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS00
> >  
> >  Required properties:
> >  
> > -  - compatible : should be "bosch,bmc150_magn"
> > +  - compatible : should be one of:
> > +                 "bosch,bmc150_magn"
> > +                 "bosch,bmc156_magn"
> > +                 "bosch,bmm150_magn"
> >    - reg : the I2C address of the magnetometer
> >  
> >  Optional properties:
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: iio: bmc150_magn: Document missing compatibles
  2020-06-22  5:19   ` Krzysztof Kozlowski
@ 2020-06-27 14:57     ` Jonathan Cameron
  2020-06-29  6:49       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2020-06-27 14:57 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Rob Herring, linux-iio, devicetree, linux-kernel, stable

On Mon, 22 Jun 2020 07:19:40 +0200
Krzysztof Kozlowski <krzk@kernel.org> wrote:

> On Sat, Jun 20, 2020 at 04:40:49PM +0100, Jonathan Cameron wrote:
> > On Wed, 17 Jun 2020 12:12:59 +0200
> > Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >   
> > > The driver supports also BMC156B and BMM150B so document the compatibles
> > > for these devices.
> > > 
> > > Fixes: 9d75db36df14 ("iio: magn: Add support for BMM150 magnetometer")
> > > Cc: <stable@vger.kernel.org>
> > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > > 
> > > ---
> > > 
> > > The fixes tag is not accurate but at least offer some backporting.  
> > 
> > I'm not sure we generally bother backporting a missing section of binding
> > documentation. Particularly as this doc isn't in yaml yet so it's not
> > as though any automated checking is likely to be occurring.
> > 
> > Rob, any views on backporting this sort of missing id addition?
> > 
> > One side comment here is that the devices that are magnetometers only
> > should never have had the _magn prefix in their compatibles. We only
> > do that for devices in incorporating several sensors in one package
> > (like the bmc150) where we have multiple drivers for the different
> > sensors incorporated. We are too late to fix that now though.  It
> > may make sense to mark the _magn variants deprecated though and
> > add the ones without the _magn postfix.  
> 
> I can add proper compatibles and mark these as deprecated but actually
> the driver should not have additional compatibles in first place - all
> devices are just compatible with bosch,bmc150.

Why not?  Whilst the devices may be compatible in theory, it's not unusual
for subtle differences to emerge later.   As such we tend to at least
support the most specific compatible possible for a part - though we
can use fallback compatibles.

> 
> Therefore I can just add one new compatible: "bosch,bmc156" and mark the
> last two deprecated.

Sorry. I missed this earlier in the week.   The bmc156 is a SIP combining
separate silicon for the magnetometer and accelerometer.  Hence that one
should have the _magn extension as we will (I think) be loading two drivers
for the same part number.  The bmm part however is just a magnetometer
so doesn't need the postfix.

> 
> Best regards,
> Krzysztof
> 
> 
> >   
> > > ---
> > >  .../devicetree/bindings/iio/magnetometer/bmc150_magn.txt     | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt b/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
> > > index fd5fca90fb39..7469073022db 100644
> > > --- a/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
> > > +++ b/Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
> > > @@ -4,7 +4,10 @@ http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS00
> > >  
> > >  Required properties:
> > >  
> > > -  - compatible : should be "bosch,bmc150_magn"
> > > +  - compatible : should be one of:
> > > +                 "bosch,bmc150_magn"
> > > +                 "bosch,bmc156_magn"
> > > +                 "bosch,bmm150_magn"
> > >    - reg : the I2C address of the magnetometer
> > >  
> > >  Optional properties:  
> >   


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: iio: bmc150_magn: Document missing compatibles
  2020-06-27 14:57     ` Jonathan Cameron
@ 2020-06-29  6:49       ` Krzysztof Kozlowski
  2020-07-04 15:33         ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2020-06-29  6:49 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Rob Herring, linux-iio, devicetree, linux-kernel, stable

On Sat, Jun 27, 2020 at 03:57:14PM +0100, Jonathan Cameron wrote:
> On Mon, 22 Jun 2020 07:19:40 +0200
> Krzysztof Kozlowski <krzk@kernel.org> wrote:
> 
> > On Sat, Jun 20, 2020 at 04:40:49PM +0100, Jonathan Cameron wrote:
> > > On Wed, 17 Jun 2020 12:12:59 +0200
> > > Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > >   
> > > > The driver supports also BMC156B and BMM150B so document the compatibles
> > > > for these devices.
> > > > 
> > > > Fixes: 9d75db36df14 ("iio: magn: Add support for BMM150 magnetometer")
> > > > Cc: <stable@vger.kernel.org>
> > > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > > > 
> > > > ---
> > > > 
> > > > The fixes tag is not accurate but at least offer some backporting.  
> > > 
> > > I'm not sure we generally bother backporting a missing section of binding
> > > documentation. Particularly as this doc isn't in yaml yet so it's not
> > > as though any automated checking is likely to be occurring.
> > > 
> > > Rob, any views on backporting this sort of missing id addition?
> > > 
> > > One side comment here is that the devices that are magnetometers only
> > > should never have had the _magn prefix in their compatibles. We only
> > > do that for devices in incorporating several sensors in one package
> > > (like the bmc150) where we have multiple drivers for the different
> > > sensors incorporated. We are too late to fix that now though.  It
> > > may make sense to mark the _magn variants deprecated though and
> > > add the ones without the _magn postfix.  
> > 
> > I can add proper compatibles and mark these as deprecated but actually
> > the driver should not have additional compatibles in first place - all
> > devices are just compatible with bosch,bmc150.
> 
> Why not?  Whilst the devices may be compatible in theory, it's not unusual
> for subtle differences to emerge later.   As such we tend to at least
> support the most specific compatible possible for a part - though we
> can use fallback compatibles.

It does not strictly harm but have in mind that adding is always
possible (when you spot the difference between devices). But it is
entirely different with removal - it takes time to deprecate one and to
remove it.

There is just no benefit for adding new compatibles for really
compatible devices. The module device table just grows. It makes sense
however to document in bindings that given compatible serves family of
devices.

Somehow driver developers got impression that they need to make a commit
like "Add support for xyz123 device" adding only compatible, to bring
support for new device. But the support was already there so just
document that xyz001 is compatible with xyz123.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: iio: bmc150_magn: Document missing compatibles
  2020-06-29  6:49       ` Krzysztof Kozlowski
@ 2020-07-04 15:33         ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2020-07-04 15:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Rob Herring, linux-iio, devicetree, linux-kernel, stable

On Mon, 29 Jun 2020 08:49:25 +0200
Krzysztof Kozlowski <krzk@kernel.org> wrote:

> On Sat, Jun 27, 2020 at 03:57:14PM +0100, Jonathan Cameron wrote:
> > On Mon, 22 Jun 2020 07:19:40 +0200
> > Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >   
> > > On Sat, Jun 20, 2020 at 04:40:49PM +0100, Jonathan Cameron wrote:  
> > > > On Wed, 17 Jun 2020 12:12:59 +0200
> > > > Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > > >     
> > > > > The driver supports also BMC156B and BMM150B so document the compatibles
> > > > > for these devices.
> > > > > 
> > > > > Fixes: 9d75db36df14 ("iio: magn: Add support for BMM150 magnetometer")
> > > > > Cc: <stable@vger.kernel.org>
> > > > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > > > > 
> > > > > ---
> > > > > 
> > > > > The fixes tag is not accurate but at least offer some backporting.    
> > > > 
> > > > I'm not sure we generally bother backporting a missing section of binding
> > > > documentation. Particularly as this doc isn't in yaml yet so it's not
> > > > as though any automated checking is likely to be occurring.
> > > > 
> > > > Rob, any views on backporting this sort of missing id addition?
> > > > 
> > > > One side comment here is that the devices that are magnetometers only
> > > > should never have had the _magn prefix in their compatibles. We only
> > > > do that for devices in incorporating several sensors in one package
> > > > (like the bmc150) where we have multiple drivers for the different
> > > > sensors incorporated. We are too late to fix that now though.  It
> > > > may make sense to mark the _magn variants deprecated though and
> > > > add the ones without the _magn postfix.    
> > > 
> > > I can add proper compatibles and mark these as deprecated but actually
> > > the driver should not have additional compatibles in first place - all
> > > devices are just compatible with bosch,bmc150.  
> > 
> > Why not?  Whilst the devices may be compatible in theory, it's not unusual
> > for subtle differences to emerge later.   As such we tend to at least
> > support the most specific compatible possible for a part - though we
> > can use fallback compatibles.  
> 
> It does not strictly harm but have in mind that adding is always
> possible (when you spot the difference between devices). But it is
> entirely different with removal - it takes time to deprecate one and to
> remove it.
> 
> There is just no benefit for adding new compatibles for really
> compatible devices. The module device table just grows. It makes sense
> however to document in bindings that given compatible serves family of
> devices.
> 
> Somehow driver developers got impression that they need to make a commit
> like "Add support for xyz123 device" adding only compatible, to bring
> support for new device. But the support was already there so just
> document that xyz001 is compatible with xyz123.

Whilst I agree the compatible is not really necessary, it is often
non trivial to establish two parts are actual compatible. Manufacturers
have an annoying habit of not actually saying so on their datasheets.
So it is useful to add documentation for the support so that a grep
will identify the driver supports it.

I don't have a problem with people adding the ID particularly as they
are often not entirely sure the parts are compatible.  I'm not fussed
if they don't do so of course.

Ideal in my view is to list multiple compatibles in the dts files
in this case to allow us to support any differences if any turn up
in the future. 

From a purely practical basis, if I'm writing a DTS I'd much rather
it matched up with my BOM rather than having to 'know' that two parts
are compatible.

Jonathan

> 
> Best regards,
> Krzysztof
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-04 15:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-17 10:12 [PATCH] dt-bindings: iio: bmc150_magn: Document missing compatibles Krzysztof Kozlowski
2020-06-20 15:40 ` Jonathan Cameron
2020-06-22  5:19   ` Krzysztof Kozlowski
2020-06-27 14:57     ` Jonathan Cameron
2020-06-29  6:49       ` Krzysztof Kozlowski
2020-07-04 15:33         ` Jonathan Cameron

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).