diff mbox series

[v2,19/19] media: camss: Apply vfe_get/vfe_put fix to SDM845

Message ID 20211124175921.1048375-20-bryan.odonoghue@linaro.org (mailing list archive)
State New, archived
Headers show
Series CAMSS: Add SM8250 support | expand

Commit Message

Bryan O'Donoghue Nov. 24, 2021, 5:59 p.m. UTC
Similar to the SM8250 the CSID relies on the VFE to be clocked prior to
taking the CSID out of reset.

Apply the same fixup to SDM845 as SM8250.

Suggested-by: Robert Foss <robert.foss@linaro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/camss/camss-csid.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Robert Foss Nov. 25, 2021, 10:45 a.m. UTC | #1
Thanks for submitting this!

On Wed, 24 Nov 2021 at 18:57, Bryan O'Donoghue
<bryan.odonoghue@linaro.org> wrote:
>
> Similar to the SM8250 the CSID relies on the VFE to be clocked prior to
> taking the CSID out of reset.
>
> Apply the same fixup to SDM845 as SM8250.
>
> Suggested-by: Robert Foss <robert.foss@linaro.org>
> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/camss/camss-csid.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
> index e6835b92695b..32f82e471bae 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid.c
> @@ -159,10 +159,11 @@ static int csid_set_power(struct v4l2_subdev *sd, int on)
>         struct camss *camss = csid->camss;
>         struct device *dev = camss->dev;
>         struct vfe_device *vfe = &camss->vfe[csid->id];
> +       u32 version = camss->version;
>         int ret;
>
>         if (on) {
> -               if (camss->version == CAMSS_8250) {
> +               if (version == CAMSS_8250 || version == CAMSS_845) {
>                         ret = vfe_get(vfe);
>                         if (ret < 0)
>                                 return ret;
> @@ -212,7 +213,7 @@ static int csid_set_power(struct v4l2_subdev *sd, int on)
>                 camss_disable_clocks(csid->nclocks, csid->clock);
>                 ret = csid->vdda ? regulator_disable(csid->vdda) : 0;
>                 pm_runtime_put_sync(dev);
> -               if (camss->version == CAMSS_8250)
> +               if (version == CAMSS_8250 || version == CAMSS_845)
>                         vfe_put(vfe);
>         }
>
> --
> 2.33.0
>

Reviewed-by: Robert Foss <robert.foss@linaro.org>
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
index e6835b92695b..32f82e471bae 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.c
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
@@ -159,10 +159,11 @@  static int csid_set_power(struct v4l2_subdev *sd, int on)
 	struct camss *camss = csid->camss;
 	struct device *dev = camss->dev;
 	struct vfe_device *vfe = &camss->vfe[csid->id];
+	u32 version = camss->version;
 	int ret;
 
 	if (on) {
-		if (camss->version == CAMSS_8250) {
+		if (version == CAMSS_8250 || version == CAMSS_845) {
 			ret = vfe_get(vfe);
 			if (ret < 0)
 				return ret;
@@ -212,7 +213,7 @@  static int csid_set_power(struct v4l2_subdev *sd, int on)
 		camss_disable_clocks(csid->nclocks, csid->clock);
 		ret = csid->vdda ? regulator_disable(csid->vdda) : 0;
 		pm_runtime_put_sync(dev);
-		if (camss->version == CAMSS_8250)
+		if (version == CAMSS_8250 || version == CAMSS_845)
 			vfe_put(vfe);
 	}