Beispiel #1
0
int
rtii_get_info(void *v, struct radio_info *ri)
{
	struct rtii_softc *sc = v;

	ri->mute = sc->mute;
	ri->volume = sc->vol ? 255 : 0;
	ri->stereo = sc->stereo == TEA5757_STEREO ? 1 : 0;
	ri->caps = RTII_CAPABILITIES;
	ri->rfreq = 0;
	ri->lock = tea5757_decode_lock(sc->lock);

	ri->freq  = sc->freq = tea5757_decode_freq(rtii_hw_read(sc->tea.iot,
	    sc->tea.ioh, sc->tea.offset), sc->tea.flags & TEA5757_TEA5759);

	switch (bus_space_read_1(sc->tea.iot, sc->tea.ioh, 0)) {
	case 0xFD:
		ri->info = RADIO_INFO_SIGNAL | RADIO_INFO_STEREO;
		break;
	case 0xFF:
		ri->info = 0;
		break;
	default:
		ri->info = RADIO_INFO_SIGNAL;
	}

	return (0);
}
int
fmsradio_get_info(void *v, struct radio_info *ri)
{
	struct fms_softc *sc = v;
	struct fmsradio_if *radio = (struct fmsradio_if *)sc->radio;
	u_int32_t buf;

	ri->mute = radio->mute;
	ri->volume = radio->vol ? 255 : 0;
	ri->stereo = radio->stereo == TEA5757_STEREO ? 1 : 0;
	ri->lock = tea5757_decode_lock(radio->lock);

	switch (radio->type) {
	case TUNER_SF256PCS:
		ri->caps = SF256PCS_CAPS;
		buf = sf256pcs_hw_read(radio->tea.iot, radio->tea.ioh,
		    radio->tea.offset);
		ri->info = 0; /* UNSUPPORTED */
		break;
	case TUNER_SF256PCPR:
		ri->caps = SF256PCPR_CAPS;
		buf = sf256pcpr_hw_read(radio->tea.iot, radio->tea.ioh,
		    radio->tea.offset);
		ri->info = bus_space_read_2(radio->tea.iot, radio->tea.ioh,
			FM_VOLUME) == PCPR_INFO_STEREO ?
			RADIO_INFO_STEREO : 0;
		break;
	case TUNER_SF64PCR:
		ri->caps = SF64PCR_CAPS;
		buf = sf64pcr_hw_read(radio->tea.iot, radio->tea.ioh,
		    radio->tea.offset);
		ri->info  = buf & PCR_INFO_SIGNAL ? 0 : RADIO_INFO_SIGNAL;
		ri->info |= buf & PCR_INFO_STEREO ? 0 : RADIO_INFO_STEREO;
		break;
	default:
		break;
	}

	ri->freq = radio->freq = tea5757_decode_freq(buf,
			sc->sc_dev.dv_cfdata->cf_flags & TEA5757_TEA5759);

	fmsradio_set_mute(sc);

	/* UNSUPPORTED */
	ri->rfreq = 0;

	return (0);
}
Beispiel #3
0
int
sf2r_get_info(void *v, struct radio_info *ri)
{
	struct sf2r_softc *sc = v;
	u_int32_t buf;

	ri->mute = sc->mute;
	ri->volume = sc->vol ? 255 : 0;
	ri->stereo = sc->stereo == TEA5757_STEREO ? 1 : 0;
	ri->caps = SF16FMR2_CAPABILITIES;
	ri->rfreq = 0;
	ri->lock = tea5757_decode_lock(sc->lock);

	buf = sf2r_read_register(sc->tea.iot, sc->tea.ioh, sc->tea.offset);
	ri->freq  = sc->freq = tea5757_decode_freq(buf, 0);
	ri->info = 3 & (buf >> 24);

	return (0);
}
Beispiel #4
0
static int
gtp_get_info(void *v, struct radio_info *ri)
{
	struct gtp_softc *sc = v;

	ri->mute = sc->mute;
	ri->volume = sc->vol ? 255 : 0;
	ri->stereo = sc->stereo == TEA5757_STEREO ? 1 : 0;
	ri->caps = GEMTEK_PCI_CAPS;
	ri->rfreq = 0;
	ri->lock = tea5757_decode_lock(sc->lock);

	/* Frequency read unsupported */
	ri->freq = sc->freq;

	ri->info = gtp_state(sc->tea.iot, sc->tea.ioh);
	gtp_set_mute(sc);

	return (0);
}