@@ -2799,7 +2799,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
struct device_node *endpoint;
struct device_node *np;
unsigned int flags;
- u32 v;
+ u32 v = -1;
np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node;
@@ -2809,14 +2809,24 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
return -EINVAL;
v4l2_of_parse_endpoint(endpoint, &bus_cfg);
-
- if (!of_property_read_u32(endpoint, "default-input", &v))
- state->pdata.default_input = v;
- else
- state->pdata.default_input = -1;
-
of_node_put(endpoint);
+ if (of_property_read_u32(np, "default-input", &v)) {
+ /* not specified ... can we choose automatically? */
+ switch (state->info->type) {
+ case ADV7611:
+ v = 0;
+ break;
+ case ADV7612:
+ if (state->info->max_port == ADV76XX_PAD_HDMI_PORT_A)
+ v = 0;
+ /* else is unhobbled, leave unspecified */
+ default:
+ break;
+ }
+ }
+ state->pdata.default_input = v;
+
flags = bus_cfg.bus.parallel.flags;
if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)