All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
To: hans.verkuil@cisco.com, niklas.soderlund@ragnatech.se
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com,
	ian.molton@codethink.co.uk, lars@metafoo.de,
	william.towle@codethink.co.uk,
	Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Subject: [PATCH v3 2/7] media: adv7604: automatic "default-input" selection
Date: Thu, 14 Apr 2016 18:17:45 +0200	[thread overview]
Message-ID: <1460650670-20849-3-git-send-email-ulrich.hecht+renesas@gmail.com> (raw)
In-Reply-To: <1460650670-20849-1-git-send-email-ulrich.hecht+renesas@gmail.com>

From: William Towle <william.towle@codethink.co.uk>

Add logic such that the "default-input" property becomes unnecessary
for chips that only have one suitable input (ADV7611 by design, and
ADV7612 due to commit 7111cddd518f ("[media] media: adv7604: reduce
support to first (digital) input").

Additionally, Ian's documentation in commit bf9c82278c34 ("[media]
media: adv7604: ability to read default input port from DT") states
that the "default-input" property should reside directly in the node
for adv7612. Hence, also adjust the parsing to make the implementation
consistent with this.

Signed-off-by: William Towle <william.towle@codethink.co.uk>
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 drivers/media/i2c/adv7604.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 41a1bfc..d722c16 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -2788,7 +2788,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 	struct device_node *np;
 	unsigned int flags;
 	int ret;
-	u32 v;
+	u32 v = -1;
 
 	np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node;
 
@@ -2810,6 +2810,22 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 
 	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)
-- 
2.7.4


  parent reply	other threads:[~2016-04-14 16:18 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 16:17 [PATCH v3 0/7] Lager board HDMI input support Ulrich Hecht
2016-04-14 16:17 ` [PATCH v3 1/7] v4l: subdev: Add pad config allocator and init Ulrich Hecht
2016-04-14 16:17 ` Ulrich Hecht [this message]
2016-04-14 16:17 ` [PATCH v3 3/7] media: rcar_vin: Use correct pad number in try_fmt Ulrich Hecht
2016-04-14 16:17 ` [PATCH v3 4/7] media: rcar-vin: pad-aware driver initialisation Ulrich Hecht
2016-04-14 16:17   ` [PATCH v3 4/7] media: rcar-vin: pad-aware driver initialisation, [PATCH 4/4] arm64: dts: r8a7795: Don't disable referenced optional clocks Ulrich Hecht, Simon Horman
2016-04-14 16:17 ` [PATCH v3 5/7] media: rcar-vin: add DV timings support Ulrich Hecht
2016-04-18 10:04   ` Hans Verkuil
2016-04-20 16:24     ` Ulrich Hecht
2016-04-22 12:05       ` Hans Verkuil
2016-04-22 12:37   ` Hans Verkuil
2016-04-22 14:07   ` Hans Verkuil
2016-04-14 16:17 ` [PATCH v3 6/7] media: rcar-vin: initialize EDID data Ulrich Hecht
2016-04-18 10:13   ` Hans Verkuil
2016-04-20 16:24     ` Ulrich Hecht
2016-04-14 16:17 ` [PATCH v3 7/7] ARM: dts: lager: Add entries for VIN HDMI input support Ulrich Hecht
2016-04-14 16:17   ` [PATCH v3 7/7] ARM: dts: lager: Add entries for VIN HDMI input support, [PATCH 2/2] arm64: dts: r8a7795: Use SYSC "always-on" PM Domain Ulrich Hecht, Simon Horman
2016-04-27  4:06 [GIT PULL] Second Round of Renesas ARM64 Based SoC DT Updates for v4.7 Simon Horman
2016-04-27  4:06 ` Simon Horman
2016-04-27  4:06 ` [PATCH 1/4] arm64: dts: r8a7795: Add PCIe nodes Simon Horman
2016-04-27  4:06   ` Simon Horman
2016-04-27  4:06 ` [PATCH 2/4] arm64: dts: r8a7795: enable PCIe on Salvator-X Simon Horman
2016-04-27  4:06   ` Simon Horman
2016-04-27  4:06 ` [PATCH 3/4] arm64: dts: salvator-x: populate EXTALR Simon Horman
2016-04-27  4:06   ` Simon Horman
2016-04-27  4:06 ` [PATCH 4/4] arm64: dts: r8a7795: Don't disable referenced optional clocks Simon Horman
2016-04-27  4:06   ` Simon Horman
2016-04-28 14:14 ` [GIT PULL] Second Round of Renesas ARM64 Based SoC DT Updates for v4.7 Arnd Bergmann
2016-04-28 14:14   ` Arnd Bergmann
2016-04-28 14:19   ` Arnd Bergmann
2016-04-28 14:19     ` Arnd Bergmann
2016-04-27  4:20 [GIT PULL] Renesas ARM64 Based SoC DT PM Domain " Simon Horman
2016-04-27  4:20 ` Simon Horman
2016-04-27  4:20 ` [PATCH 1/2] arm64: dts: r8a7795: Add SYSC PM Domains Simon Horman
2016-04-27  4:20   ` Simon Horman
2016-04-27  4:20 ` [PATCH 2/2] arm64: dts: r8a7795: Use SYSC "always-on" PM Domain Simon Horman
2016-04-27  4:20   ` Simon Horman
2016-05-06  0:21 ` [GIT PULL] Renesas ARM64 Based SoC DT PM Domain Updates for v4.7 Simon Horman
2016-05-06  0:21   ` Simon Horman
2016-05-09 13:10   ` Arnd Bergmann
2016-05-09 13:10     ` Arnd Bergmann
2016-05-10  0:03     ` Simon Horman
2016-05-10  0:03       ` Simon Horman
2016-05-09 13:40 ` Arnd Bergmann
2016-05-09 13:40   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460650670-20849-3-git-send-email-ulrich.hecht+renesas@gmail.com \
    --to=ulrich.hecht+renesas@gmail.com \
    --cc=hans.verkuil@cisco.com \
    --cc=ian.molton@codethink.co.uk \
    --cc=lars@metafoo.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=william.towle@codethink.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.