Add Freescale MC44S803 tuner driver
PATCH v4 1/1 Add Freescale MC44S803 tuner driver
---
Changes since v1:
- rebase against official linux tree. v1 was based against a local tree and didn't apply cleanly.
Changes since v2:
- fix typo KERN_ERROR -> KERN_ERR
Changes since v3:
- fix circuit adjust (reserved bits should be 1)
- don't initialize priv in mc44s803_attach()
- use a macro for printk to avoid duplicating the driver name over and over.
drivers/media/common/tuners/Kconfig | 8 + drivers/media/common/tuners/Makefile | 1 + drivers/media/common/tuners/mc44s803.c | 370 +++++++++++++++++++++++++++ drivers/media/common/tuners/mc44s803.h | 46 ++++ drivers/media/common/tuners/mc44s803_priv.h | 208 +++++++++++++++ 5 files changed, 633 insertions(+), 0 deletions(-) create mode 100644 drivers/media/common/tuners/mc44s803.c create mode 100644 drivers/media/common/tuners/mc44s803.h create mode 100644 drivers/media/common/tuners/mc44s803_priv.h
drivers/media/common/tuners/Kconfig +8 -0
@@ -29,6 +29,7 @@ config MEDIA_TUNER select MEDIA_TUNER_TEA5767 if !MEDIA_TUNER_CUSTOMIZE select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE select MEDIA_TUNER_TDA9887 if !MEDIA_TUNER_CUSTOMIZE + select MEDIA_TUNER_MC44S803 if !MEDIA_TUNER_CUSTOMIZE menuconfig MEDIA_TUNER_CUSTOMIZE bool "Customize analog and hybrid tuner modules to build"
@@ -164,4 +165,11 @@ config MEDIA_TUNER_MXL5007T help A driver for the silicon tuner MxL5007T from MaxLinear. +config MEDIA_TUNER_MC44S803 + tristate "Freescale MC44S803 Low Power CMOS Broadband tuners" + depends on VIDEO_MEDIA && I2C + default m if DVB_FE_CUSTOMISE + help + Say Y here to support the Freescale MC44S803 based tuners + endif # MEDIA_TUNER_CUSTOMIZE
drivers/media/common/tuners/Makefile +1 -0
@@ -22,6 +22,7 @@ obj-$(CONFIG_MEDIA_TUNER_QT1010) += qt1010.o obj-$(CONFIG_MEDIA_TUNER_MT2131) += mt2131.o obj-$(CONFIG_MEDIA_TUNER_MXL5005S) += mxl5005s.o obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o +obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
drivers/media/common/tuners/mc44s803.c new file +370 -0
370 lines not on this page · raw message
drivers/media/common/tuners/mc44s803.h new file +46 -0
46 lines not on this page · raw message
drivers/media/common/tuners/mc44s803_priv.h new file +208 -0
208 lines not on this page · raw message
Signature · 1 line
1.5.6.5
Hello Jochen,
I just reviewed this patch and here is my comments;
drivers/media/common/tuners/mc44s803.c line 43
Quoted 1 line · Jochen Friedrich
drivers/media/common/tuners/mc44s803.c new file +1
-0+ buf[0 ] = (val &0xFF0000 ) >>16 ;
I am not sure where it comes I have seen comments sometimes that we should use lower case hex numbers.
Quoted 1 line
(quoted diff) +1
-0+ return -EREMOTEIO;
[...]
drivers/media/common/tuners/mc44s803.c line 321
Quoted 1 line
drivers/media/common/tuners/mc44s803.c new file +1
-0+u8 ret, id;
Error status (-EREMOTEIO) is stored to the u8, which leads ~254. This seems not to be problem currently because mc44s803_readreg() is used only in mc44s803_attach() that returns NULL in error case. Anyhow, I think it would be better to use int for clarity.
regards,
Antti
Signature · 1 line
http://palosaari.fi/
Hi All,
I have to apologize being a stupid newbie not able to put Antti's latest source (mc44s803-71b0ef33303a) into my kernel (2.6.27-11-generic).
Have performed successfully a "make", but running "install" failed because of missed option settings for this operation. I am uncertain if I must set a path directory. Is'nt there a symbolic link to the right directory? "make" compiled lots of not needed stuff here, but my system needs only a firmware file:
(Copied from /var/log/messages)
Jan 17 23:22:21 detlef-laptop kernel: [ 155.512517] dvb-usb: found a 'TerraTec Cinergy T USB XE' in cold state, will try to load a firmware Jan 17 23:22:21 detlef-laptop kernel: [ 155.512530] firmware: requesting dvb-usb-af9015.fw Jan 17 23:22:21 detlef-laptop kernel: [ 155.526289] dvb_usb_af9015: probe of 4-3.3:1.0 failed with error -2
Maybe Antti can post me one which I simply can paste into /lib/firmware? Hopefully one of you can give an advice.. regards,
Detlef
Antti Palosaari schrieb: 2.6.27-11-generic
Quoted 16 lines
Hello Jochen,
I just reviewed this patch and here is my comments;Quoted 1 line · Jochen Friedrich
+ buf[0] = (val &
0xFF0000) >> 16;I am not sure where it comes I have seen comments sometimes that we should use lower case hex numbers.
Quoted 1 line
+ return
-EREMOTEIO;[...]
Quoted 1 line
+ u8 ret, id;
Error status (
-EREMOTEIO) is stored to the u8, which leads ~254. This seems not to be problem currently becausemc44s803_readreg()is used only inmc44s803_attach()that returns NULL in error case. Anyhow, I think it would be better to use int for clarity.regards,
Antti
Quoted 8 lines · Detlef Rohde
Hi All,
I have to apologize being a stupid newbie not able to put Antti's latest source (mc44s803-71b0ef33303a) into my kernel (2.6.27-11-generic). Have performed successfully a "make", but running "install" failed because of missed option settings for this operation. I am uncertain if I must set a path directory. Is'nt there a symbolic link to the right directory?
I don't understand what is happening.
What kind of error message you get?
Hmm, are you running "install" instead of "make install"?
"make" compiled lots of not needed stuff here, but my system
Quoted 10 lines
needs only a firmware file:
(Copied from/var/log/messages)Jan 17 23:22:21 detlef-laptop kernel: [ 155.512517] dvb-usb: found a 'TerraTec Cinergy T USB XE' in cold state, will try to load a firmware Jan 17 23:22:21 detlef-laptop kernel: [ 155.512530] firmware: requesting dvb-usb-af9015.fw Jan 17 23:22:21 detlef-laptop kernel: [ 155.526289] dvb_usb_af9015:probe of 4-3.3:1.0 failed with error -2
Maybe Antti can post me one which I simply can paste into
/lib/firmware?
Here is the firmware I use.
Quoted 1 line
Hopefully one of you can give an advice..
I tried. :-)
Signature · 1 line
Roberto Ragusa mail at robertoragusa.it
Good morning Roberto,
thanks for the firmware file which finally helped getting my DVB-T running! I pasted it in the /lib/firmware tree and could get a new message:
Jan 18 11:42:56 detlef-laptop kernel: [ 7677.396309] usb 4-3.3: new high speed USB device using ehci_hcd and address 6 Jan 18 11:42:56 detlef-laptop kernel: [ 7677.517469] usb 4-3.3: configuration #1 chosen from 1 choice Jan 18 11:42:56 detlef-laptop kernel: [ 7677.548306] dvb-usb: found a 'TerraTec Cinergy T USB XE' in cold state, will try to load a firmware Jan 18 11:42:56 detlef-laptop kernel: [ 7677.548318] firmware: requesting dvb-usb-af9015.fw Jan 18 11:42:56 detlef-laptop kernel: [ 7677.564421] dvb-usb: downloading firmware from file 'dvb-usb-af9015.fw' Jan 18 11:42:56 detlef-laptop kernel: [ 7677.648439] dvb-usb: found a 'TerraTec Cinergy T USB XE' in warm state. Jan 18 11:42:56 detlef-laptop kernel: [ 7677.651636] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. Jan 18 11:42:56 detlef-laptop kernel: [ 7677.653060] DVB: registering new adapter (TerraTec Cinergy T USB XE) Jan 18 11:42:57 detlef-laptop kernel: [ 7678.103047] af9013: firmware version:4.95.0 Jan 18 11:42:57 detlef-laptop kernel: [ 7678.108177] DVB: registering adapter 0 frontend 0 (Afatech AF9013 DVB-T)... Jan 18 11:42:57 detlef-laptop kernel: [ 7678.127280] mc44s803: successfully identified (ID = 14) Jan 18 11:42:57 detlef-laptop kernel: [ 7678.128910] dvb-usb: TerraTec
Cinergy T USB XE successfully initialized and connected. When compiling Antti's source I have tried "make install" in one step as root and got the message that "install" needs additional parameters. Same happened when trying first only "make" and next "install".
Anyway using Kaffeine my TV is running now! There are some configuration issues with this program but hopefully I will fix it soon. Thanks again and have a nice Sunday!
Regards
Detlef
Quoted 32 lines · Roberto Ragusa
Quoted 8 lines · Detlef Rohde
Hi All,
I have to apologize being a stupid newbie not able to put Antti's latest source (mc44s803-71b0ef33303a) into my kernel (2.6.27-11-generic). Have performed successfully a "make", but running "install" failed because of missed option settings for this operation. I am uncertain if I must set a path directory. Is'nt there a symbolic link to the right directory?I don't understand what is happening.
What kind of error message you get?Hmm, are you running "install" instead of "make install"?
"make" compiled lots of not needed stuff here, but my system
Quoted 11 lines
needs only a firmware file:
(Copied from/var/log/messages)Jan 17 23:22:21 detlef-laptop kernel: [ 155.512517] dvb-usb: found a 'TerraTec Cinergy T USB XE' in cold state, will try to load a firmware Jan 17 23:22:21 detlef-laptop kernel: [ 155.512530] firmware: requesting dvb-usb-af9015.fw Jan 17 23:22:21 detlef-laptop kernel: [ 155.526289] dvb_usb_af9015:probe of 4-3.3:1.0 failed with error -2
Maybe Antti can post me one which I simply can paste into
/lib/firmware?Here is the firmware I use.
Quoted 9 lines
Quoted 2 lines
Hopefully one of you can give an advice..
I tried. :-)
-
Hi Antti,
Quoted 4 lines
drivers/media/common/tuners/mc44s803.c line 43
Quoted 1 line
drivers/media/common/tuners/mc44s803.c new file +1
-0+ buf[0 ] = (val &0xFF0000 ) >>16 ;I am not sure where it comes I have seen comments sometimes that we should use lower case hex numbers.
OK, will fix.
Quoted 8 lines
Quoted 1 line
(quoted diff) +1
-0+ return -EREMOTEIO;[...]
drivers/media/common/tuners/mc44s803.c line 321
Quoted 1 line
drivers/media/common/tuners/mc44s803.c new file +1
-0+u8 ret, id;Error status (
-EREMOTEIO) is stored to the u8, which leads ~254. This seems not to be problem currently becausemc44s803_readreg()is used only inmc44s803_attach()that returns NULL in error case. Anyhow, I think it would be better to use int for clarity.
This is definitely a BUG. I'll also fix this. Do you want me to post an update to the tuner or an incremental patch against your repository?
Thanks,
Jochen
Quoted 2 lines · Jochen Friedrich
This is definitely a BUG. I'll also fix this. Do you want me to post an update to the tuner or an incremental patch against your repository?
Post new patch. I hope Mauro will pick up your patch and add it to the master when no more comments are given. Anyhow, I don't know what's correct procedure.
regards
Antti
Signature · 1 line
http://palosaari.fi/