media: imx258: remove test pattern map from driver

change bayer order when using test pattern mode.
remove test pattern mapping method

[Sakari Ailus: Drop extra added newline]

Signed-off-by: Chen, JasonX Z <jasonx.z.chen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Chen, JasonX Z 2018-11-07 21:47:34 -05:00 committed by Mauro Carvalho Chehab
parent 9ffd7ffe65
commit 53f6f81da7
1 changed files with 3 additions and 19 deletions

View File

@ -62,11 +62,6 @@
/* Test Pattern Control */ /* Test Pattern Control */
#define IMX258_REG_TEST_PATTERN 0x0600 #define IMX258_REG_TEST_PATTERN 0x0600
#define IMX258_TEST_PATTERN_DISABLE 0
#define IMX258_TEST_PATTERN_SOLID_COLOR 1
#define IMX258_TEST_PATTERN_COLOR_BARS 2
#define IMX258_TEST_PATTERN_GREY_COLOR 3
#define IMX258_TEST_PATTERN_PN9 4
/* Orientation */ /* Orientation */
#define REG_MIRROR_FLIP_CONTROL 0x0101 #define REG_MIRROR_FLIP_CONTROL 0x0101
@ -504,20 +499,12 @@ static const struct imx258_reg mode_1048_780_regs[] = {
static const char * const imx258_test_pattern_menu[] = { static const char * const imx258_test_pattern_menu[] = {
"Disabled", "Disabled",
"Color Bars",
"Solid Color", "Solid Color",
"Color Bars",
"Grey Color Bars", "Grey Color Bars",
"PN9" "PN9"
}; };
static const int imx258_test_pattern_val[] = {
IMX258_TEST_PATTERN_DISABLE,
IMX258_TEST_PATTERN_COLOR_BARS,
IMX258_TEST_PATTERN_SOLID_COLOR,
IMX258_TEST_PATTERN_GREY_COLOR,
IMX258_TEST_PATTERN_PN9,
};
/* Configurations for supported link frequencies */ /* Configurations for supported link frequencies */
#define IMX258_LINK_FREQ_634MHZ 633600000ULL #define IMX258_LINK_FREQ_634MHZ 633600000ULL
#define IMX258_LINK_FREQ_320MHZ 320000000ULL #define IMX258_LINK_FREQ_320MHZ 320000000ULL
@ -778,13 +765,10 @@ static int imx258_set_ctrl(struct v4l2_ctrl *ctrl)
case V4L2_CID_TEST_PATTERN: case V4L2_CID_TEST_PATTERN:
ret = imx258_write_reg(imx258, IMX258_REG_TEST_PATTERN, ret = imx258_write_reg(imx258, IMX258_REG_TEST_PATTERN,
IMX258_REG_VALUE_16BIT, IMX258_REG_VALUE_16BIT,
imx258_test_pattern_val[ctrl->val]); ctrl->val);
ret = imx258_write_reg(imx258, REG_MIRROR_FLIP_CONTROL, ret = imx258_write_reg(imx258, REG_MIRROR_FLIP_CONTROL,
IMX258_REG_VALUE_08BIT, IMX258_REG_VALUE_08BIT,
ctrl->val == imx258_test_pattern_val !ctrl->val ? REG_CONFIG_MIRROR_FLIP :
[IMX258_TEST_PATTERN_DISABLE] ?
REG_CONFIG_MIRROR_FLIP :
REG_CONFIG_FLIP_TEST_PATTERN); REG_CONFIG_FLIP_TEST_PATTERN);
break; break;
default: default: