Mercurial > pt1
comparison driver/pt1_tuner.c @ 77:517e61637f7b
a bit cleanup
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 01 Dec 2009 18:33:01 +0900 |
parents | 28f25ec7f962 |
children | 3c2123189edf |
comparison
equal
deleted
inserted
replaced
76:d1c740aa1b67 | 77:517e61637f7b |
---|---|
47 {112, 0x80E4} // 101〜112迄 | 47 {112, 0x80E4} // 101〜112迄 |
48 }; | 48 }; |
49 | 49 |
50 void settuner_reset(void __iomem *regs, int cardtype, __u32 lnb, __u32 tuner) | 50 void settuner_reset(void __iomem *regs, int cardtype, __u32 lnb, __u32 tuner) |
51 { | 51 { |
52 __u32 val = 0; | 52 __u32 val = TUNER_POWER_OFF; |
53 switch(lnb){ | 53 switch(lnb){ |
54 case LNB_11V: | 54 case LNB_11V: |
55 val = (1 << BIT_LNB_DOWN); | 55 val = (1 << BIT_LNB_DOWN); |
56 break ; | 56 break ; |
57 case LNB_15V: | 57 case LNB_15V: |
110 printk(KERN_INFO "PT1:ISDB-S Read(%x)\n", val); | 110 printk(KERN_INFO "PT1:ISDB-S Read(%x)\n", val); |
111 return -EIO ; | 111 return -EIO ; |
112 } | 112 } |
113 | 113 |
114 if(cardtype == PT1) { | 114 if(cardtype == PT1) { |
115 for(lp = 0 ; lp < MAX_ISDB_S_INIT ; lp++){ | 115 for(lp = 0 ; lp < PT1_MAX_ISDB_S_INIT ; lp++){ |
116 memcpy(&wk, isdb_s_initial_pt1[lp], sizeof(WBLOCK)); | 116 memcpy(&wk, isdb_s_initial_pt1[lp], sizeof(WBLOCK)); |
117 wk.addr = addr; | 117 wk.addr = addr; |
118 i2c_write(regs, lock, &wk); | 118 i2c_write(regs, lock, &wk); |
119 } | 119 } |
120 } | 120 } |
121 else if(cardtype == PT2) { | 121 else if(cardtype == PT2) { |
122 for(lp = 0 ; lp < MAX_ISDB_S_INIT2 ; lp++){ | 122 for(lp = 0 ; lp < PT2_MAX_ISDB_S_INIT ; lp++){ |
123 memcpy(&wk, isdb_s_initial_pt2[lp], sizeof(WBLOCK)); | 123 memcpy(&wk, isdb_s_initial_pt2[lp], sizeof(WBLOCK)); |
124 wk.addr = addr; | 124 wk.addr = addr; |
125 i2c_write(regs, lock, &wk); | 125 i2c_write(regs, lock, &wk); |
126 } | 126 } |
127 } | 127 } |
133 int lp ; | 133 int lp ; |
134 WBLOCK wk; | 134 WBLOCK wk; |
135 | 135 |
136 // ISDB-S/T初期化 | 136 // ISDB-S/T初期化 |
137 if(cardtype == PT1) { | 137 if(cardtype == PT1) { |
138 for(lp = 0 ; lp < MAX_ISDB_T_INIT ; lp++){ | 138 for(lp = 0 ; lp < PT1_MAX_ISDB_T_INIT ; lp++){ |
139 memcpy(&wk, isdb_t_initial_pt1[lp], sizeof(WBLOCK)); | 139 memcpy(&wk, isdb_t_initial_pt1[lp], sizeof(WBLOCK)); |
140 wk.addr = addr; | 140 wk.addr = addr; |
141 i2c_write(regs, lock, &wk); | 141 i2c_write(regs, lock, &wk); |
142 } | 142 } |
143 } | 143 } |
144 else if(cardtype == PT2) { | 144 else if(cardtype == PT2) { |
145 for(lp = 0 ; lp < MAX_ISDB_T_INIT2 ; lp++){ | 145 for(lp = 0 ; lp < PT2_MAX_ISDB_T_INIT ; lp++){ |
146 memcpy(&wk, isdb_t_initial_pt2[lp], sizeof(WBLOCK)); | 146 memcpy(&wk, isdb_t_initial_pt2[lp], sizeof(WBLOCK)); |
147 wk.addr = addr; | 147 wk.addr = addr; |
148 i2c_write(regs, lock, &wk); | 148 i2c_write(regs, lock, &wk); |
149 } | 149 } |
150 } | 150 } |
185 { | 185 { |
186 WBLOCK wk; | 186 WBLOCK wk; |
187 | 187 |
188 if(type == TYPE_WAKEUP){ | 188 if(type == TYPE_WAKEUP){ |
189 switch(tuner_type){ | 189 switch(tuner_type){ |
190 case CHANNEL_TYPE_ISDB_S: | 190 case CHANNEL_TYPE_ISDB_S: |
191 memcpy(&wk, &isdb_s_wake, sizeof(WBLOCK)); | 191 printk(KERN_INFO "PT1:ISDB-S Wakeup\n"); |
192 break ; | 192 memcpy(&wk, &isdb_s_wake, sizeof(WBLOCK)); |
193 case CHANNEL_TYPE_ISDB_T: | 193 wk.addr = address ; |
194 memcpy(&wk, &isdb_t_wake, sizeof(WBLOCK)); | 194 i2c_write(regs, lock, &wk); |
195 break ; | 195 |
196 } | 196 memcpy(&wk, &isdb_s_sleep, sizeof(WBLOCK)); |
197 wk.addr = address ; | 197 wk.value[1] = 0x01 ; |
198 i2c_write(regs, lock, &wk); | 198 wk.addr = address ; |
199 } | 199 i2c_write(regs, lock, &wk); |
200 switch(tuner_type){ | 200 break ; |
201 case CHANNEL_TYPE_ISDB_T: | |
202 printk(KERN_INFO "PT1:ISDB-T Wakeup\n"); | |
203 memcpy(&wk, &isdb_t_wake, sizeof(WBLOCK)); | |
204 wk.addr = address ; | |
205 i2c_write(regs, lock, &wk); | |
206 | |
207 memcpy(&wk, &isdb_s_sleep, sizeof(WBLOCK)); | |
208 wk.value[1] = 0x90 ; | |
209 wk.addr = address ; | |
210 i2c_write(regs, lock, &wk); | |
211 break ; | |
212 } | |
213 } | |
214 if(type == TYPE_SLEEP){ | |
215 switch(tuner_type){ | |
201 case CHANNEL_TYPE_ISDB_S: | 216 case CHANNEL_TYPE_ISDB_S: |
202 printk(KERN_INFO "PT1:ISDB-S Sleep\n"); | 217 printk(KERN_INFO "PT1:ISDB-S Sleep\n"); |
203 memcpy(&wk, &isdb_s_sleep, sizeof(WBLOCK)); | 218 memcpy(&wk, &isdb_s_sleep, sizeof(WBLOCK)); |
204 if(type == TYPE_WAKEUP){ | 219 wk.addr = address; |
205 wk.value[1] = 0x01 ; | 220 i2c_write(regs, lock, &wk); |
206 } | |
207 break ; | 221 break ; |
208 case CHANNEL_TYPE_ISDB_T: | 222 case CHANNEL_TYPE_ISDB_T: |
209 printk(KERN_INFO "PT1:ISDB-T Sleep\n"); | 223 printk(KERN_INFO "PT1:ISDB-T Sleep\n"); |
210 memcpy(&wk, &isdb_t_sleep, sizeof(WBLOCK)); | 224 memcpy(&wk, &isdb_t_sleep, sizeof(WBLOCK)); |
211 if(type == TYPE_WAKEUP){ | 225 wk.addr = address; |
212 wk.value[1] = 0x90 ; | 226 i2c_write(regs, lock, &wk); |
213 } | 227 break ; |
214 break ; | 228 } |
215 } | 229 } |
216 wk.addr = address; | |
217 i2c_write(regs, lock, &wk); | |
218 } | 230 } |
219 | 231 |
220 int bs_frequency(void __iomem *regs, struct mutex *lock, int addr, int channel) | 232 int bs_frequency(void __iomem *regs, struct mutex *lock, int addr, int channel) |
221 { | 233 { |
222 int lp ; | 234 int lp ; |