LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   How to power-up/down camera with V4L2? (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-power-up-down-camera-with-v4l2-4175659243/)

OliverChen 08-16-2019 09:49 AM

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:


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 where I can post this question?

zeebra 08-17-2019 05:36 AM

What do you get with
Code:

v4l2-ctl --all?

OliverChen 08-17-2019 07:23 AM

Hi Zeebra,
First thank you for your reply.
By
Code:

v4l2-ctl --all
I get:

Code:

linaro@linaro-developer:~$ v4l2-ctl --all
Driver Info:
        Driver name      : qcom-camss
        Card type        : Qualcomm Camera Subsystem
        Bus info        : platform:1b0ac00.camss
        Driver version  : 4.14.96
        Capabilities    : 0x85201000
                Video Capture Multiplanar
                Read/Write
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x05201000
                Video Capture Multiplanar
                Read/Write
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : qcom-camss
        Model            : Qualcomm Camera Subsystem
        Serial          :
        Bus info        :
        Media version    : 4.14.96
        Hardware revision: 0x00000000 (0)
        Driver version  : 4.14.96
Interface Info:
        ID              : 0x03000018
        Type            : V4L Video
Entity Info:
        ID              : 0x00000016 (22)
        Name            : msm_vfe0_video0
        Function        : V4L2 I/O
        Pad 0x01000017  : Sink
          Link 0x0200001a: from remote pad 0x1000015 of entity 'msm_vfe0_rdi0': Data, Enabled, Immutable
Priority: 2
Video input : 0 (camera: ok)
Format Video Capture Multiplanar:
        Width/Height      : 1920/1080
        Pixel Format      : 'UYVY' (UYVY 4:2:2)
        Field            : None
        Number of planes  : 1
        Flags            :
        Colorspace        : sRGB
        Transfer Function : sRGB
        YCbCr/HSV Encoding: ITU-R 601
        Quantization      : Full Range
        Plane 0          :
          Bytes per Line : 3840
          Size Image    : 4147200

Any comment?

OliverChen 08-25-2019 04:00 AM

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.


All times are GMT -5. The time now is 11:41 PM.