linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jakub Ladman <ladmanj@volny.cz>, Rob Herring <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	<linux-input@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-hwmon@vger.kernel.org>, <linux-i2c@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-iio@vger.kernel.org>
Subject: Re: [PATCH][RESEND] New driver for TLV493D-A1B6 I2C chip, input and hwmon class device.
Date: Mon, 28 Oct 2019 13:05:15 +0000	[thread overview]
Message-ID: <20191028130515.00003bb0@huawei.com> (raw)
In-Reply-To: <20191018205637.GS35946@dtor-ws>

On Fri, 18 Oct 2019 13:56:37 -0700
Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:

> Hi Jakub,
> 
> On Fri, Oct 18, 2019 at 10:10:19PM +0200, Jakub Ladman wrote:
> > Dear maintainers.
> > 
> > As a linux-patch newbie i made some mistakes in my first attempt to send
> > this patch.
> > This patch contains a new driver for i2c connected chip, Infineon
> > TLV493D-A1B6.
> > The chip is 3D hall-effect sensor with thermometer.
> > 
> > This particular driver senses magnetic field rotation in X/Y plane with 1
> > degree resolution and +/- 1 degree error.
> > 
> > Input device is created for the angle sensing part.
> > Hwmon device is created for the thermometer part.
> > 
> > Input device axis must be configured by device-tree. There are also optional
> > parameters regarding absolute/relative mode switching, minimum step in
> > relative mode, filtering and thermometer calibration.
> > 
> > We are using that device as high reliability rotary encoder.  
> 
> I wonder if IIO subsystem that support s magnetometers and temperature
> sensors would not be a better hone for this.
> 
> CC-ing Jonathan.
> 
Hi Jakub, Dmitry,

Sorry for slow reply, was on vacation.

Anyhow, from a quick glance at the datasheet this looks like a fairly standard
magnetometer, be it one designed for use with an associated magnet, rather than
intended for use to measure the earths magnetic field (compass type chips).

These devices only become an 'input device' once the relative positioning relative
to the magnet is known.  We should probably figure out a way to represent that
in DT etc for devices where it is known.  Whether we then do a bridge to input
using that info in kernel or pass it all up to userspace to deal with is a
separate issue, that position information needs to be described first.  My suspicion
is that it would be hard to handle the maths in kernel, but I've not tried
working it out!

So this would fit in IIO, even if the eventual 'use case' is classic input
(I'm guessing a rotary dial).

We have a driver for a part with similar support undergoing revisions at the
moment:

https://www.azoteq.com/images/stories/pdf/iqs624_datasheet.pdf

There might be other hall effect devices like this in IIO, I can't recall but
I certainly have one in my todo pile.

+CC linux-iio

Thanks,

Jonathan


> Also, your mailer mangled your patch pretty badly, please consider using
> git send-email next time.


> 
> Thanks.
> 



  reply	other threads:[~2019-10-28 13:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 20:10 [PATCH][RESEND] New driver for TLV493D-A1B6 I2C chip, input and hwmon class device Jakub Ladman
2019-10-18 20:56 ` Dmitry Torokhov
2019-10-28 13:05   ` Jonathan Cameron [this message]
2019-10-18 21:01 Guenter Roeck

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=20191028130515.00003bb0@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ladmanj@volny.cz \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).