Lines Matching refs:demod

208 #define DRXJ_WAKE_UP_KEY (demod->my_i2c_dev_addr->i2c_addr)
1025 ctrl_lock_status(struct drx_demod_instance *demod, enum drx_lock_status *lock_stat);
1028 ctrl_power_mode(struct drx_demod_instance *demod, enum drx_power_mode *mode);
1030 static int power_down_aud(struct drx_demod_instance *demod);
1033 ctrl_set_cfg_pre_saw(struct drx_demod_instance *demod, struct drxj_cfg_pre_saw *pre_saw);
1036 ctrl_set_cfg_afe_gain(struct drx_demod_instance *demod, struct drxj_cfg_afe_gain *afe_gain);
2233 static int hi_cfg_command(const struct drx_demod_instance *demod) in hi_cfg_command() argument
2240 ext_attr = (struct drxj_data *) demod->my_ext_attr; in hi_cfg_command()
2250 rc = hi_command(demod->my_i2c_dev_addr, &hi_cmd, &result); in hi_cfg_command()
2388 static int init_hi(const struct drx_demod_instance *demod) in init_hi() argument
2395 ext_attr = (struct drxj_data *) demod->my_ext_attr; in init_hi()
2396 common_attr = (struct drx_common_attr *) demod->my_common_attr; in init_hi()
2397 dev_addr = demod->my_i2c_dev_addr; in init_hi()
2434 rc = hi_cfg_command(demod); in init_hi()
2472 static int get_device_capabilities(struct drx_demod_instance *demod) in get_device_capabilities() argument
2482 common_attr = (struct drx_common_attr *) demod->my_common_attr; in get_device_capabilities()
2483 ext_attr = (struct drxj_data *) demod->my_ext_attr; in get_device_capabilities()
2484 dev_addr = demod->my_i2c_dev_addr; in get_device_capabilities()
2676 static int power_up_device(struct drx_demod_instance *demod) in power_up_device() argument
2683 dev_addr = demod->my_i2c_dev_addr; in power_up_device()
2727 ctrl_set_cfg_mpeg_output(struct drx_demod_instance *demod, struct drx_cfg_mpeg_output *cfg_data) in ctrl_set_cfg_mpeg_output() argument
2748 if ((demod == NULL) || (cfg_data == NULL)) in ctrl_set_cfg_mpeg_output()
2751 dev_addr = demod->my_i2c_dev_addr; in ctrl_set_cfg_mpeg_output()
2752 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_cfg_mpeg_output()
2753 common_attr = (struct drx_common_attr *) demod->my_common_attr; in ctrl_set_cfg_mpeg_output()
3370 static int set_mpegtei_handling(struct drx_demod_instance *demod) in set_mpegtei_handling() argument
3379 dev_addr = demod->my_i2c_dev_addr; in set_mpegtei_handling()
3380 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_mpegtei_handling()
3443 static int bit_reverse_mpeg_output(struct drx_demod_instance *demod) in bit_reverse_mpeg_output() argument
3450 dev_addr = demod->my_i2c_dev_addr; in bit_reverse_mpeg_output()
3451 ext_attr = (struct drxj_data *) demod->my_ext_attr; in bit_reverse_mpeg_output()
3486 static int set_mpeg_start_width(struct drx_demod_instance *demod) in set_mpeg_start_width() argument
3494 dev_addr = demod->my_i2c_dev_addr; in set_mpeg_start_width()
3495 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_mpeg_start_width()
3496 common_attr = demod->my_common_attr; in set_mpeg_start_width()
3534 static int ctrl_set_uio_cfg(struct drx_demod_instance *demod, struct drxuio_cfg *uio_cfg) in ctrl_set_uio_cfg() argument
3539 if ((uio_cfg == NULL) || (demod == NULL)) in ctrl_set_uio_cfg()
3542 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_uio_cfg()
3545 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_TOP_COMM_KEY__A, SIO_TOP_COMM_KEY_KEY, 0); in ctrl_set_uio_cfg()
3565 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_TX_CFG__A, 0, 0); in ctrl_set_uio_cfg()
3588 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_RX_CFG__A, 0, 0); in ctrl_set_uio_cfg()
3611 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_GPIO_CFG__A, 0, 0); in ctrl_set_uio_cfg()
3632 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_IRQN_CFG__A, 0, 0); in ctrl_set_uio_cfg()
3650 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_TOP_COMM_KEY__A, 0x0000, 0); in ctrl_set_uio_cfg()
3669 ctrl_uio_write(struct drx_demod_instance *demod, struct drxuio_data *uio_data) in ctrl_uio_write() argument
3676 if ((uio_data == NULL) || (demod == NULL)) in ctrl_uio_write()
3679 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_uio_write()
3682 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_TOP_COMM_KEY__A, SIO_TOP_COMM_KEY_KEY, 0); in ctrl_uio_write()
3704 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_TX_CFG__A, pin_cfg_value, 0); in ctrl_uio_write()
3711 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, &value, 0); in ctrl_uio_write()
3722 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, value, 0); in ctrl_uio_write()
3743 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_RX_CFG__A, pin_cfg_value, 0); in ctrl_uio_write()
3750 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, &value, 0); in ctrl_uio_write()
3761 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, value, 0); in ctrl_uio_write()
3782 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_GPIO_CFG__A, pin_cfg_value, 0); in ctrl_uio_write()
3789 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_HI__A, &value, 0); in ctrl_uio_write()
3800 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_HI__A, value, 0); in ctrl_uio_write()
3822 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_IRQN_CFG__A, pin_cfg_value, 0); in ctrl_uio_write()
3829 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, &value, 0); in ctrl_uio_write()
3840 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, value, 0); in ctrl_uio_write()
3852 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_TOP_COMM_KEY__A, 0x0000, 0); in ctrl_uio_write()
3879 ctrl_i2c_bridge(struct drx_demod_instance *demod, bool *bridge_closed) in ctrl_i2c_bridge() argument
3895 return hi_command(demod->my_i2c_dev_addr, &hi_cmd, &result); in ctrl_i2c_bridge()
3912 static int smart_ant_init(struct drx_demod_instance *demod) in smart_ant_init() argument
3920 dev_addr = demod->my_i2c_dev_addr; in smart_ant_init()
3921 ext_attr = (struct drxj_data *) demod->my_ext_attr; in smart_ant_init()
3924 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_TOP_COMM_KEY__A, SIO_TOP_COMM_KEY_KEY, 0); in smart_ant_init()
3950 rc = ctrl_set_uio_cfg(demod, &uio_cfg); in smart_ant_init()
3955 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_TX_CFG__A, 0x13, 0); in smart_ant_init()
3960 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_TX_GPIO_FNC__A, 0x03, 0); in smart_ant_init()
3967 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_TOP_COMM_KEY__A, 0x0000, 0); in smart_ant_init()
4257 static int adc_sync_measurement(struct drx_demod_instance *demod, u16 *count) in adc_sync_measurement() argument
4263 dev_addr = demod->my_i2c_dev_addr; in adc_sync_measurement()
4320 static int adc_synchronization(struct drx_demod_instance *demod) in adc_synchronization() argument
4326 dev_addr = demod->my_i2c_dev_addr; in adc_synchronization()
4328 rc = adc_sync_measurement(demod, &count); in adc_synchronization()
4351 rc = adc_sync_measurement(demod, &count); in adc_synchronization()
4383 static int init_agc(struct drx_demod_instance *demod) in init_agc() argument
4407 dev_addr = demod->my_i2c_dev_addr; in init_agc()
4408 common_attr = (struct drx_common_attr *) demod->my_common_attr; in init_agc()
4409 ext_attr = (struct drxj_data *) demod->my_ext_attr; in init_agc()
4761 set_frequency(struct drx_demod_instance *demod, in set_frequency() argument
4764 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_frequency()
4765 struct drxj_data *ext_attr = demod->my_ext_attr; in set_frequency()
4782 tuner_mirror = demod->my_common_attr->mirror_freq_spect ? false : true; in set_frequency()
4811 intermediate_freq = demod->my_common_attr->intermediate_freq; in set_frequency()
4812 sampling_frequency = demod->my_common_attr->sys_clock_freq / 3; in set_frequency()
4861 static int get_acc_pkt_err(struct drx_demod_instance *demod, u16 *packet_err) in get_acc_pkt_err() argument
4870 ext_attr = (struct drxj_data *) demod->my_ext_attr; in get_acc_pkt_err()
4871 dev_addr = demod->my_i2c_dev_addr; in get_acc_pkt_err()
4910 set_agc_rf(struct drx_demod_instance *demod, struct drxj_cfg_agc *agc_settings, bool atomic) in set_agc_rf() argument
4920 common_attr = (struct drx_common_attr *) demod->my_common_attr; in set_agc_rf()
4921 dev_addr = demod->my_i2c_dev_addr; in set_agc_rf()
4922 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_agc_rf()
5124 set_agc_if(struct drx_demod_instance *demod, struct drxj_cfg_agc *agc_settings, bool atomic) in set_agc_if() argument
5134 common_attr = (struct drx_common_attr *) demod->my_common_attr; in set_agc_if()
5135 dev_addr = demod->my_i2c_dev_addr; in set_agc_if()
5136 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_agc_if()
5352 static int set_iqm_af(struct drx_demod_instance *demod, bool active) in set_iqm_af() argument
5358 dev_addr = demod->my_i2c_dev_addr; in set_iqm_af()
5398 static int power_down_vsb(struct drx_demod_instance *demod, bool primary) in power_down_vsb() argument
5400 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in power_down_vsb()
5444 rc = set_iqm_af(demod, false); in power_down_vsb()
5478 rc = ctrl_set_cfg_mpeg_output(demod, &cfg_mpeg_output); in power_down_vsb()
5495 static int set_vsb_leak_n_gain(struct drx_demod_instance *demod) in set_vsb_leak_n_gain() argument
5688 dev_addr = demod->my_i2c_dev_addr; in set_vsb_leak_n_gain()
5712 static int set_vsb(struct drx_demod_instance *demod) in set_vsb() argument
5752 dev_addr = demod->my_i2c_dev_addr; in set_vsb()
5753 common_attr = (struct drx_common_attr *) demod->my_common_attr; in set_vsb()
5754 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_vsb()
6047 rc = set_iqm_af(demod, true); in set_vsb()
6052 rc = adc_synchronization(demod); in set_vsb()
6058 rc = init_agc(demod); in set_vsb()
6063 rc = set_agc_if(demod, &(ext_attr->vsb_if_agc_cfg), false); in set_vsb()
6068 rc = set_agc_rf(demod, &(ext_attr->vsb_rf_agc_cfg), false); in set_vsb()
6079 rc = ctrl_set_cfg_afe_gain(demod, &vsb_pga_cfg); in set_vsb()
6085 rc = ctrl_set_cfg_pre_saw(demod, &(ext_attr->vsb_pre_saw_cfg)); in set_vsb()
6092 rc = set_mpegtei_handling(demod); in set_vsb()
6097 rc = bit_reverse_mpeg_output(demod); in set_vsb()
6102 rc = set_mpeg_start_width(demod); in set_vsb()
6115 rc = ctrl_set_cfg_mpeg_output(demod, &cfg_mpeg_output); in set_vsb()
6358 static int power_down_qam(struct drx_demod_instance *demod, bool primary) in power_down_qam() argument
6367 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in power_down_qam()
6369 struct drx_common_attr *common_attr = demod->my_common_attr; in power_down_qam()
6406 rc = set_iqm_af(demod, false); in power_down_qam()
6442 rc = ctrl_set_cfg_mpeg_output(demod, &cfg_mpeg_output); in power_down_qam()
6473 set_qam_measurement(struct drx_demod_instance *demod, in set_qam_measurement() argument
6490 dev_addr = demod->my_i2c_dev_addr; in set_qam_measurement()
6491 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_qam_measurement()
6673 static int set_qam16(struct drx_demod_instance *demod) in set_qam16() argument
6675 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_qam16()
6908 static int set_qam32(struct drx_demod_instance *demod) in set_qam32() argument
6910 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_qam32()
7143 static int set_qam64(struct drx_demod_instance *demod) in set_qam64() argument
7145 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_qam64()
7379 static int set_qam128(struct drx_demod_instance *demod) in set_qam128() argument
7381 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_qam128()
7614 static int set_qam256(struct drx_demod_instance *demod) in set_qam256() argument
7616 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_qam256()
7854 set_qam(struct drx_demod_instance *demod, in set_qam() argument
7995 dev_addr = demod->my_i2c_dev_addr; in set_qam()
7996 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_qam()
7997 common_attr = (struct drx_common_attr *) demod->my_common_attr; in set_qam()
8149 rc = set_qam_measurement(demod, channel->constellation, channel->symbolrate); in set_qam()
8160 rc = set_frequency(demod, channel, tuner_freq_offset); in set_qam()
8453 rc = set_iqm_af(demod, true); in set_qam()
8458 rc = adc_synchronization(demod); in set_qam()
8464 rc = init_agc(demod); in set_qam()
8469 rc = set_agc_if(demod, &(ext_attr->qam_if_agc_cfg), false); in set_qam()
8474 rc = set_agc_rf(demod, &(ext_attr->qam_rf_agc_cfg), false); in set_qam()
8485 rc = ctrl_set_cfg_afe_gain(demod, &qam_pga_cfg); in set_qam()
8491 rc = ctrl_set_cfg_pre_saw(demod, &(ext_attr->qam_pre_saw_cfg)); in set_qam()
8555 rc = set_qam16(demod); in set_qam()
8562 rc = set_qam32(demod); in set_qam()
8569 rc = set_qam64(demod); in set_qam()
8576 rc = set_qam128(demod); in set_qam()
8583 rc = set_qam256(demod); in set_qam()
8602 rc = set_mpegtei_handling(demod); in set_qam()
8607 rc = bit_reverse_mpeg_output(demod); in set_qam()
8612 rc = set_mpeg_start_width(demod); in set_qam()
8625 rc = ctrl_set_cfg_mpeg_output(demod, &cfg_mpeg_output); in set_qam()
8671 static int ctrl_get_qam_sig_quality(struct drx_demod_instance *demod);
8673 static int qam_flip_spec(struct drx_demod_instance *demod, struct drx_channel *channel) in qam_flip_spec() argument
8675 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in qam_flip_spec()
8676 struct drxj_data *ext_attr = demod->my_ext_attr; in qam_flip_spec()
8866 qam64auto(struct drx_demod_instance *demod, in qam64auto() argument
8870 struct drxj_data *ext_attr = demod->my_ext_attr; in qam64auto()
8871 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in qam64auto()
8886 rc = ctrl_lock_status(demod, lock_status); in qam64auto()
8895 rc = ctrl_get_qam_sig_quality(demod); in qam64auto()
8912 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, &data, 0); in qam64auto()
8917 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, data | 0x1, 0); in qam64auto()
8930 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, &data, 0); in qam64auto()
8935 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, data & 0xFFFE, 0); in qam64auto()
8942 rc = qam_flip_spec(demod, channel); in qam64auto()
8964 rc = ctrl_get_qam_sig_quality(demod); in qam64auto()
8970 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, &data, 0); in qam64auto()
8975 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, data | 0x1, 0); in qam64auto()
9014 qam256auto(struct drx_demod_instance *demod, in qam256auto() argument
9018 struct drxj_data *ext_attr = demod->my_ext_attr; in qam256auto()
9019 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in qam256auto()
9033 rc = ctrl_lock_status(demod, lock_status); in qam256auto()
9041 rc = ctrl_get_qam_sig_quality(demod); in qam256auto()
9059 rc = qam_flip_spec(demod, channel); in qam256auto()
9096 set_qam_channel(struct drx_demod_instance *demod, in set_qam_channel() argument
9105 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_qam_channel()
9124 rc = set_qam(demod, channel, tuner_freq_offset, QAM_SET_OP_ALL); in set_qam_channel()
9131 rc = qam64auto(demod, channel, tuner_freq_offset, in set_qam_channel()
9134 rc = qam256auto(demod, channel, tuner_freq_offset, in set_qam_channel()
9154 rc = set_qam(demod, channel, tuner_freq_offset, in set_qam_channel()
9160 rc = qam256auto(demod, channel, tuner_freq_offset, in set_qam_channel()
9180 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9187 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9194 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9202 rc = set_qam(demod, channel, tuner_freq_offset, in set_qam_channel()
9208 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9216 rc = qam64auto(demod, channel, tuner_freq_offset, in set_qam_channel()
9235 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9242 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9249 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9257 rc = set_qam(demod, channel, tuner_freq_offset, in set_qam_channel()
9263 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9270 rc = qam64auto(demod, channel, tuner_freq_offset, in set_qam_channel()
9381 static int get_sig_strength(struct drx_demod_instance *demod, u16 *sig_strength) in get_sig_strength() argument
9383 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in get_sig_strength()
9459 ctrl_get_qam_sig_quality(struct drx_demod_instance *demod) in ctrl_get_qam_sig_quality() argument
9461 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in ctrl_get_qam_sig_quality()
9462 struct drxj_data *ext_attr = demod->my_ext_attr; in ctrl_get_qam_sig_quality()
9645 rc = get_acc_pkt_err(demod, &sig_quality->packet_error); in ctrl_get_qam_sig_quality()
9744 power_down_atv(struct drx_demod_instance *demod, enum drx_standard standard, bool primary) in power_down_atv() argument
9746 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in power_down_atv()
9788 rc = set_iqm_af(demod, false); in power_down_atv()
9820 rc = power_down_aud(demod); in power_down_atv()
9839 static int power_down_aud(struct drx_demod_instance *demod) in power_down_aud() argument
9845 dev_addr = (struct i2c_device_addr *)demod->my_i2c_dev_addr; in power_down_aud()
9846 ext_attr = (struct drxj_data *) demod->my_ext_attr; in power_down_aud()
9868 static int set_orx_nsu_aox(struct drx_demod_instance *demod, bool active) in set_orx_nsu_aox() argument
9870 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_orx_nsu_aox()
9919 static int ctrl_set_oob(struct drx_demod_instance *demod, struct drxoob *oob_param) in ctrl_set_oob() argument
9946 dev_addr = demod->my_i2c_dev_addr; in ctrl_set_oob()
9947 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_oob()
9963 rc = set_orx_nsu_aox(demod, false); in ctrl_set_oob()
10401 rc = set_orx_nsu_aox(demod, true); in ctrl_set_oob()
10442 ctrl_set_channel(struct drx_demod_instance *demod, struct drx_channel *channel) in ctrl_set_channel() argument
10456 if ((demod == NULL) || (channel == NULL)) in ctrl_set_channel()
10459 dev_addr = demod->my_i2c_dev_addr; in ctrl_set_channel()
10460 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_channel()
10507 rc = ctrl_set_uio_cfg(demod, &uio_cfg); in ctrl_set_channel()
10602 rc = ctrl_uio_write(demod, &uio1); in ctrl_set_channel()
10624 rc = set_vsb(demod); in ctrl_set_channel()
10629 rc = set_frequency(demod, channel, tuner_freq_offset); in ctrl_set_channel()
10639 rc = set_qam_channel(demod, channel, tuner_freq_offset); in ctrl_set_channel()
10675 ctrl_sig_quality(struct drx_demod_instance *demod, in ctrl_sig_quality() argument
10678 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in ctrl_sig_quality()
10679 struct drxj_data *ext_attr = demod->my_ext_attr; in ctrl_sig_quality()
10687 rc = get_sig_strength(demod, &strength); in ctrl_sig_quality()
10699 rc = get_acc_pkt_err(demod, &pkt); in ctrl_sig_quality()
10761 rc = ctrl_get_qam_sig_quality(demod); in ctrl_sig_quality()
10788 ctrl_lock_status(struct drx_demod_instance *demod, enum drx_lock_status *lock_stat) in ctrl_lock_status() argument
10804 if ((demod == NULL) || (lock_stat == NULL)) in ctrl_lock_status()
10807 dev_addr = demod->my_i2c_dev_addr; in ctrl_lock_status()
10808 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_lock_status()
10878 ctrl_set_standard(struct drx_demod_instance *demod, enum drx_standard *standard) in ctrl_set_standard() argument
10885 if ((standard == NULL) || (demod == NULL)) in ctrl_set_standard()
10888 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_standard()
10899 rc = power_down_qam(demod, false); in ctrl_set_standard()
10907 rc = power_down_vsb(demod, false); in ctrl_set_standard()
10934 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, SCU_RAM_VERSION_HI__A, &dummy, 0); in ctrl_set_standard()
10943 rc = set_vsb_leak_n_gain(demod); in ctrl_set_standard()
11035 ctrl_power_mode(struct drx_demod_instance *demod, enum drx_power_mode *mode) in ctrl_power_mode() argument
11043 common_attr = (struct drx_common_attr *) demod->my_common_attr; in ctrl_power_mode()
11044 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_power_mode()
11045 dev_addr = demod->my_i2c_dev_addr; in ctrl_power_mode()
11076 rc = power_up_device(demod); in ctrl_power_mode()
11104 rc = power_down_qam(demod, true); in ctrl_power_mode()
11111 rc = power_down_vsb(demod, true); in ctrl_power_mode()
11124 rc = power_down_atv(demod, ext_attr->standard, true); in ctrl_power_mode()
11154 rc = init_hi(demod); in ctrl_power_mode()
11161 rc = hi_cfg_command(demod); in ctrl_power_mode()
11192 ctrl_set_cfg_pre_saw(struct drx_demod_instance *demod, struct drxj_cfg_pre_saw *pre_saw) in ctrl_set_cfg_pre_saw() argument
11198 dev_addr = demod->my_i2c_dev_addr; in ctrl_set_cfg_pre_saw()
11199 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_cfg_pre_saw()
11255 ctrl_set_cfg_afe_gain(struct drx_demod_instance *demod, struct drxj_cfg_afe_gain *afe_gain) in ctrl_set_cfg_afe_gain() argument
11266 dev_addr = demod->my_i2c_dev_addr; in ctrl_set_cfg_afe_gain()
11267 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_cfg_afe_gain()
11328 static int drx_ctrl_u_code(struct drx_demod_instance *demod,
11331 static int drxj_set_lna_state(struct drx_demod_instance *demod, bool state);
11344 static int drxj_open(struct drx_demod_instance *demod) in drxj_open() argument
11355 if ((demod == NULL) || in drxj_open()
11356 (demod->my_common_attr == NULL) || in drxj_open()
11357 (demod->my_ext_attr == NULL) || in drxj_open()
11358 (demod->my_i2c_dev_addr == NULL) || in drxj_open()
11359 (demod->my_common_attr->is_opened)) { in drxj_open()
11364 if (demod->my_ext_attr == NULL) in drxj_open()
11367 dev_addr = demod->my_i2c_dev_addr; in drxj_open()
11368 ext_attr = (struct drxj_data *) demod->my_ext_attr; in drxj_open()
11369 common_attr = (struct drx_common_attr *) demod->my_common_attr; in drxj_open()
11371 rc = ctrl_power_mode(demod, &power_mode); in drxj_open()
11383 rc = get_device_capabilities(demod); in drxj_open()
11417 rc = set_iqm_af(demod, false); in drxj_open()
11422 rc = set_orx_nsu_aox(demod, false); in drxj_open()
11428 rc = init_hi(demod); in drxj_open()
11438 rc = ctrl_set_cfg_mpeg_output(demod, &cfg_mpeg_output); in drxj_open()
11444 rc = power_down_aud(demod); in drxj_open()
11463 if (DRX_ISPOWERDOWNMODE(demod->my_common_attr->current_power_mode)) { in drxj_open()
11468 rc = drx_ctrl_u_code(demod, &ucode_info, UCODE_UPLOAD); in drxj_open()
11474 rc = drx_ctrl_u_code(demod, &ucode_info, UCODE_VERIFY); in drxj_open()
11498 rc = smart_ant_init(demod); in drxj_open()
11534 rc = ctrl_set_oob(demod, NULL); in drxj_open()
11543 demod->my_common_attr->is_opened = true; in drxj_open()
11544 drxj_set_lna_state(demod, false); in drxj_open()
11558 static int drxj_close(struct drx_demod_instance *demod) in drxj_close() argument
11560 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in drxj_close()
11564 if ((demod->my_common_attr == NULL) || in drxj_close()
11565 (demod->my_ext_attr == NULL) || in drxj_close()
11566 (demod->my_i2c_dev_addr == NULL) || in drxj_close()
11567 (!demod->my_common_attr->is_opened)) { in drxj_close()
11572 rc = ctrl_power_mode(demod, &power_mode); in drxj_close()
11584 rc = ctrl_power_mode(demod, &power_mode); in drxj_close()
11590 DRX_ATTR_ISOPENED(demod) = false; in drxj_close()
11594 DRX_ATTR_ISOPENED(demod) = false; in drxj_close()
11638 static int drx_check_firmware(struct drx_demod_instance *demod, u8 *mc_data, in drx_check_firmware() argument
11653 DRX_ATTR_MCRECORD(demod).aux_type = 0; in drx_check_firmware()
11654 DRX_ATTR_MCRECORD(demod).mc_dev_type = 0; in drx_check_firmware()
11655 DRX_ATTR_MCRECORD(demod).mc_version = 0; in drx_check_firmware()
11656 DRX_ATTR_MCRECORD(demod).mc_base_version = 0; in drx_check_firmware()
11697 DRX_ATTR_MCRECORD(demod).aux_type = auxtype; in drx_check_firmware()
11698 DRX_ATTR_MCRECORD(demod).mc_dev_type = mc_dev_type; in drx_check_firmware()
11699 DRX_ATTR_MCRECORD(demod).mc_version = mc_version; in drx_check_firmware()
11700 DRX_ATTR_MCRECORD(demod).mc_base_version = mc_base_version; in drx_check_firmware()
11736 static int drx_ctrl_u_code(struct drx_demod_instance *demod, in drx_ctrl_u_code() argument
11740 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in drx_ctrl_u_code()
11756 if (!demod->firmware) { in drx_ctrl_u_code()
11759 rc = request_firmware(&fw, mc_file, demod->i2c->dev.parent); in drx_ctrl_u_code()
11764 demod->firmware = fw; in drx_ctrl_u_code()
11766 if (demod->firmware->size < 2 * sizeof(u16)) { in drx_ctrl_u_code()
11773 mc_file, demod->firmware->size); in drx_ctrl_u_code()
11776 mc_data_init = demod->firmware->data; in drx_ctrl_u_code()
11777 size = demod->firmware->size; in drx_ctrl_u_code()
11793 rc = drx_check_firmware(demod, (u8 *)mc_data_init, size); in drx_ctrl_u_code()
11901 release_firmware(demod->firmware); in drx_ctrl_u_code()
11902 demod->firmware = NULL; in drx_ctrl_u_code()
11908 static int drxj_set_lna_state(struct drx_demod_instance *demod, bool state) in drxj_set_lna_state() argument
11917 result = ctrl_set_uio_cfg(demod, &uio_cfg); in drxj_set_lna_state()
11925 result = ctrl_uio_write(demod, &uio_data); in drxj_set_lna_state()
11943 struct drx_demod_instance *demod = state->demod; in drx39xxj_set_powerstate() local
11952 result = ctrl_power_mode(demod, &power_mode); in drx39xxj_set_powerstate()
11964 struct drx_demod_instance *demod = state->demod; in drx39xxj_read_status() local
11970 result = ctrl_lock_status(demod, &lock_status); in drx39xxj_read_status()
12004 ctrl_sig_quality(demod, lock_status); in drx39xxj_read_status()
12080 struct drx_demod_instance *demod = state->demod; in drx39xxj_set_frontend() local
12118 demod->my_common_attr->intermediate_freq = int_freq / 1000; in drx39xxj_set_frontend()
12148 result = ctrl_set_standard(demod, &standard); in drx39xxj_set_frontend()
12162 result = ctrl_set_channel(demod, &channel); in drx39xxj_set_frontend()
12168 drxj_set_lna_state(demod, false); in drx39xxj_set_frontend()
12185 struct drx_demod_instance *demod = state->demod; in drx39xxj_i2c_gate_ctrl() local
12204 result = ctrl_i2c_bridge(demod, &i2c_gate_state); in drx39xxj_i2c_gate_ctrl()
12218 struct drx_demod_instance *demod = state->demod; in drx39xxj_init() local
12223 demod->my_common_attr->is_opened = false; in drx39xxj_init()
12224 rc = drxj_open(demod); in drx39xxj_init()
12237 struct drx_demod_instance *demod = state->demod; in drx39xxj_set_lna() local
12238 struct drxj_data *ext_attr = demod->my_ext_attr; in drx39xxj_set_lna()
12248 return drxj_set_lna_state(demod, c->lna); in drx39xxj_set_lna()
12261 struct drx_demod_instance *demod = state->demod; in drx39xxj_release() local
12265 drxj_close(demod); in drx39xxj_release()
12267 kfree(demod->my_ext_attr); in drx39xxj_release()
12268 kfree(demod->my_common_attr); in drx39xxj_release()
12269 kfree(demod->my_i2c_dev_addr); in drx39xxj_release()
12270 release_firmware(demod->firmware); in drx39xxj_release()
12271 kfree(demod); in drx39xxj_release()
12283 struct drx_demod_instance *demod = NULL; in drx39xxj_attach() local
12292 demod = kmemdup(&drxj_default_demod_g, in drx39xxj_attach()
12294 if (demod == NULL) in drx39xxj_attach()
12314 state->demod = demod; in drx39xxj_attach()
12317 demod->my_i2c_dev_addr = demod_addr; in drx39xxj_attach()
12318 demod->my_common_attr = demod_comm_attr; in drx39xxj_attach()
12319 demod->my_i2c_dev_addr->user_data = state; in drx39xxj_attach()
12320 demod->my_common_attr->microcode_file = DRX39XX_MAIN_FIRMWARE; in drx39xxj_attach()
12321 demod->my_common_attr->verify_microcode = true; in drx39xxj_attach()
12322 demod->my_common_attr->intermediate_freq = 5000; in drx39xxj_attach()
12323 demod->my_common_attr->current_power_mode = DRX_POWER_DOWN; in drx39xxj_attach()
12324 demod->my_ext_attr = demod_ext_attr; in drx39xxj_attach()
12326 demod->i2c = i2c; in drx39xxj_attach()
12328 result = drxj_open(demod); in drx39xxj_attach()
12366 kfree(demod); in drx39xxj_attach()