[PATCH] lib: fix regression on Fitipower FC0012

David Kozub zub.272 at gmail.com
Wed Nov 15 20:23:21 UTC 2017


The commit ba64a745 fixed rtlsdr_set_gpio_output() but also caused librtlsdr
to stop working with (at least some) dongles with the FC0012 tuner. It seems
that the FC0012 is connected to GPIO 4 while rtlsdr_open() assumes it's
connected to GPIO 5. Before ba64a745 the bug in rtlsdr_set_gpio_output()
caused GPIOs 3 and 4 to be set low and so everything worked.

This changes the GPIO used in rtlsdr_open() from 5 to 4. At least on my
dongle this fixes the regression.
---
 src/librtlsdr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index b369a5d..4fb2128 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -1565,11 +1565,11 @@ int rtlsdr_open(rtlsdr_dev_t **out_dev, uint32_t index)
 	}
 
 	/* initialise GPIOs */
-	rtlsdr_set_gpio_output(dev, 5);
+	rtlsdr_set_gpio_output(dev, 4);
 
 	/* reset tuner before probing */
-	rtlsdr_set_gpio_bit(dev, 5, 1);
-	rtlsdr_set_gpio_bit(dev, 5, 0);
+	rtlsdr_set_gpio_bit(dev, 4, 1);
+	rtlsdr_set_gpio_bit(dev, 4, 0);
 
 	reg = rtlsdr_i2c_read_reg(dev, FC2580_I2C_ADDR, FC2580_CHECK_ADDR);
 	if ((reg & 0x7f) == FC2580_CHECK_VAL) {
-- 
2.14.2



More information about the osmocom-sdr mailing list