How to power-up/down camera with V4L2?

Hi!
I'm trying to find a way to power-up an OV5645 image sensor in my system (Dragonboard 410c running Linaro Linux R.19.01). In its driver (ov5645.c) there are code like:
1
2
3
4
5
6
7
8
static int ov5645_s_power(struct v4l2_subdev *sd, int on)
{
:
}
:
static const struct v4l2_subdev_core_ops ov5645_core_ops = {
.s_power = ov5645_s_power,
};


Calling ov5645_s_power() will power-up or power-down this OV5645. And I found that the program gst-launch-1.0 may call ov5645_s_power() internally, but I just don't know how it can do this. I'm wondering whether there is anyway I can use any V4L2 control (maybe something like V4L2_CID_***?) to get ov5645_s_power() to be called, so I can arbitrarily power this OV5645 up/down?

I'm not sure whether this question is a proper one for this forum or not. If not, could anyone advice a better place for this question?
Last edited on
This sadly isn't the right forum, no. The question you're asking is a very specific question about a very specific embedded system that isn't borderline ubiquitous. If there is a forum dedicated to Dragonboard enthusiasts (or even embedded programming in general), that might be a better place to ask.

That said, it's possible that there's some way to get that ov5645_core_ops struct, possibly by some function returning a pointer to it. It might be worth digging around gst-launch's source code to see how it does it.

-Albatross
Hi Albatross,
OK, I understand. I'll study gst-launch's source code.
Thanks for your replay and comment!

Regards,

Oliver
Finally I've found how to power-up this camera module:
1. Configure the Media Controller pipeline like:
sudo media-ctl -d /dev/media0 -l '"msm_csiphy0":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_rdi0":0[1]'


2. Open its corresponding /dev/video*

Then ov5645_s_power() will be call to power this OV5645 up.

FYR.
Topic archived. No new replies allowed.