Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 08-16-2019, 09:49 AM   #1
LQ Newbie
Registered: Aug 2019
Posts: 6

Rep: Reputation: Disabled
How to power-up/down camera with V4L2?

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?

Last edited by OliverChen; 08-16-2019 at 09:50 AM.
Old 08-17-2019, 05:36 AM   #2
Registered: Dec 2011
Distribution: Mageia, Slackware
Posts: 823
Blog Entries: 7

Rep: Reputation: 201Reputation: 201Reputation: 201
What do you get with
v4l2-ctl --all?
Old 08-17-2019, 07:23 AM   #3
LQ Newbie
Registered: Aug 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi Zeebra,
First thank you for your reply.
v4l2-ctl --all
I get:

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
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x05201000
                Video Capture Multiplanar
                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?
Old 08-25-2019, 04:00 AM   #4
LQ Newbie
Registered: Aug 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.

1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to access v4l2 controls at i2c sensor (camera) driver? ssuesens Linux - Kernel 5 12-09-2018 11:51 PM
V4l2 support for monochrom camera sensors ashok_2680 Linux - Newbie 1 07-12-2016 07:39 AM
Problem with capturing image from camera with v4l2 on a RPi dstrigl Linux - Software 2 06-24-2016 01:16 AM
[SOLVED] Camera settings in Linux ...(V4L2 or UVC drivers) KansaiRobot Linux - Software 12 03-11-2015 07:33 PM
v4l2 App to display video image as if from camera radiodee1 Debian 1 10-05-2011 07:23 AM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:41 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration