void exar7300_unipolar_onoff(struct channel *sc, u32 mode)
{
	switch (mode) {
	case SBE_2T3E3_OFF:
		exar7300_clear_bit(sc, SBE_2T3E3_LIU_REG_REG3,
				   SBE_2T3E3_LIU_VAL_DECODER_DISABLE);
		exar7300_clear_bit(sc, SBE_2T3E3_LIU_REG_REG1,
				   SBE_2T3E3_LIU_VAL_TRANSMIT_BINARY_DATA);
		break;
	case SBE_2T3E3_ON:
		exar7300_set_bit(sc, SBE_2T3E3_LIU_REG_REG3,
				 SBE_2T3E3_LIU_VAL_DECODER_DISABLE);
		exar7300_set_bit(sc, SBE_2T3E3_LIU_REG_REG1,
				 SBE_2T3E3_LIU_VAL_TRANSMIT_BINARY_DATA);
		break;
	}
}
Пример #2
0
void exar7250_set_loopback(struct channel *sc, u32 mode)
{
	switch (mode) {
	case SBE_2T3E3_FRAMER_VAL_LOOPBACK_OFF:
		exar7300_clear_bit(sc, SBE_2T3E3_FRAMER_REG_OPERATING_MODE,
				   SBE_2T3E3_FRAMER_VAL_LOCAL_LOOPBACK_MODE);
		break;
	case SBE_2T3E3_FRAMER_VAL_LOOPBACK_ON:
		exar7300_set_bit(sc, SBE_2T3E3_FRAMER_REG_OPERATING_MODE,
				 SBE_2T3E3_FRAMER_VAL_LOCAL_LOOPBACK_MODE);
		break;
	}
}
Пример #3
0
void exar7250_unipolar_onoff(struct channel *sc, u32 mode)
{
	switch (mode) {
	case SBE_2T3E3_OFF:
		exar7300_clear_bit(sc, SBE_2T3E3_FRAMER_REG_IO_CONTROL,
				   SBE_2T3E3_FRAMER_VAL_UNIPOLAR);
		break;
	case SBE_2T3E3_ON:
		exar7300_set_bit(sc, SBE_2T3E3_FRAMER_REG_IO_CONTROL,
				 SBE_2T3E3_FRAMER_VAL_UNIPOLAR);
		break;
	}
}
void exar7300_transmit_all_ones_onoff(struct channel *sc, u32 mode)
{
	if (sc->p.transmit_all_ones == mode)
		return;

	switch (mode) {
	case SBE_2T3E3_ON:
		exar7300_set_bit(sc, SBE_2T3E3_LIU_REG_REG1,
				 SBE_2T3E3_LIU_VAL_TRANSMIT_ALL_ONES);
		break;
	case SBE_2T3E3_OFF:
		exar7300_clear_bit(sc, SBE_2T3E3_LIU_REG_REG1,
				   SBE_2T3E3_LIU_VAL_TRANSMIT_ALL_ONES);
		break;
	default:
		return;
	}

	sc->p.transmit_all_ones = mode;
}
void exar7300_receive_equalization_onoff(struct channel *sc, u32 mode)
{
	if (sc->p.receive_equalization == mode)
		return;

	switch (mode) {
	case SBE_2T3E3_OFF:
		exar7300_set_bit(sc, SBE_2T3E3_LIU_REG_REG2,
				 SBE_2T3E3_LIU_VAL_RECEIVE_EQUALIZATION_DISABLE);
		break;
	case SBE_2T3E3_ON:
		exar7300_clear_bit(sc, SBE_2T3E3_LIU_REG_REG2,
				   SBE_2T3E3_LIU_VAL_RECEIVE_EQUALIZATION_DISABLE);
		break;
	default:
		return;
	}

	sc->p.receive_equalization = mode;
}
void exar7300_line_build_out_onoff(struct channel *sc, u32 mode)
{
	if (sc->p.line_build_out == mode)
		return;

	switch (mode) {
	case SBE_2T3E3_OFF:
		exar7300_set_bit(sc, SBE_2T3E3_LIU_REG_REG1,
				 SBE_2T3E3_LIU_VAL_TRANSMIT_LEVEL_SELECT);
		exar7300_receive_equalization_onoff(sc, SBE_2T3E3_OFF);
		break;
	case SBE_2T3E3_ON:
		exar7300_clear_bit(sc, SBE_2T3E3_LIU_REG_REG1,
				   SBE_2T3E3_LIU_VAL_TRANSMIT_LEVEL_SELECT);
		exar7300_receive_equalization_onoff(sc, SBE_2T3E3_ON);
		break;
	default:
		return;
	}

	sc->p.line_build_out = mode;
}