Thread (11 messages) 11 messages, 3 authors, 2016-08-15

Re: [PATCH v6 1/4] media: adv7604: automatic "default-input" selection

From: Sergei Shtylyov <hidden>
Date: 2016-07-22 19:50:04
Also in: linux-renesas-soc

On 07/22/2016 12:09 PM, Ulrich Hecht wrote:
quoted hunk ↗ jump to hunk
Fall back to input 0 if "default-input" property is not present.

Additionally, 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.

Based on patch by William Towle [off-list ref].

Signed-off-by: Ulrich Hecht <redacted>
---
 drivers/media/i2c/adv7604.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 4003831..055c9df 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -3077,10 +3077,13 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 	if (!of_property_read_u32(endpoint, "default-input", &v))
 		state->pdata.default_input = v;
 	else
-		state->pdata.default_input = -1;
+		state->pdata.default_input = 0;

 	of_node_put(endpoint);

+	if (!of_property_read_u32(np, "default-input", &v))
+		state->pdata.default_input = v;
	of_property_read_u32(np, "default-input",
			     &state->pdata.default_input));

should be equivalent...

MBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help