diff options
Diffstat (limited to 'sound/pci/ctxfi/ctdaio.c')
-rw-r--r-- | sound/pci/ctxfi/ctdaio.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c index 47d9ea97de0..0c00eb4088e 100644 --- a/sound/pci/ctxfi/ctdaio.c +++ b/sound/pci/ctxfi/ctdaio.c | |||
@@ -22,20 +22,9 @@ | |||
22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | 24 | ||
25 | #define DAIO_RESOURCE_NUM NUM_DAIOTYP | ||
26 | #define DAIO_OUT_MAX SPDIFOO | 25 | #define DAIO_OUT_MAX SPDIFOO |
27 | 26 | ||
28 | union daio_usage { | 27 | struct daio_usage { |
29 | struct { | ||
30 | unsigned short lineo1:1; | ||
31 | unsigned short lineo2:1; | ||
32 | unsigned short lineo3:1; | ||
33 | unsigned short lineo4:1; | ||
34 | unsigned short spdifoo:1; | ||
35 | unsigned short lineim:1; | ||
36 | unsigned short spdifio:1; | ||
37 | unsigned short spdifi1:1; | ||
38 | } bf; | ||
39 | unsigned short data; | 28 | unsigned short data; |
40 | }; | 29 | }; |
41 | 30 | ||
@@ -61,6 +50,7 @@ struct daio_rsc_idx idx_20k2[NUM_DAIOTYP] = { | |||
61 | [LINEO3] = {.left = 0x50, .right = 0x51}, | 50 | [LINEO3] = {.left = 0x50, .right = 0x51}, |
62 | [LINEO4] = {.left = 0x70, .right = 0x71}, | 51 | [LINEO4] = {.left = 0x70, .right = 0x71}, |
63 | [LINEIM] = {.left = 0x45, .right = 0xc5}, | 52 | [LINEIM] = {.left = 0x45, .right = 0xc5}, |
53 | [MIC] = {.left = 0x55, .right = 0xd5}, | ||
64 | [SPDIFOO] = {.left = 0x00, .right = 0x01}, | 54 | [SPDIFOO] = {.left = 0x00, .right = 0x01}, |
65 | [SPDIFIO] = {.left = 0x05, .right = 0x85}, | 55 | [SPDIFIO] = {.left = 0x05, .right = 0x85}, |
66 | }; | 56 | }; |
@@ -138,6 +128,7 @@ static unsigned int daio_device_index(enum DAIOTYP type, struct hw *hw) | |||
138 | case LINEO3: return 5; | 128 | case LINEO3: return 5; |
139 | case LINEO4: return 6; | 129 | case LINEO4: return 6; |
140 | case LINEIM: return 4; | 130 | case LINEIM: return 4; |
131 | case MIC: return 5; | ||
141 | default: return -EINVAL; | 132 | default: return -EINVAL; |
142 | } | 133 | } |
143 | default: | 134 | default: |
@@ -519,17 +510,17 @@ static int dai_rsc_uninit(struct dai *dai) | |||
519 | 510 | ||
520 | static int daio_mgr_get_rsc(struct rsc_mgr *mgr, enum DAIOTYP type) | 511 | static int daio_mgr_get_rsc(struct rsc_mgr *mgr, enum DAIOTYP type) |
521 | { | 512 | { |
522 | if (((union daio_usage *)mgr->rscs)->data & (0x1 << type)) | 513 | if (((struct daio_usage *)mgr->rscs)->data & (0x1 << type)) |
523 | return -ENOENT; | 514 | return -ENOENT; |
524 | 515 | ||
525 | ((union daio_usage *)mgr->rscs)->data |= (0x1 << type); | 516 | ((struct daio_usage *)mgr->rscs)->data |= (0x1 << type); |
526 | 517 | ||
527 | return 0; | 518 | return 0; |
528 | } | 519 | } |
529 | 520 | ||
530 | static int daio_mgr_put_rsc(struct rsc_mgr *mgr, enum DAIOTYP type) | 521 | static int daio_mgr_put_rsc(struct rsc_mgr *mgr, enum DAIOTYP type) |
531 | { | 522 | { |
532 | ((union daio_usage *)mgr->rscs)->data &= ~(0x1 << type); | 523 | ((struct daio_usage *)mgr->rscs)->data &= ~(0x1 << type); |
533 | 524 | ||
534 | return 0; | 525 | return 0; |
535 | } | 526 | } |
@@ -712,7 +703,7 @@ int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr) | |||
712 | if (!daio_mgr) | 703 | if (!daio_mgr) |
713 | return -ENOMEM; | 704 | return -ENOMEM; |
714 | 705 | ||
715 | err = rsc_mgr_init(&daio_mgr->mgr, DAIO, DAIO_RESOURCE_NUM, hw); | 706 | err = rsc_mgr_init(&daio_mgr->mgr, DAIO, NUM_DAIOTYP, hw); |
716 | if (err) | 707 | if (err) |
717 | goto error1; | 708 | goto error1; |
718 | 709 | ||