From: Dmitry Osipenko <digetx@gmail.com>
To: Lee Jones <lee.jones@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Pavel Machek <pavel@ucw.cz>, Dan Murphy <dmurphy@ti.com>,
Sebastian Reichel <sre@kernel.org>,
Lubomir Rintel <lkundrak@v3.sk>, Mark Brown <broonie@kernel.org>
Cc: devicetree@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-leds@vger.kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/6] regmap: Use flexible sleep
Date: Sun, 30 Aug 2020 21:53:52 +0300 [thread overview]
Message-ID: <20200830185356.5365-3-digetx@gmail.com> (raw)
In-Reply-To: <20200830185356.5365-1-digetx@gmail.com>
The multi-reg write function uses udelay(), which is a busy-loop based
delaying function that is not suitable for a long delays. Hence let's
replace the udelay() with fsleep(), which is flexible sleep function that
selects best delay function based on the delay-time.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
drivers/base/regmap/regmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index e93700af7e6e..a417cb1a11dc 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -2231,7 +2231,7 @@ static int _regmap_range_multi_paged_reg_write(struct regmap *map,
return ret;
if (regs[i].delay_us)
- udelay(regs[i].delay_us);
+ fsleep(regs[i].delay_us);
base += n;
n = 0;
@@ -2268,7 +2268,7 @@ static int _regmap_multi_reg_write(struct regmap *map,
return ret;
if (regs[i].delay_us)
- udelay(regs[i].delay_us);
+ fsleep(regs[i].delay_us);
}
return 0;
}
--
2.27.0
next prev parent reply other threads:[~2020-08-30 18:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-30 18:53 [PATCH v2 0/6] Introduce Embedded Controller driver for Acer A500 Dmitry Osipenko
2020-08-30 18:53 ` [PATCH v2 1/6] dt-bindings: mfd: Add ENE KB930 Embedded Controller binding Dmitry Osipenko
2020-09-03 16:10 ` Rob Herring
2020-09-04 12:07 ` Dmitry Osipenko
2020-09-04 15:40 ` Rob Herring
2020-09-04 15:54 ` Dmitry Osipenko
2020-09-08 17:09 ` Rob Herring
2020-08-30 18:53 ` Dmitry Osipenko [this message]
[not found] ` <CGME20200902124731eucas1p13716070977dbef39d09147bb71e050f6@eucas1p1.samsung.com>
2020-09-02 12:47 ` [PATCH v2 2/6] regmap: Use flexible sleep Marek Szyprowski
2020-09-02 12:56 ` Dmitry Osipenko
2020-08-30 18:53 ` [PATCH v2 3/6] mfd: Add driver for Embedded Controller found on Acer Iconia Tab A500 Dmitry Osipenko
2020-08-30 18:53 ` [PATCH v2 4/6] power: supply: Add battery gauge driver for " Dmitry Osipenko
2020-08-30 18:53 ` [PATCH v2 5/6] leds: Add " Dmitry Osipenko
2020-08-30 18:53 ` [PATCH v2 6/6] ARM: tegra: acer-a500: Add Embedded Controller Dmitry Osipenko
2020-09-01 14:50 ` [PATCH v2 0/6] Introduce Embedded Controller driver for Acer A500 Mark Brown
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=20200830185356.5365-3-digetx@gmail.com \
--to=digetx@gmail.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmurphy@ti.com \
--cc=jonathanh@nvidia.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lkundrak@v3.sk \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
--cc=sre@kernel.org \
--cc=thierry.reding@gmail.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).