Exemplo n.º 1
0
int BBM_LONG_WRITE(HANDLE hDevice, u16 addr, u32 data)
{
	int res;

	res = bbm_long_write(hDevice, addr, data);

	return res;
}
Exemplo n.º 2
0
fci_s32 bbm_com_long_write(HANDLE handle, fci_u16 addr, fci_u32 data)
{
    fci_s32 res;

    res = bbm_long_write(handle, addr, data);

    return res;
}
Exemplo n.º 3
0
s32 bbm_com_long_write(HANDLE handle, DEVICEID devid, u16 addr, u32 data)
{
	s32 res;

	res = bbm_long_write(handle, devid, addr, data);

	return res;
}
int bbm_com_long_write(HANDLE hDevice, u16 addr, u32 data)
{
    int res;

    res = bbm_long_write(hDevice, addr, data);

    return res;
}
s32 tuner_select(HANDLE handle, DEVICEID devid,
		enum PRODUCT_TYPE product, enum BROADCAST_TYPE broadcast)
{
	switch (product) {
	case FC8300_TUNER:
		tuner = &fc8300_tuner;
		tuner_addr = FC8300_TUNER_ADDR;
		broadcast_type = broadcast;
		break;
	}

	if (tuner == NULL)
	{
			print_log(0,"ERROR tuner == NULL\n");
		return BBM_E_TN_SELECT;
	}
	if (tuner->init(handle, devid, broadcast))
	{
			print_log(0,"tuner->init\n");
		return BBM_E_TN_INIT;
	}
	fc8300_set_broadcast_mode(handle, devid, broadcast);

#ifdef BBM_ES

	if (product == FC8300_TUNER) {
		u8 chip_ver = 0x00;
		tuner_i2c_read(handle, devid, 0xff, 1, &chip_ver, 1);

		if (chip_ver == 0xc0)
			return BBM_OK;

		bbm_byte_write(handle, DIV_MASTER, BBM_RESYNC_ENABLE, 0xcf);
		bbm_long_write(handle, DIV_BROADCAST, BBM_MEMORY_RWM0,
							0x05555555);
		bbm_byte_write(handle, DIV_BROADCAST, BBM_SFS_FTS_ERR_MAX_1SEG,
							0x08);
		bbm_byte_write(handle, DIV_BROADCAST, BBM_SFS_FTS_ERR_MAX_3SEG,
							0x08);
		bbm_byte_write(handle, DIV_BROADCAST, BBM_PGA_GAIN_MAX, 0x0c);
		bbm_byte_write(handle, DIV_BROADCAST, BBM_CSF_GAIN_MAX, 0x09);
		bbm_byte_write(handle, DIV_MASTER, BBM_FD_OUT_MODE, 0x03);
		bbm_byte_write(handle, DIV_MASTER, BBM_DIV_START_MODE, 0x17);
		bbm_byte_write(handle, DIV_BROADCAST,
					BBM_PSAT_ON_REF_1SEG_QPSK, 0x1a);
		bbm_byte_write(handle, DIV_BROADCAST,
					BBM_PSAT_ON_REF_1SEG_16QAM, 0x1b);

		switch (broadcast) {
		case ISDBT_1SEG:
		case ISDBTMM_1SEG:
		case ISDBTSB_1SEG:
		case ISDBT_CATV_1SEG:
		case ISDBTSB_3SEG:
			bbm_byte_write(handle, DIV_BROADCAST, BBM_SFS_MTH,
							0x32);
			break;
		case ISDBT_13SEG:
		case ISDBTMM_13SEG:
		case ISDBT_CATV_13SEG:
			bbm_byte_write(handle, DIV_BROADCAST, BBM_SFS_MTH,
							0x31);
			break;
		}

#if defined(BBM_2_DIVERSITY) || defined(BBM_4_DIVERSITY)
		bbm_byte_write(handle, DIV_MASTER, BBM_XTAL_OUTBUF_EN, 0x00);
		bbm_byte_write(handle, DIV_MASTER, BBM_XTAL_OUTBUF_GAIN, 0x03);
		bbm_word_write(handle, DIV_BROADCAST, BBM_FD_RD_LATENCY_1SEG,
								0x1840);
		bbm_byte_write(handle, DIV_BROADCAST, BBM_COMB_OFF, 0x80);
#else /* SINGLE */
		bbm_word_write(handle, DIV_BROADCAST, BBM_FD_RD_LATENCY_1SEG,
								0x0002);
#endif /* #if defined(BBM_2_DIVERSITY) || defined(BBM_4_DIVERSITY) */
	}
#endif /* #ifdef BBM_ES */

	return BBM_OK;
}
Exemplo n.º 6
0
static s32 fc8080_set_xtal(HANDLE handle)
{
	if (main_xtal_freq == 24576) {
		bbm_long_write(handle, BBM_NCO_OFFSET, 0x04000000);
		bbm_byte_write(handle, BBM_NCO_INV, 0x80);
		bbm_byte_write(handle, BBM_EZ_CONST, 0x80);
		bbm_byte_write(handle, BBM_CLK_MODE, 0x02);

		/* filter coefficient */
		bbm_byte_write(handle, BBM_COEF00, 0x02);
		bbm_byte_write(handle, BBM_COEF01, 0x0f);
		bbm_byte_write(handle, BBM_COEF02, 0x0d);
		bbm_byte_write(handle, BBM_COEF03, 0x00);
		bbm_byte_write(handle, BBM_COEF04, 0x04);
		bbm_byte_write(handle, BBM_COEF05, 0x03);
		bbm_byte_write(handle, BBM_COEF06, 0x1c);
		bbm_byte_write(handle, BBM_COEF07, 0x19);
		bbm_byte_write(handle, BBM_COEF08, 0x02);
		bbm_byte_write(handle, BBM_COEF09, 0x0c);
		bbm_byte_write(handle, BBM_COEF0A, 0x04);
		bbm_byte_write(handle, BBM_COEF0B, 0x30);
		bbm_byte_write(handle, BBM_COEF0C, 0xed);
		bbm_byte_write(handle, BBM_COEF0D, 0x13);
		bbm_byte_write(handle, BBM_COEF0E, 0x4f);
		bbm_byte_write(handle, BBM_COEF0F, 0x6b);
	} else if (main_xtal_freq == 16384) {
		/* clock mode */
		bbm_long_write(handle, BBM_NCO_OFFSET, 0x04000000);
		bbm_byte_write(handle, BBM_NCO_INV, 0x80);
		bbm_byte_write(handle, BBM_EZ_CONST, 0x80);
		bbm_byte_write(handle, BBM_CLK_MODE, 0x00);

		/* filter coefficient */
		bbm_byte_write(handle, BBM_COEF00, 0x02);
		bbm_byte_write(handle, BBM_COEF01, 0x0f);
		bbm_byte_write(handle, BBM_COEF02, 0x0d);
		bbm_byte_write(handle, BBM_COEF03, 0x00);
		bbm_byte_write(handle, BBM_COEF04, 0x04);
		bbm_byte_write(handle, BBM_COEF05, 0x03);
		bbm_byte_write(handle, BBM_COEF06, 0x1c);
		bbm_byte_write(handle, BBM_COEF07, 0x19);
		bbm_byte_write(handle, BBM_COEF08, 0x02);
		bbm_byte_write(handle, BBM_COEF09, 0x0c);
		bbm_byte_write(handle, BBM_COEF0A, 0x04);
		bbm_byte_write(handle, BBM_COEF0B, 0x30);
		bbm_byte_write(handle, BBM_COEF0C, 0xed);
		bbm_byte_write(handle, BBM_COEF0D, 0x13);
		bbm_byte_write(handle, BBM_COEF0E, 0x4f);
		bbm_byte_write(handle, BBM_COEF0F, 0x6b);
	} else if (main_xtal_freq == 19200) {
		bbm_long_write(handle, BBM_NCO_OFFSET, 0x0369d037);
		bbm_byte_write(handle, BBM_NCO_INV, 0x96);
		bbm_byte_write(handle, BBM_EZ_CONST, 0x6d);
		bbm_byte_write(handle, BBM_CLK_MODE, 0x00);

		/* filter coefficient */
		bbm_byte_write(handle, BBM_COEF00, 0x0e);
		bbm_byte_write(handle, BBM_COEF01, 0x00);
		bbm_byte_write(handle, BBM_COEF02, 0x03);
		bbm_byte_write(handle, BBM_COEF03, 0x03);
		bbm_byte_write(handle, BBM_COEF04, 0x1f);
		bbm_byte_write(handle, BBM_COEF05, 0x1a);
		bbm_byte_write(handle, BBM_COEF06, 0x1b);
		bbm_byte_write(handle, BBM_COEF07, 0x03);
		bbm_byte_write(handle, BBM_COEF08, 0x0a);
		bbm_byte_write(handle, BBM_COEF09, 0x05);
		bbm_byte_write(handle, BBM_COEF0A, 0x37);
		bbm_byte_write(handle, BBM_COEF0B, 0x2d);
		bbm_byte_write(handle, BBM_COEF0C, 0xfa);
		bbm_byte_write(handle, BBM_COEF0D, 0x1f);
		bbm_byte_write(handle, BBM_COEF0E, 0x49);
		bbm_byte_write(handle, BBM_COEF0F, 0x5c);
	} else if (main_xtal_freq == 24000) {
		bbm_long_write(handle, BBM_NCO_OFFSET, 0x02bb0cf8);
		bbm_byte_write(handle, BBM_NCO_INV, 0xbc);
		bbm_byte_write(handle, BBM_EZ_CONST, 0x57);
		bbm_byte_write(handle, BBM_CLK_MODE, 0x00);

		/* filter coefficient */
		bbm_byte_write(handle, BBM_COEF00, 0x02);
		bbm_byte_write(handle, BBM_COEF01, 0x02);
		bbm_byte_write(handle, BBM_COEF02, 0x00);
		bbm_byte_write(handle, BBM_COEF03, 0x0c);
		bbm_byte_write(handle, BBM_COEF04, 0x1c);
		bbm_byte_write(handle, BBM_COEF05, 0x1f);
		bbm_byte_write(handle, BBM_COEF06, 0x05);
		bbm_byte_write(handle, BBM_COEF07, 0x08);
		bbm_byte_write(handle, BBM_COEF08, 0x04);
		bbm_byte_write(handle, BBM_COEF09, 0x3a);
		bbm_byte_write(handle, BBM_COEF0A, 0x31);
		bbm_byte_write(handle, BBM_COEF0B, 0x34);
		bbm_byte_write(handle, BBM_COEF0C, 0x07);
		bbm_byte_write(handle, BBM_COEF0D, 0x26);
		bbm_byte_write(handle, BBM_COEF0E, 0x42);
		bbm_byte_write(handle, BBM_COEF0F, 0x4e);
	} else if (main_xtal_freq == 26000) {
		bbm_long_write(handle, BBM_NCO_OFFSET, 0x03c7ea98);
		bbm_byte_write(handle, BBM_NCO_INV, 0x87);
		bbm_byte_write(handle, BBM_EZ_CONST, 0x79);
		bbm_byte_write(handle, BBM_CLK_MODE, 0x02);

		/* filter coefficient */
		bbm_byte_write(handle, BBM_COEF00, 0x0f);
		bbm_byte_write(handle, BBM_COEF01, 0x0d);
		bbm_byte_write(handle, BBM_COEF02, 0x0f);
		bbm_byte_write(handle, BBM_COEF03, 0x03);
		bbm_byte_write(handle, BBM_COEF04, 0x04);
		bbm_byte_write(handle, BBM_COEF05, 0x1f);
		bbm_byte_write(handle, BBM_COEF06, 0x19);
		bbm_byte_write(handle, BBM_COEF07, 0x1c);
		bbm_byte_write(handle, BBM_COEF08, 0x07);
		bbm_byte_write(handle, BBM_COEF09, 0x0b);
		bbm_byte_write(handle, BBM_COEF0A, 0x3f);
		bbm_byte_write(handle, BBM_COEF0B, 0x2d);
		bbm_byte_write(handle, BBM_COEF0C, 0xf2);
		bbm_byte_write(handle, BBM_COEF0D, 0x19);
		bbm_byte_write(handle, BBM_COEF0E, 0x4d);
		bbm_byte_write(handle, BBM_COEF0F, 0x65);
	} else if  (main_xtal_freq == 27000) {
		bbm_long_write(handle, BBM_NCO_OFFSET, 0x03a4114b);
		bbm_byte_write(handle, BBM_NCO_INV, 0x8d);
		bbm_byte_write(handle, BBM_EZ_CONST, 0x75);
		bbm_byte_write(handle, BBM_CLK_MODE, 0x02);

		/* filter coefficient */
		bbm_byte_write(handle, BBM_COEF00, 0x0e);
		bbm_byte_write(handle, BBM_COEF01, 0x0e);
		bbm_byte_write(handle, BBM_COEF02, 0x01);
		bbm_byte_write(handle, BBM_COEF03, 0x04);
		bbm_byte_write(handle, BBM_COEF04, 0x03);
		bbm_byte_write(handle, BBM_COEF05, 0x1d);
		bbm_byte_write(handle, BBM_COEF06, 0x19);
		bbm_byte_write(handle, BBM_COEF07, 0x1f);
		bbm_byte_write(handle, BBM_COEF08, 0x09);
		bbm_byte_write(handle, BBM_COEF09, 0x09);
		bbm_byte_write(handle, BBM_COEF0A, 0x3b);
		bbm_byte_write(handle, BBM_COEF0B, 0x2d);
		bbm_byte_write(handle, BBM_COEF0C, 0xf5);
		bbm_byte_write(handle, BBM_COEF0D, 0x1c);
		bbm_byte_write(handle, BBM_COEF0E, 0x4b);
		bbm_byte_write(handle, BBM_COEF0F, 0x61);
	} else if (main_xtal_freq == 27120) {
		bbm_long_write(handle, BBM_NCO_OFFSET, 0x039ff180);
		bbm_byte_write(handle, BBM_NCO_INV, 0x8d);
		bbm_byte_write(handle, BBM_EZ_CONST, 0x74);
		bbm_byte_write(handle, BBM_CLK_MODE, 0x02);

		/* filter coefficient */
		bbm_byte_write(handle, BBM_COEF00, 0x0e);
		bbm_byte_write(handle, BBM_COEF01, 0x0e);
		bbm_byte_write(handle, BBM_COEF02, 0x01);
		bbm_byte_write(handle, BBM_COEF03, 0x04);
		bbm_byte_write(handle, BBM_COEF04, 0x03);
		bbm_byte_write(handle, BBM_COEF05, 0x1d);
		bbm_byte_write(handle, BBM_COEF06, 0x19);
		bbm_byte_write(handle, BBM_COEF07, 0x1f);
		bbm_byte_write(handle, BBM_COEF08, 0x09);
		bbm_byte_write(handle, BBM_COEF09, 0x09);
		bbm_byte_write(handle, BBM_COEF0A, 0x3b);
		bbm_byte_write(handle, BBM_COEF0B, 0x2d);
		bbm_byte_write(handle, BBM_COEF0C, 0xf5);
		bbm_byte_write(handle, BBM_COEF0D, 0x1c);
		bbm_byte_write(handle, BBM_COEF0E, 0x4b);
		bbm_byte_write(handle, BBM_COEF0F, 0x61);
	} else if (main_xtal_freq == 32000) {
		bbm_long_write(handle, BBM_NCO_OFFSET, 0x03126eb8);
		bbm_byte_write(handle, BBM_NCO_INV, 0xa7);
		bbm_byte_write(handle, BBM_EZ_CONST, 0x62);
		bbm_byte_write(handle, BBM_CLK_MODE, 0x02);

		/* filter coefficient */
		bbm_byte_write(handle, BBM_COEF00, 0x0e);
		bbm_byte_write(handle, BBM_COEF01, 0x0e);
		bbm_byte_write(handle, BBM_COEF02, 0x01);
		bbm_byte_write(handle, BBM_COEF03, 0x04);
		bbm_byte_write(handle, BBM_COEF04, 0x03);
		bbm_byte_write(handle, BBM_COEF05, 0x1d);
		bbm_byte_write(handle, BBM_COEF06, 0x19);
		bbm_byte_write(handle, BBM_COEF07, 0x1f);
		bbm_byte_write(handle, BBM_COEF08, 0x09);
		bbm_byte_write(handle, BBM_COEF09, 0x09);
		bbm_byte_write(handle, BBM_COEF0A, 0x3b);
		bbm_byte_write(handle, BBM_COEF0B, 0x3d);
		bbm_byte_write(handle, BBM_COEF0C, 0xf5);
		bbm_byte_write(handle, BBM_COEF0D, 0x1c);
		bbm_byte_write(handle, BBM_COEF0E, 0x4b);
		bbm_byte_write(handle, BBM_COEF0F, 0x61);
	} else if (main_xtal_freq == 38400) {
		bbm_long_write(handle, BBM_NCO_OFFSET, 0x0369d037);
		bbm_byte_write(handle, BBM_NCO_INV, 0x96);
		bbm_byte_write(handle, BBM_EZ_CONST, 0x6d);
		bbm_byte_write(handle, BBM_CLK_MODE, 0x01);

		/* filter coefficient */
		bbm_byte_write(handle, BBM_COEF00, 0x0e);
		bbm_byte_write(handle, BBM_COEF01, 0x00);
		bbm_byte_write(handle, BBM_COEF02, 0x03);
		bbm_byte_write(handle, BBM_COEF03, 0x03);
		bbm_byte_write(handle, BBM_COEF04, 0x1f);
		bbm_byte_write(handle, BBM_COEF05, 0x1a);
		bbm_byte_write(handle, BBM_COEF06, 0x1b);
		bbm_byte_write(handle, BBM_COEF07, 0x03);
		bbm_byte_write(handle, BBM_COEF08, 0x0a);
		bbm_byte_write(handle, BBM_COEF09, 0x05);
		bbm_byte_write(handle, BBM_COEF0A, 0x37);
		bbm_byte_write(handle, BBM_COEF0B, 0x2d);
		bbm_byte_write(handle, BBM_COEF0C, 0xfa);
		bbm_byte_write(handle, BBM_COEF0D, 0x1f);
		bbm_byte_write(handle, BBM_COEF0E, 0x49);
		bbm_byte_write(handle, BBM_COEF0F, 0x5c);
	}
	return BBM_OK;
}