Re: [PATCH v2 0/4] Add QST QMC5883P magnetometer driver
From: Hardik Phalet
Date: Sun Apr 12 2026 - 06:28:04 EST
On Fri Apr 10, 2026 at 10:06 AM IST, Andy Shevchenko wrote:
> On Thu, Apr 09, 2026 at 09:07:11PM +0000, Hardik Phalet wrote:
>> Verification steps performed:
>> - Chip ID register (0x00) reads back 0x80 on probe, confirming the
>> correct device is present
>> - All three axes (in_magn_x_raw, in_magn_y_raw, in_magn_z_raw) return
>> non-zero, stable values when the board is held still and change
>> appropriately when the board is rotated
>> - in_magn_x_scale (and Y, Z) returns the expected fractional value for
>> the default ±8 G range (1/37500000)
>> - in_magn_sampling_frequency / _available, in_magn_oversampling_ratio /
>> _available, and downsampling_ratio / downsampling_ratio_available all
>> read and write correctly; the chip responds without error to each
>> valid setting
>> - Runtime PM: after 2 s of inactivity the device enters suspend mode
>> (MODE = 0x00 confirmed via i2cdump); the next sysfs read correctly
>> resumes the device and returns valid data
>> - System suspend/resume (echo mem > /sys/power/state) leaves the
>> driver in a consistent state; readings remain valid after resume
>> - dt_binding_check passes for patch 2/4
>> - Kernel builds cleanly with W=1 and no new warnings
>
> This driver is rather huge. There are mistakes you made in the process, though:
> - never send a new version for such a code (amount and complexity) earlier than
> a week; give others a chance to review
Noted, Andy. I will take care of it from now on.
> - do not put driver to staging, why?
There are some functionality missing. But it has since been made clear
to me that that is not a valid reason. I will move to `drivers/iio`
in the next patch series.
> - the investigation is rather poor about existence of the driver — make sure
> there is no compatible (by register layout) driver in IIO or even outside it
> (for ADCs it might appear as HWMON [drivers/hwmon] or INPUT [drivers/input]
> in some cases)
I will dig a bit deeper into this. But I could not find any thing
realted to the device I am working on (qmc5883p).
There is a device hmc5843_core.c that already handles HMC5883L. But the
register layout is different, field ranges, gain encoding etc. are
different and I think warrants a separate driver. Other than that I
could not find something related to device I am working on.
I will carefully go through HWMON and INPUT too, but do you have a
strategy to help me find somehting similar? It will be very useful.
Would `grep`-ing for 5883 and QST be a right starting point?
>
> --
> With Best Regards,
> Andy Shevchenko
Thank you for the review Andy, I appreciate your time!
Regards,
Hardik
-