All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: omap: omap4-embt2ws: Add IMU on control unit
@ 2023-09-24 22:25 Andreas Kemnade
  2023-09-24 22:25 ` [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter Andreas Kemnade
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Andreas Kemnade @ 2023-09-24 22:25 UTC (permalink / raw)
  To: jic23, lars, robh+dt, krzysztof.kozlowski+dt, conor+dt, bcousson,
	tony, jean-baptiste.maneyrol, chenhuiz, andreas, andy.shevchenko,
	linux-iio, devicetree, linux-kernel, linux-omap

Contrary to the IMU at the head, a bit needs to be set to
make probe of the magnetometer successful.

Andreas Kemnade (3):
  dt-bindings: iio: imu: mpu6050: Add level shifter
  iio: imu: mpu6050: add level shifter flag
  ARM: dts: omap: omap4-embt2ws: Add IMU at control unit

 .../bindings/iio/imu/invensense,mpu6050.yaml    |  2 ++
 .../boot/dts/ti/omap/omap4-epson-embt2ws.dts    | 17 ++++++++++++++++-
 drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c       |  5 +++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c      |  3 +++
 drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h       |  1 +
 5 files changed, 27 insertions(+), 1 deletion(-)

-- 
2.39.2


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

* [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
  2023-09-24 22:25 [PATCH 0/3] ARM: omap: omap4-embt2ws: Add IMU on control unit Andreas Kemnade
@ 2023-09-24 22:25 ` Andreas Kemnade
  2023-09-24 23:33   ` Rob Herring
                     ` (2 more replies)
  2023-09-24 22:25 ` [PATCH 2/3] iio: imu: mpu6050: add level shifter flag Andreas Kemnade
  2023-09-24 22:25 ` [PATCH 3/3] ARM: dts: omap: omap4-embt2ws: Add IMU at control unit Andreas Kemnade
  2 siblings, 3 replies; 18+ messages in thread
From: Andreas Kemnade @ 2023-09-24 22:25 UTC (permalink / raw)
  To: jic23, lars, robh+dt, krzysztof.kozlowski+dt, conor+dt, bcousson,
	tony, jean-baptiste.maneyrol, chenhuiz, andreas, andy.shevchenko,
	linux-iio, devicetree, linux-kernel, linux-omap

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

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 .../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


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

* [PATCH 2/3] iio: imu: mpu6050: add level shifter flag
  2023-09-24 22:25 [PATCH 0/3] ARM: omap: omap4-embt2ws: Add IMU on control unit Andreas Kemnade
  2023-09-24 22:25 ` [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter Andreas Kemnade
@ 2023-09-24 22:25 ` Andreas Kemnade
  2023-09-25 11:07   ` Andy Shevchenko
  2023-09-24 22:25 ` [PATCH 3/3] ARM: dts: omap: omap4-embt2ws: Add IMU at control unit Andreas Kemnade
  2 siblings, 1 reply; 18+ messages in thread
From: Andreas Kemnade @ 2023-09-24 22:25 UTC (permalink / raw)
  To: jic23, lars, robh+dt, krzysztof.kozlowski+dt, conor+dt, bcousson,
	tony, jean-baptiste.maneyrol, chenhuiz, andreas, andy.shevchenko,
	linux-iio, devicetree, linux-kernel, linux-omap

Some boards fail in magnetometer probe if flag is not set.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c  | 5 +++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 3 +++
 drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h  | 1 +
 3 files changed, 9 insertions(+)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c
index 7327e5723f961..15dbe88ff8c43 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c
@@ -71,6 +71,11 @@ int inv_mpu_aux_init(const struct inv_mpu6050_state *st)
 	unsigned int val;
 	int ret;
 
+	ret = regmap_update_bits(st->map, 0x1, 0x80,
+				 st->level_shifter ? 0x80 : 0);
+	if (ret)
+		return ret;
+
 	/* configure i2c master */
 	val = INV_MPU6050_BITS_I2C_MST_CLK_400KHZ |
 			INV_MPU6050_BIT_WAIT_FOR_ES;
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 29f906c884bd8..21cf794a41561 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -17,6 +17,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/pm.h>
 #include <linux/pm_runtime.h>
+#include <linux/property.h>
 
 #include <linux/iio/common/inv_sensors_timestamp.h>
 #include <linux/iio/iio.h>
@@ -1495,6 +1496,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
 	st->irq = irq;
 	st->map = regmap;
 
+	st->level_shifter = device_property_present(dev,
+						    "invensense,level-shifter");
 	pdata = dev_get_platdata(dev);
 	if (!pdata) {
 		result = iio_read_mount_matrix(dev, &st->orientation);
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
index ed5a96e78df05..7eba1439c8093 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
@@ -203,6 +203,7 @@ struct inv_mpu6050_state {
 	s32 magn_raw_to_gauss[3];
 	struct iio_mount_matrix magn_orient;
 	unsigned int suspended_sensors;
+	bool level_shifter;
 	u8 *data;
 };
 
-- 
2.39.2


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

* [PATCH 3/3] ARM: dts: omap: omap4-embt2ws: Add IMU at control unit
  2023-09-24 22:25 [PATCH 0/3] ARM: omap: omap4-embt2ws: Add IMU on control unit Andreas Kemnade
  2023-09-24 22:25 ` [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter Andreas Kemnade
  2023-09-24 22:25 ` [PATCH 2/3] iio: imu: mpu6050: add level shifter flag Andreas Kemnade
@ 2023-09-24 22:25 ` Andreas Kemnade
  2023-09-25  6:53   ` Krzysztof Kozlowski
  2 siblings, 1 reply; 18+ messages in thread
From: Andreas Kemnade @ 2023-09-24 22:25 UTC (permalink / raw)
  To: jic23, lars, robh+dt, krzysztof.kozlowski+dt, conor+dt, bcousson,
	tony, jean-baptiste.maneyrol, chenhuiz, andreas, andy.shevchenko,
	linux-iio, devicetree, linux-kernel, linux-omap

Add also the level-shifter flag to avoid probe failure in magnetometer
probe.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 .../boot/dts/ti/omap/omap4-epson-embt2ws.dts    | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
index cd4f858d846ab..0e6b050d588ac 100644
--- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
+++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
@@ -391,7 +391,16 @@ tlv320aic3x: codec@18 {
 		reset-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
 	};
 
-	/* TODO: mpu9150 at control unit, seems to require quirks */
+	mpu9150: imu@68 {
+		compatible = "invensense,mpu9150";
+		reg = <0x68>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&mpu9150_pins>;
+		interrupt-parent = <&gpio2>;
+		interrupt = <7 IRQ_TYPE_LEVEL_HIGH>;
+		invensense,level-shifter;
+	};
 };
 
 &keypad {
@@ -530,6 +539,12 @@ OMAP4_IOPAD(0x0fc, PIN_INPUT | MUX_MODE0)       /* abe_mcbsp2_fsx */
 		>;
 	};
 
+	mpu9150_pins: pinmux_mpu9150_pins {
+		pinctrl-single,pins = <
+			OMAP4_IOPAD(0x5e, PIN_INPUT_PULLUP | MUX_MODE3)
+		>;
+	};
+
 	mpu9150h_pins: pinmux-mpu9150h-pins {
 		pinctrl-single,pins = <
 			OMAP4_IOPAD(0x76, PIN_INPUT_PULLUP | MUX_MODE3)
-- 
2.39.2


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

* Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
  2023-09-24 22:25 ` [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter Andreas Kemnade
@ 2023-09-24 23:33   ` Rob Herring
  2023-09-24 23:39   ` kernel test robot
  2023-09-25  6:54   ` Krzysztof Kozlowski
  2 siblings, 0 replies; 18+ messages in thread
From: Rob Herring @ 2023-09-24 23:33 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: linux-kernel, linux-iio, conor+dt, krzysztof.kozlowski+dt, jic23,
	linux-omap, chenhuiz, jean-baptiste.maneyrol, bcousson, robh+dt,
	tony, lars, andy.shevchenko, devicetree


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 <andreas@kemnade.info>
> ---
>  .../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/20230924222559.2038721-2-andreas@kemnade.info

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.


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

* Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
  2023-09-24 22:25 ` [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter Andreas Kemnade
  2023-09-24 23:33   ` Rob Herring
@ 2023-09-24 23:39   ` kernel test robot
  2023-09-25  6:54   ` Krzysztof Kozlowski
  2 siblings, 0 replies; 18+ messages in thread
From: kernel test robot @ 2023-09-24 23:39 UTC (permalink / raw)
  To: Andreas Kemnade, jic23, lars, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, bcousson, tony, jean-baptiste.maneyrol, chenhuiz,
	andy.shevchenko, linux-iio, devicetree, linux-kernel, linux-omap
  Cc: oe-kbuild-all

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/202309250753.7v7FAzek-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309250753.7v7FAzek-lkp@intel.com/

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

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

* Re: [PATCH 3/3] ARM: dts: omap: omap4-embt2ws: Add IMU at control unit
  2023-09-24 22:25 ` [PATCH 3/3] ARM: dts: omap: omap4-embt2ws: Add IMU at control unit Andreas Kemnade
@ 2023-09-25  6:53   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-09-25  6:53 UTC (permalink / raw)
  To: Andreas Kemnade, jic23, lars, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, bcousson, tony, jean-baptiste.maneyrol, chenhuiz,
	andy.shevchenko, linux-iio, devicetree, linux-kernel, linux-omap

On 25/09/2023 00:25, Andreas Kemnade wrote:
> Add also the level-shifter flag to avoid probe failure in magnetometer
> probe.
> 
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---


>  &keypad {
> @@ -530,6 +539,12 @@ OMAP4_IOPAD(0x0fc, PIN_INPUT | MUX_MODE0)       /* abe_mcbsp2_fsx */
>  		>;
>  	};
>  
> +	mpu9150_pins: pinmux_mpu9150_pins {

No underscores in node names.

Best regards,
Krzysztof


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

* Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
  2023-09-24 22:25 ` [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter Andreas Kemnade
  2023-09-24 23:33   ` Rob Herring
  2023-09-24 23:39   ` kernel test robot
@ 2023-09-25  6:54   ` Krzysztof Kozlowski
  2023-09-25 10:28     ` Jonathan Cameron
  2 siblings, 1 reply; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-09-25  6:54 UTC (permalink / raw)
  To: Andreas Kemnade, jic23, lars, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, bcousson, tony, jean-baptiste.maneyrol, chenhuiz,
	andy.shevchenko, linux-iio, devicetree, linux-kernel, linux-omap

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 <andreas@kemnade.info>
> ---
>  .../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


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

* Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
  2023-09-25  6:54   ` Krzysztof Kozlowski
@ 2023-09-25 10:28     ` Jonathan Cameron
  2023-09-25 11:02       ` Andreas Kemnade
  0 siblings, 1 reply; 18+ messages in thread
From: Jonathan Cameron @ 2023-09-25 10:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andreas Kemnade, jic23, lars, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, bcousson, tony, jean-baptiste.maneyrol, chenhuiz,
	andy.shevchenko, linux-iio, devicetree, linux-kernel, linux-omap

On Mon, 25 Sep 2023 08:54:08 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 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 <andreas@kemnade.info>
> > ---
> >  .../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.

Jonathan


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

* Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
  2023-09-25 10:28     ` Jonathan Cameron
@ 2023-09-25 11:02       ` Andreas Kemnade
  2023-09-25 12:24         ` Krzysztof Kozlowski
  0 siblings, 1 reply; 18+ messages in thread
From: Andreas Kemnade @ 2023-09-25 11:02 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Krzysztof Kozlowski, jic23, lars, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, bcousson, tony,
	jean-baptiste.maneyrol, chenhuiz, andy.shevchenko, linux-iio,
	devicetree, linux-kernel, linux-omap

On Mon, 25 Sep 2023 11:28:52 +0100
Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote:

> On Mon, 25 Sep 2023 08:54:08 +0200
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 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 <andreas@kemnade.info>
> > > ---
> > >  .../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

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

* Re: [PATCH 2/3] iio: imu: mpu6050: add level shifter flag
  2023-09-24 22:25 ` [PATCH 2/3] iio: imu: mpu6050: add level shifter flag Andreas Kemnade
@ 2023-09-25 11:07   ` Andy Shevchenko
  2023-09-25 11:14     ` Jean-Baptiste Maneyrol
  2023-09-25 12:04     ` Andreas Kemnade
  0 siblings, 2 replies; 18+ messages in thread
From: Andy Shevchenko @ 2023-09-25 11:07 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: jic23, lars, robh+dt, krzysztof.kozlowski+dt, conor+dt, bcousson,
	tony, jean-baptiste.maneyrol, chenhuiz, linux-iio, devicetree,
	linux-kernel, linux-omap

On Mon, Sep 25, 2023 at 1:26 AM Andreas Kemnade <andreas@kemnade.info> wrote:
>
> Some boards fail in magnetometer probe if flag is not set.

Which flag? Can you elaborate a bit more?

Does it deserve the Fixes tag?

...

>         unsigned int val;
>         int ret;

> +       ret = regmap_update_bits(st->map, 0x1, 0x80,
> +                                st->level_shifter ? 0x80 : 0);

This is a bit cryptic, what does 1 stand for?

Also

  unsigned int mask = BIT(7);
  ...
  val = st->level_shifter ? mask : 0;

> +       if (ret)
> +               return ret;

...
> +       st->level_shifter = device_property_present(dev,
> +                                                   "invensense,level-shifter");

It was a recommendation to use _read_bool() when reading the value,
while the result will be the same.

--
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 2/3] iio: imu: mpu6050: add level shifter flag
  2023-09-25 11:07   ` Andy Shevchenko
@ 2023-09-25 11:14     ` Jean-Baptiste Maneyrol
  2023-09-25 12:04     ` Andreas Kemnade
  1 sibling, 0 replies; 18+ messages in thread
From: Jean-Baptiste Maneyrol @ 2023-09-25 11:14 UTC (permalink / raw)
  To: Andy Shevchenko, Andreas Kemnade
  Cc: jic23, lars, robh+dt, krzysztof.kozlowski+dt, conor+dt, bcousson,
	tony, chenhuiz, linux-iio, devicetree, linux-kernel, linux-omap

Hello,

these are very old unsupported chips, thus this is not something I can easily find. 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: Andy Shevchenko <andy.shevchenko@gmail.com>
Sent: Monday, September 25, 2023 13:07
To: Andreas Kemnade <andreas@kemnade.info>
Cc: jic23@kernel.org <jic23@kernel.org>; lars@metafoo.de <lars@metafoo.de>; robh+dt@kernel.org <robh+dt@kernel.org>; krzysztof.kozlowski+dt@linaro.org <krzysztof.kozlowski+dt@linaro.org>; conor+dt@kernel.org <conor+dt@kernel.org>; bcousson@baylibre.com <bcousson@baylibre.com>; tony@atomide.com <tony@atomide.com>; Jean-Baptiste Maneyrol <Jean-Baptiste.Maneyrol@tdk.com>; chenhuiz@axis.com <chenhuiz@axis.com>; linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>; devicetree@vger.kernel.org <devicetree@vger.kernel.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; linux-omap@vger.kernel.org <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 2/3] iio: imu: mpu6050: add level shifter flag 
 
On Mon, Sep 25, 2023 at 1: 26 AM Andreas Kemnade <andreas@ kemnade. info> wrote: > > Some boards fail in magnetometer probe if flag is not set. Which flag? Can you elaborate a bit more? Does it deserve the Fixes tag? .. . > unsigned 
ZjQcmQRYFpfptBannerStart
This Message Is From an Untrusted Sender 
You have not previously corresponded with this sender. 
 
ZjQcmQRYFpfptBannerEnd
On Mon, Sep 25, 2023 at 1:26 AM Andreas Kemnade <andreas@kemnade.info> wrote:
>
> Some boards fail in magnetometer probe if flag is not set.

Which flag? Can you elaborate a bit more?

Does it deserve the Fixes tag?

...

>         unsigned int val;
>         int ret;

> +       ret = regmap_update_bits(st->map, 0x1, 0x80,
> +                                st->level_shifter ? 0x80 : 0);

This is a bit cryptic, what does 1 stand for?

Also

  unsigned int mask = BIT(7);
  ...
  val = st->level_shifter ? mask : 0;

> +       if (ret)
> +               return ret;

...
> +       st->level_shifter = device_property_present(dev,
> +                                                   "invensense,level-shifter");

It was a recommendation to use _read_bool() when reading the value,
while the result will be the same.

--
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 2/3] iio: imu: mpu6050: add level shifter flag
  2023-09-25 11:07   ` Andy Shevchenko
  2023-09-25 11:14     ` Jean-Baptiste Maneyrol
@ 2023-09-25 12:04     ` Andreas Kemnade
  2023-09-25 12:28       ` Andy Shevchenko
  1 sibling, 1 reply; 18+ messages in thread
From: Andreas Kemnade @ 2023-09-25 12:04 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: jic23, lars, robh+dt, krzysztof.kozlowski+dt, conor+dt, bcousson,
	tony, jean-baptiste.maneyrol, chenhuiz, linux-iio, devicetree,
	linux-kernel, linux-omap

On Mon, 25 Sep 2023 14:07:58 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Mon, Sep 25, 2023 at 1:26 AM Andreas Kemnade <andreas@kemnade.info> wrote:
> >
> > Some boards fail in magnetometer probe if flag is not set.  
> 
> Which flag? Can you elaborate a bit more?
> 
well see $subj. The level shifter flag.

> Does it deserve the Fixes tag?
> 
As there are only certain boards affected, they would also have
to add the flag in dtb, I do not think it deservers a Fixes tag.
Even in the board I have here, there are basically two
mpu9150 connected per cable, only one of them needs the flag.

> ...
> 
> >         unsigned int val;
> >         int ret;  
> 
> > +       ret = regmap_update_bits(st->map, 0x1, 0x80,
> > +                                st->level_shifter ? 0x80 : 0);  
> 
> This is a bit cryptic, what does 1 stand for?
> 
Well, I do not find anything in
https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-9150-Register-Map.pdf
I have just found a similar line in the ancient 3.0 vendor kernel. No symbolic
names there.

Regards,
Andreas

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

* Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
  2023-09-25 11:02       ` Andreas Kemnade
@ 2023-09-25 12:24         ` Krzysztof Kozlowski
  2023-09-25 13:21           ` Jonathan Cameron
  0 siblings, 1 reply; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-09-25 12:24 UTC (permalink / raw)
  To: Andreas Kemnade, Jonathan Cameron
  Cc: jic23, lars, robh+dt, krzysztof.kozlowski+dt, conor+dt, bcousson,
	tony, jean-baptiste.maneyrol, chenhuiz, andy.shevchenko,
	linux-iio, devicetree, linux-kernel, linux-omap

On 25/09/2023 13:02, Andreas Kemnade wrote:
> On Mon, 25 Sep 2023 11:28:52 +0100
> Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote:
> 
>> On Mon, 25 Sep 2023 08:54:08 +0200
>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 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 <andreas@kemnade.info>
>>>> ---
>>>>  .../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


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

* Re: [PATCH 2/3] iio: imu: mpu6050: add level shifter flag
  2023-09-25 12:04     ` Andreas Kemnade
@ 2023-09-25 12:28       ` Andy Shevchenko
  0 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2023-09-25 12:28 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: jic23, lars, robh+dt, krzysztof.kozlowski+dt, conor+dt, bcousson,
	tony, jean-baptiste.maneyrol, chenhuiz, linux-iio, devicetree,
	linux-kernel, linux-omap

On Mon, Sep 25, 2023 at 3:04 PM Andreas Kemnade <andreas@kemnade.info> wrote:
> On Mon, 25 Sep 2023 14:07:58 +0300
> Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > On Mon, Sep 25, 2023 at 1:26 AM Andreas Kemnade <andreas@kemnade.info> wrote:
> > >
> > > Some boards fail in magnetometer probe if flag is not set.
> >
> > Which flag? Can you elaborate a bit more?
> >
> well see $subj. The level shifter flag.

Well. it is better to have the commit message being self-contained.

> > Does it deserve the Fixes tag?
> >
> As there are only certain boards affected, they would also have
> to add the flag in dtb, I do not think it deservers a Fixes tag.
> Even in the board I have here, there are basically two
> mpu9150 connected per cable, only one of them needs the flag.

OK.

...

> > >         unsigned int val;
> > >         int ret;
> >
> > > +       ret = regmap_update_bits(st->map, 0x1, 0x80,
> > > +                                st->level_shifter ? 0x80 : 0);
> >
> > This is a bit cryptic, what does 1 stand for?
> >
> Well, I do not find anything in
> https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-9150-Register-Map.pdf
> I have just found a similar line in the ancient 3.0 vendor kernel. No symbolic
> names there.

Okay, perhaps a comment on top to point out this ("the code based on
v3.0 vendor kernel, the meaning is unknown").

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
  2023-09-25 12:24         ` Krzysztof Kozlowski
@ 2023-09-25 13:21           ` Jonathan Cameron
  2023-09-25 14:25             ` Jean-Baptiste Maneyrol
  2023-09-25 18:02             ` Andreas Kemnade
  0 siblings, 2 replies; 18+ messages in thread
From: Jonathan Cameron @ 2023-09-25 13:21 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andreas Kemnade, jic23, lars, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, bcousson, tony, jean-baptiste.maneyrol, chenhuiz,
	andy.shevchenko, linux-iio, devicetree, linux-kernel, linux-omap

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> wrote:
> >   
> >> On Mon, 25 Sep 2023 08:54:08 +0200
> >> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 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 <andreas@kemnade.info>
> >>>> ---
> >>>>  .../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
> 
> 


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

* Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
  2023-09-25 13:21           ` Jonathan Cameron
@ 2023-09-25 14:25             ` Jean-Baptiste Maneyrol
  2023-09-25 18:02             ` Andreas Kemnade
  1 sibling, 0 replies; 18+ messages in thread
From: Jean-Baptiste Maneyrol @ 2023-09-25 14:25 UTC (permalink / raw)
  To: Jonathan Cameron, Krzysztof Kozlowski
  Cc: Andreas Kemnade, jic23, lars, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, bcousson, tony, chenhuiz, andy.shevchenko, linux-iio,
	devicetree, linux-kernel, linux-omap

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 <Jonathan.Cameron@Huawei.com>
Sent: Monday, September 25, 2023 15:21
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Andreas Kemnade <andreas@kemnade.info>; jic23@kernel.org <jic23@kernel.org>; lars@metafoo.de <lars@metafoo.de>; robh+dt@kernel.org <robh+dt@kernel.org>; krzysztof.kozlowski+dt@linaro.org <krzysztof.kozlowski+dt@linaro.org>; conor+dt@kernel.org <conor+dt@kernel.org>; bcousson@baylibre.com <bcousson@baylibre.com>; tony@atomide.com <tony@atomide.com>; Jean-Baptiste Maneyrol <Jean-Baptiste.Maneyrol@tdk.com>; chenhuiz@axis.com <chenhuiz@axis.com>; andy.shevchenko@gmail.com <andy.shevchenko@gmail.com>; linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>; devicetree@vger.kernel.org <devicetree@vger.kernel.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; linux-omap@vger.kernel.org <linux-omap@vger.kernel.org>
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 <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> wrote:
> >   
> >> On Mon, 25 Sep 2023 08:54:08 +0200
> >> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 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 <andreas@kemnade.info>
> >>>> ---
> >>>>  .../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
> 
> 


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

* Re: [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter
  2023-09-25 13:21           ` Jonathan Cameron
  2023-09-25 14:25             ` Jean-Baptiste Maneyrol
@ 2023-09-25 18:02             ` Andreas Kemnade
  1 sibling, 0 replies; 18+ messages in thread
From: Andreas Kemnade @ 2023-09-25 18:02 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Krzysztof Kozlowski, jic23, lars, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, bcousson, tony,
	jean-baptiste.maneyrol, chenhuiz, andy.shevchenko, linux-iio,
	devicetree, linux-kernel, linux-omap

On Mon, 25 Sep 2023 14:21:57 +0100
Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote:

> 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> wrote:
> > >     
> > >> On Mon, 25 Sep 2023 08:54:08 +0200
> > >> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 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 <andreas@kemnade.info>
> > >>>> ---
> > >>>>  .../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

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

end of thread, other threads:[~2023-09-25 18:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-24 22:25 [PATCH 0/3] ARM: omap: omap4-embt2ws: Add IMU on control unit Andreas Kemnade
2023-09-24 22:25 ` [PATCH 1/3] dt-bindings: iio: imu: mpu6050: Add level shifter Andreas Kemnade
2023-09-24 23:33   ` Rob Herring
2023-09-24 23:39   ` kernel test robot
2023-09-25  6:54   ` Krzysztof Kozlowski
2023-09-25 10:28     ` Jonathan Cameron
2023-09-25 11:02       ` Andreas Kemnade
2023-09-25 12:24         ` Krzysztof Kozlowski
2023-09-25 13:21           ` Jonathan Cameron
2023-09-25 14:25             ` Jean-Baptiste Maneyrol
2023-09-25 18:02             ` Andreas Kemnade
2023-09-24 22:25 ` [PATCH 2/3] iio: imu: mpu6050: add level shifter flag Andreas Kemnade
2023-09-25 11:07   ` Andy Shevchenko
2023-09-25 11:14     ` Jean-Baptiste Maneyrol
2023-09-25 12:04     ` Andreas Kemnade
2023-09-25 12:28       ` Andy Shevchenko
2023-09-24 22:25 ` [PATCH 3/3] ARM: dts: omap: omap4-embt2ws: Add IMU at control unit Andreas Kemnade
2023-09-25  6:53   ` Krzysztof Kozlowski

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.