diff options
Diffstat (limited to 'sound/pci/asihpi/hpi6205.c')
-rw-r--r-- | sound/pci/asihpi/hpi6205.c | 52 |
1 files changed, 15 insertions, 37 deletions
diff --git a/sound/pci/asihpi/hpi6205.c b/sound/pci/asihpi/hpi6205.c index 9d5df54a6b46..e041a6ae1c5a 100644 --- a/sound/pci/asihpi/hpi6205.c +++ b/sound/pci/asihpi/hpi6205.c | |||
@@ -373,6 +373,7 @@ static void instream_message(struct hpi_adapter_obj *pao, | |||
373 | /** Entry point to this HPI backend | 373 | /** Entry point to this HPI backend |
374 | * All calls to the HPI start here | 374 | * All calls to the HPI start here |
375 | */ | 375 | */ |
376 | static | ||
376 | void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm, | 377 | void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm, |
377 | struct hpi_response *phr) | 378 | struct hpi_response *phr) |
378 | { | 379 | { |
@@ -392,7 +393,7 @@ void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm, | |||
392 | 393 | ||
393 | HPI_DEBUG_LOG(VERBOSE, "start of switch\n"); | 394 | HPI_DEBUG_LOG(VERBOSE, "start of switch\n"); |
394 | switch (phm->type) { | 395 | switch (phm->type) { |
395 | case HPI_TYPE_MESSAGE: | 396 | case HPI_TYPE_REQUEST: |
396 | switch (phm->object) { | 397 | switch (phm->object) { |
397 | case HPI_OBJ_SUBSYSTEM: | 398 | case HPI_OBJ_SUBSYSTEM: |
398 | subsys_message(pao, phm, phr); | 399 | subsys_message(pao, phm, phr); |
@@ -402,7 +403,6 @@ void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm, | |||
402 | adapter_message(pao, phm, phr); | 403 | adapter_message(pao, phm, phr); |
403 | break; | 404 | break; |
404 | 405 | ||
405 | case HPI_OBJ_CONTROLEX: | ||
406 | case HPI_OBJ_CONTROL: | 406 | case HPI_OBJ_CONTROL: |
407 | control_message(pao, phm, phr); | 407 | control_message(pao, phm, phr); |
408 | break; | 408 | break; |
@@ -634,11 +634,12 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao, | |||
634 | 634 | ||
635 | HPI_DEBUG_LOG(VERBOSE, "init ADAPTER_GET_INFO\n"); | 635 | HPI_DEBUG_LOG(VERBOSE, "init ADAPTER_GET_INFO\n"); |
636 | memset(&hm, 0, sizeof(hm)); | 636 | memset(&hm, 0, sizeof(hm)); |
637 | hm.type = HPI_TYPE_MESSAGE; | 637 | /* wAdapterIndex == version == 0 */ |
638 | hm.type = HPI_TYPE_REQUEST; | ||
638 | hm.size = sizeof(hm); | 639 | hm.size = sizeof(hm); |
639 | hm.object = HPI_OBJ_ADAPTER; | 640 | hm.object = HPI_OBJ_ADAPTER; |
640 | hm.function = HPI_ADAPTER_GET_INFO; | 641 | hm.function = HPI_ADAPTER_GET_INFO; |
641 | hm.adapter_index = 0; | 642 | |
642 | memset(&hr, 0, sizeof(hr)); | 643 | memset(&hr, 0, sizeof(hr)); |
643 | hr.size = sizeof(hr); | 644 | hr.size = sizeof(hr); |
644 | 645 | ||
@@ -658,9 +659,6 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao, | |||
658 | hr.u.ax.info.num_outstreams + | 659 | hr.u.ax.info.num_outstreams + |
659 | hr.u.ax.info.num_instreams; | 660 | hr.u.ax.info.num_instreams; |
660 | 661 | ||
661 | hpios_locked_mem_prepare((max_streams * 6) / 10, max_streams, | ||
662 | 65536, pao->pci.pci_dev); | ||
663 | |||
664 | HPI_DEBUG_LOG(VERBOSE, | 662 | HPI_DEBUG_LOG(VERBOSE, |
665 | "got adapter info type %x index %d serial %d\n", | 663 | "got adapter info type %x index %d serial %d\n", |
666 | hr.u.ax.info.adapter_type, hr.u.ax.info.adapter_index, | 664 | hr.u.ax.info.adapter_type, hr.u.ax.info.adapter_index, |
@@ -709,9 +707,6 @@ static void delete_adapter_obj(struct hpi_adapter_obj *pao) | |||
709 | [i]); | 707 | [i]); |
710 | phw->outstream_host_buffer_size[i] = 0; | 708 | phw->outstream_host_buffer_size[i] = 0; |
711 | } | 709 | } |
712 | |||
713 | hpios_locked_mem_unprepare(pao->pci.pci_dev); | ||
714 | |||
715 | kfree(phw); | 710 | kfree(phw); |
716 | } | 711 | } |
717 | 712 | ||
@@ -1371,9 +1366,8 @@ static u16 adapter_boot_load_dsp(struct hpi_adapter_obj *pao, | |||
1371 | return err; | 1366 | return err; |
1372 | 1367 | ||
1373 | /* write the DSP code down into the DSPs memory */ | 1368 | /* write the DSP code down into the DSPs memory */ |
1374 | dsp_code.ps_dev = pao->pci.pci_dev; | 1369 | err = hpi_dsp_code_open(boot_code_id[dsp], pao->pci.pci_dev, |
1375 | err = hpi_dsp_code_open(boot_code_id[dsp], &dsp_code, | 1370 | &dsp_code, pos_error_code); |
1376 | pos_error_code); | ||
1377 | if (err) | 1371 | if (err) |
1378 | return err; | 1372 | return err; |
1379 | 1373 | ||
@@ -2084,13 +2078,13 @@ static u16 message_response_sequence(struct hpi_adapter_obj *pao, | |||
2084 | u16 err = 0; | 2078 | u16 err = 0; |
2085 | 2079 | ||
2086 | message_count++; | 2080 | message_count++; |
2087 | if (phm->size > sizeof(interface->u)) { | 2081 | if (phm->size > sizeof(interface->u.message_buffer)) { |
2088 | phr->error = HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL; | 2082 | phr->error = HPI_ERROR_MESSAGE_BUFFER_TOO_SMALL; |
2089 | phr->specific_error = sizeof(interface->u); | 2083 | phr->specific_error = sizeof(interface->u.message_buffer); |
2090 | phr->size = sizeof(struct hpi_response_header); | 2084 | phr->size = sizeof(struct hpi_response_header); |
2091 | HPI_DEBUG_LOG(ERROR, | 2085 | HPI_DEBUG_LOG(ERROR, |
2092 | "message len %d too big for buffer %zd \n", phm->size, | 2086 | "message len %d too big for buffer %zd \n", phm->size, |
2093 | sizeof(interface->u)); | 2087 | sizeof(interface->u.message_buffer)); |
2094 | return 0; | 2088 | return 0; |
2095 | } | 2089 | } |
2096 | 2090 | ||
@@ -2122,18 +2116,19 @@ static u16 message_response_sequence(struct hpi_adapter_obj *pao, | |||
2122 | 2116 | ||
2123 | /* read the result */ | 2117 | /* read the result */ |
2124 | if (time_out) { | 2118 | if (time_out) { |
2125 | if (interface->u.response_buffer.size <= phr->size) | 2119 | if (interface->u.response_buffer.response.size <= phr->size) |
2126 | memcpy(phr, &interface->u.response_buffer, | 2120 | memcpy(phr, &interface->u.response_buffer, |
2127 | interface->u.response_buffer.size); | 2121 | interface->u.response_buffer.response.size); |
2128 | else { | 2122 | else { |
2129 | HPI_DEBUG_LOG(ERROR, | 2123 | HPI_DEBUG_LOG(ERROR, |
2130 | "response len %d too big for buffer %d\n", | 2124 | "response len %d too big for buffer %d\n", |
2131 | interface->u.response_buffer.size, phr->size); | 2125 | interface->u.response_buffer.response.size, |
2126 | phr->size); | ||
2132 | memcpy(phr, &interface->u.response_buffer, | 2127 | memcpy(phr, &interface->u.response_buffer, |
2133 | sizeof(struct hpi_response_header)); | 2128 | sizeof(struct hpi_response_header)); |
2134 | phr->error = HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL; | 2129 | phr->error = HPI_ERROR_RESPONSE_BUFFER_TOO_SMALL; |
2135 | phr->specific_error = | 2130 | phr->specific_error = |
2136 | interface->u.response_buffer.size; | 2131 | interface->u.response_buffer.response.size; |
2137 | phr->size = sizeof(struct hpi_response_header); | 2132 | phr->size = sizeof(struct hpi_response_header); |
2138 | } | 2133 | } |
2139 | } | 2134 | } |
@@ -2202,23 +2197,6 @@ static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm, | |||
2202 | phm->u.d.u.data.data_size, H620_HIF_GET_DATA); | 2197 | phm->u.d.u.data.data_size, H620_HIF_GET_DATA); |
2203 | break; | 2198 | break; |
2204 | 2199 | ||
2205 | case HPI_CONTROL_SET_STATE: | ||
2206 | if (phm->object == HPI_OBJ_CONTROLEX | ||
2207 | && phm->u.cx.attribute == HPI_COBRANET_SET_DATA) | ||
2208 | err = hpi6205_transfer_data(pao, | ||
2209 | phm->u.cx.u.cobranet_bigdata.pb_data, | ||
2210 | phm->u.cx.u.cobranet_bigdata.byte_count, | ||
2211 | H620_HIF_SEND_DATA); | ||
2212 | break; | ||
2213 | |||
2214 | case HPI_CONTROL_GET_STATE: | ||
2215 | if (phm->object == HPI_OBJ_CONTROLEX | ||
2216 | && phm->u.cx.attribute == HPI_COBRANET_GET_DATA) | ||
2217 | err = hpi6205_transfer_data(pao, | ||
2218 | phm->u.cx.u.cobranet_bigdata.pb_data, | ||
2219 | phr->u.cx.u.cobranet_data.byte_count, | ||
2220 | H620_HIF_GET_DATA); | ||
2221 | break; | ||
2222 | } | 2200 | } |
2223 | phr->error = err; | 2201 | phr->error = err; |
2224 | 2202 | ||