Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] v4l: Add AUTO option for the V4L2_CID_POWER_LINE_FREQUENCY control

V4L2_CID_POWER_LINE_FREQUENCY control allows applications to instruct
a driver what is the power line frequency so an appropriate filter
can be used by the device to cancel flicker by compensating the light
intensity ripple. Currently in the menu we have entries for 50 Hz and
60 Hz and for entirely disabling the anti-flicker filter.
However some devices are capable of automatically detecting the
frequency, so add V4L2_CID_POWER_LINE_FREQUENCY_AUTO entry for them.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Sylwester Nawrocki and committed by
Mauro Carvalho Chehab
d26a6635 2e56d933

+5 -2
+3 -2
Documentation/DocBook/media/v4l/controls.xml
··· 232 232 <entry>Enables a power line frequency filter to avoid 233 233 flicker. Possible values for <constant>enum v4l2_power_line_frequency</constant> are: 234 234 <constant>V4L2_CID_POWER_LINE_FREQUENCY_DISABLED</constant> (0), 235 - <constant>V4L2_CID_POWER_LINE_FREQUENCY_50HZ</constant> (1) and 236 - <constant>V4L2_CID_POWER_LINE_FREQUENCY_60HZ</constant> (2).</entry> 235 + <constant>V4L2_CID_POWER_LINE_FREQUENCY_50HZ</constant> (1), 236 + <constant>V4L2_CID_POWER_LINE_FREQUENCY_60HZ</constant> (2) and 237 + <constant>V4L2_CID_POWER_LINE_FREQUENCY_AUTO</constant> (3).</entry> 237 238 </row> 238 239 <row> 239 240 <entry><constant>V4L2_CID_HUE_AUTO</constant></entry>
+1
drivers/media/video/v4l2-ctrls.c
··· 210 210 "Disabled", 211 211 "50 Hz", 212 212 "60 Hz", 213 + "Auto", 213 214 NULL 214 215 }; 215 216 static const char * const camera_exposure_auto[] = {
+1
include/linux/videodev2.h
··· 1169 1169 V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0, 1170 1170 V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1, 1171 1171 V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2, 1172 + V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3, 1172 1173 }; 1173 1174 #define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25) 1174 1175 #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)