From: Tony Lindgren <tony@atomide.com>
To: linux-omap@vger.kernel.org
Cc: "Andrew F . Davis" <afd@ti.com>,
"Dave Gerlach" <d-gerlach@ti.com>,
"Faiz Abbas" <faiz_abbas@ti.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
Keerthy <j-keerthy@ti.com>, "Nishanth Menon" <nm@ti.com>,
"Peter Ujfalusi" <peter.ujfalusi@ti.com>,
"Roger Quadros" <rogerq@ti.com>, "Suman Anna" <s-anna@ti.com>,
"Tero Kristo" <t-kristo@ti.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Adam Ford" <aford173@gmail.com>,
"André Hentschel" <nerv@dawncrow.de>,
"H. Nikolaus Schaller" <hns@goldelico.com>
Subject: [PATCH 2/7] bus: ti-sysc: Rename clk related quirks to pre_reset and post_reset quirks
Date: Fri, 21 Feb 2020 11:52:51 -0800 [thread overview]
Message-ID: <20200221195256.54016-3-tony@atomide.com> (raw)
In-Reply-To: <20200221195256.54016-1-tony@atomide.com>
The clk_disable_quirk and clk_enable_quirk should really be called
pre_reset_quirk and post_reset_quirk to avoid confusion like we had
with hdq1w reset.
Let's also rename the related functions so the code is easier to follow.
Note that we also have reset_done_quirk that is needed in some cases
after checking the separate register for reset done bit.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/bus/ti-sysc.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -70,8 +70,8 @@ static const char * const clock_names[SYSC_MAX_CLOCKS] = {
* @child_needs_resume: runtime resume needed for child on resume from suspend
* @disable_on_idle: status flag used for disabling modules with resets
* @idle_work: work structure used to perform delayed idle on a module
- * @clk_enable_quirk: module specific clock enable quirk
- * @clk_disable_quirk: module specific clock disable quirk
+ * @pre_reset_quirk: module specific pre-reset quirk
+ * @post_reset_quirk: module specific post-reset quirk
* @reset_done_quirk: module specific reset done quirk
* @module_enable_quirk: module specific enable quirk
* @module_disable_quirk: module specific disable quirk
@@ -97,8 +97,8 @@ struct sysc {
unsigned int needs_resume:1;
unsigned int child_needs_resume:1;
struct delayed_work idle_work;
- void (*clk_enable_quirk)(struct sysc *sysc);
- void (*clk_disable_quirk)(struct sysc *sysc);
+ void (*pre_reset_quirk)(struct sysc *sysc);
+ void (*post_reset_quirk)(struct sysc *sysc);
void (*reset_done_quirk)(struct sysc *sysc);
void (*module_enable_quirk)(struct sysc *sysc);
void (*module_disable_quirk)(struct sysc *sysc);
@@ -1418,7 +1418,7 @@ static void sysc_module_enable_quirk_aess(struct sysc *ddata)
sysc_write(ddata, offset, 1);
}
-/* I2C needs extra enable bit toggling for reset */
+/* I2C needs to be disabled for reset */
static void sysc_clk_quirk_i2c(struct sysc *ddata, bool enable)
{
int offset;
@@ -1439,14 +1439,14 @@ static void sysc_clk_quirk_i2c(struct sysc *ddata, bool enable)
sysc_write(ddata, offset, val);
}
-static void sysc_clk_enable_quirk_i2c(struct sysc *ddata)
+static void sysc_pre_reset_quirk_i2c(struct sysc *ddata)
{
- sysc_clk_quirk_i2c(ddata, true);
+ sysc_clk_quirk_i2c(ddata, false);
}
-static void sysc_clk_disable_quirk_i2c(struct sysc *ddata)
+static void sysc_post_reset_quirk_i2c(struct sysc *ddata)
{
- sysc_clk_quirk_i2c(ddata, false);
+ sysc_clk_quirk_i2c(ddata, true);
}
/* 36xx SGX needs a quirk for to bypass OCP IPG interrupt logic */
@@ -1488,14 +1488,14 @@ static void sysc_init_module_quirks(struct sysc *ddata)
return;
if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_HDQ1W) {
- ddata->clk_disable_quirk = sysc_pre_reset_quirk_hdq1w;
+ ddata->pre_reset_quirk = sysc_pre_reset_quirk_hdq1w;
return;
}
if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_I2C) {
- ddata->clk_enable_quirk = sysc_clk_enable_quirk_i2c;
- ddata->clk_disable_quirk = sysc_clk_disable_quirk_i2c;
+ ddata->pre_reset_quirk = sysc_pre_reset_quirk_i2c;
+ ddata->post_reset_quirk = sysc_post_reset_quirk_i2c;
return;
}
@@ -1583,8 +1583,8 @@ static int sysc_reset(struct sysc *ddata)
else
syss_done = ddata->cfg.syss_mask;
- if (ddata->clk_disable_quirk)
- ddata->clk_disable_quirk(ddata);
+ if (ddata->pre_reset_quirk)
+ ddata->pre_reset_quirk(ddata);
sysc_val = sysc_read_sysconfig(ddata);
sysc_val |= sysc_mask;
@@ -1594,8 +1594,8 @@ static int sysc_reset(struct sysc *ddata)
usleep_range(ddata->cfg.srst_udelay,
ddata->cfg.srst_udelay * 2);
- if (ddata->clk_enable_quirk)
- ddata->clk_enable_quirk(ddata);
+ if (ddata->post_reset_quirk)
+ ddata->post_reset_quirk(ddata);
/* Poll on reset status */
if (syss_offset >= 0) {
--
2.25.1
next prev parent reply other threads:[~2020-02-21 19:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-21 19:52 [PATCH 0/7] ti-sysc driver fix for hdq1w and few improvments Tony Lindgren
2020-02-21 19:52 ` [PATCH 1/7] bus: ti-sysc: Fix 1-wire reset quirk Tony Lindgren
2020-02-21 19:52 ` Tony Lindgren [this message]
2020-02-21 19:52 ` [PATCH 3/7] ti-sysc: Improve reset to work with modules with no sysconfig Tony Lindgren
2020-02-21 19:52 ` [PATCH 4/7] bus: ti-sysc: Consider non-existing registers too when matching quirks Tony Lindgren
2020-02-21 19:52 ` [PATCH 5/7] bus: ti-sysc: Don't warn about legacy property for nested ti-sysc devices Tony Lindgren
2020-02-21 19:52 ` [PATCH 6/7] bus: ti-sysc: Implement SoC revision handling Tony Lindgren
2022-03-02 14:38 ` Adam Ford
2022-03-04 6:56 ` Tony Lindgren
2022-03-04 13:57 ` Adam Ford
2020-02-21 19:52 ` [PATCH 7/7] bus: ti-sysc: Handle module unlock quirk needed for some RTC Tony Lindgren
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=20200221195256.54016-3-tony@atomide.com \
--to=tony@atomide.com \
--cc=afd@ti.com \
--cc=aford173@gmail.com \
--cc=d-gerlach@ti.com \
--cc=faiz_abbas@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=hns@goldelico.com \
--cc=j-keerthy@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=nerv@dawncrow.de \
--cc=nm@ti.com \
--cc=peter.ujfalusi@ti.com \
--cc=rogerq@ti.com \
--cc=s-anna@ti.com \
--cc=t-kristo@ti.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).