public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Dixit Parmar <dixitparmar19@gmail.com>
To: David Lechner <dlechner@baylibre.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] dt-bindings: iio: magnetometer: document Infineon TLV493D 3D Magnetic sensor
Date: Tue, 29 Jul 2025 08:33:27 +0530	[thread overview]
Message-ID: <aIg5_x4UMLjRk4dn@dixit> (raw)
In-Reply-To: <455141b2-e82f-45fd-b30f-5d9436aa861b@baylibre.com>

On Sat, Jul 26, 2025 at 03:43:56PM -0500, David Lechner wrote:
> On 7/26/25 4:37 AM, Dixit Parmar wrote:
> > Document the bindings for Infineon TLV493D Low-Power 3D Magnetic Sensor
> > controlled by I2C interface. Main applications includes joysticks, control
> > elements (white goods, multifunction knops), or electric meters (anti
> > tampering).
> > 
> > The device can be configured in to different operating modes by optional
> > device-tree "mode" property. Also, the temperature sensing part requires
> > raw offset captured at 25°C and that can be specified by "temp-offset"
> > optional device-tree property.
> > 
> > Datasheet: https://www.infineon.com/assets/row/public/documents/24/49/infineon-tlv493d-a1b6-datasheet-en.pdf
> > 
> > Signed-off-by: Dixit Parmar <dixitparmar19@gmail.com>
> > ---
> >  .../iio/magnetometer/infineon,tlv493d.yaml         | 57 ++++++++++++++++++++++
> >  1 file changed, 57 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/magnetometer/infineon,tlv493d.yaml b/Documentation/devicetree/bindings/iio/magnetometer/infineon,tlv493d.yaml
> > new file mode 100644
> > index 000000000000..0442cf41503b
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/magnetometer/infineon,tlv493d.yaml
> > @@ -0,0 +1,57 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/magnetometer/infineon,tlv493d.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Infineon Technologies TLV493D Low-Power 3D Magnetic Sensor
> > +
> > +maintainers:
> > +  - Dixit Parmar <dixitparmar19@gmail.com>
> > +
> > +properties:
> > +  $nodename:
> > +    pattern: '^magnetometer@[0-9a-f]+$'
> > +
> > +  compatible:
> > +    const: infineon,tlv493d-a1b6
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  vdd-supply:
> > +    description: 2.8V to 3.5V supply
> 
> The SDA pin can also be a /INT signal, so we need to have an
> optional interrupts property as well.
>
Okay. Will add it.
> > +
> > +  mode:
> > +    description: Sensor operating mode. Must be one of the defined enum values.
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    enum:
> > +      - 0 # Power Down Mode. No measurement.
> > +      - 1 # Fast Mode
> > +      - 2 # Low-Power Mode
> > +      - 3 # Ultra Low-Power Mode
> > +      - 4 # Master Controlled Mode
> > +    default: 4
> 
> This is not the sort of thing that really belongs in a devicetree.
> We should be describing here how the chip is wired up, and only
> control how it works based on that.
> 
> If there are any wiring conditions that could affect this setting,
> they could go here. For example, if the power supply doesn't have
> enough current, then we can only operate in one of the low power
> modes. Otherwise generally we just stick to the best performing
> mode. And specifying the power down mode here really doesn't make
> sense - you could never use the sensor!
> 
Got it. Will remove it.
> > +
> > +  temp-offset:
> > +    description: Raw temperature offset at 25°C to apply before applying scale and correction.
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    default: 340
> 
> This is another one that likely doesn't belong in the devicetree.
> There is a standard *_calibbias attribute that can be used for
> such a calibration if needed.
> 
Its factory setting so I thought if there is any deviation from that
than we can handle it like this but as you pointed out, its not the
right way, so will stick to 340 default factory value as per the
datasheet.
> > +
> > +required:
> > +  - compatible
> > +  - reg
> 
> Power supplies are usually required.
> 
Ack.
> > +
> > +additionalProperties: false
> > +
> > +example:
> > +  - |
> > +    i2c {
> > +      #address-cells = <1>;
> > +      #size-cells = <0>;
> > +      magnetometer@5e {
> > +        compatible = "infineon,tlv493d-a1b6";
> > +        reg = <0x5e>;
> > +        vdd = <&hall_vcc>;
> > +      };
> > +    };
> > 
> 
Thanks for the review,
Dixit

  reply	other threads:[~2025-07-29  3:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-26  9:37 [PATCH 0/2] iio: magnetometer: add support for Infineon TLV493D 3D Magnetic Sensor Dixit Parmar
2025-07-26  9:37 ` [PATCH 1/2] iio: magnetometer: add support for Infineon TLV493D 3D Magentic sensor Dixit Parmar
2025-07-26 20:44   ` David Lechner
2025-07-27 12:38     ` Jonathan Cameron
2025-07-29  3:27       ` Dixit Parmar
2025-07-29  3:26     ` Dixit Parmar
2025-07-29  7:49       ` Andy Shevchenko
2025-07-29 18:47       ` Jonathan Cameron
2025-07-29 18:51       ` David Lechner
2025-07-26 22:03   ` Christophe JAILLET
2025-07-29  3:28     ` Dixit Parmar
2025-07-27 13:05   ` Jonathan Cameron
2025-07-29  3:49     ` Dixit Parmar
2025-07-29 19:05       ` Jonathan Cameron
2025-07-30  3:44         ` Dixit Parmar
2025-07-31 13:04           ` Jonathan Cameron
2025-07-26  9:37 ` [PATCH 2/2] dt-bindings: iio: magnetometer: document Infineon TLV493D 3D Magnetic sensor Dixit Parmar
2025-07-26 20:43   ` David Lechner
2025-07-29  3:03     ` Dixit Parmar [this message]
2025-07-27  2:09   ` kernel test robot
2025-07-27  9:23   ` Krzysztof Kozlowski
2025-07-29  3:05     ` Dixit Parmar
2025-07-27 20:27   ` Rob Herring (Arm)
2025-07-29  3:09     ` Dixit Parmar

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=aIg5_x4UMLjRk4dn@dixit \
    --to=dixitparmar19@gmail.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox