static INT32 as_select_nim(S_NODE *snode) { INT32 res = SUCCESS; UINT8 nim_id = 0; //0 or 1 if(snode->tuner1_valid == 1) { nim_id = 0; tsi_select(TSI_DMX_0, ts_route_get_nim_tsiid(nim_id)); as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); } else if(snode->tuner2_valid == 1) { nim_id = 1; tsi_select(TSI_DMX_0, ts_route_get_nim_tsiid(nim_id)); as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); } else { nim_id = 0; as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); return res; } return res; }
static int SetSPISSISelect(unsigned int argc, unsigned char * argv[]) { extern UINT32 nim_s3501_set_ts_output_mode(struct nim_device *dev,UINT32 ts_output_mode); struct dmx_device *dmx_dev = dev_get_by_id(HLD_DEV_TYPE_DMX, nim_id); if (argc != 2) { SH_PRINTF("Usage: SetPara <nim_id> \n"); return -1; } if(strcasecmp("SSI",argv[1])) { //nim_id = 0; nim_s3501_set_ts_output_mode(dmx_dev,1); *((volatile UINT32 *)0xb8000088) = *((volatile UINT32 *)0xb8000088)& (~(0x40000000)); osal_task_sleep(10); tsi_select(TSI_DMX_0, TSI_SSI_0); tsi_select(TSI_DMX_1, TSI_SSI_0); } else { //nim_id = 1; nim_s3501_set_ts_output_mode(dmx_dev,0); *((volatile UINT32 *)0xb8000088) = *((volatile UINT32 *)0xb8000088)& (~(0x60000000)); osal_task_sleep(10); tsi_select(TSI_DMX_0, TSI_SPI_1); tsi_select(TSI_DMX_1, TSI_SPI_1); } //SH_PRINTF("%s ",argv[1]); LIB_ASH_OC('O'); LIB_ASH_OC('K'); LIB_ASH_OC('\r'); LIB_ASH_OC('\n'); }
//for tuner to select the nim device static INT32 as_select_nim(S_NODE *snode) { INT32 res = SUCCESS; UINT8 nim_id = 0; if(2 > dev_get_device_cnt(HLD_DEV_TYPE_NIM, FRONTEND_TYPE_S)) { nim_id = 0; tsi_select(TSI_DMX_0, ts_route_get_nim_tsiid(nim_id)); as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); return res; } #ifndef SUPPORT_SELECT_SAME_SAT if(snode->tuner1_valid == 1) #else if(snode->reserve_1 == 0) #endif { nim_id = 0; tsi_select(TSI_DMX_0, ts_route_get_nim_tsiid(nim_id)); as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); } #ifndef SUPPORT_SELECT_SAME_SAT else if(snode->tuner2_valid == 1) #else else if(snode->reserve_1 == 1) #endif { nim_id = 1; tsi_select(TSI_DMX_0, ts_route_get_nim_tsiid(nim_id)); as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); } else { res = ERR_FAILUE; } return res; }
//for tuner to select the nim device static INT32 as_select_nim(S_NODE *snode) { INT32 res = SUCCESS; if(2 > lib_nimng_get_lnb_ns()) { #ifdef SYS_TS_INPUT_INTERFACE tsi_select(TSI_DMX_0, SYS_TS_INPUT_INTERFACE); #else tsi_select(TSI_DMX_0, TSI_SPI_0); #endif as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, 0); return res; } if(snode->tuner1_valid == 1) { #ifdef SYS_TS_INPUT_INTERFACE tsi_select(TSI_DMX_0, SYS_TS_INPUT_INTERFACE); #else tsi_select(TSI_DMX_0, TSI_SPI_0); #endif as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, 0); } else if(snode->tuner2_valid == 1) { //modified for 29e tuner2 ts select #if (SYS_CHIP_MODULE == ALI_M3329E) tsi_select(TSI_DMX_0, TSI_SSI_0); #else #ifdef SYS_TS_INPUT_INTERFACE tsi_select(TSI_DMX_0, SYS_TS_INPUT_INTERFACE); #else tsi_select(TSI_DMX_0, TSI_SPI_1); #endif #endif as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, 1); } else { res = ERR_FAILUE; } return res; }
void win_otaset_turn_frntend(void) { UINT8 back_saved; S_NODE s_node; T_NODE t_node; win_otaset_get_FreqSymbPid_display(); cur_tuner_idx = OTA_TUNER_IDX; #ifdef _BUILD_OTA_E_ MEMCPY(&s_node, &m_ota_cfg.s_node, sizeof(s_node)); #else get_tuner_sat(OTA_TUNER_IDX, ota_satpos, &s_node); MEMCPY(&m_ota_cfg.s_node, &s_node, sizeof(s_node)); t_node.frq = ota_freq; t_node.sym = ota_symb; t_node.pol = ota_pol; MEMCPY(&m_ota_cfg.t_node, &t_node, sizeof(t_node)); #endif #ifndef NEW_DEMO_FRAME struct xpond_antenna_info xai; sat2antenna_ext(&s_node, &xai.antenna,OTA_TUNER_IDX); xai.xpond.frq = ota_freq; xai.xpond.sym = ota_symb; xai.xpond.pol = ota_pol; UIChChgSetAntennaXpond(&xai); #else struct ft_antenna antenna; union ft_xpond xponder; struct nim_device *nim = NULL; #ifdef SUPPORT_SELECT_SAME_SAT cur_tuner_idx =s_node.reserve_1; //s_node.tuner1_valid ? 0 : 1; #else cur_tuner_idx = s_node.tuner1_valid ? 0 : 1; #endif MEMSET(&antenna, 0, sizeof(struct ft_antenna)); MEMSET(&xponder, 0, sizeof(union ft_xpond)); sat2antenna(&s_node, &antenna); xponder.s_info.type = FRONTEND_TYPE_S; xponder.s_info.frq = ota_freq; xponder.s_info.sym = ota_symb; xponder.s_info.pol = ota_pol; #ifdef SUPPORT_SELECT_SAME_SAT nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, ((s_node.reserve_1 == 0)? 0 : ((s_node.reserve_1 == 1) ? 1 : 0))); #else nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, (s_node.tuner1_valid ? 0 : (s_node.tuner2_valid ? 1 : 0))); #endif frontend_tuning(nim, &antenna, &xponder, 1); if(0 == cur_tuner_idx) //TUNER1 <--> TSI_TS_A <--> DMX0 { tsi_dmx_src_select(TSI_DMX_0,TSI_TS_A); tsi_select(TSI_TS_A,TSI_SPI_0); } else//TUNER2 <--> TSI_TS_B <--> DMX0 { tsi_dmx_src_select(TSI_DMX_0,TSI_TS_B); tsi_select(TSI_TS_B, TSI_SPI_1); } #endif wincom_dish_move_popup_open(ota_presat_id,s_node.sat_id,cur_tuner_idx,&back_saved); ota_presat_id = s_node.sat_id;