Lines Matching +full:9 +full:- +full:channel

1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* ZD1211 USB-WLAN driver for Linux
4 * Copyright (C) 2005-2007 Ulrich Kunitz <kune@deine-taler.de>
5 * Copyright (C) 2006-2007 Daniel Drake <dsd@gentoo.org>
20 /* The 3-wire serial interface provides access to 8 write-only registers.
24 /* For channel tuning, we have to configure registers 1 (synthesizer), 2 (synth
29 * of different VCO configurations on channel 1 until we detect a PLL lock.
35 * autocal configuration, which has a fixed (as opposed to per-channel) VCO
39 /* The per-channel synth values for all standard VCO configurations. These get
50 RF_CHANNEL( 9) = 0x57,
70 RF_CHANNEL( 9) = 0x999,
81 * are all 'Reserved' and are always set to 0x4 - we chop them off in the data
83 #define CHAN_TO_PAIRIDX(a) ((a - 1) / 2)
91 RF_CHANPAIR( 9, 10) = 0x6655,
100 RF_CHANPAIR( 9, 10) = 0x6675,
109 RF_CHANPAIR( 9, 10) = 0x664d,
118 RF_CHANPAIR( 9, 10) = 0x666d,
127 RF_CHANPAIR( 9, 10) = 0x665d,
136 RF_CHANPAIR( 9, 10) = 0x667d,
145 RF_CHANPAIR( 9, 10) = 0x6643,
154 RF_CHANPAIR( 9, 10) = 0x6663,
158 { /* table 9 */
163 RF_CHANPAIR( 9, 10) = 0x6653,
172 RF_CHANPAIR( 9, 10) = 0x6673,
181 RF_CHANPAIR( 9, 10) = 0x664b,
188 /* The per-channel synth values for autocal. These get written to register 1. */
198 RF_CHANNEL( 9) = 0x6857,
233 /* RF-specific structure */
236 * -1 means autocal */
240 #define UW2453_PRIV(rf) ((struct uw2453_priv *) (rf)->priv)
242 static int uw2453_synth_set_channel(struct zd_chip *chip, int channel, in uw2453_synth_set_channel() argument
246 int idx = channel - 1; in uw2453_synth_set_channel()
282 static int uw2453_set_tx_gain_level(struct zd_chip *chip, int channel) in uw2453_set_tx_gain_level() argument
284 u8 int_value = chip->pwr_int_values[channel - 1]; in uw2453_set_tx_gain_level()
288 "int value %x on channel %d\n", int_value, channel); in uw2453_set_tx_gain_level()
299 int found_config = -1; in uw2453_init_hw()
309 { ZD_CR35, 0x43 }, /* 6112 3e->43 */ in uw2453_init_hw()
311 { ZD_CR46, 0x92 }, /* 6112 96->92 */ in uw2453_init_hw()
318 { ZD_CR101, 0x09 }, /* 6112 13->1f 6220 1f->13 6407 13->9 */ in uw2453_init_hw()
320 { ZD_CR106, 0x1c }, /* 5d07 5112 1f->1c 6220 1c->1f in uw2453_init_hw()
321 * 6221 1f->1c in uw2453_init_hw()
323 { ZD_CR107, 0x1c }, /* 6220 1c->1a 5221 1a->1c */ in uw2453_init_hw()
325 { ZD_CR110, 0x1f }, /* 6112 13->1f 6221 1f->13 6407 13->0x09 */ in uw2453_init_hw()
327 { ZD_CR114, 0x23 }, /* 6221 27->23 */ in uw2453_init_hw()
328 { ZD_CR115, 0x24 }, /* 6112 24->1c 6220 1c->24 */ in uw2453_init_hw()
329 { ZD_CR116, 0x24 }, /* 6220 1c->24 */ in uw2453_init_hw()
330 { ZD_CR117, 0xfa }, /* 6112 fa->f8 6220 f8->f4 6220 f4->fa */ in uw2453_init_hw()
331 { ZD_CR118, 0xf0 }, /* 5d07 6112 f0->f2 6220 f2->f0 */ in uw2453_init_hw()
332 { ZD_CR119, 0x1a }, /* 6112 1a->10 6220 10->14 6220 14->1a */ in uw2453_init_hw()
334 { ZD_CR121, 0x1f }, /* 6220 4f->1f */ in uw2453_init_hw()
337 { ZD_CR128, 0x14 }, /* 6302 12->11 */ in uw2453_init_hw()
338 { ZD_CR129, 0x12 }, /* 6301 10->0f */ in uw2453_init_hw()
354 /* synthesizer configuration for channel 1 */ in uw2453_init_hw()
377 /* Try all standard VCO configuration settings on channel 1 */ in uw2453_init_hw()
378 for (i = 0; i < ARRAY_SIZE(uw2453_std_vco_cfg) - 1; i++) { in uw2453_init_hw()
379 /* Configure synthesizer for channel 1 */ in uw2453_init_hw()
407 if (found_config == -1) { in uw2453_init_hw()
423 UW2453_PRIV(rf)->config = found_config + 1; in uw2453_init_hw()
428 static int uw2453_set_channel(struct zd_rf *rf, u8 channel) in uw2453_set_channel() argument
432 int config = UW2453_PRIV(rf)->config; in uw2453_set_channel()
433 bool autocal = (config == -1); in uw2453_set_channel()
441 r = uw2453_synth_set_channel(chip, channel, autocal); in uw2453_set_channel()
448 vco_cfg = uw2453_std_vco_cfg[config][CHAN_TO_PAIRIDX(channel)]; in uw2453_set_channel()
462 r = uw2453_set_tx_gain_level(chip, channel); in uw2453_set_channel()
507 kfree(rf->priv); in uw2453_clear()
512 rf->init_hw = uw2453_init_hw; in zd_rf_init_uw2453()
513 rf->set_channel = uw2453_set_channel; in zd_rf_init_uw2453()
514 rf->switch_radio_on = uw2453_switch_radio_on; in zd_rf_init_uw2453()
515 rf->switch_radio_off = uw2453_switch_radio_off; in zd_rf_init_uw2453()
516 rf->patch_6m_band_edge = zd_rf_generic_patch_6m; in zd_rf_init_uw2453()
517 rf->clear = uw2453_clear; in zd_rf_init_uw2453()
519 rf->update_channel_int = 0; in zd_rf_init_uw2453()
521 rf->priv = kmalloc(sizeof(struct uw2453_priv), GFP_KERNEL); in zd_rf_init_uw2453()
522 if (rf->priv == NULL) in zd_rf_init_uw2453()
523 return -ENOMEM; in zd_rf_init_uw2453()