public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] media: radio: Tuning bugfix for si470x over i2c
@ 2018-02-26  2:24 Douglas Fischer
  0 siblings, 0 replies; only message in thread
From: Douglas Fischer @ 2018-02-26  2:24 UTC (permalink / raw)
  To: hverkuil, linux-media

Fixed si470x_set_channel() trying to tune before chip is turned
on, which causes warnings in dmesg and when probing, makes driver
wait for 3s for tuning timeout. This issue did not affect USB
devices because they have a different probing sequence.

Changed from v2: radio power check returns if power is off instead
of putting the rest of the function in the conditional.

Signed-off-by: Douglas Fischer <fischerdouglasc@gmail.com>
---

diff -uprN linux.orig/drivers/media/radio/si470x/radio-si470x-common.c linux/drivers/media/radio/si470x/radio-si470x-common.c
--- linux.orig/drivers/media/radio/si470x/radio-si470x-common.c	2018-01-15 21:58:10.675620432 -0500
+++ linux/drivers/media/radio/si470x/radio-si470x-common.c	2018-02-25 19:18:11.108930138 -0500
@@ -207,6 +207,15 @@ static int si470x_set_chan(struct si470x
 	unsigned long time_left;
 	bool timed_out = false;
 
+	retval = si470x_get_register(radio, POWERCFG);
+	if (retval)
+		return retval;
+
+	if ( (radio->registers[POWERCFG] & (POWERCFG_ENABLE|POWERCFG_DMUTE))
+		!= (POWERCFG_ENABLE|POWERCFG_DMUTE) ) {
+		return 0;
+	}
+
 	/* start tuning */
 	radio->registers[CHANNEL] &= ~CHANNEL_CHAN;
 	radio->registers[CHANNEL] |= CHANNEL_TUNE | chan;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-26  2:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-26  2:24 [PATCH v3] media: radio: Tuning bugfix for si470x over i2c Douglas Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox