how to read brightness value for ov5640 using ioctl_g_ctrl?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to read brightness value for ov5640 using ioctl_g_ctrl?

2,004 Views
gbiradar
Contributor IV

Hi Guys,

            I have necessary document to set brightness value for different level. now i want to read brightness level using ioctl_g_ctrl in application. can anybody share idea on this one.

regards,

Ganesh Biradar

0 Kudos
Reply
5 Replies

1,599 Views
BrilliantovKiri
Senior Contributor I

Set brightness:

v4l2_control control;

control.id = V4L2_CID_BRIGHTNESS;

control.value = value;

if (ioctl(fd, VIDIOC_S_CTRL, &control))

     log_error("Failed configure image brightness, errno %d (%s)", errno, strerror(errno));

And please read documentation ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL

0 Kudos
Reply

1,599 Views
gbiradar
Contributor IV

Hi BrilliantovKirillVladimirovich​ i did that but now i have to read back the value their i'm getting error. in ov5640_mipi.c i have set the vc->value but when i'm trying to read i'm getting zero.

0 Kudos
Reply

1,599 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ganesh

ioctl_g_ctrl (V4L2_CID_BRIGHTNESS) reads current values from the

video_control[] array, check ov5640.c :

to read from sensor one will have to add function using ov5640_read_reg()

from SDE CTRL7,8

https://git.congatec.com/arm/qmx6_kernel/blob/648dfe433d427a257ee85f9ae95076b41d1d563f/drivers/media...

Best regards

igor

0 Kudos
Reply

1,599 Views
gbiradar
Contributor IV

Hi igorpadykov

igorpadykov wrote:

Hi Ganesh

ioctl_g_ctrl (V4L2_CID_BRIGHTNESS) reads current values from the

video_control[] array, check ov5640.c :

to read from sensor one will have to add function using ov5640_read_reg()

from SDE CTRL7,8

https://git.congatec.com/arm/qmx6_kernel/blob/648dfe433d427a257ee85f9ae95076b41d1d563f/drivers/media...

Best regards

igor

what you said is correct i did that earlier only but ov5640_read_reg() is returning zero and the variable which i'm passing as argument beside register tor ead is also returning zero. that's why i ask how to read brightness value. from ov5640  datasheet i'm reading 0x5587 register for brightness. correct me if i'm wrong.

0 Kudos
Reply

1,599 Views
igorpadykov
NXP Employee
NXP Employee

please post this to omnivision support

OmniVision

0 Kudos
Reply