summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/qcom/camss/camss-csid.c
diff options
context:
space:
mode:
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>2021-12-22 01:37:50 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-01-23 21:18:41 +0100
commitc5af8db84c01585e077019d5fd384c57a9fcad2f (patch)
treeee72b83f6c024c38e7e14cf46d9a195cdef7e9c5 /drivers/media/platform/qcom/camss/camss-csid.c
parent5ba38efb2622191ad8e81c4751db744e7c9ea459 (diff)
downloadlinux-c5af8db84c01585e077019d5fd384c57a9fcad2f.tar.bz2
media: camss: Do vfe_get/vfe_put for csid on sm8250
The sm8250 CAMSS CSID depends on the VFE it is attached to being powered on and clocked prior to taking the CSID out of reset. It is possible to open just the CSID subdev from libcamera and attempt to bring the CSID block up. If we do not first bring up the VFE the CSID will fail to come out of reset. Tested-by: Julian Grahsl <jgrahsl@snap.com> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/qcom/camss/camss-csid.c')
-rw-r--r--drivers/media/platform/qcom/camss/camss-csid.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
index 9ef6fbbeeddf..e6835b92695b 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.c
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
@@ -156,10 +156,18 @@ static int csid_set_clock_rates(struct csid_device *csid)
static int csid_set_power(struct v4l2_subdev *sd, int on)
{
struct csid_device *csid = v4l2_get_subdevdata(sd);
- struct device *dev = csid->camss->dev;
+ struct camss *camss = csid->camss;
+ struct device *dev = camss->dev;
+ struct vfe_device *vfe = &camss->vfe[csid->id];
int ret;
if (on) {
+ if (camss->version == CAMSS_8250) {
+ ret = vfe_get(vfe);
+ if (ret < 0)
+ return ret;
+ }
+
ret = pm_runtime_resume_and_get(dev);
if (ret < 0)
return ret;
@@ -204,6 +212,8 @@ 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)
+ vfe_put(vfe);
}
return ret;