21 #include <linux/kernel.h>
27 static const u32 rf2959_table[][2] = {
47 rw &= ~(0xffffffff
U << (to+1));
54 return bits(rw, bit, bit);
57 static void dump_regwrite(
u32 rw)
60 int rw_flag =
bits(rw, 23, 23);
61 PDEBUG(
"rf2959 %#010x reg %d rw %d", rw, reg, rw_flag);
65 PDEBUG(
"reg0 CFG1 ref_sel %d hybernate %d rf_vco_reg_en %d"
66 " if_vco_reg_en %d if_vga_en %d",
71 PDEBUG(
"reg1 IFPLL1 pll_en1 %d kv_en1 %d vtc_en1 %d lpf1 %d"
72 " cpl1 %d pdp1 %d autocal_en1 %d ld_en1 %d ifloopr %d"
73 " ifloopc %d dac1 %d",
79 PDEBUG(
"reg2 IFPLL2 n1 %d num1 %d",
86 PDEBUG(
"reg4 IFPLL4 dn1 %#04x ct_def1 %d kv_def1 %d",
90 PDEBUG(
"reg5 RFPLL1 pll_en %d kv_en %d vtc_en %d lpf %d cpl %d"
91 " pdp %d autocal_en %d ld_en %d rfloopr %d rfloopc %d"
98 PDEBUG(
"reg6 RFPLL2 n %d num %d",
102 PDEBUG(
"reg7 RFPLL3 num2 %d",
bits(rw, 0, 17));
105 PDEBUG(
"reg8 RFPLL4 dn %#06x ct_def %d kv_def %d",
109 PDEBUG(
"reg9 CAL1 tvco %d tlock %d m_ct_value %d ld_window %d",
114 PDEBUG(
"reg10 TXRX1 rxdcfbbyps %d pcontrol %d txvgc %d"
115 " rxlpfbw %d txlpfbw %d txdiffmode %d txenmode %d"
116 " intbiasen %d tybypass %d",
118 bits(rw, 7, 9),
bits(rw, 4, 6),
bit(rw, 3),
bit(rw, 2),
122 PDEBUG(
"reg11 PCNT1 mid_bias %d p_desired %d pc_offset %d"
128 PDEBUG(
"reg12 PCNT2 max_power %d mid_power %d min_power %d",
132 PDEBUG(
"reg13 VCOT1 rfpll vco comp %d ifpll vco comp %d"
133 " lobias %d if_biasbuf %d if_biasvco %d rf_biasbuf %d"
140 PDEBUG(
"reg14 IQCAL rx_acal %d rx_pcal %d"
141 " tx_acal %d tx_pcal %d",
149 static int rf2959_init_hw(
struct zd_rf *
rf)
195 static const u32 rv[] = {
234 const u32 *rv = rf2959_table[channel-1];
235 struct zd_chip *chip = zd_rf_to_chip(rf);
237 for (i = 0; i < 2; i++) {
238 r = zd_rfwrite_locked(chip, rv[i],
RF_RV_BITS);
245 static int rf2959_switch_radio_on(
struct zd_rf *rf)
251 struct zd_chip *chip = zd_rf_to_chip(rf);
256 static int rf2959_switch_radio_off(
struct zd_rf *rf)
262 struct zd_chip *chip = zd_rf_to_chip(rf);
269 struct zd_chip *chip = zd_rf_to_chip(rf);
271 if (zd_chip_is_zd1211b(chip)) {
273 "RF2959 is currently not supported for ZD1211B"