diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2019-07-09 20:32:28 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2019-07-14 12:44:14 +0200 |
commit | 42954857190b9df16d9d873ecc7f6cc38e013e44 (patch) | |
tree | 98c588f629ff534d458eb0884782ea99672d7634 /target/linux/brcm2708/patches-4.19/950-0264-staging-bcm2835-camera-Use-enums-for-max-value-in-co.patch | |
parent | f1875e902d0afb7d9b9e5285b4fd8da7f6c5e30a (diff) | |
download | upstream-42954857190b9df16d9d873ecc7f6cc38e013e44.tar.gz upstream-42954857190b9df16d9d873ecc7f6cc38e013e44.tar.bz2 upstream-42954857190b9df16d9d873ecc7f6cc38e013e44.zip |
brcm2708: add linux 4.19 support
Boot tested on Raspberry Pi B+ (BCM2708) and Raspberry Pi 2 (BCM2709)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.19/950-0264-staging-bcm2835-camera-Use-enums-for-max-value-in-co.patch')
-rw-r--r-- | target/linux/brcm2708/patches-4.19/950-0264-staging-bcm2835-camera-Use-enums-for-max-value-in-co.patch | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.19/950-0264-staging-bcm2835-camera-Use-enums-for-max-value-in-co.patch b/target/linux/brcm2708/patches-4.19/950-0264-staging-bcm2835-camera-Use-enums-for-max-value-in-co.patch new file mode 100644 index 0000000000..24a4205549 --- /dev/null +++ b/target/linux/brcm2708/patches-4.19/950-0264-staging-bcm2835-camera-Use-enums-for-max-value-in-co.patch @@ -0,0 +1,112 @@ +From cbfd21871e5882f8ffa73a7b5c96018409b683ea Mon Sep 17 00:00:00 2001 +From: Dave Stevenson <dave.stevenson@raspberrypi.org> +Date: Fri, 28 Sep 2018 10:17:11 +0100 +Subject: [PATCH 264/703] staging: bcm2835-camera: Use enums for max value in + controls + +Controls of type MMAL_CONTROL_TYPE_STD_MENU call v4l2_ctrl_new_std_menu +with a max value and a mask. The max value is one of the defined +values for the control, however in the config array there are several +entries where raw numbers have been used instead. Replace these +with the appropriate enum. + +Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> +--- + .../vc04_services/bcm2835-camera/controls.c | 37 +++++++------------ + 1 file changed, 13 insertions(+), 24 deletions(-) + +--- a/drivers/staging/vc04_services/bcm2835-camera/controls.c ++++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c +@@ -58,19 +58,6 @@ static const uint32_t iso_values[] = { + 0, 100, 200, 400, 800, + }; + +-static const s64 mains_freq_qmenu[] = { +- V4L2_CID_POWER_LINE_FREQUENCY_DISABLED, +- V4L2_CID_POWER_LINE_FREQUENCY_50HZ, +- V4L2_CID_POWER_LINE_FREQUENCY_60HZ, +- V4L2_CID_POWER_LINE_FREQUENCY_AUTO +-}; +- +-/* Supported video encode modes */ +-static const s64 bitrate_mode_qmenu[] = { +- (s64)V4L2_MPEG_VIDEO_BITRATE_MODE_VBR, +- (s64)V4L2_MPEG_VIDEO_BITRATE_MODE_CBR, +-}; +- + enum bm2835_mmal_ctrl_type { + MMAL_CONTROL_TYPE_STD, + MMAL_CONTROL_TYPE_STD_MENU, +@@ -966,8 +953,8 @@ static const struct bm2835_mmal_v4l2_ctr + }, + { + V4L2_CID_ISO_SENSITIVITY_AUTO, MMAL_CONTROL_TYPE_STD_MENU, +- 0, 1, V4L2_ISO_SENSITIVITY_AUTO, 1, NULL, +- MMAL_PARAMETER_ISO, ++ 0, V4L2_ISO_SENSITIVITY_AUTO, V4L2_ISO_SENSITIVITY_AUTO, 1, ++ NULL, MMAL_PARAMETER_ISO, + &ctrl_set_iso, + false + }, +@@ -984,8 +971,8 @@ static const struct bm2835_mmal_v4l2_ctr + */ + { + V4L2_CID_EXPOSURE_AUTO, MMAL_CONTROL_TYPE_STD_MENU, +- ~0x03, 3, V4L2_EXPOSURE_AUTO, 0, NULL, +- MMAL_PARAMETER_EXPOSURE_MODE, ++ ~0x03, V4L2_EXPOSURE_APERTURE_PRIORITY, V4L2_EXPOSURE_AUTO, 0, ++ NULL, MMAL_PARAMETER_EXPOSURE_MODE, + &ctrl_set_exposure, + false + }, +@@ -1021,7 +1008,8 @@ static const struct bm2835_mmal_v4l2_ctr + { + V4L2_CID_EXPOSURE_METERING, + MMAL_CONTROL_TYPE_STD_MENU, +- ~0x7, 2, V4L2_EXPOSURE_METERING_AVERAGE, 0, NULL, ++ ~0x7, V4L2_EXPOSURE_METERING_SPOT, ++ V4L2_EXPOSURE_METERING_AVERAGE, 0, NULL, + MMAL_PARAMETER_EXP_METERING_MODE, + &ctrl_set_metering_mode, + false +@@ -1029,7 +1017,8 @@ static const struct bm2835_mmal_v4l2_ctr + { + V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE, + MMAL_CONTROL_TYPE_STD_MENU, +- ~0x3ff, 9, V4L2_WHITE_BALANCE_AUTO, 0, NULL, ++ ~0x3ff, V4L2_WHITE_BALANCE_SHADE, V4L2_WHITE_BALANCE_AUTO, 0, ++ NULL, + MMAL_PARAMETER_AWB_MODE, + &ctrl_set_awb_mode, + false +@@ -1050,7 +1039,7 @@ static const struct bm2835_mmal_v4l2_ctr + }, + { + V4L2_CID_COLORFX, MMAL_CONTROL_TYPE_STD_MENU, +- 0, 15, V4L2_COLORFX_NONE, 0, NULL, ++ 0, V4L2_COLORFX_SET_CBCR, V4L2_COLORFX_NONE, 0, NULL, + MMAL_PARAMETER_IMAGE_EFFECT, + &ctrl_set_image_effect, + false +@@ -1085,8 +1074,8 @@ static const struct bm2835_mmal_v4l2_ctr + }, + { + V4L2_CID_MPEG_VIDEO_BITRATE_MODE, MMAL_CONTROL_TYPE_STD_MENU, +- 0, ARRAY_SIZE(bitrate_mode_qmenu) - 1, +- 0, 0, bitrate_mode_qmenu, ++ 0, V4L2_MPEG_VIDEO_BITRATE_MODE_CBR, ++ 0, 0, NULL, + MMAL_PARAMETER_RATECONTROL, + &ctrl_set_bitrate_mode, + false +@@ -1108,8 +1097,8 @@ static const struct bm2835_mmal_v4l2_ctr + }, + { + V4L2_CID_POWER_LINE_FREQUENCY, MMAL_CONTROL_TYPE_STD_MENU, +- 0, ARRAY_SIZE(mains_freq_qmenu) - 1, +- 1, 1, mains_freq_qmenu, ++ 0, V4L2_CID_POWER_LINE_FREQUENCY_AUTO, ++ 1, 1, NULL, + MMAL_PARAMETER_FLICKER_AVOID, + &ctrl_set_flicker_avoidance, + false |