3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
4 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
31 #define ES1370_VENDORID 0x1274
32 #define ES1370_DEVICEID 0x5000
39 int es1370_inb (es1370_t
*dev
, int port
)
43 if ((value
= inb (dev
->addr_io
+port
)) != 0)
44 DPRINT (DBG_DRIVER
| DBG_SOUND
, "es1370DSP: inb () failed - %d", value
);
49 void es1370_outb (es1370_t
*dev
, int port
, int value
)
53 outb (dev
->addr_io
+port
, value
);
56 /* detect es1370 device in PC */
57 pcidev_t
*es1370_detect ()
59 /* First detect sound card - is connected to PCI bus ?*/
60 pcidev_t
*pcidev
= pcidev_find (ES1370_VENDORID
, ES1370_DEVICEID
);
68 unsigned init_es1370 ()
70 pcidev_t
*pcidev
= es1370_detect ();
75 es1370_t
*dev
= (es1370_t
*) kmalloc (sizeof (es1370_t
));
81 dev
->irq
= pcidev
->u
.h0
.interrupt_line
;
82 dev
->addr_io
= pcidev
->u
.h0
.base_registers
[0];
84 kprintf ("es1370 -> found at 0x%x, irq: %d\n", dev
->addr_io
, dev
->irq
);
86 unsigned char *c
= (unsigned char *) dev
->addr_io
;
88 //es1370_outb (dev, 0x0, 1);
90 //kprintf ("Prvni znak: 0x%x\n", c[0]);
95 bool es1370_acthandler (unsigned act
, unsigned freq
)