From: Daniel Golle <daniel@makrotopia.org>
To: linux-i2c@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Qii Wang <qii.wang@mediatek.com>,
Sam Shih <sam.shih@mediatek.com>
Cc: 郭小桥 <joe@gainstrong.cn>
Subject: [PATCH 2/2] i2c: mt65xx: add additional clocks
Date: Wed, 31 May 2023 17:11:17 +0100 [thread overview]
Message-ID: <6632ce37e260f5f5cbdd0c6a5da8fe9679352aee.1685549360.git.daniel@makrotopia.org> (raw)
In-Reply-To: <5f15212060f82fb94239174c4e4b46c151645fe8.1685549360.git.daniel@makrotopia.org>
On MT7981 additional clocks are required when accessing I2C registers.
Add MCK and PCK optional clocks to i2c-mt65xx driver so we don't have
to always have them enabled, but really only if I2C is used.
Fixes: f82fd1845d309 ("i2c: mediatek: add support for MT7981 SoC")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/i2c/busses/i2c-mt65xx.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index a43c4d77739ab..cd28cbec2b96d 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -93,6 +93,8 @@
* @I2C_MT65XX_CLK_DMA: DMA clock for i2c via DMA
* @I2C_MT65XX_CLK_PMIC: PMIC clock for i2c from PMIC
* @I2C_MT65XX_CLK_ARB: Arbitrator clock for i2c
+ * @I2C_MT65XX_CLK_MCK: MCK clock for i2c
+ * @I2C_MT65XX_CLK_PCK: PCK clock for i2c
* @I2C_MT65XX_CLK_MAX: Number of supported clocks
*/
enum i2c_mt65xx_clks {
@@ -100,11 +102,13 @@ enum i2c_mt65xx_clks {
I2C_MT65XX_CLK_DMA,
I2C_MT65XX_CLK_PMIC,
I2C_MT65XX_CLK_ARB,
+ I2C_MT65XX_CLK_MCK,
+ I2C_MT65XX_CLK_PCK,
I2C_MT65XX_CLK_MAX
};
static const char * const i2c_mt65xx_clk_ids[I2C_MT65XX_CLK_MAX] = {
- "main", "dma", "pmic", "arb"
+ "main", "dma", "pmic", "arb", "mck", "pck"
};
enum DMA_REGS_OFFSET {
@@ -1444,6 +1448,14 @@ static int mtk_i2c_probe(struct platform_device *pdev)
if (IS_ERR(i2c->clocks[I2C_MT65XX_CLK_ARB].clk))
return PTR_ERR(i2c->clocks[I2C_MT65XX_CLK_ARB].clk);
+ i2c->clocks[I2C_MT65XX_CLK_MCK].clk = devm_clk_get_optional(&pdev->dev, "mck");
+ if (IS_ERR(i2c->clocks[I2C_MT65XX_CLK_MCK].clk))
+ return PTR_ERR(i2c->clocks[I2C_MT65XX_CLK_MCK].clk);
+
+ i2c->clocks[I2C_MT65XX_CLK_PCK].clk = devm_clk_get_optional(&pdev->dev, "pck");
+ if (IS_ERR(i2c->clocks[I2C_MT65XX_CLK_PCK].clk))
+ return PTR_ERR(i2c->clocks[I2C_MT65XX_CLK_PCK].clk);
+
if (i2c->have_pmic) {
i2c->clocks[I2C_MT65XX_CLK_PMIC].clk = devm_clk_get(&pdev->dev, "pmic");
if (IS_ERR(i2c->clocks[I2C_MT65XX_CLK_PMIC].clk)) {
--
2.40.1
next prev parent reply other threads:[~2023-05-31 16:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 16:10 [PATCH 1/2] dt-bindings: i2c: i2c-mt65xx: add additional clocks Daniel Golle
2023-05-31 16:11 ` Daniel Golle [this message]
2023-06-01 9:18 ` [PATCH 2/2] i2c: mt65xx: " AngeloGioacchino Del Regno
2023-06-01 16:54 ` [PATCH 1/2] dt-bindings: i2c: i2c-mt65xx: " Krzysztof Kozlowski
2023-06-01 19:10 ` Daniel Golle
2023-06-01 20:16 ` Conor Dooley
2023-06-02 7:12 ` Krzysztof Kozlowski
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=6632ce37e260f5f5cbdd0c6a5da8fe9679352aee.1685549360.git.daniel@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=joe@gainstrong.cn \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=qii.wang@mediatek.com \
--cc=sam.shih@mediatek.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).