|
@@ -164,6 +164,7 @@ struct adv76xx_state {
|
|
struct adv76xx_platform_data pdata;
|
|
struct adv76xx_platform_data pdata;
|
|
|
|
|
|
struct gpio_desc *hpd_gpio[4];
|
|
struct gpio_desc *hpd_gpio[4];
|
|
|
|
+ struct gpio_desc *reset_gpio;
|
|
|
|
|
|
struct v4l2_subdev sd;
|
|
struct v4l2_subdev sd;
|
|
struct media_pad pads[ADV76XX_PAD_MAX];
|
|
struct media_pad pads[ADV76XX_PAD_MAX];
|
|
@@ -3018,6 +3019,19 @@ static int configure_regmaps(struct adv76xx_state *state)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void adv76xx_reset(struct adv76xx_state *state)
|
|
|
|
+{
|
|
|
|
+ if (state->reset_gpio) {
|
|
|
|
+ /* ADV76XX can be reset by a low reset pulse of minimum 5 ms. */
|
|
|
|
+ gpiod_set_value_cansleep(state->reset_gpio, 0);
|
|
|
|
+ usleep_range(5000, 10000);
|
|
|
|
+ gpiod_set_value_cansleep(state->reset_gpio, 1);
|
|
|
|
+ /* It is recommended to wait 5 ms after the low pulse before */
|
|
|
|
+ /* an I2C write is performed to the ADV76XX. */
|
|
|
|
+ usleep_range(5000, 10000);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
static int adv76xx_probe(struct i2c_client *client,
|
|
static int adv76xx_probe(struct i2c_client *client,
|
|
const struct i2c_device_id *id)
|
|
const struct i2c_device_id *id)
|
|
{
|
|
{
|
|
@@ -3081,6 +3095,12 @@ static int adv76xx_probe(struct i2c_client *client,
|
|
if (state->hpd_gpio[i])
|
|
if (state->hpd_gpio[i])
|
|
v4l_info(client, "Handling HPD %u GPIO\n", i);
|
|
v4l_info(client, "Handling HPD %u GPIO\n", i);
|
|
}
|
|
}
|
|
|
|
+ state->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset",
|
|
|
|
+ GPIOD_OUT_HIGH);
|
|
|
|
+ if (IS_ERR(state->reset_gpio))
|
|
|
|
+ return PTR_ERR(state->reset_gpio);
|
|
|
|
+
|
|
|
|
+ adv76xx_reset(state);
|
|
|
|
|
|
state->timings = cea640x480;
|
|
state->timings = cea640x480;
|
|
state->format = adv76xx_format_info(state, MEDIA_BUS_FMT_YUYV8_2X8);
|
|
state->format = adv76xx_format_info(state, MEDIA_BUS_FMT_YUYV8_2X8);
|