Mercurial > pt1
diff driver/pt1_tuner.c @ 69:272a8fba970b
added very rough support for PT2.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Mon, 26 Oct 2009 19:46:49 +0900 |
parents | c701bbc532b4 |
children | 28f25ec7f962 |
line wrap: on
line diff
--- 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 ;