From: Przemyslaw Gaj <pgaj@cadence.com>
To: <bbrezillon@kernel.org>
Cc: linux-i3c@lists.infradead.org, agolec@cadence.com,
Przemyslaw Gaj <pgaj@cadence.com>,
rafalc@cadence.com, vitor.soares@synopsys.com
Subject: [PATCH 1/3] i3c: master: add data hold delay support
Date: Thu, 14 Nov 2019 06:51:53 +0100 [thread overview]
Message-ID: <20191114055155.20446-2-pgaj@cadence.com> (raw)
In-Reply-To: <20191114055155.20446-1-pgaj@cadence.com>
This patch adds support for THD_DEL (Data Hold Delay) to Cadence
I3C master constoller driver.
Signed-off-by: Przemyslaw Gaj <pgaj@cadence.com>
---
drivers/i3c/master/i3c-master-cdns.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c
index 10db0bf0655a..90ea98eef905 100644
--- a/drivers/i3c/master/i3c-master-cdns.c
+++ b/drivers/i3c/master/i3c-master-cdns.c
@@ -60,6 +60,7 @@
#define CTRL_HALT_EN BIT(30)
#define CTRL_MCS BIT(29)
#define CTRL_MCS_EN BIT(28)
+#define CTRL_THD_DEL(x) (((x) << 24) & GENMASK(25, 24))
#define CTRL_HJ_DISEC BIT(8)
#define CTRL_MST_ACK BIT(7)
#define CTRL_HJ_ACK BIT(6)
@@ -1186,7 +1187,7 @@ static int cdns_i3c_master_bus_init(struct i3c_master_controller *m)
struct cdns_i3c_master *master = to_cdns_i3c_master(m);
unsigned long pres_step, sysclk_rate, max_i2cfreq;
struct i3c_bus *bus = i3c_master_get_bus(m);
- u32 ctrl, prescl0, prescl1, pres, low;
+ u32 ctrl, prescl0, prescl1, pres, low, thd_del;
struct i3c_device_info info = { };
int ret, ncycles;
@@ -1264,6 +1265,8 @@ static int cdns_i3c_master_bus_init(struct i3c_master_controller *m)
* We will issue ENTDAA afterwards from the threaded IRQ handler.
*/
ctrl |= CTRL_HJ_ACK | CTRL_HJ_DISEC | CTRL_HALT_EN | CTRL_MCS_EN;
+ if (!of_property_read_u32(m->dev.of_node, "thd_del", &thd_del))
+ ctrl |= CTRL_THD_DEL(thd_del);
writel(ctrl, master->regs + CTRL);
cdns_i3c_master_enable(master);
--
2.14.0
_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next prev parent reply other threads:[~2019-11-14 5:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-14 5:51 [PATCH 0/3] Add data hold delay support Przemyslaw Gaj
2019-11-14 5:51 ` Przemyslaw Gaj [this message]
2019-11-14 13:38 ` [PATCH 1/3] i3c: master: add " Vitor Soares
2019-11-14 5:51 ` [PATCH 2/3] dt-bindings: i3c: Document data hold delay feature Przemyslaw Gaj
2019-11-14 9:15 ` Boris Brezillon
2019-11-14 9:26 ` Boris Brezillon
2019-11-14 10:54 ` Przemyslaw Gaj
2019-11-14 11:09 ` Boris Brezillon
2019-11-14 11:35 ` Przemyslaw Gaj
2019-11-14 5:51 ` [PATCH 3/3] MAINTAINERS: add myself as maintainer of Cadence I3C master controller driver Przemyslaw Gaj
2019-11-15 5:09 ` Boris Brezillon
2019-11-14 11:58 ` [PATCH 0/3] Add data hold delay support Vitor Soares
2019-11-14 12:48 ` Przemyslaw Gaj
2019-11-14 13:31 ` Vitor Soares
2019-11-14 13:46 ` Boris Brezillon
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=20191114055155.20446-2-pgaj@cadence.com \
--to=pgaj@cadence.com \
--cc=agolec@cadence.com \
--cc=bbrezillon@kernel.org \
--cc=linux-i3c@lists.infradead.org \
--cc=rafalc@cadence.com \
--cc=vitor.soares@synopsys.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).