drivers: video: controls: rename controls to Linux-like names
This uses Linux V4L2 controls as a reference to give names to the CIDs. Apply the renaming down to the drivers that use them. Signed-off-by: Josuah Demangeon <me@josuah.net>
This commit is contained in:
parent
9a6df717f0
commit
217f053ccd
4 changed files with 29 additions and 29 deletions
|
|
@ -940,28 +940,28 @@ static int ov2640_set_ctrl(const struct device *dev,
|
|||
case VIDEO_CID_VFLIP:
|
||||
ret |= ov2640_set_vertical_flip(dev, (int)value);
|
||||
break;
|
||||
case VIDEO_CID_CAMERA_EXPOSURE:
|
||||
case VIDEO_CID_EXPOSURE:
|
||||
ret |= ov2640_set_exposure_ctrl(dev, (int)value);
|
||||
break;
|
||||
case VIDEO_CID_CAMERA_GAIN:
|
||||
case VIDEO_CID_GAIN:
|
||||
ret |= ov2640_set_gain_ctrl(dev, (int)value);
|
||||
break;
|
||||
case VIDEO_CID_CAMERA_BRIGHTNESS:
|
||||
case VIDEO_CID_BRIGHTNESS:
|
||||
ret |= ov2640_set_brightness(dev, (int)value);
|
||||
break;
|
||||
case VIDEO_CID_CAMERA_SATURATION:
|
||||
case VIDEO_CID_SATURATION:
|
||||
ret |= ov2640_set_saturation(dev, (int)value);
|
||||
break;
|
||||
case VIDEO_CID_CAMERA_WHITE_BAL:
|
||||
case VIDEO_CID_WHITE_BALANCE_TEMPERATURE:
|
||||
ret |= ov2640_set_white_bal(dev, (int)value);
|
||||
break;
|
||||
case VIDEO_CID_CAMERA_CONTRAST:
|
||||
case VIDEO_CID_CONTRAST:
|
||||
ret |= ov2640_set_contrast(dev, (int)value);
|
||||
break;
|
||||
case VIDEO_CID_CAMERA_TEST_PATTERN:
|
||||
case VIDEO_CID_TEST_PATTERN:
|
||||
ret |= ov2640_set_colorbar(dev, (int)value);
|
||||
break;
|
||||
case VIDEO_CID_CAMERA_QUALITY:
|
||||
case VIDEO_CID_JPEG_COMPRESSION_QUALITY:
|
||||
ret |= ov2640_set_quality(dev, (int)value);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -844,17 +844,17 @@ static int ov5640_set_ctrl_power_line_freq(const struct device *dev, int value)
|
|||
static int ov5640_set_ctrl(const struct device *dev, unsigned int cid, void *value)
|
||||
{
|
||||
switch (cid) {
|
||||
case VIDEO_CID_CAMERA_TEST_PATTERN:
|
||||
case VIDEO_CID_TEST_PATTERN:
|
||||
return ov5640_set_ctrl_test_pattern(dev, (int)value);
|
||||
case VIDEO_CID_CAMERA_HUE:
|
||||
case VIDEO_CID_HUE:
|
||||
return ov5640_set_ctrl_hue(dev, (int)value);
|
||||
case VIDEO_CID_CAMERA_SATURATION:
|
||||
case VIDEO_CID_SATURATION:
|
||||
return ov5640_set_ctrl_saturation(dev, (int)(value));
|
||||
case VIDEO_CID_CAMERA_BRIGHTNESS:
|
||||
case VIDEO_CID_BRIGHTNESS:
|
||||
return ov5640_set_ctrl_brightness(dev, (int)(value));
|
||||
case VIDEO_CID_CAMERA_CONTRAST:
|
||||
case VIDEO_CID_CONTRAST:
|
||||
return ov5640_set_ctrl_contrast(dev, (int)value);
|
||||
case VIDEO_CID_CAMERA_GAIN:
|
||||
case VIDEO_CID_GAIN:
|
||||
return ov5640_set_ctrl_gain(dev, (int)(value));
|
||||
case VIDEO_CID_HFLIP:
|
||||
return ov5640_set_ctrl_hflip(dev, (int)(value));
|
||||
|
|
|
|||
|
|
@ -55,23 +55,23 @@ extern "C" {
|
|||
* @name Base class control IDs
|
||||
* @{
|
||||
*/
|
||||
#define VIDEO_CID_CAMERA_BRIGHTNESS (VIDEO_CID_BASE + 0)
|
||||
#define VIDEO_CID_CAMERA_CONTRAST (VIDEO_CID_BASE + 1)
|
||||
#define VIDEO_CID_CAMERA_SATURATION (VIDEO_CID_BASE + 2)
|
||||
#define VIDEO_CID_CAMERA_HUE (VIDEO_CID_BASE + 3)
|
||||
#define VIDEO_CID_CAMERA_EXPOSURE (VIDEO_CID_BASE + 17)
|
||||
#define VIDEO_CID_CAMERA_GAIN (VIDEO_CID_BASE + 19)
|
||||
#define VIDEO_CID_HFLIP (VIDEO_CID_BASE + 20)
|
||||
#define VIDEO_CID_VFLIP (VIDEO_CID_BASE + 21)
|
||||
#define VIDEO_CID_BRIGHTNESS (VIDEO_CID_BASE + 0)
|
||||
#define VIDEO_CID_CONTRAST (VIDEO_CID_BASE + 1)
|
||||
#define VIDEO_CID_SATURATION (VIDEO_CID_BASE + 2)
|
||||
#define VIDEO_CID_HUE (VIDEO_CID_BASE + 3)
|
||||
#define VIDEO_CID_EXPOSURE (VIDEO_CID_BASE + 17)
|
||||
#define VIDEO_CID_GAIN (VIDEO_CID_BASE + 19)
|
||||
#define VIDEO_CID_HFLIP (VIDEO_CID_BASE + 20)
|
||||
#define VIDEO_CID_VFLIP (VIDEO_CID_BASE + 21)
|
||||
/** Power line frequency (enum) filter to avoid flicker */
|
||||
#define VIDEO_CID_POWER_LINE_FREQUENCY (VIDEO_CID_BASE + 24)
|
||||
#define VIDEO_CID_POWER_LINE_FREQUENCY (VIDEO_CID_BASE + 24)
|
||||
enum video_power_line_frequency {
|
||||
VIDEO_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
|
||||
VIDEO_CID_POWER_LINE_FREQUENCY_50HZ = 1,
|
||||
VIDEO_CID_POWER_LINE_FREQUENCY_60HZ = 2,
|
||||
VIDEO_CID_POWER_LINE_FREQUENCY_AUTO = 3,
|
||||
};
|
||||
#define VIDEO_CID_CAMERA_WHITE_BAL (VIDEO_CID_BASE + 26)
|
||||
#define VIDEO_CID_WHITE_BALANCE_TEMPERATURE (VIDEO_CID_BASE + 26)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
@ -80,7 +80,7 @@ enum video_power_line_frequency {
|
|||
* @name Camera class controls IDs
|
||||
* @{
|
||||
*/
|
||||
#define VIDEO_CID_CAMERA_ZOOM (VIDEO_CID_CAMERA_CLASS_BASE + 13)
|
||||
#define VIDEO_CID_ZOOM_ABSOLUTE (VIDEO_CID_CAMERA_CLASS_BASE + 13)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
@ -89,7 +89,7 @@ enum video_power_line_frequency {
|
|||
* @name JPEG class control IDs
|
||||
* @{
|
||||
*/
|
||||
#define VIDEO_CID_CAMERA_QUALITY (VIDEO_CID_JPEG_CLASS_BASE + 3)
|
||||
#define VIDEO_CID_JPEG_COMPRESSION_QUALITY (VIDEO_CID_JPEG_CLASS_BASE + 3)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
@ -99,8 +99,8 @@ enum video_power_line_frequency {
|
|||
* @{
|
||||
*/
|
||||
/** Pixel rate (pixels/second) in the device's pixel array. This control is read-only. */
|
||||
#define VIDEO_CID_PIXEL_RATE (VIDEO_CID_IMAGE_PROC_CLASS_BASE + 2)
|
||||
#define VIDEO_CID_CAMERA_COLORBAR (VIDEO_CID_IMAGE_PROC_CLASS_BASE + 3)
|
||||
#define VIDEO_CID_PIXEL_RATE (VIDEO_CID_IMAGE_PROC_CLASS_BASE + 2)
|
||||
#define VIDEO_CID_TEST_PATTERN (VIDEO_CID_IMAGE_PROC_CLASS_BASE + 3)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ int main(void)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_TEST
|
||||
video_set_ctrl(video_dev, VIDEO_CID_CAMERA_TEST_PATTERN, (void *)1);
|
||||
video_set_ctrl(video_dev, VIDEO_CID_TEST_PATTERN, (void *)1);
|
||||
#endif
|
||||
|
||||
#if DT_HAS_CHOSEN(zephyr_display)
|
||||
|
|
|
|||
Loading…
Reference in a new issue