lkml.org 
[lkml]   [2024]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 6/7] regulator: Add refactored mtk-dvfsrc-regulator driver
From
Le 24/04/2024 à 11:54, AngeloGioacchino Del Regno a écrit :
> The previous driver never worked, and never got even compiled because
> it was missing the DVFSRC driver entirely, including needed neaders.
>
> This is a full (or nearly full) refactoring of the MediaTek DVFSRC
> controlled Regulators driver, retaining support for the MT6873, MT8183
> and MT8192 SoC, and adding MT8195.
>
> As part of the refactoring, this driver is now probed using its own
> devicetree compatible, as this is a child of the main DVFSRC driver
> and gets probed as a subnode of that.
>
> Reviewed-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
> ---
> drivers/regulator/mtk-dvfsrc-regulator.c | 196 +++++++++++++++++++++++
> 1 file changed, 196 insertions(+)
> create mode 100644 drivers/regulator/mtk-dvfsrc-regulator.c
>

..

> +static int dvfsrc_vcore_regulator_probe(struct platform_device *pdev)
> +{
> + struct regulator_config config = { .dev = &pdev->dev };
> + const struct dvfsrc_regulator_pdata *pdata;
> + int i;
> +
> + pdata = device_get_match_data(&pdev->dev);
> + if (!pdata)
> + return -EINVAL;
> +
> + for (i = 0; i < pdata->size; i++) {
> + struct regulator_desc *vrdesc = &pdata->descs[i];
> + struct regulator_dev *rdev;
> +
> + rdev = devm_regulator_register(&pdev->dev, vrdesc, &config);
> + if (IS_ERR(rdev)) {
> + dev_err(&pdev->dev, "failed to register %s\n", vrdesc->name);
> + return PTR_ERR(rdev);

Hi,

Nit: (in case of v6)

dev_err_probe()?

> + }
> + }
> +
> + return 0;
> +}

..

CJ


\
 
 \ /
  Last update: 2024-04-25 02:42    [W:0.084 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site