Re: af9015: tuner id:179 not supported, please report!

2009-12-02 Thread Bert Massop
Jan Sundman  aland.net> writes:

> 
> Hi,
> 
> I just received a usb DVB-T card and have been trying to get it to work
> under Ubuntu 9.10, but to no avail. dmesg shows the following when
> plugging in the card:
> 
> [   35.280024] usb 2-1: new high speed USB device using ehci_hcd and
> address 4
> [   35.435978] usb 2-1: configuration #1 chosen from 1 choice
> [   35.450176] af9015: tuner id:179 not supported, please report!
> [   35.452891] Afatech DVB-T 2: Fixing fullspeed to highspeed interval:
> 10 -> 7
> [   35.453097] input: Afatech DVB-T 2
> as /devices/pci:00/:00:13.2/usb2/2-1/2-1:1.1/input/input8
> [   35.453141] generic-usb 0003:15A4:9016.0005: input,hidraw3: USB HID
> v1.01 Keyboard [Afatech DVB-T 2] on usb-:00:13.2-1/input1
> 
> lsusb shows:
> Bus 002 Device 005: ID 15a4:9016  
> 
> and finally lsmod | grep dvb
> dvb_usb_af9015 37152  0 
> dvb_usb22892  1 dvb_usb_af9015
> dvb_core  109716  1 dvb_usb
> 
> While googling for an answer to my troubles I came across
> http://ubuntuforums.org/showthread.php?t=606487&page=5 which hints that
> the card may use the TDA18218HK tuner chip which does not seem to be
> supported currently.
> 
> Does anyone have any experience regarding this chip and know what to do
> to get it working.
> 
> Best regards,
> 
> //Jan
> 
> 

Hi Jan,

As stated in the Ubuntuforums thread, there doesn't seem to be any support for
this chip at the moment. I don't know how hard it is to code support for a
specific tuner, but I'm looking into that right now.

Hopefully some more experienced coders will join in writing something usable, as
I don't think I will be able to do it myself.

Please drop a message if anyone finds something useful.

Best regards,

Bert


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: af9015: tuner id:179 not supported, please report!

2009-12-03 Thread Bert Massop
Hi Jan,

The datasheet for the TDA18218 can be obtained from NXP:
http://www.nxp.com/documents/data_sheet/TDA18218HN.pdf

That's all the information I have at the moment, maybe Mike has some
other information (like the Application Note mentioned in the
datasheet, that claims to contain information on writing drivers, but
cannot be found anywhere).

Best regards,

Bert

On Thu, Dec 3, 2009 at 22:15, Jan Sundman  wrote:
>
> Hi Bert and Mike,
>
> The information that you have regarding the TDA18218, where can I get my
> hands on that? It would be interesting to take a shot at writing the
> driver, but I guess I would need some pointers in the right direction.
>
> Would it be possible to get the information from you, or is such
> information freely available on the internet? Where should I start
> looking?
>
> Best regards,
>
> //Jan
>
> On Wed, 2009-12-02 at 18:08 -0500, Michael Krufky wrote:
> > On Wed, Dec 2, 2009 at 5:06 PM, Bert Massop  wrote:
> > > Jan Sundman  aland.net> writes:
> > >
> > >>
> > >> Hi,
> > >>
> > >> I just received a usb DVB-T card and have been trying to get it to work
> > >> under Ubuntu 9.10, but to no avail. dmesg shows the following when
> > >> plugging in the card:
> > >>
> > >> [   35.280024] usb 2-1: new high speed USB device using ehci_hcd and
> > >> address 4
> > >> [   35.435978] usb 2-1: configuration #1 chosen from 1 choice
> > >> [   35.450176] af9015: tuner id:179 not supported, please report!
> > >> [   35.452891] Afatech DVB-T 2: Fixing fullspeed to highspeed interval:
> > >> 10 -> 7
> > >> [   35.453097] input: Afatech DVB-T 2
> > >> as /devices/pci:00/:00:13.2/usb2/2-1/2-1:1.1/input/input8
> > >> [   35.453141] generic-usb 0003:15A4:9016.0005: input,hidraw3: USB HID
> > >> v1.01 Keyboard [Afatech DVB-T 2] on usb-:00:13.2-1/input1
> > >>
> > >> lsusb shows:
> > >> Bus 002 Device 005: ID 15a4:9016
> > >>
> > >> and finally lsmod | grep dvb
> > >> dvb_usb_af9015         37152  0
> > >> dvb_usb                22892  1 dvb_usb_af9015
> > >> dvb_core              109716  1 dvb_usb
> > >>
> > >> While googling for an answer to my troubles I came across
> > >> http://ubuntuforums.org/showthread.php?t=606487&page=5 which hints that
> > >> the card may use the TDA18218HK tuner chip which does not seem to be
> > >> supported currently.
> > >>
> > >> Does anyone have any experience regarding this chip and know what to do
> > >> to get it working.
> > >>
> > >> Best regards,
> > >>
> > >> //Jan
> > >>
> > >>
> > >
> > > Hi Jan,
> > >
> > > As stated in the Ubuntuforums thread, there doesn't seem to be any 
> > > support for
> > > this chip at the moment. I don't know how hard it is to code support for a
> > > specific tuner, but I'm looking into that right now.
> > >
> > > Hopefully some more experienced coders will join in writing something 
> > > usable, as
> > > I don't think I will be able to do it myself.
> > >
> > > Please drop a message if anyone finds something useful.
> > >
> > > Best regards,
> > >
> > > Bert
> >
> > The TDA18218 is not currently supported under Linux.  I have the
> > information needed to write a driver to support it, but I do not have
> > any devices that use it, nor any interest (as of now) to write the
> > driver on my own time.
> >
> > For me, it would not be very difficult to get this done, as I have
> > done work to support a similar family of tuners -- TDA18271 /
> > TDA18211.  The TDA18218 tuner is not supported by the current driver.
> >
> > In the past, I would have gone ahead and written a driver for the
> > sheer enjoyment of doing so... but nowadays, I actually have other
> > projects of a higher priority that need my attention instead.
> >
> > If, in the future, any commercial entity has interest in seeing this
> > tuner silicon supported under Linux, they should contact me -- perhaps
> > my desire to write this driver can be increased ;-)
> >
> > Regards,
> >
> > Mike Krufky
> > kernellabs.com
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-media" in
> > the body of a message to majord...@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: af9015: tuner id:179 not supported, please report!

2009-12-20 Thread Bert Massop
Hi all,

Using some usb replay tools used for making the pvrusb2 work, I am
able to receive a working MPEG-TS stream, after snooping communication
in Windows. It's an ugly way to make things work, but now I'm able to
watch television in VLC. It's limited to 758MHz @ 8000KHz, thought,
because I only ran an usbsnoop for that specific frequency.

So right now I'm able to write the TS stream into a pipe / stdout /
file, but creating a (fixed frequency) driver for v4l is way too
complicated for me, at the moment. I don't really understand how the
v4l dvb drivers work, probably because I'm not really experienced in
doing so ;-) Currently, I'm trying to understand how frequency
selection works with this chip, and I'll be making a standalone
application to save the TS stream. Then, maybe someone else can write
a proper v4l driver for this chip.

Regards,
Bert

On Sat, Dec 5, 2009 at 10:45, Jan Sundman  wrote:
> Hi,
>
> Thanks for the info, I will have a look and see if it is worth the
> trouble.
>
> Br,
>
> // Jan
>
> On Fri, 2009-12-04 at 13:03 -0500, Michael Krufky wrote:
>> On Thu, Dec 3, 2009 at 5:03 PM, Devin Heitmueller
>>  wrote:
>> > On Thu, Dec 3, 2009 at 4:47 PM, Bert Massop  wrote:
>> >> Hi Jan,
>> >>
>> >> The datasheet for the TDA18218 can be obtained from NXP:
>> >> http://www.nxp.com/documents/data_sheet/TDA18218HN.pdf
>> >>
>> >> That's all the information I have at the moment, maybe Mike has some
>> >> other information (like the Application Note mentioned in the
>> >> datasheet, that claims to contain information on writing drivers, but
>> >> cannot be found anywhere).
>> >>
>> >> Best regards,
>> >>
>> >> Bert
>> >
>> > Took a quick look at that datasheet.  I would guess between that
>> > datasheet and a usbsnoop, there is probably enough there to write a
>> > driver that basically works for your particular hardware if you know
>> > what you are doing.  The register map is abbreviated, but probably
>> > good enough...
>> >
>> > Devin
>>
>> The datasheet is missing too much important information needed to
>> write a fully featured driver for the part, and I wouldn't recommend
>> using a usbsnoop for this type of tuner, but be my guest and prove me
>> wrong.
>>
>> You might be able to get it working, but you'll end up with tons of
>> binary blobs hardcoded for each frequency, unless you use a
>> programming guide.  Unfortunately, I don't have one that I can share
>> :-/
>>
>> I think you would be much better off purchasing supported hardware, instead.
>>
>> Good luck, though...
>>
>> -Mike
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fwd: af901x: NXP TDA18218

2010-02-24 Thread Bert Massop
This is a forward of the original email from Nikola Pajkovsky. Just
for the records, so it is on the list.

This solves the problem of the tuner id:179 not supported error, when
loading the AF9015 driver.

Thank you, Nikola!

Regards,
Bert Massop

-- Forwarded message --
From: Nikola Pajkovsky 
Date: Wed, Feb 24, 2010 at 11:54
Subject: Re: af901x: NXP TDA18218
To: Antti Palosaari 
Cc: jan.sund...@aland.net, bert.mas...@gmail.com,
mkru...@kernellabs.com, dheitmuel...@kernellabs.com


Hello,

   here is my solution, I can watch Vancouver right now :). I don't
look at the patch if there is some mistake(no time watch Vancouver),
but I will when I will have some free time.
Attached patch apply against this souce (hg clone
http://linuxtv.org/hg/~anttip/af9015/).

Firmware:
wget http://jusst.de/manu/fw/AFA/dvb-usb-af9015.fw_a-link
sudo mv dvb-usb-af9015.fw_a-link /lib/firmware/dvb-usb-af9015.fw

Have a nice day ;)

On 23.2.2010 14:02, Antti Palosaari wrote:
>
> Hello,
> I just got info from one user about this driver, looks like Terratec have 
> driver.
> http://forum.ubuntuusers.de/topic/probleme-beim-installieren-terratec-cinergy-t/3/?highlight=terratec+cinergy+t+stick
>
> Antti
>
> Nikola Pajkovsky wrote:
>>
>> Hello,
>>
>>    is any chance that will be support for TDA182118?
>>
>> Regards,
>>
>


--
Nikola
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Kconfig
--- a/linux/drivers/media/common/tuners/Kconfig	Thu Feb 11 02:33:12 2010 +0200
+++ b/linux/drivers/media/common/tuners/Kconfig	Wed Feb 24 11:47:14 2010 +0100
@@ -179,4 +179,11 @@
 	help
 	  A driver for the silicon tuner MAX2165 from Maxim.
 
+config MEDIA_TUNER_TDA18218
+	tristate "NXP TDA18218 silicon tuner"
+	depends on VIDEO_MEDIA && I2C
+	default m if MEDIA_TUNER_CUSTOMISE
+	help
+	  A driver for the silicon tuner TDA18218 from NXP.
+
 endif # MEDIA_TUNER_CUSTOMISE
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Makefile
--- a/linux/drivers/media/common/tuners/Makefile	Thu Feb 11 02:33:12 2010 +0200
+++ b/linux/drivers/media/common/tuners/Makefile	Wed Feb 24 11:47:14 2010 +0100
@@ -24,6 +24,7 @@
 obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o
 obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o
 obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o
+obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o
 
 EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
 EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
diff -r 0f41fd7df85d linux/drivers/media/dvb/dvb-usb/af9015.c
--- a/linux/drivers/media/dvb/dvb-usb/af9015.c	Thu Feb 11 02:33:12 2010 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/af9015.c	Wed Feb 24 11:47:14 2010 +0100
@@ -20,11 +20,7 @@
  *Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
 
-#include 
-
-#endif
 #include "af9015.h"
 #include "af9013.h"
 #include "mt2060.h"
@@ -32,6 +28,7 @@
 #include "tda18271.h"
 #include "mxl5005s.h"
 #include "mc44s803.h"
+#include "tda18218.h"
 
 static int dvb_usb_af9015_debug;
 module_param_named(debug, dvb_usb_af9015_debug, int, 0644);
@@ -273,7 +270,8 @@
 
 	while (i < num) {
 		if (msg[i].addr == af9015_af9013_config[0].demod_address ||
-		msg[i].addr == af9015_af9013_config[1].demod_address) {
+		msg[i].addr == af9015_af9013_config[1].demod_address  ||
+		msg[i].addr == 0x3a) {
 			addr = msg[i].buf[0] << 8;
 			addr += msg[i].buf[1];
 			mbox = msg[i].buf[2];
@@ -286,7 +284,8 @@
 
 		if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) {
 			if (msg[i].addr ==
-af9015_af9013_config[0].demod_address)
+af9015_af9013_config[0].demod_address ||
+			msg[i].addr == 0x3a)
 req.cmd = READ_MEMORY;
 			else
 req.cmd = READ_I2C;
@@ -301,7 +300,8 @@
 		} else if (msg[i].flags & I2C_M_RD) {
 			ret = -EINVAL;
 			if (msg[i].addr ==
-af9015_af9013_config[0].demod_address)
+af9015_af9013_config[0].demod_address ||
+			msg[i].addr == 0x3a)
 goto error;
 			else
 req.cmd = READ_I2C;
@@ -315,7 +315,8 @@
 			i += 1;
 		} else {
 			if (msg[i].addr ==
-af9015_af9013_config[0].demod_address)
+af9015_af9013_config[0].demod_address ||
+			msg[i].addr == 0x3a)
 req.cmd = WRITE_MEMORY;
 			else
 req.cmd = WRITE_I2C;
@@ -560,24 +561,11 @@
 	return ret;
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
+/* dump eeprom */
 static int af9015_eeprom_dump(struct dvb_usb_device *d)
-#else
-/* hash (and dump) eeprom */
-static int af9015_eeprom_hash(struct usb_device *udev)
-#endif
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
 	u8 reg, val;
-#else
-	static const unsigned int eeprom_size = 256;
-	unsigned int reg;
-	int ret;
-	u8 val, *eeprom;
-	struct req_t req = {READ_I2C, AF9015_I2C_EEPROM, 0, 0, 1, 1, &val};
-#endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6

Re: af9015: tuner id:179 not supported, please report!

2010-02-24 Thread Bert Massop
This is a forward of the original email from Nikola Pajkovsky. Just
for the records, so it is on the list.

This solves the problem of the tuner id:179 not supported error, when
loading the AF9015 driver.

Thank you, Nikola!

Regards,
Bert Massop

-- Forwarded message --
From: Nikola Pajkovsky 
Date: Wed, Feb 24, 2010 at 11:54
Subject: Re: af901x: NXP TDA18218
To: Antti Palosaari 
Cc: jan.sund...@aland.net, bert.mas...@gmail.com,
mkru...@kernellabs.com, dheitmuel...@kernellabs.com


Hello,

   here is my solution, I can watch Vancouver right now :). I don't
look at the patch if there is some mistake(no time watch Vancouver),
but I will when I will have some free time.
Attached patch apply against this souce (hg clone
http://linuxtv.org/hg/~anttip/af9015/).

Firmware:
wget http://jusst.de/manu/fw/AFA/dvb-usb-af9015.fw_a-link
sudo mv dvb-usb-af9015.fw_a-link /lib/firmware/dvb-usb-af9015.fw

Have a nice day ;)

On 23.2.2010 14:02, Antti Palosaari wrote:
>
> Hello,
> I just got info from one user about this driver, looks like Terratec have 
> driver.
> http://forum.ubuntuusers.de/topic/probleme-beim-installieren-terratec-cinergy-t/3/?highlight=terratec+cinergy+t+stick
>
> Antti
>
> Nikola Pajkovsky wrote:
>>
>> Hello,
>>
>>    is any chance that will be support for TDA182118?
>>
>> Regards,
>>
>


--
Nikola
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Kconfig
--- a/linux/drivers/media/common/tuners/Kconfig	Thu Feb 11 02:33:12 2010 +0200
+++ b/linux/drivers/media/common/tuners/Kconfig	Wed Feb 24 11:47:14 2010 +0100
@@ -179,4 +179,11 @@
 	help
 	  A driver for the silicon tuner MAX2165 from Maxim.
 
+config MEDIA_TUNER_TDA18218
+	tristate "NXP TDA18218 silicon tuner"
+	depends on VIDEO_MEDIA && I2C
+	default m if MEDIA_TUNER_CUSTOMISE
+	help
+	  A driver for the silicon tuner TDA18218 from NXP.
+
 endif # MEDIA_TUNER_CUSTOMISE
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Makefile
--- a/linux/drivers/media/common/tuners/Makefile	Thu Feb 11 02:33:12 2010 +0200
+++ b/linux/drivers/media/common/tuners/Makefile	Wed Feb 24 11:47:14 2010 +0100
@@ -24,6 +24,7 @@
 obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o
 obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o
 obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o
+obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o
 
 EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
 EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
diff -r 0f41fd7df85d linux/drivers/media/dvb/dvb-usb/af9015.c
--- a/linux/drivers/media/dvb/dvb-usb/af9015.c	Thu Feb 11 02:33:12 2010 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/af9015.c	Wed Feb 24 11:47:14 2010 +0100
@@ -20,11 +20,7 @@
  *Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
 
-#include 
-
-#endif
 #include "af9015.h"
 #include "af9013.h"
 #include "mt2060.h"
@@ -32,6 +28,7 @@
 #include "tda18271.h"
 #include "mxl5005s.h"
 #include "mc44s803.h"
+#include "tda18218.h"
 
 static int dvb_usb_af9015_debug;
 module_param_named(debug, dvb_usb_af9015_debug, int, 0644);
@@ -273,7 +270,8 @@
 
 	while (i < num) {
 		if (msg[i].addr == af9015_af9013_config[0].demod_address ||
-		msg[i].addr == af9015_af9013_config[1].demod_address) {
+		msg[i].addr == af9015_af9013_config[1].demod_address  ||
+		msg[i].addr == 0x3a) {
 			addr = msg[i].buf[0] << 8;
 			addr += msg[i].buf[1];
 			mbox = msg[i].buf[2];
@@ -286,7 +284,8 @@
 
 		if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) {
 			if (msg[i].addr ==
-af9015_af9013_config[0].demod_address)
+af9015_af9013_config[0].demod_address ||
+			msg[i].addr == 0x3a)
 req.cmd = READ_MEMORY;
 			else
 req.cmd = READ_I2C;
@@ -301,7 +300,8 @@
 		} else if (msg[i].flags & I2C_M_RD) {
 			ret = -EINVAL;
 			if (msg[i].addr ==
-af9015_af9013_config[0].demod_address)
+af9015_af9013_config[0].demod_address ||
+			msg[i].addr == 0x3a)
 goto error;
 			else
 req.cmd = READ_I2C;
@@ -315,7 +315,8 @@
 			i += 1;
 		} else {
 			if (msg[i].addr ==
-af9015_af9013_config[0].demod_address)
+af9015_af9013_config[0].demod_address ||
+			msg[i].addr == 0x3a)
 req.cmd = WRITE_MEMORY;
 			else
 req.cmd = WRITE_I2C;
@@ -560,24 +561,11 @@
 	return ret;
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
+/* dump eeprom */
 static int af9015_eeprom_dump(struct dvb_usb_device *d)
-#else
-/* hash (and dump) eeprom */
-static int af9015_eeprom_hash(struct usb_device *udev)
-#endif
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
 	u8 reg, val;
-#else
-	static const unsigned int eeprom_size = 256;
-	unsigned int reg;
-	int ret;
-	u8 val, *eeprom;
-	struct req_t req = {READ_I2C, AF9015_I2C_EEPROM, 0, 0, 1, 1, &val};
-#endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6

Re: af9015: tuner id:179 not supported, please report!

2010-02-26 Thread Bert Massop
Using the previous patch, the compiler will complain about a missing
file (tda18218.h). Please use this updated version of the patch, also
made by Nikola.

Have fun with it, it's working fine here!

Regards, Bert

On Wed, Feb 24, 2010 at 22:42, Bert Massop  wrote:
>
> This is a forward of the original email from Nikola Pajkovsky. Just
> for the records, so it is on the list.
>
> This solves the problem of the tuner id:179 not supported error, when
> loading the AF9015 driver.
>
> Thank you, Nikola!
>
> Regards,
> Bert Massop
>
> -- Forwarded message --
> From: Nikola Pajkovsky 
> Date: Wed, Feb 24, 2010 at 11:54
> Subject: Re: af901x: NXP TDA18218
> To: Antti Palosaari 
> Cc: jan.sund...@aland.net, bert.mas...@gmail.com,
> mkru...@kernellabs.com, dheitmuel...@kernellabs.com
>
>
> Hello,
>
>    here is my solution, I can watch Vancouver right now :). I don't
> look at the patch if there is some mistake(no time watch Vancouver),
> but I will when I will have some free time.
> Attached patch apply against this souce (hg clone
> http://linuxtv.org/hg/~anttip/af9015/).
>
> Firmware:
> wget http://jusst.de/manu/fw/AFA/dvb-usb-af9015.fw_a-link
> sudo mv dvb-usb-af9015.fw_a-link /lib/firmware/dvb-usb-af9015.fw
>
> Have a nice day ;)
>
> On 23.2.2010 14:02, Antti Palosaari wrote:
> >
> > Hello,
> > I just got info from one user about this driver, looks like Terratec have 
> > driver.
> > http://forum.ubuntuusers.de/topic/probleme-beim-installieren-terratec-cinergy-t/3/?highlight=terratec+cinergy+t+stick
> >
> > Antti
> >
> > Nikola Pajkovsky wrote:
> >>
> >> Hello,
> >>
> >>    is any chance that will be support for TDA182118?
> >>
> >> Regards,
> >>
> >
>
>
> --
> Nikola
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Kconfig
--- a/linux/drivers/media/common/tuners/Kconfig	Thu Feb 11 02:33:12 2010 +0200
+++ b/linux/drivers/media/common/tuners/Kconfig	Thu Feb 25 17:21:11 2010 +0100
@@ -179,4 +179,11 @@
 	help
 	  A driver for the silicon tuner MAX2165 from Maxim.
 
+config MEDIA_TUNER_TDA18218
+	tristate "NXP TDA18218 silicon tuner"
+	depends on VIDEO_MEDIA && I2C
+	default m if MEDIA_TUNER_CUSTOMISE
+	help
+	  A driver for the silicon tuner TDA18218 from NXP.
+
 endif # MEDIA_TUNER_CUSTOMISE
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Makefile
--- a/linux/drivers/media/common/tuners/Makefile	Thu Feb 11 02:33:12 2010 +0200
+++ b/linux/drivers/media/common/tuners/Makefile	Thu Feb 25 17:21:11 2010 +0100
@@ -24,6 +24,7 @@
 obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o
 obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o
 obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o
+obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o
 
 EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
 EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/tda18218.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +
+++ b/linux/drivers/media/common/tuners/tda18218.c	Thu Feb 25 17:21:11 2010 +0100
@@ -0,0 +1,471 @@
+/*
+ *  Driver for NXP TDA18218 silicon tuner
+ *
+ *  Copyright (C) 2010 Lauris Ding 
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include "tda18218.h"
+#include "compat.h"
+#include "tda18218_priv.h"
+
+static int tda18218_write_reg(struct dvb_frontend *fe, u8 reg, u8 val)
+{
+	struct tda18218_priv *priv = fe->tuner_priv;
+	u8 buf[2] = { reg, val };
+	struct i2c_msg msg = { .addr = priv->cfg->i2c_address, .flags = 0,
+			   .buf = buf, .len = 2 };
+	int ret;
+
+	if (fe->ops.i2c_gate_ctrl)
+		fe->ops.i2c_gate_ctrl(fe, 1);
+	/* write register */
+	ret = i2c_transfer(priv->i2c, &msg, 1);
+	if (fe->ops.i2c_gate_ctrl)
+		fe->ops.i2c_gate_ctrl(fe, 0);
+
+	if (ret != 1)
+		printk(KERN_WARNING "I2C write failed ret: %d reg: %02x\n", ret, reg);
+
+	return (ret == 1 ? 0 : ret);
+}
+
+static int tda18218_write_regs(struct dvb_frontend *fe, u8 reg,
+	u8 *val, u8 len)
+{
+	struct tda18218_priv *priv = fe->tuner_priv;
+	u8 buf[1+len];
+	struct i2c_msg msg = {
+		.ad

Re: af901x: NXP TDA18218

2010-02-26 Thread Bert Massop
Using the previous patch, the compiler will complain about a missing
file (tda18218.h). Please use this updated version of the patch, also
made by Nikola.

Have fun with it, it's working fine here!

Regards, Bert

On Wed, Feb 24, 2010 at 22:41, Bert Massop  wrote:
> This is a forward of the original email from Nikola Pajkovsky. Just
> for the records, so it is on the list.
>
> This solves the problem of the tuner id:179 not supported error, when
> loading the AF9015 driver.
>
> Thank you, Nikola!
>
> Regards,
> Bert Massop
>
> -- Forwarded message --
> From: Nikola Pajkovsky 
> Date: Wed, Feb 24, 2010 at 11:54
> Subject: Re: af901x: NXP TDA18218
> To: Antti Palosaari 
> Cc: jan.sund...@aland.net, bert.mas...@gmail.com,
> mkru...@kernellabs.com, dheitmuel...@kernellabs.com
>
>
> Hello,
>
>    here is my solution, I can watch Vancouver right now :). I don't
> look at the patch if there is some mistake(no time watch Vancouver),
> but I will when I will have some free time.
> Attached patch apply against this souce (hg clone
> http://linuxtv.org/hg/~anttip/af9015/).
>
> Firmware:
> wget http://jusst.de/manu/fw/AFA/dvb-usb-af9015.fw_a-link
> sudo mv dvb-usb-af9015.fw_a-link /lib/firmware/dvb-usb-af9015.fw
>
> Have a nice day ;)
>
> On 23.2.2010 14:02, Antti Palosaari wrote:
>>
>> Hello,
>> I just got info from one user about this driver, looks like Terratec have 
>> driver.
>> http://forum.ubuntuusers.de/topic/probleme-beim-installieren-terratec-cinergy-t/3/?highlight=terratec+cinergy+t+stick
>>
>> Antti
>>
>> Nikola Pajkovsky wrote:
>>>
>>> Hello,
>>>
>>>    is any chance that will be support for TDA182118?
>>>
>>> Regards,
>>>
>>
>
>
> --
> Nikola
>
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Kconfig
--- a/linux/drivers/media/common/tuners/Kconfig	Thu Feb 11 02:33:12 2010 +0200
+++ b/linux/drivers/media/common/tuners/Kconfig	Thu Feb 25 17:21:11 2010 +0100
@@ -179,4 +179,11 @@
 	help
 	  A driver for the silicon tuner MAX2165 from Maxim.
 
+config MEDIA_TUNER_TDA18218
+	tristate "NXP TDA18218 silicon tuner"
+	depends on VIDEO_MEDIA && I2C
+	default m if MEDIA_TUNER_CUSTOMISE
+	help
+	  A driver for the silicon tuner TDA18218 from NXP.
+
 endif # MEDIA_TUNER_CUSTOMISE
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/Makefile
--- a/linux/drivers/media/common/tuners/Makefile	Thu Feb 11 02:33:12 2010 +0200
+++ b/linux/drivers/media/common/tuners/Makefile	Thu Feb 25 17:21:11 2010 +0100
@@ -24,6 +24,7 @@
 obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o
 obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o
 obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o
+obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o
 
 EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
 EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
diff -r 0f41fd7df85d linux/drivers/media/common/tuners/tda18218.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +
+++ b/linux/drivers/media/common/tuners/tda18218.c	Thu Feb 25 17:21:11 2010 +0100
@@ -0,0 +1,471 @@
+/*
+ *  Driver for NXP TDA18218 silicon tuner
+ *
+ *  Copyright (C) 2010 Lauris Ding 
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include "tda18218.h"
+#include "compat.h"
+#include "tda18218_priv.h"
+
+static int tda18218_write_reg(struct dvb_frontend *fe, u8 reg, u8 val)
+{
+	struct tda18218_priv *priv = fe->tuner_priv;
+	u8 buf[2] = { reg, val };
+	struct i2c_msg msg = { .addr = priv->cfg->i2c_address, .flags = 0,
+			   .buf = buf, .len = 2 };
+	int ret;
+
+	if (fe->ops.i2c_gate_ctrl)
+		fe->ops.i2c_gate_ctrl(fe, 1);
+	/* write register */
+	ret = i2c_transfer(priv->i2c, &msg, 1);
+	if (fe->ops.i2c_gate_ctrl)
+		fe->ops.i2c_gate_ctrl(fe, 0);
+
+	if (ret != 1)
+		printk(KERN_WARNING "I2C write failed ret: %d reg: %02x\n", ret, reg);
+
+	return (ret == 1 ? 0 : ret);
+}
+
+static int tda18218_write_regs(struct dvb_frontend *fe, u8 reg,
+	u8 *val, u8 len)
+{
+	struct tda18218_priv *priv = fe->tuner_priv;
+	u8 buf[1+len];
+	struct i2c_msg msg = {
+		.addr = priv->cfg->i2

Re: [PATCH 3/3] [media] tuner, xc2028: add support for get_afc()

2012-07-05 Thread Bert Massop
On Thu, Jul 5, 2012 at 5:05 PM, Antti Palosaari  wrote:
>
> On 07/05/2012 05:16 PM, Mauro Carvalho Chehab wrote:
>>
>> Implement API support to return AFC frequency shift, as this device
>> supports it. The only other driver that implements it is tda9887,
>> and the frequency there is reported in Hz. So, use Hz also for this
>> tuner.
>
>
> What is AFC and why it is needed?
>

AFC is short for Automatic Frequency Control, by which a tuner
automatically fine-tunes the frequency for the best reception,
compensating for small offsets and oscillator frequency drift.
This is however done automatically on the tuner, so its configuration
is read-only. Aside from being a "nice to know" statistic, getting
hold of the AFC frequency shift does as far as I know not have any
practical uses related to properly operating the tuner.

Regards,
Bert
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html