2023-09-24 22:26:55

by Andreas Kemnade

[permalink] [raw]
Subject: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter

Found in ancient platform data struct:
level_shifter: 0: VLogic, 1: VDD

Signed-off-by: Andreas Kemnade <[email protected]>
---
.../devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
index 1db6952ddca5e..6aae2272fa15c 100644
--- a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
+++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
@@ -48,6 +48,8 @@ properties:

mount-matrix: true

+ invensense,level-shifter: true
+
i2c-gate:
$ref: /schemas/i2c/i2c-controller.yaml
unevaluatedProperties: false
--
2.39.2


2023-09-24 23:33:45

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter


On Mon, 25 Sep 2023 00:25:57 +0200, Andreas Kemnade wrote:
> Found in ancient platform data struct:
> level_shifter: 0: VLogic, 1: VDD
>
> Signed-off-by: Andreas Kemnade <[email protected]>
> ---
> .../devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml: properties:invensense,level-shifter: True is not of type 'object'
hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml: properties:invensense,level-shifter: More than one condition true in oneOf schema:
{'description': 'Vendor specific properties must have a type and '
'description unless they have a defined, common '
'suffix.',
'oneOf': [{'additionalProperties': False,
'description': 'A vendor boolean property can use "type: '
'boolean"',
'properties': {'deprecated': True,
'description': True,
'type': {'const': 'boolean'}},
'required': ['type', 'description']},
{'additionalProperties': False,
'description': 'A vendor string property with exact values '
'has an implicit type',
'oneOf': [{'required': ['enum']}, {'required': ['const']}],
'properties': {'const': {'type': 'string'},
'deprecated': True,
'description': True,
'enum': {'items': {'type': 'string'}}},
'required': ['description']},
{'description': 'A vendor property needs a $ref to '
'types.yaml',
'oneOf': [{'required': ['$ref']}, {'required': ['allOf']}],
'properties': {'$ref': {'pattern': 'types.yaml#/definitions/'},
'allOf': {'items': [{'properties': {'$ref': {'pattern': 'types.yaml#/definitions/'}},
'required': ['$ref']}]}},
'required': ['description']},
{'description': 'A vendor property can have a $ref to a a '
'$defs schema',
'properties': {'$ref': {'pattern': '^#/(definitions|\\$defs)/'}},
'required': ['$ref']}],
'type': 'object'}
hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.

2023-09-24 23:40:12

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter

Hi Andreas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on robh/for-next linus/master v6.6-rc3 next-20230921]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Andreas-Kemnade/dt-bindings-iio-imu-mpu6050-Add-level-shifter/20230925-062804
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link: https://lore.kernel.org/r/20230924222559.2038721-2-andreas%40kemnade.info
patch subject: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230925/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

dtcheck warnings: (new ones prefixed by >>)
>> Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml: properties:invensense,level-shifter: True is not of type 'object'
hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
>> Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml: properties:invensense,level-shifter: More than one condition true in oneOf schema:
{'description': 'Vendor specific properties must have a type and '
'description unless they have a defined, common '
'suffix.',
'oneOf': [{'additionalProperties': False,
'description': 'A vendor boolean property can use "type: '
'boolean"',
'properties': {'deprecated': True,
'description': True,
'type': {'const': 'boolean'}},
'required': ['type', 'description']},

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

2023-09-25 11:16:31

by Andreas Kemnade

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter

On Mon, 25 Sep 2023 11:28:52 +0100
Jonathan Cameron <[email protected]> wrote:

> On Mon, 25 Sep 2023 08:54:08 +0200
> Krzysztof Kozlowski <[email protected]> wrote:
>
> > On 25/09/2023 00:25, Andreas Kemnade wrote:
> > > Found in ancient platform data struct:
> > > level_shifter: 0: VLogic, 1: VDD
> > >
> > > Signed-off-by: Andreas Kemnade <[email protected]>
> > > ---
> > > .../devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> > > index 1db6952ddca5e..6aae2272fa15c 100644
> > > --- a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> > > +++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> > > @@ -48,6 +48,8 @@ properties:
> > >
> > > mount-matrix: true
> > >
> > > + invensense,level-shifter: true
> >
> > It does not look like you tested the bindings, at least after quick
> > look. Please run `make dt_binding_check` (see
> > Documentation/devicetree/bindings/writing-schema.rst for instructions).
> > Maybe you need to update your dtschema and yamllint.
> >
> > Best regards,
> > Krzysztof
> >
> >
>
> Also this one isn't obvious - give it a description in the binding doc.
>
> I'm not sure of the arguement for calling it level shift in general.
>
I have no more descrption than the old source (see the citation from there)
https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-9150-Register-Map.pdf

does not list it. But that bit is needed to get things to work what also does the
vendor kernel do.

What could be a better descrption?

Regards,
Andreas

2023-09-25 18:04:33

by Andreas Kemnade

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter

On Mon, 25 Sep 2023 14:21:57 +0100
Jonathan Cameron <[email protected]> wrote:

> On Mon, 25 Sep 2023 14:24:32 +0200
> Krzysztof Kozlowski <[email protected]> wrote:
>
> > On 25/09/2023 13:02, Andreas Kemnade wrote:
> > > On Mon, 25 Sep 2023 11:28:52 +0100
> > > Jonathan Cameron <[email protected]> wrote:
> > >
> > >> On Mon, 25 Sep 2023 08:54:08 +0200
> > >> Krzysztof Kozlowski <[email protected]> wrote:
> > >>
> > >>> On 25/09/2023 00:25, Andreas Kemnade wrote:
> > >>>> Found in ancient platform data struct:
> > >>>> level_shifter: 0: VLogic, 1: VDD
> > >>>>
> > >>>> Signed-off-by: Andreas Kemnade <[email protected]>
> > >>>> ---
> > >>>> .../devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 2 ++
> > >>>> 1 file changed, 2 insertions(+)
> > >>>>
> > >>>> diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> > >>>> index 1db6952ddca5e..6aae2272fa15c 100644
> > >>>> --- a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> > >>>> +++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> > >>>> @@ -48,6 +48,8 @@ properties:
> > >>>>
> > >>>> mount-matrix: true
> > >>>>
> > >>>> + invensense,level-shifter: true
> > >>>
> > >>> It does not look like you tested the bindings, at least after quick
> > >>> look. Please run `make dt_binding_check` (see
> > >>> Documentation/devicetree/bindings/writing-schema.rst for instructions).
> > >>> Maybe you need to update your dtschema and yamllint.
> > >>>
> > >>> Best regards,
> > >>> Krzysztof
> > >>>
> > >>>
> > >>
> > >> Also this one isn't obvious - give it a description in the binding doc.
> > >>
> > >> I'm not sure of the arguement for calling it level shift in general.
> > >>
> > > I have no more descrption than the old source (see the citation from there)
citation = line from ancient pdata struct comment cited in the commit message.

> > > https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-9150-Register-Map.pdf
> >
> > I could not find any reference to level shift in this manual. To which
> > page and part do you refer?
> >
> > >
> > > does not list it. But that bit is needed to get things to work what also does the
> > > vendor kernel do.
> > >
> > > What could be a better descrption?
> >
> > I don't know, but something reasonable to you should be put there.
>
> The text you have in the commit log seems better than nothing.
> I suspect it's internally wiring VDD to VDDIO. Normally people just
> connect both power supplies to same supply if they want to do that,
> but maybe there was a chip variant that didn't have enough pins?
>
> If you have the device, can you see it actually matches the packaging
> types in the manual?
>
packaging matches. It is just as usual. I think VLogic (=VDDIO) would be 1.8V
while VDD needs to be something higher, so I guess here it might be 3.3V.
There are some slight hints about level shifting here:
https://product.tdk.com/system/files/dam/doc/product/sensor/mortion-inertial/imu/data_sheet/mpu-9150-datasheet.pdf
page 37. The aux i2c bus seem to run at levels till VDD. But here, there
seems to be nothing at the aux i2c bus besides that internal magnetometer.

Regards,
Andreas

2023-09-25 21:03:19

by Jean-Baptiste Maneyrol

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter

Hello,

these are very old unsupported chips, thus this is not something that can be easily found. Even after doing some archaeology.

But when looking at register maps, it should only be used with MPU-9150 and not MPU-9250. I would feel much more comfortable to restrict this fix to MPU-9150 only (by testing chip_type against INV_MPU9150).

Thanks,
JB


From: Jonathan Cameron <[email protected]>
Sent: Monday, September 25, 2023 15:21
To: Krzysztof Kozlowski <[email protected]>
Cc: Andreas Kemnade <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Jean-Baptiste Maneyrol <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
 
On Mon, 25 Sep 2023 14: 24: 32 +0200 Krzysztof Kozlowski <krzysztof. kozlowski@ linaro. org> wrote: > On 25/09/2023 13: 02, Andreas Kemnade wrote: > > On Mon, 25 Sep 2023 11: 28: 52 +0100 > > Jonathan Cameron <Jonathan. Cameron@ Huawei. com>
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd
On Mon, 25 Sep 2023 14:24:32 +0200
Krzysztof Kozlowski <[email protected]> wrote:

> On 25/09/2023 13:02, Andreas Kemnade wrote:
> > On Mon, 25 Sep 2023 11:28:52 +0100
> > Jonathan Cameron <[email protected]> wrote:
> >
> >> On Mon, 25 Sep 2023 08:54:08 +0200
> >> Krzysztof Kozlowski <[email protected]> wrote:
> >>
> >>> On 25/09/2023 00:25, Andreas Kemnade wrote:
> >>>> Found in ancient platform data struct:
> >>>> level_shifter: 0: VLogic, 1: VDD
> >>>>
> >>>> Signed-off-by: Andreas Kemnade <[email protected]>
> >>>> ---
> >>>> .../devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 2 ++
> >>>> 1 file changed, 2 insertions(+)
> >>>>
> >>>> diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> >>>> index 1db6952ddca5e..6aae2272fa15c 100644
> >>>> --- a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> >>>> +++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> >>>> @@ -48,6 +48,8 @@ properties:
> >>>>
> >>>> mount-matrix: true
> >>>>
> >>>> + invensense,level-shifter: true
> >>>
> >>> It does not look like you tested the bindings, at least after quick
> >>> look. Please run `make dt_binding_check` (see
> >>> Documentation/devicetree/bindings/writing-schema.rst for instructions).
> >>> Maybe you need to update your dtschema and yamllint.
> >>>
> >>> Best regards,
> >>> Krzysztof
> >>>
> >>>
> >>
> >> Also this one isn't obvious - give it a description in the binding doc.
> >>
> >> I'm not sure of the arguement for calling it level shift in general.
> >>
> > I have no more descrption than the old source (see the citation from there)
> > https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-9150-Register-Map.pdf
>
> I could not find any reference to level shift in this manual. To which
> page and part do you refer?
>
> >
> > does not list it. But that bit is needed to get things to work what also does the
> > vendor kernel do.
> >
> > What could be a better descrption?
>
> I don't know, but something reasonable to you should be put there.

The text you have in the commit log seems better than nothing.
I suspect it's internally wiring VDD to VDDIO. Normally people just
connect both power supplies to same supply if they want to do that,
but maybe there was a chip variant that didn't have enough pins?

If you have the device, can you see it actually matches the packaging
types in the manual?

Jonathan

>
> Best regards,
> Krzysztof
>
>

2023-09-26 09:05:12

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter

On 25/09/2023 13:02, Andreas Kemnade wrote:
> On Mon, 25 Sep 2023 11:28:52 +0100
> Jonathan Cameron <[email protected]> wrote:
>
>> On Mon, 25 Sep 2023 08:54:08 +0200
>> Krzysztof Kozlowski <[email protected]> wrote:
>>
>>> On 25/09/2023 00:25, Andreas Kemnade wrote:
>>>> Found in ancient platform data struct:
>>>> level_shifter: 0: VLogic, 1: VDD
>>>>
>>>> Signed-off-by: Andreas Kemnade <[email protected]>
>>>> ---
>>>> .../devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 2 ++
>>>> 1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
>>>> index 1db6952ddca5e..6aae2272fa15c 100644
>>>> --- a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
>>>> +++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
>>>> @@ -48,6 +48,8 @@ properties:
>>>>
>>>> mount-matrix: true
>>>>
>>>> + invensense,level-shifter: true
>>>
>>> It does not look like you tested the bindings, at least after quick
>>> look. Please run `make dt_binding_check` (see
>>> Documentation/devicetree/bindings/writing-schema.rst for instructions).
>>> Maybe you need to update your dtschema and yamllint.
>>>
>>> Best regards,
>>> Krzysztof
>>>
>>>
>>
>> Also this one isn't obvious - give it a description in the binding doc.
>>
>> I'm not sure of the arguement for calling it level shift in general.
>>
> I have no more descrption than the old source (see the citation from there)
> https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-9150-Register-Map.pdf

I could not find any reference to level shift in this manual. To which
page and part do you refer?

>
> does not list it. But that bit is needed to get things to work what also does the
> vendor kernel do.
>
> What could be a better descrption?

I don't know, but something reasonable to you should be put there.

Best regards,
Krzysztof

2023-09-27 03:32:36

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter

On 25/09/2023 00:25, Andreas Kemnade wrote:
> Found in ancient platform data struct:
> level_shifter: 0: VLogic, 1: VDD
>
> Signed-off-by: Andreas Kemnade <[email protected]>
> ---
> .../devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> index 1db6952ddca5e..6aae2272fa15c 100644
> --- a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> +++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
> @@ -48,6 +48,8 @@ properties:
>
> mount-matrix: true
>
> + invensense,level-shifter: true

It does not look like you tested the bindings, at least after quick
look. Please run `make dt_binding_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).
Maybe you need to update your dtschema and yamllint.

Best regards,
Krzysztof