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()
2389 static int init_hi(const struct drx_demod_instance *demod) in init_hi() argument
2396 ext_attr = (struct drxj_data *) demod->my_ext_attr; in init_hi()
2397 common_attr = (struct drx_common_attr *) demod->my_common_attr; in init_hi()
2398 dev_addr = demod->my_i2c_dev_addr; in init_hi()
2435 rc = hi_cfg_command(demod); in init_hi()
2473 static int get_device_capabilities(struct drx_demod_instance *demod) in get_device_capabilities() argument
2483 common_attr = (struct drx_common_attr *) demod->my_common_attr; in get_device_capabilities()
2484 ext_attr = (struct drxj_data *) demod->my_ext_attr; in get_device_capabilities()
2485 dev_addr = demod->my_i2c_dev_addr; in get_device_capabilities()
2677 static int power_up_device(struct drx_demod_instance *demod) in power_up_device() argument
2684 dev_addr = demod->my_i2c_dev_addr; in power_up_device()
2728 ctrl_set_cfg_mpeg_output(struct drx_demod_instance *demod, struct drx_cfg_mpeg_output *cfg_data) in ctrl_set_cfg_mpeg_output() argument
2749 if ((demod == NULL) || (cfg_data == NULL)) in ctrl_set_cfg_mpeg_output()
2752 dev_addr = demod->my_i2c_dev_addr; in ctrl_set_cfg_mpeg_output()
2753 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_cfg_mpeg_output()
2754 common_attr = (struct drx_common_attr *) demod->my_common_attr; in ctrl_set_cfg_mpeg_output()
3371 static int set_mpegtei_handling(struct drx_demod_instance *demod) in set_mpegtei_handling() argument
3380 dev_addr = demod->my_i2c_dev_addr; in set_mpegtei_handling()
3381 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_mpegtei_handling()
3444 static int bit_reverse_mpeg_output(struct drx_demod_instance *demod) in bit_reverse_mpeg_output() argument
3451 dev_addr = demod->my_i2c_dev_addr; in bit_reverse_mpeg_output()
3452 ext_attr = (struct drxj_data *) demod->my_ext_attr; in bit_reverse_mpeg_output()
3487 static int set_mpeg_start_width(struct drx_demod_instance *demod) in set_mpeg_start_width() argument
3495 dev_addr = demod->my_i2c_dev_addr; in set_mpeg_start_width()
3496 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_mpeg_start_width()
3497 common_attr = demod->my_common_attr; in set_mpeg_start_width()
3535 static int ctrl_set_uio_cfg(struct drx_demod_instance *demod, struct drxuio_cfg *uio_cfg) in ctrl_set_uio_cfg() argument
3540 if ((uio_cfg == NULL) || (demod == NULL)) in ctrl_set_uio_cfg()
3543 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_uio_cfg()
3546 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()
3566 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_TX_CFG__A, 0, 0); in ctrl_set_uio_cfg()
3589 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_RX_CFG__A, 0, 0); in ctrl_set_uio_cfg()
3613 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_GPIO_CFG__A, 0, 0); in ctrl_set_uio_cfg()
3635 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_IRQN_CFG__A, 0, 0); in ctrl_set_uio_cfg()
3654 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_TOP_COMM_KEY__A, 0x0000, 0); in ctrl_set_uio_cfg()
3673 ctrl_uio_write(struct drx_demod_instance *demod, struct drxuio_data *uio_data) in ctrl_uio_write() argument
3680 if ((uio_data == NULL) || (demod == NULL)) in ctrl_uio_write()
3683 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_uio_write()
3686 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()
3708 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_TX_CFG__A, pin_cfg_value, 0); in ctrl_uio_write()
3715 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, &value, 0); in ctrl_uio_write()
3726 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, value, 0); in ctrl_uio_write()
3747 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_RX_CFG__A, pin_cfg_value, 0); in ctrl_uio_write()
3754 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, &value, 0); in ctrl_uio_write()
3765 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, value, 0); in ctrl_uio_write()
3786 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_GPIO_CFG__A, pin_cfg_value, 0); in ctrl_uio_write()
3793 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_HI__A, &value, 0); in ctrl_uio_write()
3804 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_HI__A, value, 0); in ctrl_uio_write()
3826 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_IRQN_CFG__A, pin_cfg_value, 0); in ctrl_uio_write()
3833 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, &value, 0); in ctrl_uio_write()
3844 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_UIO_OUT_LO__A, value, 0); in ctrl_uio_write()
3856 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_TOP_COMM_KEY__A, 0x0000, 0); in ctrl_uio_write()
3883 ctrl_i2c_bridge(struct drx_demod_instance *demod, bool *bridge_closed) in ctrl_i2c_bridge() argument
3899 return hi_command(demod->my_i2c_dev_addr, &hi_cmd, &result); in ctrl_i2c_bridge()
3916 static int smart_ant_init(struct drx_demod_instance *demod) in smart_ant_init() argument
3924 dev_addr = demod->my_i2c_dev_addr; in smart_ant_init()
3925 ext_attr = (struct drxj_data *) demod->my_ext_attr; in smart_ant_init()
3928 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()
3954 rc = ctrl_set_uio_cfg(demod, &uio_cfg); in smart_ant_init()
3959 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_TX_CFG__A, 0x13, 0); in smart_ant_init()
3964 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_PDR_SMA_TX_GPIO_FNC__A, 0x03, 0); in smart_ant_init()
3971 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, SIO_TOP_COMM_KEY__A, 0x0000, 0); in smart_ant_init()
4261 static int adc_sync_measurement(struct drx_demod_instance *demod, u16 *count) in adc_sync_measurement() argument
4267 dev_addr = demod->my_i2c_dev_addr; in adc_sync_measurement()
4324 static int adc_synchronization(struct drx_demod_instance *demod) in adc_synchronization() argument
4330 dev_addr = demod->my_i2c_dev_addr; in adc_synchronization()
4332 rc = adc_sync_measurement(demod, &count); in adc_synchronization()
4355 rc = adc_sync_measurement(demod, &count); in adc_synchronization()
4387 static int init_agc(struct drx_demod_instance *demod) in init_agc() argument
4411 dev_addr = demod->my_i2c_dev_addr; in init_agc()
4412 common_attr = (struct drx_common_attr *) demod->my_common_attr; in init_agc()
4413 ext_attr = (struct drxj_data *) demod->my_ext_attr; in init_agc()
4765 set_frequency(struct drx_demod_instance *demod, in set_frequency() argument
4768 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_frequency()
4769 struct drxj_data *ext_attr = demod->my_ext_attr; in set_frequency()
4786 tuner_mirror = demod->my_common_attr->mirror_freq_spect ? false : true; in set_frequency()
4815 intermediate_freq = demod->my_common_attr->intermediate_freq; in set_frequency()
4816 sampling_frequency = demod->my_common_attr->sys_clock_freq / 3; in set_frequency()
4865 static int get_acc_pkt_err(struct drx_demod_instance *demod, u16 *packet_err) in get_acc_pkt_err() argument
4874 ext_attr = (struct drxj_data *) demod->my_ext_attr; in get_acc_pkt_err()
4875 dev_addr = demod->my_i2c_dev_addr; in get_acc_pkt_err()
4914 set_agc_rf(struct drx_demod_instance *demod, struct drxj_cfg_agc *agc_settings, bool atomic) in set_agc_rf() argument
4924 common_attr = (struct drx_common_attr *) demod->my_common_attr; in set_agc_rf()
4925 dev_addr = demod->my_i2c_dev_addr; in set_agc_rf()
4926 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_agc_rf()
5128 set_agc_if(struct drx_demod_instance *demod, struct drxj_cfg_agc *agc_settings, bool atomic) in set_agc_if() argument
5138 common_attr = (struct drx_common_attr *) demod->my_common_attr; in set_agc_if()
5139 dev_addr = demod->my_i2c_dev_addr; in set_agc_if()
5140 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_agc_if()
5356 static int set_iqm_af(struct drx_demod_instance *demod, bool active) in set_iqm_af() argument
5362 dev_addr = demod->my_i2c_dev_addr; in set_iqm_af()
5402 static int power_down_vsb(struct drx_demod_instance *demod, bool primary) in power_down_vsb() argument
5404 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in power_down_vsb()
5448 rc = set_iqm_af(demod, false); in power_down_vsb()
5482 rc = ctrl_set_cfg_mpeg_output(demod, &cfg_mpeg_output); in power_down_vsb()
5499 static int set_vsb_leak_n_gain(struct drx_demod_instance *demod) in set_vsb_leak_n_gain() argument
5692 dev_addr = demod->my_i2c_dev_addr; in set_vsb_leak_n_gain()
5716 static int set_vsb(struct drx_demod_instance *demod) in set_vsb() argument
5756 dev_addr = demod->my_i2c_dev_addr; in set_vsb()
5757 common_attr = (struct drx_common_attr *) demod->my_common_attr; in set_vsb()
5758 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_vsb()
6051 rc = set_iqm_af(demod, true); in set_vsb()
6056 rc = adc_synchronization(demod); in set_vsb()
6062 rc = init_agc(demod); in set_vsb()
6067 rc = set_agc_if(demod, &(ext_attr->vsb_if_agc_cfg), false); in set_vsb()
6072 rc = set_agc_rf(demod, &(ext_attr->vsb_rf_agc_cfg), false); in set_vsb()
6083 rc = ctrl_set_cfg_afe_gain(demod, &vsb_pga_cfg); in set_vsb()
6089 rc = ctrl_set_cfg_pre_saw(demod, &(ext_attr->vsb_pre_saw_cfg)); in set_vsb()
6096 rc = set_mpegtei_handling(demod); in set_vsb()
6101 rc = bit_reverse_mpeg_output(demod); in set_vsb()
6106 rc = set_mpeg_start_width(demod); in set_vsb()
6119 rc = ctrl_set_cfg_mpeg_output(demod, &cfg_mpeg_output); in set_vsb()
6362 static int power_down_qam(struct drx_demod_instance *demod, bool primary) in power_down_qam() argument
6371 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in power_down_qam()
6373 struct drx_common_attr *common_attr = demod->my_common_attr; in power_down_qam()
6410 rc = set_iqm_af(demod, false); in power_down_qam()
6446 rc = ctrl_set_cfg_mpeg_output(demod, &cfg_mpeg_output); in power_down_qam()
6477 set_qam_measurement(struct drx_demod_instance *demod, in set_qam_measurement() argument
6494 dev_addr = demod->my_i2c_dev_addr; in set_qam_measurement()
6495 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_qam_measurement()
6677 static int set_qam16(struct drx_demod_instance *demod) in set_qam16() argument
6679 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_qam16()
6912 static int set_qam32(struct drx_demod_instance *demod) in set_qam32() argument
6914 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_qam32()
7147 static int set_qam64(struct drx_demod_instance *demod) in set_qam64() argument
7149 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_qam64()
7383 static int set_qam128(struct drx_demod_instance *demod) in set_qam128() argument
7385 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_qam128()
7618 static int set_qam256(struct drx_demod_instance *demod) in set_qam256() argument
7620 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_qam256()
7858 set_qam(struct drx_demod_instance *demod, in set_qam() argument
7999 dev_addr = demod->my_i2c_dev_addr; in set_qam()
8000 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_qam()
8001 common_attr = (struct drx_common_attr *) demod->my_common_attr; in set_qam()
8153 rc = set_qam_measurement(demod, channel->constellation, channel->symbolrate); in set_qam()
8164 rc = set_frequency(demod, channel, tuner_freq_offset); in set_qam()
8457 rc = set_iqm_af(demod, true); in set_qam()
8462 rc = adc_synchronization(demod); in set_qam()
8468 rc = init_agc(demod); in set_qam()
8473 rc = set_agc_if(demod, &(ext_attr->qam_if_agc_cfg), false); in set_qam()
8478 rc = set_agc_rf(demod, &(ext_attr->qam_rf_agc_cfg), false); in set_qam()
8489 rc = ctrl_set_cfg_afe_gain(demod, &qam_pga_cfg); in set_qam()
8495 rc = ctrl_set_cfg_pre_saw(demod, &(ext_attr->qam_pre_saw_cfg)); in set_qam()
8559 rc = set_qam16(demod); in set_qam()
8566 rc = set_qam32(demod); in set_qam()
8573 rc = set_qam64(demod); in set_qam()
8580 rc = set_qam128(demod); in set_qam()
8587 rc = set_qam256(demod); in set_qam()
8606 rc = set_mpegtei_handling(demod); in set_qam()
8611 rc = bit_reverse_mpeg_output(demod); in set_qam()
8616 rc = set_mpeg_start_width(demod); in set_qam()
8629 rc = ctrl_set_cfg_mpeg_output(demod, &cfg_mpeg_output); in set_qam()
8675 static int ctrl_get_qam_sig_quality(struct drx_demod_instance *demod);
8677 static int qam_flip_spec(struct drx_demod_instance *demod, struct drx_channel *channel) in qam_flip_spec() argument
8679 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in qam_flip_spec()
8680 struct drxj_data *ext_attr = demod->my_ext_attr; in qam_flip_spec()
8870 qam64auto(struct drx_demod_instance *demod, in qam64auto() argument
8874 struct drxj_data *ext_attr = demod->my_ext_attr; in qam64auto()
8875 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in qam64auto()
8890 rc = ctrl_lock_status(demod, lock_status); in qam64auto()
8899 rc = ctrl_get_qam_sig_quality(demod); in qam64auto()
8916 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, &data, 0); in qam64auto()
8921 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, data | 0x1, 0); in qam64auto()
8934 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, &data, 0); in qam64auto()
8939 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, data & 0xFFFE, 0); in qam64auto()
8946 rc = qam_flip_spec(demod, channel); in qam64auto()
8968 rc = ctrl_get_qam_sig_quality(demod); in qam64auto()
8974 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, &data, 0); in qam64auto()
8979 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, QAM_SY_TIMEOUT__A, data | 0x1, 0); in qam64auto()
9018 qam256auto(struct drx_demod_instance *demod, in qam256auto() argument
9022 struct drxj_data *ext_attr = demod->my_ext_attr; in qam256auto()
9023 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in qam256auto()
9037 rc = ctrl_lock_status(demod, lock_status); in qam256auto()
9045 rc = ctrl_get_qam_sig_quality(demod); in qam256auto()
9063 rc = qam_flip_spec(demod, channel); in qam256auto()
9100 set_qam_channel(struct drx_demod_instance *demod, in set_qam_channel() argument
9109 ext_attr = (struct drxj_data *) demod->my_ext_attr; in set_qam_channel()
9128 rc = set_qam(demod, channel, tuner_freq_offset, QAM_SET_OP_ALL); in set_qam_channel()
9135 rc = qam64auto(demod, channel, tuner_freq_offset, in set_qam_channel()
9138 rc = qam256auto(demod, channel, tuner_freq_offset, in set_qam_channel()
9158 rc = set_qam(demod, channel, tuner_freq_offset, in set_qam_channel()
9164 rc = qam256auto(demod, channel, tuner_freq_offset, in set_qam_channel()
9184 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9191 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9198 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9206 rc = set_qam(demod, channel, tuner_freq_offset, in set_qam_channel()
9212 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9220 rc = qam64auto(demod, channel, tuner_freq_offset, in set_qam_channel()
9239 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9246 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9253 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9261 rc = set_qam(demod, channel, tuner_freq_offset, in set_qam_channel()
9267 rc = drxj_dap_write_reg16(demod->my_i2c_dev_addr, in set_qam_channel()
9274 rc = qam64auto(demod, channel, tuner_freq_offset, in set_qam_channel()
9385 static int get_sig_strength(struct drx_demod_instance *demod, u16 *sig_strength) in get_sig_strength() argument
9387 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in get_sig_strength()
9463 ctrl_get_qam_sig_quality(struct drx_demod_instance *demod) in ctrl_get_qam_sig_quality() argument
9465 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in ctrl_get_qam_sig_quality()
9466 struct drxj_data *ext_attr = demod->my_ext_attr; in ctrl_get_qam_sig_quality()
9649 rc = get_acc_pkt_err(demod, &sig_quality->packet_error); in ctrl_get_qam_sig_quality()
9748 power_down_atv(struct drx_demod_instance *demod, enum drx_standard standard, bool primary) in power_down_atv() argument
9750 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in power_down_atv()
9792 rc = set_iqm_af(demod, false); in power_down_atv()
9824 rc = power_down_aud(demod); in power_down_atv()
9843 static int power_down_aud(struct drx_demod_instance *demod) in power_down_aud() argument
9849 dev_addr = (struct i2c_device_addr *)demod->my_i2c_dev_addr; in power_down_aud()
9850 ext_attr = (struct drxj_data *) demod->my_ext_attr; in power_down_aud()
9872 static int set_orx_nsu_aox(struct drx_demod_instance *demod, bool active) in set_orx_nsu_aox() argument
9874 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in set_orx_nsu_aox()
9923 static int ctrl_set_oob(struct drx_demod_instance *demod, struct drxoob *oob_param) in ctrl_set_oob() argument
9950 dev_addr = demod->my_i2c_dev_addr; in ctrl_set_oob()
9951 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_oob()
9967 rc = set_orx_nsu_aox(demod, false); in ctrl_set_oob()
10405 rc = set_orx_nsu_aox(demod, true); in ctrl_set_oob()
10446 ctrl_set_channel(struct drx_demod_instance *demod, struct drx_channel *channel) in ctrl_set_channel() argument
10460 if ((demod == NULL) || (channel == NULL)) in ctrl_set_channel()
10463 dev_addr = demod->my_i2c_dev_addr; in ctrl_set_channel()
10464 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_channel()
10511 rc = ctrl_set_uio_cfg(demod, &uio_cfg); in ctrl_set_channel()
10606 rc = ctrl_uio_write(demod, &uio1); in ctrl_set_channel()
10628 rc = set_vsb(demod); in ctrl_set_channel()
10633 rc = set_frequency(demod, channel, tuner_freq_offset); in ctrl_set_channel()
10643 rc = set_qam_channel(demod, channel, tuner_freq_offset); in ctrl_set_channel()
10679 ctrl_sig_quality(struct drx_demod_instance *demod, in ctrl_sig_quality() argument
10682 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in ctrl_sig_quality()
10683 struct drxj_data *ext_attr = demod->my_ext_attr; in ctrl_sig_quality()
10691 rc = get_sig_strength(demod, &strength); in ctrl_sig_quality()
10703 rc = get_acc_pkt_err(demod, &pkt); in ctrl_sig_quality()
10765 rc = ctrl_get_qam_sig_quality(demod); in ctrl_sig_quality()
10792 ctrl_lock_status(struct drx_demod_instance *demod, enum drx_lock_status *lock_stat) in ctrl_lock_status() argument
10808 if ((demod == NULL) || (lock_stat == NULL)) in ctrl_lock_status()
10811 dev_addr = demod->my_i2c_dev_addr; in ctrl_lock_status()
10812 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_lock_status()
10882 ctrl_set_standard(struct drx_demod_instance *demod, enum drx_standard *standard) in ctrl_set_standard() argument
10889 if ((standard == NULL) || (demod == NULL)) in ctrl_set_standard()
10892 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_standard()
10903 rc = power_down_qam(demod, false); in ctrl_set_standard()
10911 rc = power_down_vsb(demod, false); in ctrl_set_standard()
10938 rc = drxj_dap_read_reg16(demod->my_i2c_dev_addr, SCU_RAM_VERSION_HI__A, &dummy, 0); in ctrl_set_standard()
10947 rc = set_vsb_leak_n_gain(demod); in ctrl_set_standard()
11040 ctrl_power_mode(struct drx_demod_instance *demod, enum drx_power_mode *mode) in ctrl_power_mode() argument
11048 common_attr = (struct drx_common_attr *) demod->my_common_attr; in ctrl_power_mode()
11049 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_power_mode()
11050 dev_addr = demod->my_i2c_dev_addr; in ctrl_power_mode()
11082 rc = power_up_device(demod); in ctrl_power_mode()
11110 rc = power_down_qam(demod, true); in ctrl_power_mode()
11117 rc = power_down_vsb(demod, true); in ctrl_power_mode()
11130 rc = power_down_atv(demod, ext_attr->standard, true); in ctrl_power_mode()
11160 rc = init_hi(demod); in ctrl_power_mode()
11167 rc = hi_cfg_command(demod); in ctrl_power_mode()
11198 ctrl_set_cfg_pre_saw(struct drx_demod_instance *demod, struct drxj_cfg_pre_saw *pre_saw) in ctrl_set_cfg_pre_saw() argument
11204 dev_addr = demod->my_i2c_dev_addr; in ctrl_set_cfg_pre_saw()
11205 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_cfg_pre_saw()
11261 ctrl_set_cfg_afe_gain(struct drx_demod_instance *demod, struct drxj_cfg_afe_gain *afe_gain) in ctrl_set_cfg_afe_gain() argument
11272 dev_addr = demod->my_i2c_dev_addr; in ctrl_set_cfg_afe_gain()
11273 ext_attr = (struct drxj_data *) demod->my_ext_attr; in ctrl_set_cfg_afe_gain()
11334 static int drx_ctrl_u_code(struct drx_demod_instance *demod,
11337 static int drxj_set_lna_state(struct drx_demod_instance *demod, bool state);
11350 static int drxj_open(struct drx_demod_instance *demod) in drxj_open() argument
11361 if ((demod == NULL) || in drxj_open()
11362 (demod->my_common_attr == NULL) || in drxj_open()
11363 (demod->my_ext_attr == NULL) || in drxj_open()
11364 (demod->my_i2c_dev_addr == NULL) || in drxj_open()
11365 (demod->my_common_attr->is_opened)) { in drxj_open()
11370 if (demod->my_ext_attr == NULL) in drxj_open()
11373 dev_addr = demod->my_i2c_dev_addr; in drxj_open()
11374 ext_attr = (struct drxj_data *) demod->my_ext_attr; in drxj_open()
11375 common_attr = (struct drx_common_attr *) demod->my_common_attr; in drxj_open()
11377 rc = ctrl_power_mode(demod, &power_mode); in drxj_open()
11389 rc = get_device_capabilities(demod); in drxj_open()
11423 rc = set_iqm_af(demod, false); in drxj_open()
11428 rc = set_orx_nsu_aox(demod, false); in drxj_open()
11434 rc = init_hi(demod); in drxj_open()
11444 rc = ctrl_set_cfg_mpeg_output(demod, &cfg_mpeg_output); in drxj_open()
11450 rc = power_down_aud(demod); in drxj_open()
11469 if (DRX_ISPOWERDOWNMODE(demod->my_common_attr->current_power_mode)) { in drxj_open()
11474 rc = drx_ctrl_u_code(demod, &ucode_info, UCODE_UPLOAD); in drxj_open()
11480 rc = drx_ctrl_u_code(demod, &ucode_info, UCODE_VERIFY); in drxj_open()
11504 rc = smart_ant_init(demod); in drxj_open()
11540 rc = ctrl_set_oob(demod, NULL); in drxj_open()
11549 demod->my_common_attr->is_opened = true; in drxj_open()
11550 drxj_set_lna_state(demod, false); in drxj_open()
11564 static int drxj_close(struct drx_demod_instance *demod) in drxj_close() argument
11566 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in drxj_close()
11570 if ((demod->my_common_attr == NULL) || in drxj_close()
11571 (demod->my_ext_attr == NULL) || in drxj_close()
11572 (demod->my_i2c_dev_addr == NULL) || in drxj_close()
11573 (!demod->my_common_attr->is_opened)) { in drxj_close()
11578 rc = ctrl_power_mode(demod, &power_mode); in drxj_close()
11590 rc = ctrl_power_mode(demod, &power_mode); in drxj_close()
11596 DRX_ATTR_ISOPENED(demod) = false; in drxj_close()
11600 DRX_ATTR_ISOPENED(demod) = false; in drxj_close()
11644 static int drx_check_firmware(struct drx_demod_instance *demod, u8 *mc_data, in drx_check_firmware() argument
11659 DRX_ATTR_MCRECORD(demod).aux_type = 0; in drx_check_firmware()
11660 DRX_ATTR_MCRECORD(demod).mc_dev_type = 0; in drx_check_firmware()
11661 DRX_ATTR_MCRECORD(demod).mc_version = 0; in drx_check_firmware()
11662 DRX_ATTR_MCRECORD(demod).mc_base_version = 0; in drx_check_firmware()
11703 DRX_ATTR_MCRECORD(demod).aux_type = auxtype; in drx_check_firmware()
11704 DRX_ATTR_MCRECORD(demod).mc_dev_type = mc_dev_type; in drx_check_firmware()
11705 DRX_ATTR_MCRECORD(demod).mc_version = mc_version; in drx_check_firmware()
11706 DRX_ATTR_MCRECORD(demod).mc_base_version = mc_base_version; in drx_check_firmware()
11742 static int drx_ctrl_u_code(struct drx_demod_instance *demod, in drx_ctrl_u_code() argument
11746 struct i2c_device_addr *dev_addr = demod->my_i2c_dev_addr; in drx_ctrl_u_code()
11762 if (!demod->firmware) { in drx_ctrl_u_code()
11765 rc = request_firmware(&fw, mc_file, demod->i2c->dev.parent); in drx_ctrl_u_code()
11770 demod->firmware = fw; in drx_ctrl_u_code()
11772 if (demod->firmware->size < 2 * sizeof(u16)) { in drx_ctrl_u_code()
11779 mc_file, demod->firmware->size); in drx_ctrl_u_code()
11782 mc_data_init = demod->firmware->data; in drx_ctrl_u_code()
11783 size = demod->firmware->size; in drx_ctrl_u_code()
11799 rc = drx_check_firmware(demod, (u8 *)mc_data_init, size); in drx_ctrl_u_code()
11908 release_firmware(demod->firmware); in drx_ctrl_u_code()
11909 demod->firmware = NULL; in drx_ctrl_u_code()
11915 static int drxj_set_lna_state(struct drx_demod_instance *demod, bool state) in drxj_set_lna_state() argument
11924 result = ctrl_set_uio_cfg(demod, &uio_cfg); in drxj_set_lna_state()
11932 result = ctrl_uio_write(demod, &uio_data); in drxj_set_lna_state()
11950 struct drx_demod_instance *demod = state->demod; in drx39xxj_set_powerstate() local
11959 result = ctrl_power_mode(demod, &power_mode); in drx39xxj_set_powerstate()
11971 struct drx_demod_instance *demod = state->demod; in drx39xxj_read_status() local
11977 result = ctrl_lock_status(demod, &lock_status); in drx39xxj_read_status()
12011 ctrl_sig_quality(demod, lock_status); in drx39xxj_read_status()
12087 struct drx_demod_instance *demod = state->demod; in drx39xxj_set_frontend() local
12125 demod->my_common_attr->intermediate_freq = int_freq / 1000; in drx39xxj_set_frontend()
12155 result = ctrl_set_standard(demod, &standard); in drx39xxj_set_frontend()
12169 result = ctrl_set_channel(demod, &channel); in drx39xxj_set_frontend()
12175 drxj_set_lna_state(demod, false); in drx39xxj_set_frontend()
12192 struct drx_demod_instance *demod = state->demod; in drx39xxj_i2c_gate_ctrl() local
12211 result = ctrl_i2c_bridge(demod, &i2c_gate_state); in drx39xxj_i2c_gate_ctrl()
12225 struct drx_demod_instance *demod = state->demod; in drx39xxj_init() local
12230 demod->my_common_attr->is_opened = false; in drx39xxj_init()
12231 rc = drxj_open(demod); in drx39xxj_init()
12244 struct drx_demod_instance *demod = state->demod; in drx39xxj_set_lna() local
12245 struct drxj_data *ext_attr = demod->my_ext_attr; in drx39xxj_set_lna()
12255 return drxj_set_lna_state(demod, c->lna); in drx39xxj_set_lna()
12268 struct drx_demod_instance *demod = state->demod; in drx39xxj_release() local
12272 drxj_close(demod); in drx39xxj_release()
12274 kfree(demod->my_ext_attr); in drx39xxj_release()
12275 kfree(demod->my_common_attr); in drx39xxj_release()
12276 kfree(demod->my_i2c_dev_addr); in drx39xxj_release()
12277 release_firmware(demod->firmware); in drx39xxj_release()
12278 kfree(demod); in drx39xxj_release()
12290 struct drx_demod_instance *demod = NULL; in drx39xxj_attach() local
12299 demod = kmemdup(&drxj_default_demod_g, in drx39xxj_attach()
12301 if (demod == NULL) in drx39xxj_attach()
12321 state->demod = demod; in drx39xxj_attach()
12324 demod->my_i2c_dev_addr = demod_addr; in drx39xxj_attach()
12325 demod->my_common_attr = demod_comm_attr; in drx39xxj_attach()
12326 demod->my_i2c_dev_addr->user_data = state; in drx39xxj_attach()
12327 demod->my_common_attr->microcode_file = DRX39XX_MAIN_FIRMWARE; in drx39xxj_attach()
12328 demod->my_common_attr->verify_microcode = true; in drx39xxj_attach()
12329 demod->my_common_attr->intermediate_freq = 5000; in drx39xxj_attach()
12330 demod->my_common_attr->current_power_mode = DRX_POWER_DOWN; in drx39xxj_attach()
12331 demod->my_ext_attr = demod_ext_attr; in drx39xxj_attach()
12333 demod->i2c = i2c; in drx39xxj_attach()
12335 result = drxj_open(demod); in drx39xxj_attach()
12373 kfree(demod); in drx39xxj_attach()