All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mn88473: fix chip id check on probe
@ 2016-12-01  0:29 Antti Palosaari
  2016-12-01  0:29 ` [PATCH 2/2] mn88472: " Antti Palosaari
  2016-12-01 10:56 ` [PATCH 1/2] mn88473: " Benjamin Larsson
  0 siblings, 2 replies; 3+ messages in thread
From: Antti Palosaari @ 2016-12-01  0:29 UTC (permalink / raw)
  To: linux-media; +Cc: stable, Antti Palosaari

A register used to identify chip during probe was overwritten during
firmware download and due to that later probe's for warm chip were
failing. Detect chip from the another register, which is located on
different register bank 2.

Fixes: 7908fad99a6c ("[media] mn88473: finalize driver")
Cc: <stable@vger.kernel.org> # v4.8+
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 drivers/media/dvb-frontends/mn88473.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/media/dvb-frontends/mn88473.c b/drivers/media/dvb-frontends/mn88473.c
index f3b59a5..c221c7d 100644
--- a/drivers/media/dvb-frontends/mn88473.c
+++ b/drivers/media/dvb-frontends/mn88473.c
@@ -648,18 +648,6 @@ static int mn88473_probe(struct i2c_client *client,
 		goto err_kfree;
 	}
 
-	/* Check demod answers with correct chip id */
-	ret = regmap_read(dev->regmap[0], 0xff, &uitmp);
-	if (ret)
-		goto err_regmap_0_regmap_exit;
-
-	dev_dbg(&client->dev, "chip id=%02x\n", uitmp);
-
-	if (uitmp != 0x03) {
-		ret = -ENODEV;
-		goto err_regmap_0_regmap_exit;
-	}
-
 	/*
 	 * Chip has three I2C addresses for different register banks. Used
 	 * addresses are 0x18, 0x1a and 0x1c. We register two dummy clients,
@@ -696,6 +684,18 @@ static int mn88473_probe(struct i2c_client *client,
 	}
 	i2c_set_clientdata(dev->client[2], dev);
 
+	/* Check demod answers with correct chip id */
+	ret = regmap_read(dev->regmap[2], 0xff, &uitmp);
+	if (ret)
+		goto err_regmap_2_regmap_exit;
+
+	dev_dbg(&client->dev, "chip id=%02x\n", uitmp);
+
+	if (uitmp != 0x03) {
+		ret = -ENODEV;
+		goto err_regmap_2_regmap_exit;
+	}
+
 	/* Sleep because chip is active by default */
 	ret = regmap_write(dev->regmap[2], 0x05, 0x3e);
 	if (ret)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] mn88472: fix chip id check on probe
  2016-12-01  0:29 [PATCH 1/2] mn88473: fix chip id check on probe Antti Palosaari
@ 2016-12-01  0:29 ` Antti Palosaari
  2016-12-01 10:56 ` [PATCH 1/2] mn88473: " Benjamin Larsson
  1 sibling, 0 replies; 3+ messages in thread
From: Antti Palosaari @ 2016-12-01  0:29 UTC (permalink / raw)
  To: linux-media; +Cc: stable, Antti Palosaari

A register used to identify chip during probe was overwritten during
firmware download and due to that later probe's for warm chip were
failing. Detect chip from the another register, which is located on
different register bank 2.

Fixes: 94d0eaa41987 ("[media] mn88472: move out of staging to media")
Cc: <stable@vger.kernel.org> # v4.8+
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 drivers/media/dvb-frontends/mn88472.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/media/dvb-frontends/mn88472.c b/drivers/media/dvb-frontends/mn88472.c
index b6f5f83..29dd13b 100644
--- a/drivers/media/dvb-frontends/mn88472.c
+++ b/drivers/media/dvb-frontends/mn88472.c
@@ -488,18 +488,6 @@ static int mn88472_probe(struct i2c_client *client,
 		goto err_kfree;
 	}
 
-	/* Check demod answers with correct chip id */
-	ret = regmap_read(dev->regmap[0], 0xff, &utmp);
-	if (ret)
-		goto err_regmap_0_regmap_exit;
-
-	dev_dbg(&client->dev, "chip id=%02x\n", utmp);
-
-	if (utmp != 0x02) {
-		ret = -ENODEV;
-		goto err_regmap_0_regmap_exit;
-	}
-
 	/*
 	 * Chip has three I2C addresses for different register banks. Used
 	 * addresses are 0x18, 0x1a and 0x1c. We register two dummy clients,
@@ -536,6 +524,18 @@ static int mn88472_probe(struct i2c_client *client,
 	}
 	i2c_set_clientdata(dev->client[2], dev);
 
+	/* Check demod answers with correct chip id */
+	ret = regmap_read(dev->regmap[2], 0xff, &utmp);
+	if (ret)
+		goto err_regmap_2_regmap_exit;
+
+	dev_dbg(&client->dev, "chip id=%02x\n", utmp);
+
+	if (utmp != 0x02) {
+		ret = -ENODEV;
+		goto err_regmap_2_regmap_exit;
+	}
+
 	/* Sleep because chip is active by default */
 	ret = regmap_write(dev->regmap[2], 0x05, 0x3e);
 	if (ret)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] mn88473: fix chip id check on probe
  2016-12-01  0:29 [PATCH 1/2] mn88473: fix chip id check on probe Antti Palosaari
  2016-12-01  0:29 ` [PATCH 2/2] mn88472: " Antti Palosaari
@ 2016-12-01 10:56 ` Benjamin Larsson
  1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Larsson @ 2016-12-01 10:56 UTC (permalink / raw)
  To: Antti Palosaari, linux-media

On 2016-12-01 01:29, Antti Palosaari wrote:
> A register used to identify chip during probe was overwritten during
> firmware download and due to that later probe's for warm chip were
> failing. Detect chip from the another register, which is located on
> different register bank 2.
>
> Fixes: 7908fad99a6c ("[media] mn88473: finalize driver")
> Cc: <stable@vger.kernel.org> # v4.8+
> Signed-off-by: Antti Palosaari <crope@iki.fi>

I can confirm that I saw something with regards to this one time before.

MvH
Benjamin Larsson

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-01 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-01  0:29 [PATCH 1/2] mn88473: fix chip id check on probe Antti Palosaari
2016-12-01  0:29 ` [PATCH 2/2] mn88472: " Antti Palosaari
2016-12-01 10:56 ` [PATCH 1/2] mn88473: " Benjamin Larsson

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.