From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Romain TISSERAND <romain.tisserand@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
sashiko-reviews@lists.linux.dev
Subject: Re: [PATCH 0/4] iio: adc: Add the Miyoo A30 and PocketGo S30 analog stick MCUs
Date: Fri, 27 Nov 2026 13:49:02 +0200 [thread overview]
Message-ID: <awluLgvMt9BN1Aj8@ashevche-desk.local> (raw)
In-Reply-To: <20261127012612.1589039-1-romain.tisserand@gmail.com>
On Fri, Nov 27, 2026 at 02:26:08AM +0100, Romain TISSERAND wrote:
> The Miyoo A30 and the PocketGo S30 are two Allwinner A33 handhelds
> whose analog stick is read by a small microcontroller: the MCU samples
> the stick potentiometers and hands the raw 8-bit readings to the SoC,
> on a UART (A30, a stream of frames at 9600 baud) or over I2C (S30, a
> four-byte read with complements). Neither MCU takes commands.
Why a brand new driver for each of the cases?
> Both drivers expose the readings as raw IIO channels for the existing
> adc-joystick driver. The A30 MCU pushes its frames on its own, so its
> driver also feeds a software IIO buffer and adc-joystick takes the stick
> from it without polling. The S30 MCU only answers when read and has no
> data-ready line, so adc-joystick polls it, as on the Anbernic RGxx3
> boards where the stick is behind a SARADC. There is no scale: the
> readings are raw ADC codes of the MCU.
> Patches 1 and 2 add the A30 binding and driver, patches 3 and 4 the S30
> ones. Both use the existing "miyoo" vendor prefix (the PocketGo S30 is
> a Miyoo/Bittboy product). The board devicetrees will be sent to the
> sunxi tree.
>
> Testing: each patch built with W=1 for arm (multi_v7_defconfig, both
> drivers =y and =m) and arm64 (defconfig, =m), no warnings;
> dt_binding_check clean for both bindings; the board devicetrees pass
> dtbs_check with these bindings.
>
> On a PocketGo S30 on 7.3.1: about one single read in four fails an exact
> complement check (the value and its complement differ by a count or two
> at rest, up to about thirty while the stick moves fast); with the +-2
> tolerance and up to three tries, polling as adc-joystick does (two reads
> every 10 ms), no read failed over 2 x 6000 reads at rest and moving, and
> under 2% needed a second try (exact check: about 4% failed). The in-tree
> adc-joystick driver on the S30 channels reported 365 and 374 events over
> 15 s of full circles, 42..231 and 24..246.
>
> On a Miyoo A30 on 7.3.1: rest 136/123; reading the channels from sysfs,
> full circles 22..248 (X) and 11..221 (Y). The in-tree adc-joystick
> driver, without poll-interval, takes the stick from the IIO buffer: 826
> and 852 events over 15 s of full circles (the MCU sends about 67 frames
> a second), 37..246 and 11..220.
>
> Retested with this version on the A30 (7.3.1): with only one channel
> enabled in the buffer, each channel gives its own axis (stick held
> right: ch0 alone 141..242, ch1 alone 116..119); three unbind/bind rounds
> with adc-joystick bound: no warning, the readings and the adc-joystick
> device come back; at rest 139/118, +-1 over 50 sysfs reads.
> On the S30 (7.3.1): at rest 152/126, no failed read; adc-joystick 1213
> events over 15 s of full circles; three unbind/bind rounds: no warning,
> readings and adc-joystick back.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-11-27 11:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 1:26 Romain TISSERAND
2026-11-27 1:26 ` [PATCH 1/4] dt-bindings: iio: adc: Add the Miyoo A30 analog stick MCU Romain TISSERAND
2026-11-27 1:26 ` [PATCH 2/4] " Romain TISSERAND
2026-11-27 8:47 ` Uwe Kleine-König
2026-11-27 1:26 ` [PATCH 3/4] dt-bindings: iio: adc: Add the PocketGo S30 " Romain TISSERAND
2026-11-27 1:26 ` [PATCH 4/4] " Romain TISSERAND
2026-11-27 11:49 ` Andy Shevchenko [this message]
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=awluLgvMt9BN1Aj8@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
--cc=romain.tisserand@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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
all inboxes | Powered by JetHome®