From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: "Serge Semin" <fancer.lancer@gmail.com>,
"Alexey Malahov" <Alexey.Malahov@baikalelectronics.ru>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
"Paul Burton" <paulburton@kernel.org>,
"Ralf Baechle" <ralf@linux-mips.org>,
"Wolfram Sang" <wsa@the-dreams.de>,
"Rob Herring" <robh+dt@kernel.org>,
"Frank Rowand" <frowand.list@gmail.com>,
devicetree@vger.kernel.org, linux-mips@vger.kernel.org,
"Wolfram Sang" <wsa+renesas@sang-engineering.com>,
"Jean Delvare" <jdelvare@suse.de>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Max Staudt" <max@enpas.org>, "Stefan Roese" <sr@denx.de>,
"Uwe Kleine-König" <uwe@kleine-koenig.org>,
"Shaokun Zhang" <zhangshaokun@hisilicon.com>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 04/12] i2c: designware: Convert driver to using regmap API
Date: Wed, 20 May 2020 15:16:07 +0300 [thread overview]
Message-ID: <a0d4c6d8-c2c0-b7ea-d77b-e1fe610fd966@linux.intel.com> (raw)
In-Reply-To: <20200510095019.20981-5-Sergey.Semin@baikalelectronics.ru>
On 5/10/20 12:50 PM, Serge Semin wrote:
> Seeing the DW I2C driver is using flags-based accessors with two
> conditional clauses it would be better to replace them with the regmap
> API IO methods and to initialize the regmap object with read/write
> callbacks specific to the controller registers map implementation. This
> will be also handy for the drivers with non-standard registers mapping
> (like an embedded into the Baikal-T1 System Controller DW I2C block, which
> glue-driver is a part of this series).
>
> As before the driver tries to detect the mapping setup at probe stage and
> creates a regmap object accordingly, which will be used by the rest of the
> code to correctly access the controller registers. In two places it was
> appropriate to convert the hand-written read-modify-write and
> read-poll-loop design patterns to the corresponding regmap API
> ready-to-use methods.
>
> Note the regmap IO methods return value is checked only at the probe
> stage. The rest of the code won't do this because basically we have
> MMIO-based regmap so non of the read/write methods can fail (this also
> won't be needed for the Baikal-T1-specific I2C controller).
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Wolfram Sang <wsa@the-dreams.de>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: devicetree@vger.kernel.org
> Cc: linux-mips@vger.kernel.org
> ---
> drivers/i2c/busses/Kconfig | 1 +
> drivers/i2c/busses/i2c-designware-common.c | 171 +++++++++++++++------
> drivers/i2c/busses/i2c-designware-core.h | 18 +--
> drivers/i2c/busses/i2c-designware-master.c | 125 ++++++++-------
> drivers/i2c/busses/i2c-designware-slave.c | 77 +++++-----
> 5 files changed, 239 insertions(+), 153 deletions(-)
>
Looking at patches 4/12-12/12 I think it would be good to move fixes and
less invasive patches before this. Like
i2c: designware: slave: Set DW I2C core module dependency
i2c: designware: Use `-y` to build multi-object modules
i2c: designware: Move Baytrail sem config to the platform if-clause
That said, you may add:
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
next prev parent reply other threads:[~2020-05-20 12:16 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 13:19 [PATCH 0/6] i2c: designeware: Add Baikal-T1 SoC DW I2C specifics support Sergey.Semin-UN2wsyeM1qLJ45LvJ/SUn8gurn75+9Lz
2020-03-06 13:54 ` Andy Shevchenko
[not found] ` <20200306135451.4AF0480307C4@mail.baikalelectronics.ru>
2020-03-31 11:48 ` Sergey Semin
2020-03-31 14:25 ` Andy Shevchenko
[not found] ` <20200331142530.GM1922688-XvqNBM/wLWRrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2020-03-31 16:28 ` Sergey Semin
2020-03-31 17:17 ` Andy Shevchenko
2020-03-31 19:14 ` Sergey Semin
2020-05-10 9:50 ` [PATCH v2 00/12] i2c: designeware: Add Baikal-T1 System I2C support Serge Semin
2020-05-10 9:50 ` [PATCH v2 01/12] scripts/dtc: check: Add 10bit/slave i2c reg flags support Serge Semin
2020-05-10 9:50 ` [PATCH v2 02/12] dt-bindings: i2c: Convert DW I2C binding to DT schema Serge Semin
2020-05-11 16:09 ` Rob Herring
2020-05-11 19:50 ` Serge Semin
2020-05-10 9:50 ` [PATCH v2 03/12] dt-bindings: i2c: dw: Add Baikal-T1 SoC I2C controller Serge Semin
2020-05-18 20:33 ` Rob Herring
2020-05-18 21:39 ` Serge Semin
2020-05-10 9:50 ` [PATCH v2 04/12] i2c: designware: Convert driver to using regmap API Serge Semin
2020-05-20 12:16 ` Jarkko Nikula [this message]
2020-05-21 2:02 ` Serge Semin
2020-05-10 9:50 ` [PATCH v2 05/12] i2c: designware: Use `-y` to build multi-object modules Serge Semin
2020-05-20 12:16 ` Jarkko Nikula
2020-05-10 9:50 ` [PATCH v2 06/12] i2c: designware: slave: Set DW I2C core module dependency Serge Semin
2020-05-20 12:15 ` Jarkko Nikula
2020-05-10 9:50 ` [PATCH v2 07/12] i2c: designware: Move Baytrail sem config to the platform if-clause Serge Semin
2020-05-20 12:16 ` Jarkko Nikula
2020-05-21 2:22 ` Serge Semin
2020-05-25 13:01 ` Jarkko Nikula
2020-05-26 18:40 ` Serge Semin
2020-05-10 9:50 ` [PATCH v2 08/12] i2c: designware: Introduce platform drivers glue layer interface Serge Semin
2020-05-20 12:46 ` Jarkko Nikula
2020-05-21 2:37 ` Serge Semin
2020-05-25 13:16 ` Jarkko Nikula
2020-05-25 13:42 ` Andy Shevchenko
2020-05-26 20:38 ` Serge Semin
2020-05-10 9:50 ` [PATCH v2 09/12] i2c: designware: Unpin Microsemi Ocelot I2C into a glue driver Serge Semin
2020-05-10 9:50 ` [PATCH v2 10/12] i2c: designware: Discard Cherry Trail model flag Serge Semin
2020-05-20 12:17 ` Jarkko Nikula
2020-05-10 9:50 ` [PATCH v2 11/12] i2c: designware: Use provided regmap instead of reg resource Serge Semin
2020-05-10 9:50 ` [PATCH v2 12/12] i2c: designware: Add Baikal-T1 System I2C glue driver Serge Semin
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=a0d4c6d8-c2c0-b7ea-d77b-e1fe610fd966@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=Alexey.Malahov@baikalelectronics.ru \
--cc=Sergey.Semin@baikalelectronics.ru \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=fancer.lancer@gmail.com \
--cc=frowand.list@gmail.com \
--cc=jdelvare@suse.de \
--cc=krzk@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=max@enpas.org \
--cc=mika.westerberg@linux.intel.com \
--cc=paulburton@kernel.org \
--cc=ralf@linux-mips.org \
--cc=robh+dt@kernel.org \
--cc=sr@denx.de \
--cc=tsbogend@alpha.franken.de \
--cc=uwe@kleine-koenig.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=wsa@the-dreams.de \
--cc=zhangshaokun@hisilicon.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).