diff options
author | Eliot Blennerhassett <eblennerhassett@audioscience.com> | 2010-05-27 01:53:55 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-05-27 03:55:31 -0400 |
commit | 3ee317fe9cf08d81501b142bf0054c25e3ed5e7d (patch) | |
tree | 6536ffc3c29a5c84adff9861affbfa92b616a45c /sound | |
parent | cadae4289d8e6ee8ad863f21ddc1845b38bf8e78 (diff) |
ALSA: asihpi - Minor code cleanup
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/asihpi/hpicmn.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c index 565102cae4f8..fcd64539d9ef 100644 --- a/sound/pci/asihpi/hpicmn.c +++ b/sound/pci/asihpi/hpicmn.c | |||
@@ -347,20 +347,15 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache, | |||
347 | found = 0; | 347 | found = 0; |
348 | break; | 348 | break; |
349 | case HPI_CONTROL_TUNER: | 349 | case HPI_CONTROL_TUNER: |
350 | { | 350 | if (phm->u.c.attribute == HPI_TUNER_FREQ) |
351 | struct hpi_control_cache_single *pCT = | 351 | phr->u.c.param1 = pC->u.t.freq_ink_hz; |
352 | (struct hpi_control_cache_single *)pI; | 352 | else if (phm->u.c.attribute == HPI_TUNER_BAND) |
353 | if (phm->u.c.attribute == HPI_TUNER_FREQ) | 353 | phr->u.c.param1 = pC->u.t.band; |
354 | phr->u.c.param1 = pCT->u.t.freq_ink_hz; | 354 | else if ((phm->u.c.attribute == HPI_TUNER_LEVEL) |
355 | else if (phm->u.c.attribute == HPI_TUNER_BAND) | 355 | && (phm->u.c.param1 == HPI_TUNER_LEVEL_AVERAGE)) |
356 | phr->u.c.param1 = pCT->u.t.band; | 356 | phr->u.c.param1 = pC->u.t.level; |
357 | else if ((phm->u.c.attribute == HPI_TUNER_LEVEL) | 357 | else |
358 | && (phm->u.c.param1 == | 358 | found = 0; |
359 | HPI_TUNER_LEVEL_AVERAGE)) | ||
360 | phr->u.c.param1 = pCT->u.t.level; | ||
361 | else | ||
362 | found = 0; | ||
363 | } | ||
364 | break; | 359 | break; |
365 | case HPI_CONTROL_AESEBU_RECEIVER: | 360 | case HPI_CONTROL_AESEBU_RECEIVER: |
366 | if (phm->u.c.attribute == HPI_AESEBURX_ERRORSTATUS) | 361 | if (phm->u.c.attribute == HPI_AESEBURX_ERRORSTATUS) |
@@ -503,6 +498,9 @@ void hpi_sync_control_cache(struct hpi_control_cache *p_cache, | |||
503 | struct hpi_control_cache_single *pC; | 498 | struct hpi_control_cache_single *pC; |
504 | struct hpi_control_cache_info *pI; | 499 | struct hpi_control_cache_info *pI; |
505 | 500 | ||
501 | if (phr->error) | ||
502 | return; | ||
503 | |||
506 | if (!find_control(phm, p_cache, &pI, &control_index)) | 504 | if (!find_control(phm, p_cache, &pI, &control_index)) |
507 | return; | 505 | return; |
508 | 506 | ||
@@ -520,8 +518,6 @@ void hpi_sync_control_cache(struct hpi_control_cache *p_cache, | |||
520 | break; | 518 | break; |
521 | case HPI_CONTROL_MULTIPLEXER: | 519 | case HPI_CONTROL_MULTIPLEXER: |
522 | /* mux does not return its setting on Set command. */ | 520 | /* mux does not return its setting on Set command. */ |
523 | if (phr->error) | ||
524 | return; | ||
525 | if (phm->u.c.attribute == HPI_MULTIPLEXER_SOURCE) { | 521 | if (phm->u.c.attribute == HPI_MULTIPLEXER_SOURCE) { |
526 | pC->u.x.source_node_type = (u16)phm->u.c.param1; | 522 | pC->u.x.source_node_type = (u16)phm->u.c.param1; |
527 | pC->u.x.source_node_index = (u16)phm->u.c.param2; | 523 | pC->u.x.source_node_index = (u16)phm->u.c.param2; |
@@ -529,8 +525,6 @@ void hpi_sync_control_cache(struct hpi_control_cache *p_cache, | |||
529 | break; | 525 | break; |
530 | case HPI_CONTROL_CHANNEL_MODE: | 526 | case HPI_CONTROL_CHANNEL_MODE: |
531 | /* mode does not return its setting on Set command. */ | 527 | /* mode does not return its setting on Set command. */ |
532 | if (phr->error) | ||
533 | return; | ||
534 | if (phm->u.c.attribute == HPI_CHANNEL_MODE_MODE) | 528 | if (phm->u.c.attribute == HPI_CHANNEL_MODE_MODE) |
535 | pC->u.m.mode = (u16)phm->u.c.param1; | 529 | pC->u.m.mode = (u16)phm->u.c.param1; |
536 | break; | 530 | break; |
@@ -545,20 +539,14 @@ void hpi_sync_control_cache(struct hpi_control_cache *p_cache, | |||
545 | pC->u.phantom_power.state = (u16)phm->u.c.param1; | 539 | pC->u.phantom_power.state = (u16)phm->u.c.param1; |
546 | break; | 540 | break; |
547 | case HPI_CONTROL_AESEBU_TRANSMITTER: | 541 | case HPI_CONTROL_AESEBU_TRANSMITTER: |
548 | if (phr->error) | ||
549 | return; | ||
550 | if (phm->u.c.attribute == HPI_AESEBUTX_FORMAT) | 542 | if (phm->u.c.attribute == HPI_AESEBUTX_FORMAT) |
551 | pC->u.aes3tx.format = phm->u.c.param1; | 543 | pC->u.aes3tx.format = phm->u.c.param1; |
552 | break; | 544 | break; |
553 | case HPI_CONTROL_AESEBU_RECEIVER: | 545 | case HPI_CONTROL_AESEBU_RECEIVER: |
554 | if (phr->error) | ||
555 | return; | ||
556 | if (phm->u.c.attribute == HPI_AESEBURX_FORMAT) | 546 | if (phm->u.c.attribute == HPI_AESEBURX_FORMAT) |
557 | pC->u.aes3rx.source = phm->u.c.param1; | 547 | pC->u.aes3rx.source = phm->u.c.param1; |
558 | break; | 548 | break; |
559 | case HPI_CONTROL_SAMPLECLOCK: | 549 | case HPI_CONTROL_SAMPLECLOCK: |
560 | if (phr->error) | ||
561 | return; | ||
562 | if (phm->u.c.attribute == HPI_SAMPLECLOCK_SOURCE) | 550 | if (phm->u.c.attribute == HPI_SAMPLECLOCK_SOURCE) |
563 | pC->u.clk.source = (u16)phm->u.c.param1; | 551 | pC->u.clk.source = (u16)phm->u.c.param1; |
564 | else if (phm->u.c.attribute == HPI_SAMPLECLOCK_SOURCE_INDEX) | 552 | else if (phm->u.c.attribute == HPI_SAMPLECLOCK_SOURCE_INDEX) |
@@ -590,7 +578,7 @@ struct hpi_control_cache *hpi_alloc_control_cache(const u32 | |||
590 | 578 | ||
591 | void hpi_free_control_cache(struct hpi_control_cache *p_cache) | 579 | void hpi_free_control_cache(struct hpi_control_cache *p_cache) |
592 | { | 580 | { |
593 | if ((p_cache->init) && (p_cache->p_info)) { | 581 | if (p_cache->init) { |
594 | kfree(p_cache->p_info); | 582 | kfree(p_cache->p_info); |
595 | p_cache->p_info = NULL; | 583 | p_cache->p_info = NULL; |
596 | p_cache->init = 0; | 584 | p_cache->init = 0; |