Lines Matching refs:fdtv

234 static int avc_write(struct firedtv *fdtv)  in avc_write()  argument
238 fdtv->avc_reply_received = false; in avc_write()
242 debug_fcp(fdtv->avc_data, fdtv->avc_data_length); in avc_write()
244 err = fdtv_write(fdtv, FCP_COMMAND_REGISTER, in avc_write()
245 fdtv->avc_data, fdtv->avc_data_length); in avc_write()
247 dev_err(fdtv->device, "FCP command write failed\n"); in avc_write()
256 if (wait_event_timeout(fdtv->avc_wait, in avc_write()
257 fdtv->avc_reply_received, in avc_write()
261 dev_err(fdtv->device, "FCP response timed out\n"); in avc_write()
275 int avc_recv(struct firedtv *fdtv, void *data, size_t length) in avc_recv() argument
285 fdtv_handle_rc(fdtv, r->operand[4] << 8 | r->operand[5]); in avc_recv()
286 schedule_work(&fdtv->remote_ctrl_work); in avc_recv()
289 if (is_register_rc((void *)fdtv->avc_data)) in avc_recv()
293 dev_info(fdtv->device, in avc_recv()
299 if (fdtv->avc_reply_received) { in avc_recv()
300 dev_err(fdtv->device, "out-of-order AVC response, ignored\n"); in avc_recv()
304 memcpy(fdtv->avc_data, data, length); in avc_recv()
305 fdtv->avc_data_length = length; in avc_recv()
307 fdtv->avc_reply_received = true; in avc_recv()
308 wake_up(&fdtv->avc_wait); in avc_recv()
313 static int add_pid_filter(struct firedtv *fdtv, u8 *operand) in add_pid_filter() argument
318 if (test_bit(i, &fdtv->channel_active)) { in add_pid_filter()
321 operand[pos++] = (fdtv->channel_pid[i] >> 8) & 0x1f; in add_pid_filter()
322 operand[pos++] = fdtv->channel_pid[i] & 0xff; in add_pid_filter()
337 static int avc_tuner_tuneqpsk(struct firedtv *fdtv, in avc_tuner_tuneqpsk() argument
340 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_tuneqpsk()
347 if (fdtv->type == FIREDTV_DVB_S2) in avc_tuner_tuneqpsk()
372 if (fdtv->voltage == 0xff) in avc_tuner_tuneqpsk()
374 else if (fdtv->voltage == SEC_VOLTAGE_18) /* polarisation */ in avc_tuner_tuneqpsk()
379 if (fdtv->tone == 0xff) in avc_tuner_tuneqpsk()
381 else if (fdtv->tone == SEC_TONE_ON) /* band */ in avc_tuner_tuneqpsk()
386 if (fdtv->type == FIREDTV_DVB_S2) { in avc_tuner_tuneqpsk()
387 if (fdtv->fe.dtv_property_cache.delivery_system == SYS_DVBS2) { in avc_tuner_tuneqpsk()
388 switch (fdtv->fe.dtv_property_cache.modulation) { in avc_tuner_tuneqpsk()
394 switch (fdtv->fe.dtv_property_cache.rolloff) { in avc_tuner_tuneqpsk()
402 switch (fdtv->fe.dtv_property_cache.pilot) { in avc_tuner_tuneqpsk()
418 static int avc_tuner_dsd_dvb_c(struct firedtv *fdtv, in avc_tuner_dsd_dvb_c() argument
421 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_dsd_dvb_c()
483 return 22 + add_pid_filter(fdtv, &c->operand[22]); in avc_tuner_dsd_dvb_c()
486 static int avc_tuner_dsd_dvb_t(struct firedtv *fdtv, in avc_tuner_dsd_dvb_t() argument
489 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_dsd_dvb_t()
584 return 17 + add_pid_filter(fdtv, &c->operand[17]); in avc_tuner_dsd_dvb_t()
587 int avc_tuner_dsd(struct firedtv *fdtv, in avc_tuner_dsd() argument
590 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_dsd()
593 mutex_lock(&fdtv->avc_mutex); in avc_tuner_dsd()
596 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_tuner_dsd()
598 switch (fdtv->type) { in avc_tuner_dsd()
600 case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fdtv, p); break; in avc_tuner_dsd()
601 case FIREDTV_DVB_C: pos = avc_tuner_dsd_dvb_c(fdtv, p); break; in avc_tuner_dsd()
602 case FIREDTV_DVB_T: pos = avc_tuner_dsd_dvb_t(fdtv, p); break; in avc_tuner_dsd()
608 fdtv->avc_data_length = ALIGN(3 + pos, 4); in avc_tuner_dsd()
609 ret = avc_write(fdtv); in avc_tuner_dsd()
619 mutex_unlock(&fdtv->avc_mutex); in avc_tuner_dsd()
627 int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[]) in avc_tuner_set_pids() argument
629 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_set_pids()
635 mutex_lock(&fdtv->avc_mutex); in avc_tuner_set_pids()
638 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_tuner_set_pids()
660 fdtv->avc_data_length = ALIGN(3 + pos, 4); in avc_tuner_set_pids()
661 ret = avc_write(fdtv); in avc_tuner_set_pids()
665 mutex_unlock(&fdtv->avc_mutex); in avc_tuner_set_pids()
673 int avc_tuner_get_ts(struct firedtv *fdtv) in avc_tuner_get_ts() argument
675 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_get_ts()
678 mutex_lock(&fdtv->avc_mutex); in avc_tuner_get_ts()
681 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_tuner_get_ts()
684 sl = fdtv->type == FIREDTV_DVB_T ? 0x0c : 0x11; in avc_tuner_get_ts()
700 fdtv->avc_data_length = fdtv->type == FIREDTV_DVB_T ? 24 : 28; in avc_tuner_get_ts()
701 ret = avc_write(fdtv); in avc_tuner_get_ts()
705 mutex_unlock(&fdtv->avc_mutex); in avc_tuner_get_ts()
713 int avc_identify_subunit(struct firedtv *fdtv) in avc_identify_subunit() argument
715 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_identify_subunit()
716 struct avc_response_frame *r = (void *)fdtv->avc_data; in avc_identify_subunit()
719 mutex_lock(&fdtv->avc_mutex); in avc_identify_subunit()
722 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_identify_subunit()
734 fdtv->avc_data_length = 12; in avc_identify_subunit()
735 ret = avc_write(fdtv); in avc_identify_subunit()
742 dev_err(fdtv->device, "cannot read subunit identifier\n"); in avc_identify_subunit()
746 mutex_unlock(&fdtv->avc_mutex); in avc_identify_subunit()
753 int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat) in avc_tuner_status() argument
755 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_status()
756 struct avc_response_frame *r = (void *)fdtv->avc_data; in avc_tuner_status()
759 mutex_lock(&fdtv->avc_mutex); in avc_tuner_status()
762 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_tuner_status()
774 fdtv->avc_data_length = 12; in avc_tuner_status()
775 ret = avc_write(fdtv); in avc_tuner_status()
781 dev_err(fdtv->device, "cannot read tuner status\n"); in avc_tuner_status()
788 dev_err(fdtv->device, "got invalid tuner status\n"); in avc_tuner_status()
827 mutex_unlock(&fdtv->avc_mutex); in avc_tuner_status()
832 int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst, in avc_lnb_control() argument
836 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_lnb_control()
837 struct avc_response_frame *r = (void *)fdtv->avc_data; in avc_lnb_control()
840 mutex_lock(&fdtv->avc_mutex); in avc_lnb_control()
843 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_lnb_control()
864 fdtv->avc_data_length = ALIGN(3 + pos, 4); in avc_lnb_control()
865 ret = avc_write(fdtv); in avc_lnb_control()
870 dev_err(fdtv->device, "LNB control failed\n"); in avc_lnb_control()
874 mutex_unlock(&fdtv->avc_mutex); in avc_lnb_control()
879 int avc_register_remote_control(struct firedtv *fdtv) in avc_register_remote_control() argument
881 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_register_remote_control()
884 mutex_lock(&fdtv->avc_mutex); in avc_register_remote_control()
896 fdtv->avc_data_length = 8; in avc_register_remote_control()
897 ret = avc_write(fdtv); in avc_register_remote_control()
901 mutex_unlock(&fdtv->avc_mutex); in avc_register_remote_control()
908 struct firedtv *fdtv = in avc_remote_ctrl_work() local
912 avc_register_remote_control(fdtv); in avc_remote_ctrl_work()
916 int avc_tuner_host2ca(struct firedtv *fdtv)
918 struct avc_command_frame *c = (void *)fdtv->avc_data;
921 mutex_lock(&fdtv->avc_mutex);
924 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
935 fdtv->avc_data_length = 12;
936 ret = avc_write(fdtv);
940 mutex_unlock(&fdtv->avc_mutex);
971 int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len) in avc_ca_app_info() argument
973 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_app_info()
974 struct avc_response_frame *r = (void *)fdtv->avc_data; in avc_ca_app_info()
977 mutex_lock(&fdtv->avc_mutex); in avc_ca_app_info()
980 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_app_info()
991 fdtv->avc_data_length = 12; in avc_ca_app_info()
992 ret = avc_write(fdtv); in avc_ca_app_info()
1007 mutex_unlock(&fdtv->avc_mutex); in avc_ca_app_info()
1012 int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len) in avc_ca_info() argument
1014 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_info()
1015 struct avc_response_frame *r = (void *)fdtv->avc_data; in avc_ca_info()
1018 mutex_lock(&fdtv->avc_mutex); in avc_ca_info()
1021 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_info()
1032 fdtv->avc_data_length = 12; in avc_ca_info()
1033 ret = avc_write(fdtv); in avc_ca_info()
1057 mutex_unlock(&fdtv->avc_mutex); in avc_ca_info()
1062 int avc_ca_reset(struct firedtv *fdtv) in avc_ca_reset() argument
1064 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_reset()
1067 mutex_lock(&fdtv->avc_mutex); in avc_ca_reset()
1070 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_reset()
1083 fdtv->avc_data_length = 12; in avc_ca_reset()
1084 ret = avc_write(fdtv); in avc_ca_reset()
1088 mutex_unlock(&fdtv->avc_mutex); in avc_ca_reset()
1093 int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length) in avc_ca_pmt() argument
1095 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_pmt()
1096 struct avc_response_frame *r = (void *)fdtv->avc_data; in avc_ca_pmt()
1109 mutex_lock(&fdtv->avc_mutex); in avc_ca_pmt()
1112 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_pmt()
1116 dev_info(fdtv->device, "forcing list_management to ONLY\n"); in avc_ca_pmt()
1158 dev_err(fdtv->device, in avc_ca_pmt()
1184 dev_err(fdtv->device, "invalid pmt_cmd_id %d " in avc_ca_pmt()
1213 fdtv->avc_data_length = ALIGN(3 + write_pos, 4); in avc_ca_pmt()
1214 ret = avc_write(fdtv); in avc_ca_pmt()
1219 dev_err(fdtv->device, in avc_ca_pmt()
1224 mutex_unlock(&fdtv->avc_mutex); in avc_ca_pmt()
1229 int avc_ca_get_time_date(struct firedtv *fdtv, int *interval) in avc_ca_get_time_date() argument
1231 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_get_time_date()
1232 struct avc_response_frame *r = (void *)fdtv->avc_data; in avc_ca_get_time_date()
1235 mutex_lock(&fdtv->avc_mutex); in avc_ca_get_time_date()
1238 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_get_time_date()
1249 fdtv->avc_data_length = 12; in avc_ca_get_time_date()
1250 ret = avc_write(fdtv); in avc_ca_get_time_date()
1258 mutex_unlock(&fdtv->avc_mutex); in avc_ca_get_time_date()
1263 int avc_ca_enter_menu(struct firedtv *fdtv) in avc_ca_enter_menu() argument
1265 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_enter_menu()
1268 mutex_lock(&fdtv->avc_mutex); in avc_ca_enter_menu()
1271 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_enter_menu()
1282 fdtv->avc_data_length = 12; in avc_ca_enter_menu()
1283 ret = avc_write(fdtv); in avc_ca_enter_menu()
1287 mutex_unlock(&fdtv->avc_mutex); in avc_ca_enter_menu()
1292 int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len) in avc_ca_get_mmi() argument
1294 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_get_mmi()
1295 struct avc_response_frame *r = (void *)fdtv->avc_data; in avc_ca_get_mmi()
1298 mutex_lock(&fdtv->avc_mutex); in avc_ca_get_mmi()
1301 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_get_mmi()
1312 fdtv->avc_data_length = 12; in avc_ca_get_mmi()
1313 ret = avc_write(fdtv); in avc_ca_get_mmi()
1322 mutex_unlock(&fdtv->avc_mutex); in avc_ca_get_mmi()
1329 static int cmp_read(struct firedtv *fdtv, u64 addr, __be32 *data) in cmp_read() argument
1333 ret = fdtv_read(fdtv, addr, data); in cmp_read()
1335 dev_err(fdtv->device, "CMP: read I/O error\n"); in cmp_read()
1340 static int cmp_lock(struct firedtv *fdtv, u64 addr, __be32 data[]) in cmp_lock() argument
1344 ret = fdtv_lock(fdtv, addr, data); in cmp_lock()
1346 dev_err(fdtv->device, "CMP: lock I/O error\n"); in cmp_lock()
1371 int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel) in cmp_establish_pp_connection() argument
1378 ret = cmp_read(fdtv, opcr_address, opcr); in cmp_establish_pp_connection()
1384 dev_err(fdtv->device, "CMP: output offline\n"); in cmp_establish_pp_connection()
1392 dev_err(fdtv->device, "CMP: cannot change channel\n"); in cmp_establish_pp_connection()
1395 dev_info(fdtv->device, "CMP: overlaying connection\n"); in cmp_establish_pp_connection()
1413 ret = cmp_lock(fdtv, opcr_address, opcr); in cmp_establish_pp_connection()
1431 void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel) in cmp_break_pp_connection() argument
1437 if (cmp_read(fdtv, opcr_address, opcr) < 0) in cmp_break_pp_connection()
1443 dev_err(fdtv->device, "CMP: no connection to break\n"); in cmp_break_pp_connection()
1453 if (cmp_lock(fdtv, opcr_address, opcr) < 0) in cmp_break_pp_connection()