From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Samuel Holland <samuel@sholland.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input <linux-input@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Rob Herring <robh+dt@kernel.org>, Ondrej Jirman <x@xff.cz>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
devicetree <devicetree@vger.kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Chen-Yu Tsai <wens@csie.org>,
Colin Ian King <colin.king@intel.com>,
David Gow <davidgow@google.com>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Marco Felsch <m.felsch@pengutronix.de>,
Mattijs Korpershoek <mkorpershoek@baylibre.com>,
Stephen Boyd <swboyd@chromium.org>,
Yassine Oudjana <y.oudjana@protonmail.com>,
"fengping.yu" <fengping.yu@mediatek.com>,
linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
linux-sunxi@lists.linux.dev
Subject: Re: [PATCH v4 3/4] Input: pinephone-keyboard - Support the proxied I2C bus
Date: Sun, 19 Jun 2022 13:34:12 +0200 [thread overview]
Message-ID: <CAHp75VfM3L-bKOLoXTz67JCWq8UX6d-LvuYDxXMtTBznGOTgSA@mail.gmail.com> (raw)
In-Reply-To: <20220618165747.55709-4-samuel@sholland.org>
On Sat, Jun 18, 2022 at 7:12 PM Samuel Holland <samuel@sholland.org> wrote:
>
> The PinePhone keyboard case contains a battery managed by an integrated
> power bank IC. The power bank IC communicates over I2C, and the keyboard
> MCU firmware provides an interface to read and write its registers.
> Let's use this interface to implement a SMBus adapter, so we can reuse
> the driver for the power bank IC.
...
> + /* Read back the command status until it passes or fails. */
> + do {
> + usleep_range(300, 500);
> + ret = i2c_smbus_read_byte_data(client, PPKB_SYS_COMMAND);
> + } while (ret == buf[2]);
> + if (ret < 0)
> + return ret;
> + /* Commands return 0x00 on success and 0xff on failure. */
> + if (ret)
> + return -EIO;
Something to use from iopoll.h ?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-06-19 11:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-18 16:57 [PATCH v4 0/4] Pine64 PinePhone keyboard support Samuel Holland
2022-06-18 16:57 ` [PATCH v4 1/4] dt-bindings: input: Add the PinePhone keyboard binding Samuel Holland
2022-06-18 16:57 ` [PATCH v4 2/4] Input: pinephone-keyboard - Add PinePhone keyboard driver Samuel Holland
2022-06-19 11:43 ` Andy Shevchenko
2022-06-21 4:12 ` Samuel Holland
2022-10-01 6:28 ` Dmitry Torokhov
2022-06-18 16:57 ` [PATCH v4 3/4] Input: pinephone-keyboard - Support the proxied I2C bus Samuel Holland
2022-06-19 11:34 ` Andy Shevchenko [this message]
2022-06-18 16:57 ` [PATCH v4 4/4] [DO NOT MERGE] arm64: dts: allwinner: pinephone: Add keyboard Samuel Holland
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=CAHp75VfM3L-bKOLoXTz67JCWq8UX6d-LvuYDxXMtTBznGOTgSA@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=colin.king@intel.com \
--cc=davidgow@google.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=fengping.yu@mediatek.com \
--cc=jernej.skrabec@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=m.felsch@pengutronix.de \
--cc=mkorpershoek@baylibre.com \
--cc=robh+dt@kernel.org \
--cc=samuel@sholland.org \
--cc=swboyd@chromium.org \
--cc=wens@csie.org \
--cc=x@xff.cz \
--cc=y.oudjana@protonmail.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;
as well as URLs for NNTP newsgroup(s).