Re: [PATCH v5 2/2] memory: mtk-smi: mt8188: Add SMI reset and clamp for MT8188

From: Krzysztof Kozlowski
Date: Wed Mar 12 2025 - 08:02:21 EST


On 11/03/2025 13:23, Friday Yang wrote:
> static int mtk_smi_device_link_common(struct device *dev, struct device **com_dev)
> {
> struct platform_device *smi_com_pdev;
> @@ -528,6 +598,53 @@ static int mtk_smi_dts_clk_init(struct device *dev, struct mtk_smi *smi,
> return ret;
> }
>
> +static int mtk_smi_larb_parse_clamp_optional(struct mtk_smi_larb *larb)
> +{
> + struct device *dev = larb->dev;
> + const struct mtk_smi_larb_gen *larb_gen = larb->larb_gen;
> + u32 larb_id;
> + int ret;
> +
> + /**

Not a kerneldoc

> + * Only SMI LARBs in camera, image and IPE subsys need to
> + * apply clamp and reset operations, others can be skipped.
> + */
> + ret = of_property_read_u32(dev->of_node, "mediatek,larb-id", &larb_id);


...


> static const struct mtk_smi_common_plat mtk_smi_common_mt8192 = {
> .type = MTK_SMI_GEN2,
> .has_gals = true,
> @@ -729,6 +862,7 @@ static const struct of_device_id mtk_smi_common_of_ids[] = {
> {.compatible = "mediatek,mt8186-smi-common", .data = &mtk_smi_common_mt8186},
> {.compatible = "mediatek,mt8188-smi-common-vdo", .data = &mtk_smi_common_mt8188_vdo},
> {.compatible = "mediatek,mt8188-smi-common-vpp", .data = &mtk_smi_common_mt8188_vpp},
> + {.compatible = "mediatek,mt8188-smi-sub-common", .data = &mtk_smi_sub_common_mt8188},
> {.compatible = "mediatek,mt8192-smi-common", .data = &mtk_smi_common_mt8192},
> {.compatible = "mediatek,mt8195-smi-common-vdo", .data = &mtk_smi_common_mt8195_vdo},
> {.compatible = "mediatek,mt8195-smi-common-vpp", .data = &mtk_smi_common_mt8195_vpp},
> @@ -787,7 +921,10 @@ static int mtk_smi_common_probe(struct platform_device *pdev)
> return ret;
> }
>
> - pm_runtime_enable(dev);
> + ret = devm_pm_runtime_enable(dev);
> + if (ret)
> + return ret;
> +
> platform_set_drvdata(pdev, common);
> return 0;
> }
> @@ -798,7 +935,6 @@ static void mtk_smi_common_remove(struct platform_device *pdev)
>
> if (common->plat->type == MTK_SMI_GEN2_SUB_COMM)
> device_link_remove(&pdev->dev, common->smi_common_dev);
> - pm_runtime_disable(&pdev->dev);
Does not look related to this patch. Is it some sort of cleanup to devm?

Best regards,
Krzysztof