public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Nikhil Gautam <nikhilgtr@gmail.com>,
	linux-iio@vger.kernel.org, dlechner@baylibre.com,
	nuno.sa@analog.com, andy@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] iio: magnetometer: mlx90393 - regmap vs command-based access
Date: Fri, 24 Apr 2026 11:48:18 +0100	[thread overview]
Message-ID: <20260424114818.1290b029@jic23-huawei> (raw)
In-Reply-To: <aepaWzVfgRFlau6L@ashevche-desk.local>

On Thu, 23 Apr 2026 20:43:55 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Thu, Apr 23, 2026 at 05:55:35PM +0530, Nikhil Gautam wrote:
> > 
> > Apologies for missing a few details in the previous mail.
> > 
> > The MLX90393 supports both I2C and SPI interfaces.
> > 
> > Commands include, for example:
> > - SM (Start Measurement)
> > - RM (Read Measurement)
> > - RR (Read Register)
> > 
> > Given this command-oriented interface over both I2C and SPI,
> > I wanted to confirm whether a custom command abstraction layer
> > would still be the preferred approach instead of regmap.  
> 
> I found only 4 drivers for this vendor in the kernel and they seem
> either register based or eeprom based. Perhaps the latter is the
> case here? Have you checked existing implementations?
> 

If it doesn't match up with an existing case.

I took a look at the datasheet and this is a weird mix
of a register driven and command driven device.  As such you could
do regmap for the registers, buy you'd need to bypass that for
the command only stuff.  I don't think it's worth the mess of
creating some virtual registers to deal with the commands.

Hence I think in this particular case regmap doesn't look suitable
and a custom bus abstraction layer makes sense.  Some of that is going
to look regmap like, but with some other callbacks as well.

Jonathan

  reply	other threads:[~2026-04-24 10:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 12:18 [RFC] iio: magnetometer: mlx90393 - regmap vs command-based access Nikhil Gautam
2026-04-23 12:25 ` Nikhil Gautam
2026-04-23 17:43   ` Andy Shevchenko
2026-04-24 10:48     ` Jonathan Cameron [this message]
2026-04-24 12:57       ` Nikhil Gautam

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=20260424114818.1290b029@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikhilgtr@gmail.com \
    --cc=nuno.sa@analog.com \
    /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