Skip to contentSkip to conversation

Fitipower fc0011 driver

PATCH In review Michael Büsch 2 participants 4 messages Mar 21, 2012 1 message not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20120321160237.02193470@milhouse

#1 lore raw

PATCH 1/2 Fitipower fc0011 driver

This adds the Fitipower fc0011 tuner driver.

Note: The '#if 0' statements will be removed on the final submission.

---

drivers/media/common/tuners/Kconfig +7 -0
Index: linux-source-3.2/drivers/media/common/tuners/Kconfig
===================================================================
@@ -204,6 +204,13 @@
 	help
 	  NXP TDA18212 silicon tuner driver.
 
+config MEDIA_TUNER_FC0011
+	tristate "Fitipower FC0011 silicon tuner"
+	depends on VIDEO_MEDIA && I2C
+	default m if MEDIA_TUNER_CUSTOMISE
+	help
+	  Fitipower FC0011 silicon tuner driver.
+
 config MEDIA_TUNER_FC0012
 	tristate "Fitipower FC0012 silicon tuner"
 	depends on VIDEO_MEDIA && I2C
drivers/media/common/tuners/Makefile +1 -0
Index: linux-source-3.2/drivers/media/common/tuners/Makefile
===================================================================
@@ -27,6 +27,7 @@
 obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o
 obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o
 obj-$(CONFIG_MEDIA_TUNER_TDA18212) += tda18212.o
+obj-$(CONFIG_MEDIA_TUNER_FC0011) += fc0011.o
 obj-$(CONFIG_MEDIA_TUNER_FC0012) += fc0012.o
 
 ccflags-y += -Idrivers/media/dvb/dvb-core
drivers/media/common/tuners/fc0011.c new file +501 -0

501 lines not on this page · raw message

drivers/media/common/tuners/fc0011.h new file +26 -0
Index: linux-source-3.2/drivers/media/common/tuners/fc0011.h
===================================================================
@@ -0,0 +1,26 @@
+#ifndef LINUX_FC0011_H_
+#define LINUX_FC0011_H_
+
+#include "dvb_frontend.h"
+
+#if defined(CONFIG_MEDIA_TUNER_FC0011) ||\
+    defined(CONFIG_MEDIA_TUNER_FC0011_MODULE)
+struct dvb_frontend *fc0011_attach(struct dvb_frontend *fe,
+				   struct i2c_adapter *i2c,
+				   u8 i2c_address,
+				   int (*tuner_reset)(void *),
+				   void *tuner_reset_data);
+#else
+static inline
+struct dvb_frontend *fc0011_attach(struct dvb_frontend *fe,
+				   struct i2c_adapter *i2c,
+				   u8 i2c_address,
+				   int (*tuner_reset)(void *),
+				   void *tuner_reset_data)
+{
+	dev_err(&i2c->dev, "fc0011 driver disabled in Kconfig\n");
+	return NULL;
+}
+#endif
+
+#endif /* LINUX_FC0011_H_ */
Signature · 3 lines
Greetings, Michael.

PGP encryption is encouraged / 908D8B0E
#2 lore raw

Il 21/03/2012 16:56, Michael Büsch ha scritto:

Quoted 7 lines

This adds the Fitipower fc0011 tuner driver.

Note: The '#if 0' statements will be removed on the final submission.

---

......

Quoted 5 lines
drivers/media/common/tuners/fc0011.c new file +5 -0
+
+#if 0 //TODO 3.3
+static int fc0011_set_params(struct dvb_frontend *fe)
+#else
+static int fc0011_set_params(struct dvb_frontend *fe,

drivers/media/common/tuners/fc0011.c line 151

Quoted 10 lines
drivers/media/common/tuners/fc0011.c new file +10 -0
+        struct dvb_frontend_parameters *params)
+#endif
+{
+        struct fc0011_priv *priv = fe->tuner_priv;
+	int err;
+	unsigned int i;
+#if 0 //TODO 3.3
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
+	u32 freq = p->frequency / 1000;
+	u32 delsys = p->delivery_system;

The "delsys" variable is unused, you can delete it.

BTW, I only compiled the driver, as I don't have the hardware to test it.

Regards,
Gianluca

Quoted 5 lines
drivers/media/common/tuners/fc0011.c new file +5 -0
+	u32 bandwidth = p->bandwidth_hz / 1000;
+#else
+	u32 freq = params->frequency / 1000;
+	u32 bandwidth = params->u.ofdm.bandwidth / 1000;
+#endif
#3 lore raw
Quoted 6 lines · On Wed, 21 Mar 2012 20:12:03 +0100 Gianluca Gennari <[email protected]> wrote:

drivers/media/common/tuners/fc0011.c line 151

Quoted 4 lines
drivers/media/common/tuners/fc0011.c new file +4 -0
+#if 0 //TODO 3.3
+	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
+	u32 freq = p->frequency / 1000;
+	u32 delsys = p->delivery_system;

The "delsys" variable is unused, you can delete it.

Thanks for your review. I fixed this.

Signature · 3 lines
Greetings, Michael.

PGP encryption is encouraged / 908D8B0E
#4 lore raw

PATCH 2/2 Integrate Fitipower fc0011 into af903x

In reply to a message not in the archive

This adds fc0011 support to the af903x driver.

---

drivers/media/dvb/dvb-usb/Kconfig +1 -0
Index: linux-source-3.2/drivers/media/dvb/dvb-usb/Kconfig
===================================================================
@@ -342,6 +342,7 @@
 config DVB_USB_AF903X
 	tristate "Afatech AF903X DVB-T USB2.0 support"
 	depends on DVB_USB && EXPERIMENTAL
+	select MEDIA_TUNER_FC0011   if !MEDIA_TUNER_CUSTOMISE
 	select MEDIA_TUNER_FC0012   if !MEDIA_TUNER_CUSTOMISE
 	select MEDIA_TUNER_MXL5007T if !MEDIA_TUNER_CUSTOMISE
 	help
drivers/media/dvb/dvb-usb/af903x-devices.c +4 -0
Index: linux-source-3.2/drivers/media/dvb/dvb-usb/af903x-devices.c
===================================================================
@@ -260,6 +260,7 @@
 }
 
 extern struct tuner_desc tuner_af9007;
+extern struct tuner_desc tuner_fc0011;
 extern struct tuner_desc tuner_fc0012;
 extern struct tuner_desc tuner_mxl5007t;
 
@@ -273,6 +274,9 @@
 	case TUNER_AF9007:
 		ctx->tuner_desc = &tuner_af9007;
 		break;
+	case TUNER_FC0011:
+		ctx->tuner_desc = &tuner_fc0011;
+		break;
 	case TUNER_FC0012:
 		ctx->tuner_desc = &tuner_fc0012;
 		break;
drivers/media/dvb/dvb-usb/af903x-fe.c +10 -0
Index: linux-source-3.2/drivers/media/dvb/dvb-usb/af903x-fe.c
===================================================================
@@ -28,6 +28,7 @@
 #include "af903x-fe.h"
 #include "af903x-fe-priv.h"
 #include "dvb_frontend.h"
+#include "fc0011.h"
 #include "fc0012.h"
 #include "mxl5007t.h"
 
@@ -1967,6 +1968,8 @@
 	}
 };
 
+extern int af903x_fc0011_reset(void *_ctx);
+
 static struct dvb_frontend_ops af903x_ops;
 struct dvb_frontend *af903x_fe_attach(struct i2c_adapter *i2c_adap, int id,
 	struct af903x_dev_ctx *ctx)
@@ -1990,6 +1993,13 @@
 	switch(ctx->tuner_desc->tunerId) {
 	case TUNER_AF9007:
 		break;
+	case TUNER_FC0011:
+		ret = dvb_attach(fc0011_attach, frontend, i2c_adap,
+			id == 0 ? ctx->tuner_desc->tuner_addr :
+			ctx->tuner_desc->tuner_addr + 1,
+			af903x_fc0011_reset, ctx)
+			== NULL ?  -ENODEV : 0;
+		break;
 	case TUNER_FC0012:
 		ret = dvb_attach(fc0012_attach, frontend, i2c_adap,
 			id == 0 ? ctx->tuner_desc->tuner_addr :
drivers/media/dvb/dvb-usb/af903x-tuners.c +100 -0

112 lines not on this page · raw message

Signature · 3 lines
Greetings, Michael.

PGP encryption is encouraged / 908D8B0E