Re: [PATCH v2 0/2] iio: magnetometer: add support for Melexis MLX90393

From: Nikhil Gautam

Date: Thu Jun 18 2026 - 16:27:01 EST



On 19-06-2026 12:29 am, Andy Shevchenko wrote:
On Thu, Jun 18, 2026 at 09:31:39PM +0530, Nikhil Gautam wrote:
Hi,

This series adds initial Industrial I/O subsystem support for the
Melexis MLX90393 3-axis magnetometer and temperature sensor.

The MLX90393 supports both I2C and SPI interfaces. This series
implements support for the I2C interface while keeping the driver
structure transport-independent to simplify future SPI support.

Currently supported features:

* Raw magnetic field measurements for X/Y/Z axes
* Raw temperature measurements
* Configurable gain/scale selection
* Configurable oversampling ratio
* Direct mode operation through the IIO subsystem
* I2C interface support

The driver has been tested on Raspberry Pi 5 hardware using an
MLX90393 sensor connected over I2C. Magnetic field and temperature
measurements were verified through the IIO sysfs interface.
This doesn't answer to two important questions:
- why do we need a brand new driver?
Can't one of the existing be updated to cover this HW?

- where to find the datasheet? Any Links or other means to get it?

Hi Andy,

I looked at the existing magnetometer drivers in the IIO subsystem,
but none support the MLX90393 or a sufficiently similar register map and command protocol.
The MLX90393 uses its own command-based interface and device-specific configuration and conversion logic,
so extending an existing driver would require substantial changes with little code reuse.
Therefore, I chose to implement it as a separate driver.

The datasheet is publicly available from Melexis:
Link: https://media.melexis.com/-/media/files/documents/datasheets/mlx90393-datasheet-melexis.pdf

I'll include the datasheet link and clarify the rationale for introducing
a new driver in the cover letter of the next revision.

Thanks,
Nikhil