From: William-tw Lin <william-tw.lin@mediatek.com>
To: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
William-tw Lin <william-tw.lin@mediatek.com>
Subject: [PATCH v3 3/3] nvmem: mtk-efuse: Modify driver for getting chip information
Date: Wed, 20 Dec 2023 18:39:01 +0800 [thread overview]
Message-ID: <20231220103901.22180-4-william-tw.lin@mediatek.com> (raw)
In-Reply-To: <20231220103901.22180-1-william-tw.lin@mediatek.com>
Retrieval of soc info is needed. This patch includes the following:
1. Register socinfo device in mtk-efuse.c
Signed-off-by: William-tw Lin <william-tw.lin@mediatek.com>
---
drivers/nvmem/mtk-efuse.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c
index 84f05b40a411..3914e039e288 100644
--- a/drivers/nvmem/mtk-efuse.c
+++ b/drivers/nvmem/mtk-efuse.c
@@ -68,6 +68,7 @@ static int mtk_efuse_probe(struct platform_device *pdev)
struct nvmem_config econfig = {};
struct mtk_efuse_priv *priv;
const struct mtk_efuse_pdata *pdata;
+ struct platform_device *socinfo;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
@@ -85,11 +86,19 @@ static int mtk_efuse_probe(struct platform_device *pdev)
econfig.size = resource_size(res);
econfig.priv = priv;
econfig.dev = dev;
+ econfig.name = "mtk-efuse";
if (pdata->uses_post_processing)
econfig.fixup_dt_cell_info = &mtk_efuse_fixup_dt_cell_info;
nvmem = devm_nvmem_register(dev, &econfig);
+ if (IS_ERR(nvmem))
+ return PTR_ERR(nvmem);
- return PTR_ERR_OR_ZERO(nvmem);
+ socinfo = platform_device_register_data(&pdev->dev, "mtk-socinfo",
+ PLATFORM_DEVID_AUTO, NULL, 0);
+ if (IS_ERR(socinfo))
+ dev_info(dev, "MediaTek SoC Information will be unavailable\n");
+
+ return 0;
}
static const struct mtk_efuse_pdata mtk_mt8186_efuse_pdata = {
--
2.18.0
next prev parent reply other threads:[~2023-12-20 10:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 10:38 [PATCH v3 0/3] mtk-socinfo driver implementation William-tw Lin
2023-12-20 10:38 ` [PATCH v3 1/3] arm64: dts: Add node for chip info driver William-tw Lin
2023-12-20 11:02 ` AngeloGioacchino Del Regno
2023-12-20 10:39 ` [PATCH v3 2/3] soc: mediatek: mtk-socinfo: Add driver for getting chip information William-tw Lin
2023-12-20 10:53 ` AngeloGioacchino Del Regno
2023-12-22 8:03 ` William-tw Lin (林鼎崴)
2023-12-20 11:34 ` Krzysztof Kozlowski
2023-12-20 13:13 ` AngeloGioacchino Del Regno
2023-12-22 8:03 ` William-tw Lin (林鼎崴)
2023-12-20 10:39 ` William-tw Lin [this message]
2023-12-20 11:02 ` [PATCH v3 3/3] nvmem: mtk-efuse: Modify " AngeloGioacchino Del Regno
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=20231220103901.22180-4-william-tw.lin@mediatek.com \
--to=william-tw.lin@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
/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