changeset 69:272a8fba970b

added very rough support for PT2.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 26 Oct 2009 19:46:49 +0900
parents 440c13a0030b
children babd84ff70ff
files driver/pt1_pci.c driver/pt1_tuner.c driver/pt1_tuner.h driver/pt1_tuner_data.c driver/pt1_tuner_data.h
diffstat 5 files changed, 67 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/driver/pt1_pci.c	Sat Oct 24 20:40:11 2009 +0900
+++ b/driver/pt1_pci.c	Mon Oct 26 19:46:49 2009 +0900
@@ -710,7 +710,7 @@
 
 	// Tuner 初期化処理
 	for(lp = 0 ; lp < MAX_TUNER ; lp++){
-		rc = tuner_init(dev_conf->regs, &dev_conf->lock, lp);
+		rc = tuner_init(dev_conf->regs, dev_conf->cardtype, &dev_conf->lock, lp);
 		if(rc < 0){
 			printk(KERN_ERR "Error tuner_init\n");
 			goto out_err_fpga;
--- a/driver/pt1_tuner.c	Sat Oct 24 20:40:11 2009 +0900
+++ b/driver/pt1_tuner.c	Mon Oct 26 19:46:49 2009 +0900
@@ -72,16 +72,27 @@
 	else if(cardtype == PT2) {
 		switch(tuner){
 		case TUNER_POWER_ON_RESET_ENABLE:
-			val |= (1 << BIT_TUNER) | (1 << BIT_FRONTEND);
+			val |= (1 << BIT_TUNER)
+				| (1 << BIT_33A1)
+				| (1 << BIT_33A2)
+				| (1 << BIT_5A_)
+				| (1 << BIT_5A1)
+				| (1 << BIT_5A2);
 			break;
 		case TUNER_POWER_ON_RESET_DISABLE:
-			val |= (1 << BIT_TUNER) | (1 << BIT_FRONTEND) | (1 << BIT_RESET);
+			val |= (1 << BIT_TUNER)
+				| (1 << BIT_RESET)
+				| (1 << BIT_33A1)
+				| (1 << BIT_33A2)
+				| (1 << BIT_5A_)
+				| (1 << BIT_5A1)
+				| (1 << BIT_5A2);
 			break ;
 		}
 	}
 	writel(val, (regs + CFG_REGS_ADDR));
 }
-static	int		init_isdb_s(void __iomem *regs, struct mutex *lock, __u32 addr)
+static	int		init_isdb_s(void __iomem *regs, int cardtype, struct mutex *lock, __u32 addr)
 {
 
 	WBLOCK	wk;
@@ -100,28 +111,34 @@
 		return -EIO ;
 	}
 	for(lp = 0 ; lp < MAX_ISDB_S_INIT ; lp++){
-		memcpy(&wk, isdb_s_initial[lp], sizeof(WBLOCK));
+		if(cardtype == PT1)
+			memcpy(&wk, isdb_s_initial_pt1[lp], sizeof(WBLOCK));
+		if(cardtype == PT2)
+			memcpy(&wk, isdb_s_initial_pt2[lp], sizeof(WBLOCK));
 		wk.addr = addr;
 		i2c_write(regs, lock, &wk);
 	}
 
 	return 0 ;
 }
-static	void	init_isdb_t(void __iomem *regs, struct mutex *lock, __u32 addr)
+static	void	init_isdb_t(void __iomem *regs, int cardtype, struct mutex *lock, __u32 addr)
 {
 	int		lp ;
 	WBLOCK	wk;
 
 	// ISDB-S/T初期化
 	for(lp = 0 ; lp < MAX_ISDB_T_INIT ; lp++){
-		memcpy(&wk, isdb_t_initial[lp], sizeof(WBLOCK));
+		if(cardtype == PT1)
+			memcpy(&wk, isdb_t_initial_pt1[lp], sizeof(WBLOCK));
+		if(cardtype == PT2)
+			memcpy(&wk, isdb_t_initial_pt2[lp], sizeof(WBLOCK));
 		wk.addr = addr;
 		i2c_write(regs, lock, &wk);
 	}
 
 
 }
-int		tuner_init(void __iomem *regs, struct mutex *lock, int tuner_no)
+int		tuner_init(void __iomem *regs, int cardtype, struct mutex *lock, int tuner_no)
 {
 
 	int		rc ;
@@ -136,11 +153,11 @@
 	wk.addr = tuner_info[tuner_no].isdb_s ;
 	i2c_write(regs, lock, &wk);
 
-	rc = init_isdb_s(regs, lock, tuner_info[tuner_no].isdb_s);
+	rc = init_isdb_s(regs, cardtype, lock, tuner_info[tuner_no].isdb_s);
 	if(rc < 0){
 		return rc ;
 	}
-	init_isdb_t(regs, lock, tuner_info[tuner_no].isdb_t);
+	init_isdb_t(regs, cardtype, lock, tuner_info[tuner_no].isdb_t);
 
 	memcpy(&wk, &isdb_s_init21, sizeof(WBLOCK));
 	wk.addr = tuner_info[tuner_no].isdb_s ;
--- a/driver/pt1_tuner.h	Sat Oct 24 20:40:11 2009 +0900
+++ b/driver/pt1_tuner.h	Mon Oct 26 19:46:49 2009 +0900
@@ -15,7 +15,11 @@
 	BIT_LNB_UP,
 	BIT_LNB_DOWN,
 	BIT_RESET,
-	BIT_FRONTEND
+	BIT_33A1,
+	BIT_33A2,
+	BIT_5A_,
+	BIT_5A1,
+	BIT_5A2
 };
 
 // LNBパワー設定
@@ -106,7 +110,7 @@
 /* チューナ状態定義                                                        */
 /***************************************************************************/
 extern	void	settuner_reset(void __iomem *, int, __u32, __u32);
-extern	int		tuner_init(void __iomem *, struct mutex *, int);
+extern	int		tuner_init(void __iomem *, int, struct mutex *, int);
 extern	void	set_sleepmode(void __iomem *, struct mutex *, int, int, int);
 
 extern	int		bs_tune(void __iomem *, struct mutex *, int, int, ISDB_S_TMCC *);
--- a/driver/pt1_tuner_data.c	Sat Oct 24 20:40:11 2009 +0900
+++ b/driver/pt1_tuner_data.c	Mon Oct 26 19:46:49 2009 +0900
@@ -90,7 +90,7 @@
 WBLOCK	isdb_s_init3 ={
 	0,
 	2,
-	{0x0D, 0x55}
+	{0x0D, 0x55} //pt1 only
 };
 // ISDB-S初期化値4
 WBLOCK	isdb_s_init4 ={
@@ -180,7 +180,8 @@
 WBLOCK	isdb_s_init18 ={
 	0,
 	2,
-	{0x8E, 0x02}
+//	{0x8E, 0x02}
+	{0x8E, 0x26}
 };
 // ISDB-S初期化値19
 WBLOCK	isdb_s_init19 ={
@@ -195,7 +196,7 @@
 	{0xA5, 0xC0}
 };
 // ISDB-S初期化値21
-WBLOCK	isdb_s_init21 ={
+WBLOCK isdb_s_init21 ={
 	0,
 	4,
 	{0xFE, 0xC0, 0xF0, 0x04}
@@ -213,7 +214,7 @@
 WBLOCK	isdb_t_init2 ={
 	0,
 	2,
-	{0x14, 0x8F}
+	{0x14, 0x8F} //pt1 only
 };
 // ISDB-T初期化値3
 WBLOCK	isdb_t_init3 ={
@@ -243,19 +244,19 @@
 WBLOCK	isdb_t_init7 ={
 	0,
 	2,
-	{0x31, 0x0D}
+	{0x31, 0x0D} //pt1
 };
 // ISDB-T初期化値8
 WBLOCK	isdb_t_init8 ={
 	0,
 	2,
-	{0x32, 0xE0}
+	{0x32, 0xE0} //pt1
 };
 // ISDB-T初期化値9
 WBLOCK	isdb_t_init9 ={
 	0,
 	2,
-	{0x39, 0xD3}
+	{0x39, 0xD3} //pt1
 };
 // ISDB-T初期化値10
 WBLOCK	isdb_t_init10 ={
@@ -279,13 +280,15 @@
 WBLOCK	isdb_t_init13 ={
 	0,
 	2,
-	{0x75, 0x02}
+//	{0x75, 0x02}
+	{0x75, 0x0a}
 };
 // ISDB-T初期化値14
 WBLOCK	isdb_t_init14 ={
 	0,
 	2,
-	{0x76, 0x4E}
+//	{0x76, 0x4E}
+	{0x76, 0x4c}
 };
 // ISDB-T初期化値15
 WBLOCK	isdb_t_init15 ={
@@ -300,16 +303,15 @@
 	{0xEF, 0x01}
 };
 // ISDB-T初期化値17
-WBLOCK	isdb_t_init17 ={
+WBLOCK isdb_t_init17 ={
 	0,
 	7,
 	{0xFE, 0xC2, 0x01, 0x8F, 0xC1, 0x80, 0x80}
 };
-
 /***************************************************************************/
 /* 初期化データブロック定義(ISDB-S)                                        */
 /***************************************************************************/
-WBLOCK	*isdb_s_initial[MAX_ISDB_S_INIT] =
+WBLOCK	*isdb_s_initial_pt1[MAX_ISDB_S_INIT] =
 {
 	&isdb_s_init2, &isdb_s_init3, &isdb_s_init4, &isdb_s_init5,
 	&isdb_s_init6, &isdb_s_init7, &isdb_s_init8, &isdb_s_init9,
@@ -317,16 +319,31 @@
 	&isdb_s_init14, &isdb_s_init15, &isdb_s_init16, &isdb_s_init17,
 	&isdb_s_init18, &isdb_s_init19, &isdb_s_init20
 };
+WBLOCK	*isdb_s_initial_pt2[MAX_ISDB_S_INIT] =
+{
+	&isdb_s_init2, &isdb_s_init4, &isdb_s_init5,
+	&isdb_s_init6, &isdb_s_init7, &isdb_s_init8, &isdb_s_init9,
+	&isdb_s_init10, &isdb_s_init11, &isdb_s_init12, &isdb_s_init13,
+	&isdb_s_init14, &isdb_s_init15, &isdb_s_init16, &isdb_s_init17,
+	&isdb_s_init18, &isdb_s_init19, &isdb_s_init20
+};
 /***************************************************************************/
 /* 初期化データブロック定義(ISDB-T)                                        */
 /***************************************************************************/
-WBLOCK	*isdb_t_initial[MAX_ISDB_T_INIT] =
+WBLOCK	*isdb_t_initial_pt1[MAX_ISDB_T_INIT] =
 {
 	&isdb_t_init1, &isdb_t_init2, &isdb_t_init3, &isdb_t_init4,
 	&isdb_t_init5, &isdb_t_init6, &isdb_t_init7, &isdb_t_init8,
 	&isdb_t_init9, &isdb_t_init10, &isdb_t_init11, &isdb_t_init12,
 	&isdb_t_init13, &isdb_t_init14, &isdb_t_init15, &isdb_t_init16
 };
+WBLOCK	*isdb_t_initial_pt2[MAX_ISDB_T_INIT] =
+{
+	&isdb_t_init1, &isdb_t_init3, &isdb_t_init4,
+	&isdb_t_init5, &isdb_t_init6,
+	&isdb_t_init10, &isdb_t_init11, &isdb_t_init12,
+	&isdb_t_init13, &isdb_t_init14, &isdb_t_init15, &isdb_t_init16
+};
 /***************************************************************************/
 /* 地上デジタル用データ                                                    */
 /***************************************************************************/
--- a/driver/pt1_tuner_data.h	Sat Oct 24 20:40:11 2009 +0900
+++ b/driver/pt1_tuner_data.h	Mon Oct 26 19:46:49 2009 +0900
@@ -27,8 +27,10 @@
 extern	WBLOCK	isdb_s_init21;		//ISDB-S最終
 extern	WBLOCK	isdb_t_init17;		//ISDB-T最終
 extern	WBLOCK	bs_pll_lock;		//ISDB-S PLLロック確認
-extern	WBLOCK	*isdb_s_initial[MAX_ISDB_S_INIT];
-extern	WBLOCK	*isdb_t_initial[MAX_ISDB_T_INIT];
+extern	WBLOCK	*isdb_s_initial_pt1[MAX_ISDB_S_INIT];
+extern	WBLOCK	*isdb_s_initial_pt2[MAX_ISDB_S_INIT];
+extern	WBLOCK	*isdb_t_initial_pt1[MAX_ISDB_T_INIT];
+extern	WBLOCK	*isdb_t_initial_pt2[MAX_ISDB_T_INIT];
 /***************************************************************************/
 /* BS用データ定義                                                          */
 /***************************************************************************/