public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dixit Parmar <dixitparmar19@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"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 1/2] iio: magnetometer: add support for Infineon TLV493D 3D Magentic sensor
Date: Tue, 29 Jul 2025 19:47:38 +0100	[thread overview]
Message-ID: <20250729194738.52aa3268@jic23-huawei> (raw)
In-Reply-To: <aIg_SClXq0pO69iH@dixit>

On Tue, 29 Jul 2025 08:56:00 +0530
Dixit Parmar <dixitparmar19@gmail.com> wrote:

> On Sat, Jul 26, 2025 at 03:44:03PM -0500, David Lechner wrote:
> > On 7/26/25 4:37 AM, Dixit Parmar wrote:  
> > > The Infineon TLV493D is a Low-Power 3D Magnetic Sensor. The Sensor
> > > applications includes joysticks, control elements (white goods,
> > > multifunction knops), or electric meters (anti tampering) and any
> > > other application that requires accurate angular measurements at
> > > low power consumptions.
> > > 
> > > The Sensor is configured over I2C, and as part of Sensor measurement
> > > data it provides 3-Axis magnetic fields and temperature core measurement.
> > > 
> > > The driver supports raw value read and buffered input via external trigger
> > > to allow streaming values with the same sensing timestamp.
> > > 
> > > 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.
> > > 
> > > While sensor has interrupt pin multiplexed with I2C SCL pin. But for bus
> > > configurations interrupt(INT) is not recommended, unless timing constraints
> > > between I2C data transfers and interrupt pulses are monitored and aligned.
> > > 
> > > The Sensor's I2C register map and mode information is described in product
> > > User Manual[1].
> > > 
> > > Datasheet: https://www.infineon.com/assets/row/public/documents/24/49/infineon-tlv493d-a1b6-datasheet-en.pdf
> > > [1] https://www.mouser.com/pdfDocs/Infineon-TLV493D-A1B6_3DMagnetic-UserManual-v01_03-EN.pdf
> > > 
> > > Signed-off-by: Dixit Parmar <dixitparmar19@gmail.com>

Picking out one question for a quick answer...
> > > +			return ret;
> > > +		}
> > > +		/* Return raw values for requested channel */
> > > +		switch (chan->address) {
> > > +		case AXIS_X:
> > > +			*val = x;
> > > +			return IIO_VAL_INT;
> > > +		case AXIS_Y:
> > > +			*val = y;
> > > +			return IIO_VAL_INT;
> > > +		case AXIS_Z:
> > > +			*val = z;
> > > +			return IIO_VAL_INT;
> > > +		case TEMPERATURE:
> > > +			*val = t;
> > > +			return IIO_VAL_INT;
> > > +		default:
> > > +			return -EINVAL;
> > > +		}
> > > +	case IIO_CHAN_INFO_SCALE:
> > > +		switch (chan->type) {
> > > +		case IIO_MAGN:
> > > +			/*
> > > +			 * Magnetic field scale: 0.0098 mTesla (i.e. 9.8 µT)
> > > +			 * Expressed as fractional: 98/10 = 9.8 µT.
> > > +			 */
> > > +			*val = 98;
> > > +			*val2 = 10;  
> > 
> > We use SI units, so this needs to be gauss, not tesela.
> >   
> Sure, Is there any documentation/reference this details are mentioned?

Documentation/ABI/testing/sysfs-bus-iio

https://elixir.bootlin.com/linux/v6.16/source/Documentation/ABI/testing/sysfs-bus-iio#L342
is the specific entry for magnetic fields. 

Otherwise a small process thing - where you are agreeing with review
feedback, no need to put it in your reply.  Much better to just fix
it and have it in the change log for the next version.  That will let
you crop away much more of the thread, so we can focus in on questions.

Jonathan


  parent reply	other threads:[~2025-07-29 18:47 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 [this message]
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
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=20250729194738.52aa3268@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dixitparmar19@gmail.com \
    --cc=dlechner@baylibre.com \
    --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