es137x.c (71505) | es137x.c (72535) |
---|---|
1/* 2 * Support the ENSONIQ AudioPCI board and Creative Labs SoundBlaster PCI 3 * boards based on the ES1370, ES1371 and ES1373 chips. 4 * 5 * Copyright (c) 1999 Russell Cattelan <cattelan@thebarn.com> 6 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk> 7 * Copyright (c) 1998 by Joachim Kuebart. All rights reserved. 8 * --- 24 unchanged lines hidden (view full) --- 33 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 35 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 37 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 39 * OF THE POSSIBILITY OF SUCH DAMAGE. 40 * | 1/* 2 * Support the ENSONIQ AudioPCI board and Creative Labs SoundBlaster PCI 3 * boards based on the ES1370, ES1371 and ES1373 chips. 4 * 5 * Copyright (c) 1999 Russell Cattelan <cattelan@thebarn.com> 6 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk> 7 * Copyright (c) 1998 by Joachim Kuebart. All rights reserved. 8 * --- 24 unchanged lines hidden (view full) --- 33 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 35 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 37 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 39 * OF THE POSSIBILITY OF SUCH DAMAGE. 40 * |
41 * $FreeBSD: head/sys/dev/sound/pci/es137x.c 71505 2001-01-24 01:27:31Z cg $ | 41 * $FreeBSD: head/sys/dev/sound/pci/es137x.c 72535 2001-02-16 13:29:41Z nyan $ |
42 */ 43 44/* 45 * Part of this code was heavily inspired by the linux driver from 46 * Thomas Sailer (sailer@ife.ee.ethz.ch) 47 * Just about everything has been touched and reworked in some way but 48 * the all the underlying sequences/timing/register values are from 49 * Thomas' code. --- 499 unchanged lines hidden (view full) --- 549 bus_space_write_4(es->st, es->sh, ES1371_REG_SMPRATE, 550 (es1371_wait_src_ready(s) & 551 (ES1371_DIS_SRC | ES1371_DIS_P1 | ES1371_DIS_P2 | ES1371_DIS_R1))); 552 /* wait for a SAFE time to write addr/data and then do it, dammit */ 553 for (t = 0; t < 0x1000; t++) 554 if ((bus_space_read_4(es->st, es->sh, ES1371_REG_SMPRATE) & 0x00070000) == 0x00010000) 555 break; 556 | 42 */ 43 44/* 45 * Part of this code was heavily inspired by the linux driver from 46 * Thomas Sailer (sailer@ife.ee.ethz.ch) 47 * Just about everything has been touched and reworked in some way but 48 * the all the underlying sequences/timing/register values are from 49 * Thomas' code. --- 499 unchanged lines hidden (view full) --- 549 bus_space_write_4(es->st, es->sh, ES1371_REG_SMPRATE, 550 (es1371_wait_src_ready(s) & 551 (ES1371_DIS_SRC | ES1371_DIS_P1 | ES1371_DIS_P2 | ES1371_DIS_R1))); 552 /* wait for a SAFE time to write addr/data and then do it, dammit */ 553 for (t = 0; t < 0x1000; t++) 554 if ((bus_space_read_4(es->st, es->sh, ES1371_REG_SMPRATE) & 0x00070000) == 0x00010000) 555 break; 556 |
557 if (debug > 2) printf("one b_s_w: 0x%x 0x%x 0x%x\n", es->sh, ES1371_REG_CODEC, 558 ((addr << CODEC_POADD_SHIFT) & CODEC_POADD_MASK) | 559 ((data << CODEC_PODAT_SHIFT) & CODEC_PODAT_MASK)); | 557 if (debug > 2) 558 printf("one b_s_w: 0x%lx 0x%x 0x%x\n", 559 rman_get_start(es->reg), ES1371_REG_CODEC, 560 ((addr << CODEC_POADD_SHIFT) & CODEC_POADD_MASK) | 561 ((data << CODEC_PODAT_SHIFT) & CODEC_PODAT_MASK)); |
560 561 bus_space_write_4(es->st, es->sh,ES1371_REG_CODEC, 562 ((addr << CODEC_POADD_SHIFT) & CODEC_POADD_MASK) | 563 ((data << CODEC_PODAT_SHIFT) & CODEC_PODAT_MASK)); 564 /* restore SRC reg */ 565 es1371_wait_src_ready(s); | 562 563 bus_space_write_4(es->st, es->sh,ES1371_REG_CODEC, 564 ((addr << CODEC_POADD_SHIFT) & CODEC_POADD_MASK) | 565 ((data << CODEC_PODAT_SHIFT) & CODEC_PODAT_MASK)); 566 /* restore SRC reg */ 567 es1371_wait_src_ready(s); |
566 if (debug > 2) printf("two b_s_w: 0x%x 0x%x 0x%x\n", es->sh, ES1371_REG_SMPRATE, x); | 568 if (debug > 2) 569 printf("two b_s_w: 0x%lx 0x%x 0x%x\n", 570 rman_get_start(es->reg), ES1371_REG_SMPRATE, x); |
567 bus_space_write_4(es->st, es->sh, ES1371_REG_SMPRATE, x); 568 splx(sl); 569 570 return 0; 571} 572 573static int 574es1371_rdcd(kobj_t obj, void *s, int addr) --- 318 unchanged lines hidden --- | 571 bus_space_write_4(es->st, es->sh, ES1371_REG_SMPRATE, x); 572 splx(sl); 573 574 return 0; 575} 576 577static int 578es1371_rdcd(kobj_t obj, void *s, int addr) --- 318 unchanged lines hidden --- |