media: adv7180: Disable test-pattern control on adv7180
[ Upstream commit a980bc5f56b0292336e408f657f79e574e8067c0 ] The register that enables selecting a test-pattern to be outputted in free-run mode (FREE_RUN_PAT_SEL[2:0]) is only available on adv7280 based devices, not the adv7180 based ones. Add a flag to mark devices that are capable of generating test-patterns, and those that are not. And only register the control on supported devices. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3cd2aa9367
commit
ca9f3ab612
@@ -194,6 +194,7 @@ struct adv7180_state;
|
||||
#define ADV7180_FLAG_V2 BIT(1)
|
||||
#define ADV7180_FLAG_MIPI_CSI2 BIT(2)
|
||||
#define ADV7180_FLAG_I2P BIT(3)
|
||||
#define ADV7180_FLAG_TEST_PATTERN BIT(4)
|
||||
|
||||
struct adv7180_chip_info {
|
||||
unsigned int flags;
|
||||
@@ -673,11 +674,15 @@ static int adv7180_init_controls(struct adv7180_state *state)
|
||||
ADV7180_HUE_MAX, 1, ADV7180_HUE_DEF);
|
||||
v4l2_ctrl_new_custom(&state->ctrl_hdl, &adv7180_ctrl_fast_switch, NULL);
|
||||
|
||||
v4l2_ctrl_new_std_menu_items(&state->ctrl_hdl, &adv7180_ctrl_ops,
|
||||
V4L2_CID_TEST_PATTERN,
|
||||
ARRAY_SIZE(test_pattern_menu) - 1,
|
||||
0, ARRAY_SIZE(test_pattern_menu) - 1,
|
||||
test_pattern_menu);
|
||||
if (state->chip_info->flags & ADV7180_FLAG_TEST_PATTERN) {
|
||||
v4l2_ctrl_new_std_menu_items(&state->ctrl_hdl,
|
||||
&adv7180_ctrl_ops,
|
||||
V4L2_CID_TEST_PATTERN,
|
||||
ARRAY_SIZE(test_pattern_menu) - 1,
|
||||
0,
|
||||
ARRAY_SIZE(test_pattern_menu) - 1,
|
||||
test_pattern_menu);
|
||||
}
|
||||
|
||||
state->sd.ctrl_handler = &state->ctrl_hdl;
|
||||
if (state->ctrl_hdl.error) {
|
||||
@@ -1209,7 +1214,7 @@ static const struct adv7180_chip_info adv7182_info = {
|
||||
};
|
||||
|
||||
static const struct adv7180_chip_info adv7280_info = {
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_I2P,
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_I2P | ADV7180_FLAG_TEST_PATTERN,
|
||||
.valid_input_mask = BIT(ADV7182_INPUT_CVBS_AIN1) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN2) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN3) |
|
||||
@@ -1223,7 +1228,8 @@ static const struct adv7180_chip_info adv7280_info = {
|
||||
};
|
||||
|
||||
static const struct adv7180_chip_info adv7280_m_info = {
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_MIPI_CSI2 | ADV7180_FLAG_I2P,
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_MIPI_CSI2 | ADV7180_FLAG_I2P |
|
||||
ADV7180_FLAG_TEST_PATTERN,
|
||||
.valid_input_mask = BIT(ADV7182_INPUT_CVBS_AIN1) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN2) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN3) |
|
||||
@@ -1244,7 +1250,8 @@ static const struct adv7180_chip_info adv7280_m_info = {
|
||||
};
|
||||
|
||||
static const struct adv7180_chip_info adv7281_info = {
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_MIPI_CSI2,
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_MIPI_CSI2 |
|
||||
ADV7180_FLAG_TEST_PATTERN,
|
||||
.valid_input_mask = BIT(ADV7182_INPUT_CVBS_AIN1) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN2) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN7) |
|
||||
@@ -1259,7 +1266,8 @@ static const struct adv7180_chip_info adv7281_info = {
|
||||
};
|
||||
|
||||
static const struct adv7180_chip_info adv7281_m_info = {
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_MIPI_CSI2,
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_MIPI_CSI2 |
|
||||
ADV7180_FLAG_TEST_PATTERN,
|
||||
.valid_input_mask = BIT(ADV7182_INPUT_CVBS_AIN1) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN2) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN3) |
|
||||
@@ -1279,7 +1287,8 @@ static const struct adv7180_chip_info adv7281_m_info = {
|
||||
};
|
||||
|
||||
static const struct adv7180_chip_info adv7281_ma_info = {
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_MIPI_CSI2,
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_MIPI_CSI2 |
|
||||
ADV7180_FLAG_TEST_PATTERN,
|
||||
.valid_input_mask = BIT(ADV7182_INPUT_CVBS_AIN1) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN2) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN3) |
|
||||
@@ -1304,7 +1313,7 @@ static const struct adv7180_chip_info adv7281_ma_info = {
|
||||
};
|
||||
|
||||
static const struct adv7180_chip_info adv7282_info = {
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_I2P,
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_I2P | ADV7180_FLAG_TEST_PATTERN,
|
||||
.valid_input_mask = BIT(ADV7182_INPUT_CVBS_AIN1) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN2) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN7) |
|
||||
@@ -1319,7 +1328,8 @@ static const struct adv7180_chip_info adv7282_info = {
|
||||
};
|
||||
|
||||
static const struct adv7180_chip_info adv7282_m_info = {
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_MIPI_CSI2 | ADV7180_FLAG_I2P,
|
||||
.flags = ADV7180_FLAG_V2 | ADV7180_FLAG_MIPI_CSI2 | ADV7180_FLAG_I2P |
|
||||
ADV7180_FLAG_TEST_PATTERN,
|
||||
.valid_input_mask = BIT(ADV7182_INPUT_CVBS_AIN1) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN2) |
|
||||
BIT(ADV7182_INPUT_CVBS_AIN3) |
|
||||
|
Reference in New Issue
Block a user