diff options
Diffstat (limited to 'sound/pci/asihpi/hpi6205.c')
-rw-r--r-- | sound/pci/asihpi/hpi6205.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/sound/pci/asihpi/hpi6205.c b/sound/pci/asihpi/hpi6205.c index e041a6ae1c5..4f2873880b1 100644 --- a/sound/pci/asihpi/hpi6205.c +++ b/sound/pci/asihpi/hpi6205.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
@@ -45,18 +45,21 @@ | |||
45 | #define HPI6205_ERROR_MSG_RESP_TIMEOUT 1016 | 45 | #define HPI6205_ERROR_MSG_RESP_TIMEOUT 1016 |
46 | 46 | ||
47 | /* initialization/bootload errors */ | 47 | /* initialization/bootload errors */ |
48 | #define HPI6205_ERROR_6205_NO_IRQ 1002 | 48 | #define HPI6205_ERROR_6205_NO_IRQ 1002 |
49 | #define HPI6205_ERROR_6205_INIT_FAILED 1003 | 49 | #define HPI6205_ERROR_6205_INIT_FAILED 1003 |
50 | #define HPI6205_ERROR_6205_REG 1006 | 50 | #define HPI6205_ERROR_6205_REG 1006 |
51 | #define HPI6205_ERROR_6205_DSPPAGE 1007 | 51 | #define HPI6205_ERROR_6205_DSPPAGE 1007 |
52 | #define HPI6205_ERROR_C6713_HPIC 1009 | 52 | #define HPI6205_ERROR_C6713_HPIC 1009 |
53 | #define HPI6205_ERROR_C6713_HPIA 1010 | 53 | #define HPI6205_ERROR_C6713_HPIA 1010 |
54 | #define HPI6205_ERROR_C6713_PLL 1011 | 54 | #define HPI6205_ERROR_C6713_PLL 1011 |
55 | #define HPI6205_ERROR_DSP_INTMEM 1012 | 55 | #define HPI6205_ERROR_DSP_INTMEM 1012 |
56 | #define HPI6205_ERROR_DSP_EXTMEM 1013 | 56 | #define HPI6205_ERROR_DSP_EXTMEM 1013 |
57 | #define HPI6205_ERROR_DSP_PLD 1014 | 57 | #define HPI6205_ERROR_DSP_PLD 1014 |
58 | #define HPI6205_ERROR_6205_EEPROM 1017 | 58 | #define HPI6205_ERROR_6205_EEPROM 1017 |
59 | #define HPI6205_ERROR_DSP_EMIF 1018 | 59 | #define HPI6205_ERROR_DSP_EMIF1 1018 |
60 | #define HPI6205_ERROR_DSP_EMIF2 1019 | ||
61 | #define HPI6205_ERROR_DSP_EMIF3 1020 | ||
62 | #define HPI6205_ERROR_DSP_EMIF4 1021 | ||
60 | 63 | ||
61 | /*****************************************************************************/ | 64 | /*****************************************************************************/ |
62 | /* for C6205 PCI i/f */ | 65 | /* for C6205 PCI i/f */ |
@@ -488,7 +491,7 @@ static void subsys_create_adapter(struct hpi_message *phm, | |||
488 | return; | 491 | return; |
489 | } | 492 | } |
490 | 493 | ||
491 | phr->u.s.adapter_type = ao.adapter_type; | 494 | phr->u.s.adapter_type = ao.type; |
492 | phr->u.s.adapter_index = ao.index; | 495 | phr->u.s.adapter_index = ao.index; |
493 | phr->error = 0; | 496 | phr->error = 0; |
494 | } | 497 | } |
@@ -503,7 +506,7 @@ static void adapter_delete(struct hpi_adapter_obj *pao, | |||
503 | phr->error = HPI_ERROR_INVALID_OBJ_INDEX; | 506 | phr->error = HPI_ERROR_INVALID_OBJ_INDEX; |
504 | return; | 507 | return; |
505 | } | 508 | } |
506 | phw = (struct hpi_hw_obj *)pao->priv; | 509 | phw = pao->priv; |
507 | /* reset adapter h/w */ | 510 | /* reset adapter h/w */ |
508 | /* Reset C6713 #1 */ | 511 | /* Reset C6713 #1 */ |
509 | boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); | 512 | boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); |
@@ -652,7 +655,7 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao, | |||
652 | if (hr.error) | 655 | if (hr.error) |
653 | return hr.error; | 656 | return hr.error; |
654 | 657 | ||
655 | pao->adapter_type = hr.u.ax.info.adapter_type; | 658 | pao->type = hr.u.ax.info.adapter_type; |
656 | pao->index = hr.u.ax.info.adapter_index; | 659 | pao->index = hr.u.ax.info.adapter_index; |
657 | 660 | ||
658 | max_streams = | 661 | max_streams = |
@@ -665,8 +668,6 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao, | |||
665 | hr.u.ax.info.serial_number); | 668 | hr.u.ax.info.serial_number); |
666 | } | 669 | } |
667 | 670 | ||
668 | pao->open = 0; /* upon creation the adapter is closed */ | ||
669 | |||
670 | if (phw->p_cache) | 671 | if (phw->p_cache) |
671 | phw->p_cache->adap_idx = pao->index; | 672 | phw->p_cache->adap_idx = pao->index; |
672 | 673 | ||
@@ -803,8 +804,8 @@ static void outstream_host_buffer_allocate(struct hpi_adapter_obj *pao, | |||
803 | obj_index]; | 804 | obj_index]; |
804 | status->samples_processed = 0; | 805 | status->samples_processed = 0; |
805 | status->stream_state = HPI_STATE_STOPPED; | 806 | status->stream_state = HPI_STATE_STOPPED; |
806 | status->dSP_index = 0; | 807 | status->dsp_index = 0; |
807 | status->host_index = status->dSP_index; | 808 | status->host_index = status->dsp_index; |
808 | status->size_in_bytes = phm->u.d.u.buffer.buffer_size; | 809 | status->size_in_bytes = phm->u.d.u.buffer.buffer_size; |
809 | status->auxiliary_data_available = 0; | 810 | status->auxiliary_data_available = 0; |
810 | 811 | ||
@@ -878,7 +879,7 @@ static void outstream_host_buffer_free(struct hpi_adapter_obj *pao, | |||
878 | static u32 outstream_get_space_available(struct hpi_hostbuffer_status *status) | 879 | static u32 outstream_get_space_available(struct hpi_hostbuffer_status *status) |
879 | { | 880 | { |
880 | return status->size_in_bytes - (status->host_index - | 881 | return status->size_in_bytes - (status->host_index - |
881 | status->dSP_index); | 882 | status->dsp_index); |
882 | } | 883 | } |
883 | 884 | ||
884 | static void outstream_write(struct hpi_adapter_obj *pao, | 885 | static void outstream_write(struct hpi_adapter_obj *pao, |
@@ -1080,8 +1081,8 @@ static void instream_host_buffer_allocate(struct hpi_adapter_obj *pao, | |||
1080 | obj_index]; | 1081 | obj_index]; |
1081 | status->samples_processed = 0; | 1082 | status->samples_processed = 0; |
1082 | status->stream_state = HPI_STATE_STOPPED; | 1083 | status->stream_state = HPI_STATE_STOPPED; |
1083 | status->dSP_index = 0; | 1084 | status->dsp_index = 0; |
1084 | status->host_index = status->dSP_index; | 1085 | status->host_index = status->dsp_index; |
1085 | status->size_in_bytes = phm->u.d.u.buffer.buffer_size; | 1086 | status->size_in_bytes = phm->u.d.u.buffer.buffer_size; |
1086 | status->auxiliary_data_available = 0; | 1087 | status->auxiliary_data_available = 0; |
1087 | 1088 | ||
@@ -1162,7 +1163,7 @@ static void instream_start(struct hpi_adapter_obj *pao, | |||
1162 | 1163 | ||
1163 | static u32 instream_get_bytes_available(struct hpi_hostbuffer_status *status) | 1164 | static u32 instream_get_bytes_available(struct hpi_hostbuffer_status *status) |
1164 | { | 1165 | { |
1165 | return status->dSP_index - status->host_index; | 1166 | return status->dsp_index - status->host_index; |
1166 | } | 1167 | } |
1167 | 1168 | ||
1168 | static void instream_read(struct hpi_adapter_obj *pao, | 1169 | static void instream_read(struct hpi_adapter_obj *pao, |
@@ -1614,7 +1615,7 @@ static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) | |||
1614 | boot_loader_write_mem32(pao, dsp_index, 0x01800008, setting); | 1615 | boot_loader_write_mem32(pao, dsp_index, 0x01800008, setting); |
1615 | if (setting != boot_loader_read_mem32(pao, dsp_index, | 1616 | if (setting != boot_loader_read_mem32(pao, dsp_index, |
1616 | 0x01800008)) | 1617 | 0x01800008)) |
1617 | return HPI6205_ERROR_DSP_EMIF; | 1618 | return HPI6205_ERROR_DSP_EMIF1; |
1618 | 1619 | ||
1619 | /* EMIF CE1 setup - 32 bit async. This is 6713 #1 HPI, */ | 1620 | /* EMIF CE1 setup - 32 bit async. This is 6713 #1 HPI, */ |
1620 | /* which occupies D15..0. 6713 starts at 27MHz, so need */ | 1621 | /* which occupies D15..0. 6713 starts at 27MHz, so need */ |
@@ -1627,7 +1628,7 @@ static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) | |||
1627 | boot_loader_write_mem32(pao, dsp_index, 0x01800004, setting); | 1628 | boot_loader_write_mem32(pao, dsp_index, 0x01800004, setting); |
1628 | if (setting != boot_loader_read_mem32(pao, dsp_index, | 1629 | if (setting != boot_loader_read_mem32(pao, dsp_index, |
1629 | 0x01800004)) | 1630 | 0x01800004)) |
1630 | return HPI6205_ERROR_DSP_EMIF; | 1631 | return HPI6205_ERROR_DSP_EMIF2; |
1631 | 1632 | ||
1632 | /* EMIF CE2 setup - 32 bit async. This is 6713 #2 HPI, */ | 1633 | /* EMIF CE2 setup - 32 bit async. This is 6713 #2 HPI, */ |
1633 | /* which occupies D15..0. 6713 starts at 27MHz, so need */ | 1634 | /* which occupies D15..0. 6713 starts at 27MHz, so need */ |
@@ -1639,7 +1640,7 @@ static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) | |||
1639 | boot_loader_write_mem32(pao, dsp_index, 0x01800010, setting); | 1640 | boot_loader_write_mem32(pao, dsp_index, 0x01800010, setting); |
1640 | if (setting != boot_loader_read_mem32(pao, dsp_index, | 1641 | if (setting != boot_loader_read_mem32(pao, dsp_index, |
1641 | 0x01800010)) | 1642 | 0x01800010)) |
1642 | return HPI6205_ERROR_DSP_EMIF; | 1643 | return HPI6205_ERROR_DSP_EMIF3; |
1643 | 1644 | ||
1644 | /* EMIF CE3 setup - 32 bit async. */ | 1645 | /* EMIF CE3 setup - 32 bit async. */ |
1645 | /* This is the PLD on the ASI5000 cards only */ | 1646 | /* This is the PLD on the ASI5000 cards only */ |
@@ -1650,7 +1651,7 @@ static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) | |||
1650 | boot_loader_write_mem32(pao, dsp_index, 0x01800014, setting); | 1651 | boot_loader_write_mem32(pao, dsp_index, 0x01800014, setting); |
1651 | if (setting != boot_loader_read_mem32(pao, dsp_index, | 1652 | if (setting != boot_loader_read_mem32(pao, dsp_index, |
1652 | 0x01800014)) | 1653 | 0x01800014)) |
1653 | return HPI6205_ERROR_DSP_EMIF; | 1654 | return HPI6205_ERROR_DSP_EMIF4; |
1654 | 1655 | ||
1655 | /* set EMIF SDRAM control for 2Mx32 SDRAM (512x32x4 bank) */ | 1656 | /* set EMIF SDRAM control for 2Mx32 SDRAM (512x32x4 bank) */ |
1656 | /* need to use this else DSP code crashes? */ | 1657 | /* need to use this else DSP code crashes? */ |