Lines Matching refs:fdtv

230 static int avc_write(struct firedtv *fdtv)
234 fdtv->avc_reply_received = false;
238 debug_fcp(fdtv->avc_data, fdtv->avc_data_length);
240 err = fdtv_write(fdtv, FCP_COMMAND_REGISTER,
241 fdtv->avc_data, fdtv->avc_data_length);
243 dev_err(fdtv->device, "FCP command write failed\n");
252 if (wait_event_timeout(fdtv->avc_wait,
253 fdtv->avc_reply_received,
257 dev_err(fdtv->device, "FCP response timed out\n");
271 int avc_recv(struct firedtv *fdtv, void *data, size_t length)
281 fdtv_handle_rc(fdtv, r->operand[4] << 8 | r->operand[5]);
282 schedule_work(&fdtv->remote_ctrl_work);
285 if (is_register_rc((void *)fdtv->avc_data))
289 dev_info(fdtv->device,
295 if (fdtv->avc_reply_received) {
296 dev_err(fdtv->device, "out-of-order AVC response, ignored\n");
300 memcpy(fdtv->avc_data, data, length);
301 fdtv->avc_data_length = length;
303 fdtv->avc_reply_received = true;
304 wake_up(&fdtv->avc_wait);
309 static int add_pid_filter(struct firedtv *fdtv, u8 *operand)
314 if (test_bit(i, &fdtv->channel_active)) {
317 operand[pos++] = (fdtv->channel_pid[i] >> 8) & 0x1f;
318 operand[pos++] = fdtv->channel_pid[i] & 0xff;
333 static int avc_tuner_tuneqpsk(struct firedtv *fdtv,
336 struct avc_command_frame *c = (void *)fdtv->avc_data;
343 if (fdtv->type == FIREDTV_DVB_S2)
368 if (fdtv->voltage == 0xff)
370 else if (fdtv->voltage == SEC_VOLTAGE_18) /* polarisation */
375 if (fdtv->tone == 0xff)
377 else if (fdtv->tone == SEC_TONE_ON) /* band */
382 if (fdtv->type == FIREDTV_DVB_S2) {
383 if (fdtv->fe.dtv_property_cache.delivery_system == SYS_DVBS2) {
384 switch (fdtv->fe.dtv_property_cache.modulation) {
390 switch (fdtv->fe.dtv_property_cache.rolloff) {
398 switch (fdtv->fe.dtv_property_cache.pilot) {
414 static int avc_tuner_dsd_dvb_c(struct firedtv *fdtv,
417 struct avc_command_frame *c = (void *)fdtv->avc_data;
479 return 22 + add_pid_filter(fdtv, &c->operand[22]);
482 static int avc_tuner_dsd_dvb_t(struct firedtv *fdtv,
485 struct avc_command_frame *c = (void *)fdtv->avc_data;
580 return 17 + add_pid_filter(fdtv, &c->operand[17]);
583 int avc_tuner_dsd(struct firedtv *fdtv,
586 struct avc_command_frame *c = (void *)fdtv->avc_data;
589 mutex_lock(&fdtv->avc_mutex);
592 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
594 switch (fdtv->type) {
596 case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fdtv, p); break;
597 case FIREDTV_DVB_C: pos = avc_tuner_dsd_dvb_c(fdtv, p); break;
598 case FIREDTV_DVB_T: pos = avc_tuner_dsd_dvb_t(fdtv, p); break;
604 fdtv->avc_data_length = ALIGN(3 + pos, 4);
605 ret = avc_write(fdtv);
615 mutex_unlock(&fdtv->avc_mutex);
623 int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[])
625 struct avc_command_frame *c = (void *)fdtv->avc_data;
631 mutex_lock(&fdtv->avc_mutex);
634 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
656 fdtv->avc_data_length = ALIGN(3 + pos, 4);
657 ret = avc_write(fdtv);
661 mutex_unlock(&fdtv->avc_mutex);
669 int avc_tuner_get_ts(struct firedtv *fdtv)
671 struct avc_command_frame *c = (void *)fdtv->avc_data;
674 mutex_lock(&fdtv->avc_mutex);
677 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
680 sl = fdtv->type == FIREDTV_DVB_T ? 0x0c : 0x11;
696 fdtv->avc_data_length = fdtv->type == FIREDTV_DVB_T ? 24 : 28;
697 ret = avc_write(fdtv);
701 mutex_unlock(&fdtv->avc_mutex);
709 int avc_identify_subunit(struct firedtv *fdtv)
711 struct avc_command_frame *c = (void *)fdtv->avc_data;
712 struct avc_response_frame *r = (void *)fdtv->avc_data;
715 mutex_lock(&fdtv->avc_mutex);
718 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
730 fdtv->avc_data_length = 12;
731 ret = avc_write(fdtv);
738 dev_err(fdtv->device, "cannot read subunit identifier\n");
742 mutex_unlock(&fdtv->avc_mutex);
749 int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat)
751 struct avc_command_frame *c = (void *)fdtv->avc_data;
752 struct avc_response_frame *r = (void *)fdtv->avc_data;
755 mutex_lock(&fdtv->avc_mutex);
758 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
770 fdtv->avc_data_length = 12;
771 ret = avc_write(fdtv);
777 dev_err(fdtv->device, "cannot read tuner status\n");
784 dev_err(fdtv->device, "got invalid tuner status\n");
823 mutex_unlock(&fdtv->avc_mutex);
828 int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
832 struct avc_command_frame *c = (void *)fdtv->avc_data;
833 struct avc_response_frame *r = (void *)fdtv->avc_data;
836 mutex_lock(&fdtv->avc_mutex);
839 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
860 fdtv->avc_data_length = ALIGN(3 + pos, 4);
861 ret = avc_write(fdtv);
866 dev_err(fdtv->device, "LNB control failed\n");
870 mutex_unlock(&fdtv->avc_mutex);
875 int avc_register_remote_control(struct firedtv *fdtv)
877 struct avc_command_frame *c = (void *)fdtv->avc_data;
880 mutex_lock(&fdtv->avc_mutex);
892 fdtv->avc_data_length = 8;
893 ret = avc_write(fdtv);
897 mutex_unlock(&fdtv->avc_mutex);
904 struct firedtv *fdtv =
908 avc_register_remote_control(fdtv);
912 int avc_tuner_host2ca(struct firedtv *fdtv)
914 struct avc_command_frame *c = (void *)fdtv->avc_data;
917 mutex_lock(&fdtv->avc_mutex);
920 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
931 fdtv->avc_data_length = 12;
932 ret = avc_write(fdtv);
936 mutex_unlock(&fdtv->avc_mutex);
967 int avc_ca_app_info(struct firedtv *fdtv, unsigned char *app_info,
970 struct avc_command_frame *c = (void *)fdtv->avc_data;
971 struct avc_response_frame *r = (void *)fdtv->avc_data;
974 mutex_lock(&fdtv->avc_mutex);
977 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
988 fdtv->avc_data_length = 12;
989 ret = avc_write(fdtv);
1004 mutex_unlock(&fdtv->avc_mutex);
1009 int avc_ca_info(struct firedtv *fdtv, unsigned char *app_info,
1012 struct avc_command_frame *c = (void *)fdtv->avc_data;
1013 struct avc_response_frame *r = (void *)fdtv->avc_data;
1016 mutex_lock(&fdtv->avc_mutex);
1019 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
1030 fdtv->avc_data_length = 12;
1031 ret = avc_write(fdtv);
1055 mutex_unlock(&fdtv->avc_mutex);
1060 int avc_ca_reset(struct firedtv *fdtv)
1062 struct avc_command_frame *c = (void *)fdtv->avc_data;
1065 mutex_lock(&fdtv->avc_mutex);
1068 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
1081 fdtv->avc_data_length = 12;
1082 ret = avc_write(fdtv);
1086 mutex_unlock(&fdtv->avc_mutex);
1091 int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length)
1093 struct avc_command_frame *c = (void *)fdtv->avc_data;
1094 struct avc_response_frame *r = (void *)fdtv->avc_data;
1107 mutex_lock(&fdtv->avc_mutex);
1110 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
1114 dev_info(fdtv->device, "forcing list_management to ONLY\n");
1156 dev_err(fdtv->device,
1190 dev_err(fdtv->device, "invalid pmt_cmd_id %d at stream level\n",
1219 fdtv->avc_data_length = ALIGN(3 + write_pos, 4);
1220 ret = avc_write(fdtv);
1225 dev_err(fdtv->device,
1230 mutex_unlock(&fdtv->avc_mutex);
1235 int avc_ca_get_time_date(struct firedtv *fdtv, int *interval)
1237 struct avc_command_frame *c = (void *)fdtv->avc_data;
1238 struct avc_response_frame *r = (void *)fdtv->avc_data;
1241 mutex_lock(&fdtv->avc_mutex);
1244 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
1255 fdtv->avc_data_length = 12;
1256 ret = avc_write(fdtv);
1264 mutex_unlock(&fdtv->avc_mutex);
1269 int avc_ca_enter_menu(struct firedtv *fdtv)
1271 struct avc_command_frame *c = (void *)fdtv->avc_data;
1274 mutex_lock(&fdtv->avc_mutex);
1277 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
1288 fdtv->avc_data_length = 12;
1289 ret = avc_write(fdtv);
1293 mutex_unlock(&fdtv->avc_mutex);
1298 int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len)
1300 struct avc_command_frame *c = (void *)fdtv->avc_data;
1301 struct avc_response_frame *r = (void *)fdtv->avc_data;
1304 mutex_lock(&fdtv->avc_mutex);
1307 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
1318 fdtv->avc_data_length = 12;
1319 ret = avc_write(fdtv);
1328 mutex_unlock(&fdtv->avc_mutex);
1335 static int cmp_read(struct firedtv *fdtv, u64 addr, __be32 *data)
1339 ret = fdtv_read(fdtv, addr, data);
1341 dev_err(fdtv->device, "CMP: read I/O error\n");
1346 static int cmp_lock(struct firedtv *fdtv, u64 addr, __be32 data[])
1350 ret = fdtv_lock(fdtv, addr, data);
1352 dev_err(fdtv->device, "CMP: lock I/O error\n");
1377 int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel)
1384 ret = cmp_read(fdtv, opcr_address, opcr);
1390 dev_err(fdtv->device, "CMP: output offline\n");
1398 dev_err(fdtv->device, "CMP: cannot change channel\n");
1401 dev_info(fdtv->device, "CMP: overlaying connection\n");
1419 ret = cmp_lock(fdtv, opcr_address, opcr);
1437 void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel)
1443 if (cmp_read(fdtv, opcr_address, opcr) < 0)
1449 dev_err(fdtv->device, "CMP: no connection to break\n");
1459 if (cmp_lock(fdtv, opcr_address, opcr) < 0)
1467 * fdtv->backend->dealloc_resources(fdtv, channel, bw);