lkml.org 
[lkml]   [2022]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] soc: mediatek: Introduce mediatek-regulator-coupler driver
From
16.06.2022 12:45, AngeloGioacchino Del Regno пишет:
> +static int mediatek_regulator_attach(struct regulator_coupler *coupler,
> + struct regulator_dev *rdev)
> +{
> + struct mediatek_regulator_coupler *mrc = to_mediatek_coupler(coupler);
> + const char *rdev_name = rdev_get_name(rdev);
> +
> + if (strstr(rdev_name, "sram")) {
> + if (mrc->vsram_rdev)
> + return -EINVAL;
> + mrc->vsram_rdev = rdev;
> + }

You should filter out regulators unrelated to SRAM and GPU, see
regulator_find_coupler().

> + return 0;
> +}
> +
> +static int mediatek_regulator_detach(struct regulator_coupler *coupler,
> + struct regulator_dev *rdev)
> +{
> + struct mediatek_regulator_coupler *mrc = to_mediatek_coupler(coupler);
> +
> + if (rdev == mrc->vsram_rdev) {
> + mrc->vsram_rdev = NULL;
> + return 0;
> + }

The regulator core should emit error message about GPU regulator failed
to detach because you're returning -EINVAL for it.

> + return -EINVAL;
> +}

\
 
 \ /
  Last update: 2022-06-16 14:51    [W:0.040 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site