* actually allocates and frees geode_multi struct

* also detect NS version of the chip


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29174 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2009-02-09 21:03:31 +00:00
parent 620d41514f
commit 9aa5a49e97
2 changed files with 10 additions and 2 deletions

View File

@ -55,8 +55,10 @@ init_driver(void)
for (i = 0; gPci->get_nth_pci_info(i, &info) == B_OK
&& gNumCards < MAX_CARDS; i++) {
if (info.vendor_id == AMD_VENDOR_ID
&& info.device_id == AMD_CS5536_AUDIO_DEVICE_ID) {
if ((info.vendor_id == AMD_VENDOR_ID
&& info.device_id == AMD_CS5536_AUDIO_DEVICE_ID)
|| (info.vendor_id == NS_VENDOR_ID
&& info.device_id == NS_CS5535_AUDIO_DEVICE_ID)) {
memset(&gCards[gNumCards], 0, sizeof(geode_controller));
gCards[gNumCards].pci_info = info;
gCards[gNumCards].opened = 0;

View File

@ -425,6 +425,10 @@ geode_hw_init(geode_controller* controller)
snooze(1000);
controller->multi = (geode_multi*)calloc(1, sizeof(geode_multi));
if (controller->multi == NULL)
return B_NO_MEMORY;
controller->playback_stream = geode_stream_new(controller, STREAM_PLAYBACK);
controller->record_stream = geode_stream_new(controller, STREAM_RECORD);
@ -482,6 +486,8 @@ geode_hw_uninit(geode_controller* controller)
controller->regs = NULL;
}
free(controller->multi);
geode_stream_delete(controller->playback_stream);
geode_stream_delete(controller->record_stream);