Commit b2c2715e authored by Bryan O'Donoghue's avatar Bryan O'Donoghue Committed by Hans Verkuil

media: qcom: camss: Remove special case for VFE get/put

From sdm845 onwards we need to ensure the VFE is powered on prior to
switching on the CSID.

Currently the code tests for sdm845, sm8250 and then does get/set. This is
not extensible and it turns out is not necessary either since vfe_get and
vfe_set reference count.

Remove the over-conservative SoC version check.
Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Suggested-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # rb3 # db410c
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 7c1340e4
...@@ -159,15 +159,17 @@ static int csid_set_power(struct v4l2_subdev *sd, int on) ...@@ -159,15 +159,17 @@ static int csid_set_power(struct v4l2_subdev *sd, int on)
struct camss *camss = csid->camss; struct camss *camss = csid->camss;
struct device *dev = camss->dev; struct device *dev = camss->dev;
struct vfe_device *vfe = &camss->vfe[csid->id]; struct vfe_device *vfe = &camss->vfe[csid->id];
u32 version = camss->res->version;
int ret = 0; int ret = 0;
if (on) { if (on) {
if (version == CAMSS_8250 || version == CAMSS_845) { /*
ret = vfe_get(vfe); * From SDM845 onwards, the VFE needs to be powered on before
if (ret < 0) * switching on the CSID. Do so unconditionally, as there is no
return ret; * drawback in following the same powering order on older SoCs.
} */
ret = vfe_get(vfe);
if (ret < 0)
return ret;
ret = pm_runtime_resume_and_get(dev); ret = pm_runtime_resume_and_get(dev);
if (ret < 0) if (ret < 0)
...@@ -217,8 +219,7 @@ static int csid_set_power(struct v4l2_subdev *sd, int on) ...@@ -217,8 +219,7 @@ static int csid_set_power(struct v4l2_subdev *sd, int on)
regulator_bulk_disable(csid->num_supplies, regulator_bulk_disable(csid->num_supplies,
csid->supplies); csid->supplies);
pm_runtime_put_sync(dev); pm_runtime_put_sync(dev);
if (version == CAMSS_8250 || version == CAMSS_845) vfe_put(vfe);
vfe_put(vfe);
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment