diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-01-07 18:32:20 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-01-07 18:32:20 +0000 |
commit | eaca3614406686835b9fbf953a990eca6be2c0be (patch) | |
tree | 569d8512fac557766e56110adc7b696e8bdafd73 /sys/dev/pci | |
parent | e1666a5ad6a0c67bc9fc79a79a7dddb89c3c82c6 (diff) |
use flags instead of options to choose the tea5757 vs tea5759.
from Vladimir Popov <jumbo@narod.ru>
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/maxiradio.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/sf64pcr.c | 20 |
2 files changed, 19 insertions, 11 deletions
diff --git a/sys/dev/pci/maxiradio.c b/sys/dev/pci/maxiradio.c index a507d42a529..f0f2461d421 100644 --- a/sys/dev/pci/maxiradio.c +++ b/sys/dev/pci/maxiradio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: maxiradio.c,v 1.3 2002/01/02 22:25:25 mickey Exp $ */ +/* $OpenBSD: maxiradio.c,v 1.4 2002/01/07 18:32:19 mickey Exp $ */ /* $RuOBSD: maxiradio.c,v 1.5 2001/10/18 16:51:36 pva Exp $ */ /* @@ -135,6 +135,7 @@ mr_attach(struct device *parent, struct device *self, void *aux) { struct mr_softc *sc = (struct mr_softc *) self; struct pci_attach_args *pa = aux; + struct cfdata *cf = sc->sc_dev.dv_cfdata; pci_chipset_tag_t pc = pa->pa_pc; pcireg_t csr; @@ -155,11 +156,14 @@ mr_attach(struct device *parent, struct device *self, void *aux) sc->stereo = TEA5757_STEREO; sc->lock = TEA5757_S030; sc->tea.offset = 0; + sc->tea.flags = cf->cf_flags; sc->tea.init = mr_init; sc->tea.rset = mr_rset; sc->tea.write_bit = mr_write_bit; sc->tea.read = mr_hardware_read; + printf(": Guillemot MaxiRadio FM2000 PCI\n"); + radio_attach_mi(&mr_hw_if, sc, &sc->sc_dev); } @@ -176,7 +180,7 @@ mr_get_info(void *v, struct radio_info *ri) ri->lock = tea5757_decode_lock(sc->lock); ri->freq = sc->freq = tea5757_decode_freq(mr_hardware_read(sc->tea.iot, - sc->tea.ioh, sc->tea.offset)); + sc->tea.ioh, sc->tea.offset), sc->tea.flags & TEA5757_TEA5759); ri->info = mr_state(sc->tea.iot, sc->tea.ioh); @@ -193,7 +197,7 @@ mr_set_info(void *v, struct radio_info *ri) sc->stereo = ri->stereo ? TEA5757_STEREO: TEA5757_MONO; sc->lock = tea5757_encode_lock(ri->lock); ri->freq = sc->freq = tea5757_set_freq(&sc->tea, - sc->lock, sc->stereo, ri->freq); + sc->lock, sc->stereo, ri->freq); mr_set_mute(sc); return (0); diff --git a/sys/dev/pci/sf64pcr.c b/sys/dev/pci/sf64pcr.c index 281ba3305a4..1f2d841b0f1 100644 --- a/sys/dev/pci/sf64pcr.c +++ b/sys/dev/pci/sf64pcr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sf64pcr.c,v 1.3 2002/01/02 22:25:25 mickey Exp $ */ +/* $OpenBSD: sf64pcr.c,v 1.4 2002/01/07 18:32:19 mickey Exp $ */ /* $RuOBSD: sf64pcr.c,v 1.11 2001/12/05 10:19:40 mickey Exp $ */ /* @@ -149,12 +149,12 @@ struct cfdriver sf4r_cd = { /* * Function prototypes */ -void sf64pcr_set_mute(struct sf64pcr_softc *); +void sf64pcr_set_mute(struct sf64pcr_softc *); -void sf64pcr_init(bus_space_tag_t, bus_space_handle_t, bus_size_t, u_int32_t); -void sf64pcr_rset(bus_space_tag_t, bus_space_handle_t, bus_size_t, u_int32_t); -void sf64pcr_write_bit(bus_space_tag_t, bus_space_handle_t, bus_size_t, int); -u_int32_t sf64pcr_hw_read(bus_space_tag_t, bus_space_handle_t, bus_size_t); +void sf64pcr_init(bus_space_tag_t, bus_space_handle_t, bus_size_t, u_int32_t); +void sf64pcr_rset(bus_space_tag_t, bus_space_handle_t, bus_size_t, u_int32_t); +void sf64pcr_write_bit(bus_space_tag_t, bus_space_handle_t, bus_size_t, int); +u_int32_t sf64pcr_hw_read(bus_space_tag_t, bus_space_handle_t, bus_size_t); /* * PCI initialization stuff @@ -164,7 +164,6 @@ sf64pcr_match(struct device *parent, void *match, void *aux) { struct pci_attach_args *pa = aux; /* FIXME: more thorough testing */ - /* desc = "SoundForte RadioLink SF64-PCR PCI"; */ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_FORTEMEDIA && PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_FORTEMEDIA_FM801) return (1); @@ -176,6 +175,7 @@ sf64pcr_attach(struct device *parent, struct device *self, void *aux) { struct sf64pcr_softc *sc = (struct sf64pcr_softc *) self; struct pci_attach_args *pa = aux; + struct cfdata *cf = sc->dev.dv_cfdata; pci_chipset_tag_t pc = pa->pa_pc; pcireg_t csr; @@ -196,11 +196,14 @@ sf64pcr_attach(struct device *parent, struct device *self, void *aux) sc->stereo = TEA5757_STEREO; sc->lock = TEA5757_S030; sc->tea.offset = SF64PCR_PCI_OFFSET; + sc->tea.flags = cf->cf_flags; sc->tea.init = sf64pcr_init; sc->tea.rset = sf64pcr_rset; sc->tea.write_bit = sf64pcr_write_bit; sc->tea.read = sf64pcr_hw_read; + printf(": SoundForte RadioLink SF64-PCR PCI\n"); + tea5757_set_freq(&sc->tea, sc->lock, sc->stereo, sc->freq); sf64pcr_set_mute(sc); @@ -309,7 +312,8 @@ sf64pcr_get_info(void *v, struct radio_info *ri) ri->lock = tea5757_decode_lock(sc->lock); buf = sf64pcr_hw_read(sc->tea.iot, sc->tea.ioh, sc->tea.offset); - ri->freq = sc->freq = tea5757_decode_freq(buf); + ri->freq = sc->freq = tea5757_decode_freq(buf, + sc->tea.flags & TEA5757_TEA5759); ri->info = buf & SF64PCR_INFO_SIGNAL ? 0 : RADIO_INFO_SIGNAL; ri->info |= buf & SF64PCR_INFO_STEREO ? 0 : RADIO_INFO_STEREO; |