Linux IIO development
 help / color / mirror / Atom feed
* Adding support for QMC5883L magnetometer to IIO subsystem
@ 2025-04-08 14:13 Brajesh Patil
  2025-04-10 15:10 ` David Lechner
  0 siblings, 1 reply; 3+ messages in thread
From: Brajesh Patil @ 2025-04-08 14:13 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, marcelo.schmitt1

I have a QMC5883L magnetometer module that I’ve been trying to integrate with my 
Raspberry Pi using a kernel-space driver. While checking the mainline kernel, I 
found that there is a driver for the HMC5883L (under the hmc5843 driver), but nothing 
for QMC5883L.

I compared the datasheets for both devices and confirmed that they are not 
register-compatible — the QMC5883L has a different I2C address and an entirely different 
register map from the HMC5883L.

Given that this sensor is widely used (often as a drop-in replacement for the 
now-discontinued HMC5883L), I was thinking of writing a new driver for it under the IIO 
subsystem.

Would it make sense to move forward with this? If so, I’d appreciate any guidance or 
suggestions from the community.

Thanks,  
Brajesh 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adding support for QMC5883L magnetometer to IIO subsystem
  2025-04-08 14:13 Adding support for QMC5883L magnetometer to IIO subsystem Brajesh Patil
@ 2025-04-10 15:10 ` David Lechner
       [not found]   ` <CALJe6R3YfhdLKDVBZ=NgO+m64wHHqvFf5tt1T-2pWnr29wE94Q@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: David Lechner @ 2025-04-10 15:10 UTC (permalink / raw)
  To: Brajesh Patil, jic23; +Cc: linux-iio, marcelo.schmitt1

On 4/8/25 9:13 AM, Brajesh Patil wrote:
> I have a QMC5883L magnetometer module that I’ve been trying to integrate with my 
> Raspberry Pi using a kernel-space driver. While checking the mainline kernel, I 
> found that there is a driver for the HMC5883L (under the hmc5843 driver), but nothing 
> for QMC5883L.
> 
> I compared the datasheets for both devices and confirmed that they are not 
> register-compatible — the QMC5883L has a different I2C address and an entirely different 
> register map from the HMC5883L.
> 
> Given that this sensor is widely used (often as a drop-in replacement for the 
> now-discontinued HMC5883L), I was thinking of writing a new driver for it under the IIO 
> subsystem.
> 
> Would it make sense to move forward with this? If so, I’d appreciate any guidance or 
> suggestions from the community.
> 
> Thanks,  
> Brajesh 
> 
> 

Go for it. :-)

My advice for writing a new driver: Don't try to implement every feature in one
patch (or even one patch series). Just start with the most basic functionality.
Then add more features in separate patches as they are needed. (Devicetree
bindings are an exception and should be as complete as possible in the first
patch.)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adding support for QMC5883L magnetometer to IIO subsystem
       [not found]   ` <CALJe6R3YfhdLKDVBZ=NgO+m64wHHqvFf5tt1T-2pWnr29wE94Q@mail.gmail.com>
@ 2025-04-11 21:34     ` David Lechner
  0 siblings, 0 replies; 3+ messages in thread
From: David Lechner @ 2025-04-11 21:34 UTC (permalink / raw)
  To: Brajesh Patil; +Cc: jic23, linux-iio, marcelo.schmitt1

On 4/11/25 2:46 PM, Brajesh Patil wrote:
> Thanks a lot for the response and suggestions.
> 
> I'll take your advice and start with a minimal implementation focused on basic functionality. I will first get the driver working reliably with raw data readings via the IIO subsystem. Once that’s done, I’ll gradually build on it with additional features in future patches.
> 
> I’ll make sure the devicetree bindings are complete and properly documented in the first patch, as you suggested. I’ll also look at similar existing bindings to maintain consistency.
> 
> I’ll begin development and testing shortly and will share the patches once I have a working version.

Be sure to read https://www.kernel.org/doc/html/latest/process/submitting-patches.html
too. Then you will know that the mailing lists will ignore html email like your last
reply and other important things that are expected when submitting patches. ;-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-11 21:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 14:13 Adding support for QMC5883L magnetometer to IIO subsystem Brajesh Patil
2025-04-10 15:10 ` David Lechner
     [not found]   ` <CALJe6R3YfhdLKDVBZ=NgO+m64wHHqvFf5tt1T-2pWnr29wE94Q@mail.gmail.com>
2025-04-11 21:34     ` David Lechner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox