lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250729194738.52aa3268@jic23-huawei>
Date: Tue, 29 Jul 2025 19:47:38 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Dixit Parmar <dixitparmar19@...il.com>
Cc: David Lechner <dlechner@...libre.com>, Nuno Sá
 <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>, Rob Herring
 <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, linux-kernel@...r.kernel.org,
 linux-iio@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH 1/2] iio: magnetometer: add support for Infineon TLV493D
 3D Magentic sensor

On Tue, 29 Jul 2025 08:56:00 +0530
Dixit Parmar <dixitparmar19@...il.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@...il.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ