All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Jarryd Beck <jarro.2783@gmail.com>
Cc: linux-dvb@linuxtv.org, Michael Krufky <mkrufky@linuxtv.org>
Subject: Re: [linux-dvb] NXP 18211HDC1 tuner
Date: Fri, 14 Mar 2008 20:32:30 +0200	[thread overview]
Message-ID: <47DAC4BE.5090805@iki.fi> (raw)
In-Reply-To: <47DAC42D.7010306@iki.fi>

[-- Attachment #1: Type: text/plain, Size: 795 bytes --]

forgot attach patch...

Antti Palosaari wrote:
> Michael Krufky wrote:
>> 4.3 is not close enough to 3.8.  If you don't know how to set the demod
>> to 3.8, then we can do some hacks to make it work, but signal reception
>> is likely to be very poor -- better off looking in his snoop log to see
>> how the windows driver sets the demod to 3.8
> 
> OI have looked sniffs and tested linux driver and found that it is set 
> to 3800. There is 4300 kHz set in eeprom, it is ok for 8 MHz but not for 
> 6 or 7. Looks like driver needs to do some quirks when this tuner is 
> used. Anyhow, patch attached is hardcoded to use 3.8 now.
> 
> Jarryd, please test. Also some changes to stick plug done, if it does 
> not work for you can fix it as earlier.
> 
> regards
> Antti


-- 
http://palosaari.fi/

[-- Attachment #2: af9015_tda18271_test1.patch --]
[-- Type: text/x-diff, Size: 3578 bytes --]

diff -r 67b68ae8e249 linux/drivers/media/dvb/dvb-usb/af9015.c
--- a/linux/drivers/media/dvb/dvb-usb/af9015.c	Thu Mar 13 00:58:29 2008 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/af9015.c	Fri Mar 14 20:19:28 2008 +0200
@@ -18,6 +18,7 @@
 
 /* debug */
 int dvb_usb_af9015_debug = 0x3d;
+//int dvb_usb_af9015_debug = -1;
 
 module_param_named(debug, dvb_usb_af9015_debug, int, 0644);
 MODULE_PARM_DESC(
@@ -27,7 +28,10 @@ MODULE_PARM_DESC(
 
 static struct af9013_config af9015_af9013_config = {
 	.demod_address = AF9015_I2C_DEMOD,
-	.tuner_if = 36125,
+//	.tuner_if = 36125,
+//	.tuner_if = 4300,
+	.tuner_if = 3800, //7MHz
+//	.tuner_if = 3300,
 	.ts_mode = AF9013_USB,
 };
 
@@ -413,8 +417,9 @@ static int af9015_download_firmware(stru
 		err("%s: boot failed: %d", __FUNCTION__, ret);
 		goto exit;
 	}
-	msleep(20);
+	msleep(1);
 
+#if 1
 	/* boot done, ensure that firmware is running */
 	req.cmd = GET_CONFIG;
 	req.len = 1;
@@ -429,8 +434,8 @@ static int af9015_download_firmware(stru
 		err("%s: firmware did not run (%02x)", __FUNCTION__, tmp);
 		return -EIO;
 	}
-
-#if 0
+#endif
+#if 1
 	/* firmware is running, reconnect device in the usb bus */
 	req.cmd = RECONNECT_USB;
 	ret = af9015_rw_udev(udev, &req);
@@ -495,6 +500,7 @@ static int af9015_read_config(struct dvb
 	case AF9013_TUNER_TDA18271:
 		af9015_af9013_config.tuner = AF9013_TUNER_TDA18271;
 		af9015_af9013_config.rf_spec_inv = 1;
+//		af9015_af9013_config.rf_spec_inv = 0;
 		state->gpio3 = 0x3; /* connect tuner on GPIO3 */
 		break;
 	default:
@@ -738,18 +744,22 @@ static struct dvb_usb_device_properties 
 			},
 		}
 	},
-	.num_device_descs = 3,
+	.num_device_descs = 2,
 	.devices = {
 		{
 			.name = "Afatech AF9015 DVB-T USB2.0 stick",
-			.cold_ids = {&af9015_usb_table[0], NULL},
+			.cold_ids = {&af9015_usb_table[0], &af9015_usb_table[1], NULL},
 			.warm_ids = {NULL},
 		},
+#if 0
 		{
 			.name = "Afatech AF9015 DVB-T USB2.0 stick",
-			.cold_ids = {&af9015_usb_table[1], NULL},
-			.warm_ids = {NULL},
+			.cold_ids = {NULL},
+//			.cold_ids = {&af9015_usb_table[1], NULL},
+			.warm_ids = {&af9015_usb_table[1], NULL},
+//			.warm_ids = {NULL},
 		},
+#endif
 		{
 			/* Leadtek Winfast DTV Dongle Gold */
 			.name = "Afatech AF9015 DVB-T USB2.0 stick",
diff -r 67b68ae8e249 linux/drivers/media/dvb/frontends/af9013.c
--- a/linux/drivers/media/dvb/frontends/af9013.c	Thu Mar 13 00:58:29 2008 +0200
+++ b/linux/drivers/media/dvb/frontends/af9013.c	Fri Mar 14 20:19:28 2008 +0200
@@ -22,7 +22,7 @@
 #include "af9013_priv.h"
 #include "af9013.h"
 
-int debug;
+int debug = 1;
 
 struct af9013_state {
 	struct i2c_adapter *i2c;
@@ -347,6 +347,9 @@ static int af9013_set_adc_ctrl(struct af
 	buf[1] = (u8) ((adc_cw & 0x0000ff00) >> 8);
 	buf[2] = (u8) ((adc_cw & 0x00ff0000) >> 16);
 
+	deb_info("adc_cw:");
+	debug_dump(buf, sizeof(buf), deb_info);
+
 	/* program */
 	for (i = 0; i < sizeof(buf); i++) {
 		ret = af9013_write_reg(state, addr++, buf[i]);
@@ -402,9 +405,31 @@ static int af9013_set_freq_ctrl(struct a
 	for (i = 0; i < sizeof(buf); i++) {
 		ret = af9013_write_reg(state, addr++, buf[i]);
 		if (ret)
+			goto exit;
+	}
+
+	/* program to dummy ram also */
+	addr = 0x9be7;
+	for (i = 0; i < sizeof(buf); i++) {
+		ret = af9013_write_reg(state, addr++, buf[i]);
+		if (ret)
+			goto exit;
+//			break;
+	}
+
+#if 1
+	/* program other fcw FIXME */
+	addr = 0x9bea;
+	buf[0] = 0xec;
+	buf[1] = 0xa0;
+	buf[2] = 0x6e;
+	for (i = 0; i < sizeof(buf); i++) {
+		ret = af9013_write_reg(state, addr++, buf[i]);
+		if (ret)
 			break;
 	}
-
+#endif
+exit:
 	return ret;
 }
 

[-- Attachment #3: Type: text/plain, Size: 150 bytes --]

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

  reply	other threads:[~2008-03-14 18:32 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-10  1:36 [linux-dvb] NXP 18211HDC1 tuner Jarryd Beck
2008-03-10  1:46 ` Michael Krufky
     [not found]   ` <abf3e5070803092042q6f4e90d9h890efb0ea441419e@mail.gmail.com>
2008-03-10  4:28     ` Michael Krufky
2008-03-10  7:39       ` Jarryd Beck
2008-03-10  9:56         ` Antti Palosaari
2008-03-10 11:12           ` Jarryd Beck
2008-03-10 13:38         ` Michael Krufky
2008-03-10 21:15           ` Jarryd Beck
2008-03-10 21:59             ` Antti Palosaari
2008-03-11 21:05               ` Jarryd Beck
2008-03-11 23:25                 ` Michael Krufky
2008-03-12  0:08                   ` Jarryd Beck
2008-03-12  1:46                     ` Michael Krufky
2008-03-12  2:02                       ` Steven Toth
2008-03-12  3:06                       ` Jarryd Beck
2008-03-12 12:49                         ` Michael Krufky
2008-03-12 14:02                           ` Antti Palosaari
2008-03-12 15:06                             ` mkrufky
2008-03-12 20:36                               ` Jarryd Beck
2008-03-12 20:54                                 ` Michael Krufky
2008-03-12 21:07                                   ` Jarryd Beck
2008-03-12 21:09                                     ` mkrufky
2008-03-12 21:12                                       ` Jarryd Beck
2008-03-12 21:14                                         ` mkrufky
2008-03-12 21:25                                           ` Jarryd Beck
2008-03-12 21:28                                             ` mkrufky
2008-03-12 23:11                                             ` Antti Palosaari
2008-03-13  2:20                                               ` Jarryd Beck
2008-03-13 23:07                                                 ` Jarryd Beck
2008-03-14  0:13                                                   ` Antti Palosaari
2008-03-14  2:53                                                     ` Jarryd Beck
2008-03-14  3:19                                                       ` Michael Krufky
2008-03-14  3:22                                                         ` Jarryd Beck
2008-03-14  3:33                                                           ` Jarryd Beck
2008-03-14  4:28                                                             ` Michael Krufky
2008-03-14  4:40                                                             ` Antti Palosaari
2008-03-14  5:37                                                           ` Antti Palosaari
2008-03-14 12:31                                                             ` Michael Krufky
2008-03-14 18:30                                                               ` Antti Palosaari
2008-03-14 18:32                                                                 ` Antti Palosaari [this message]
2008-03-15 13:06                                                                   ` Jarryd Beck
2008-03-15 13:21                                                                     ` Jarryd Beck
2008-03-15 14:22                                                                       ` Antti Palosaari
2008-03-15 23:42                                                                         ` Jarryd Beck
2008-03-16  0:08                                                                           ` Antti Palosaari
2008-03-16  0:27                                                                             ` Jarryd Beck
2008-03-16  0:37                                                                               ` Antti Palosaari
2008-03-16  0:40                                                                                 ` Jarryd Beck
2008-03-16  0:42                                                                                   ` Michael Krufky
2008-03-16  0:47                                                                             ` Michael Krufky
2008-03-16  1:27                                                                               ` Jarryd Beck
2008-03-16  1:39                                                                                 ` Antti Palosaari
2008-03-16  2:01                                                                                   ` Jarryd Beck
2008-03-16  2:04                                                                                     ` Antti Palosaari
2008-03-16  4:29                                                                                       ` Michael Krufky
2008-03-16  2:04                                                                                 ` Michael Krufky
2008-03-16  3:25                                                                                   ` Jarryd Beck
2008-03-16  3:28                                                                                     ` Michael Krufky
2008-03-18  2:14                                                                                       ` Antti Palosaari
2008-03-20  2:01                                                                                         ` Jarryd Beck
2008-03-20  2:29                                                                                           ` Antti Palosaari
2008-03-20  2:39                                                                                             ` Jarryd Beck
2008-03-24  5:32                                                                                             ` Jarryd Beck
2008-03-24  5:35                                                                                               ` Jarryd Beck
2008-03-24 11:58                                                                                                 ` Antti Palosaari
2008-03-24 11:59                                                                                                   ` Jarryd Beck
2008-03-24 11:56                                                                                               ` Antti Palosaari
2008-03-14  4:33                                                         ` Antti Palosaari
2008-03-14  4:26                                                       ` Antti Palosaari
     [not found] <mailman.135.1205356481.830.linux-dvb@linuxtv.org>
2008-03-13  0:02 ` ras243-dvb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47DAC4BE.5090805@iki.fi \
    --to=crope@iki.fi \
    --cc=jarro.2783@gmail.com \
    --cc=linux-dvb@linuxtv.org \
    --cc=mkrufky@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.