aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/ctxfi/ctamixer.h3
-rw-r--r--sound/pci/ctxfi/ctdaio.c34
-rw-r--r--sound/pci/ctxfi/ctdaio.h2
-rw-r--r--sound/pci/ctxfi/cthardware.h2
-rw-r--r--sound/pci/ctxfi/ctsrc.h3
5 files changed, 26 insertions, 18 deletions
diff --git a/sound/pci/ctxfi/ctamixer.h b/sound/pci/ctxfi/ctamixer.h
index 6fa5eff7b89d..72f42f27434e 100644
--- a/sound/pci/ctxfi/ctamixer.h
+++ b/sound/pci/ctxfi/ctamixer.h
@@ -21,6 +21,7 @@
21 21
22#include "ctresource.h" 22#include "ctresource.h"
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <sound/core.h>
24 25
25/* Define the descriptor of a summation node resource */ 26/* Define the descriptor of a summation node resource */
26struct sum { 27struct sum {
@@ -35,6 +36,7 @@ struct sum_desc {
35 36
36struct sum_mgr { 37struct sum_mgr {
37 struct rsc_mgr mgr; /* Basic resource manager info */ 38 struct rsc_mgr mgr; /* Basic resource manager info */
39 struct snd_card *card; /* pointer to this card */
38 spinlock_t mgr_lock; 40 spinlock_t mgr_lock;
39 41
40 /* request one sum resource */ 42 /* request one sum resource */
@@ -79,6 +81,7 @@ struct amixer_desc {
79 81
80struct amixer_mgr { 82struct amixer_mgr {
81 struct rsc_mgr mgr; /* Basic resource manager info */ 83 struct rsc_mgr mgr; /* Basic resource manager info */
84 struct snd_card *card; /* pointer to this card */
82 spinlock_t mgr_lock; 85 spinlock_t mgr_lock;
83 86
84 /* request one amixer resource */ 87 /* request one amixer resource */
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c
index 75416410fb0b..aa4aa712c285 100644
--- a/sound/pci/ctxfi/ctdaio.c
+++ b/sound/pci/ctxfi/ctdaio.c
@@ -140,19 +140,19 @@ static int dao_rsc_reinit(struct dao *dao, const struct dao_desc *desc);
140 140
141static int dao_spdif_get_spos(struct dao *dao, unsigned int *spos) 141static int dao_spdif_get_spos(struct dao *dao, unsigned int *spos)
142{ 142{
143 ((struct hw *)dao->hw)->dao_get_spos(dao->ctrl_blk, spos); 143 dao->hw->dao_get_spos(dao->ctrl_blk, spos);
144 return 0; 144 return 0;
145} 145}
146 146
147static int dao_spdif_set_spos(struct dao *dao, unsigned int spos) 147static int dao_spdif_set_spos(struct dao *dao, unsigned int spos)
148{ 148{
149 ((struct hw *)dao->hw)->dao_set_spos(dao->ctrl_blk, spos); 149 dao->hw->dao_set_spos(dao->ctrl_blk, spos);
150 return 0; 150 return 0;
151} 151}
152 152
153static int dao_commit_write(struct dao *dao) 153static int dao_commit_write(struct dao *dao)
154{ 154{
155 ((struct hw *)dao->hw)->dao_commit_write(dao->hw, 155 dao->hw->dao_commit_write(dao->hw,
156 daio_device_index(dao->daio.type, dao->hw), dao->ctrl_blk); 156 daio_device_index(dao->daio.type, dao->hw), dao->ctrl_blk);
157 return 0; 157 return 0;
158} 158}
@@ -277,16 +277,14 @@ static struct dao_rsc_ops dao_ops = {
277static int dai_set_srt_srcl(struct dai *dai, struct rsc *src) 277static int dai_set_srt_srcl(struct dai *dai, struct rsc *src)
278{ 278{
279 src->ops->master(src); 279 src->ops->master(src);
280 ((struct hw *)dai->hw)->dai_srt_set_srcm(dai->ctrl_blk, 280 dai->hw->dai_srt_set_srcm(dai->ctrl_blk, src->ops->index(src));
281 src->ops->index(src));
282 return 0; 281 return 0;
283} 282}
284 283
285static int dai_set_srt_srcr(struct dai *dai, struct rsc *src) 284static int dai_set_srt_srcr(struct dai *dai, struct rsc *src)
286{ 285{
287 src->ops->master(src); 286 src->ops->master(src);
288 ((struct hw *)dai->hw)->dai_srt_set_srco(dai->ctrl_blk, 287 dai->hw->dai_srt_set_srco(dai->ctrl_blk, src->ops->index(src));
289 src->ops->index(src));
290 return 0; 288 return 0;
291} 289}
292 290
@@ -297,25 +295,25 @@ static int dai_set_srt_msr(struct dai *dai, unsigned int msr)
297 for (rsr = 0; msr > 1; msr >>= 1) 295 for (rsr = 0; msr > 1; msr >>= 1)
298 rsr++; 296 rsr++;
299 297
300 ((struct hw *)dai->hw)->dai_srt_set_rsr(dai->ctrl_blk, rsr); 298 dai->hw->dai_srt_set_rsr(dai->ctrl_blk, rsr);
301 return 0; 299 return 0;
302} 300}
303 301
304static int dai_set_enb_src(struct dai *dai, unsigned int enb) 302static int dai_set_enb_src(struct dai *dai, unsigned int enb)
305{ 303{
306 ((struct hw *)dai->hw)->dai_srt_set_ec(dai->ctrl_blk, enb); 304 dai->hw->dai_srt_set_ec(dai->ctrl_blk, enb);
307 return 0; 305 return 0;
308} 306}
309 307
310static int dai_set_enb_srt(struct dai *dai, unsigned int enb) 308static int dai_set_enb_srt(struct dai *dai, unsigned int enb)
311{ 309{
312 ((struct hw *)dai->hw)->dai_srt_set_et(dai->ctrl_blk, enb); 310 dai->hw->dai_srt_set_et(dai->ctrl_blk, enb);
313 return 0; 311 return 0;
314} 312}
315 313
316static int dai_commit_write(struct dai *dai) 314static int dai_commit_write(struct dai *dai)
317{ 315{
318 ((struct hw *)dai->hw)->dai_commit_write(dai->hw, 316 dai->hw->dai_commit_write(dai->hw,
319 daio_device_index(dai->daio.type, dai->hw), dai->ctrl_blk); 317 daio_device_index(dai->daio.type, dai->hw), dai->ctrl_blk);
320 return 0; 318 return 0;
321} 319}
@@ -336,7 +334,7 @@ static int daio_rsc_init(struct daio *daio,
336 int err; 334 int err;
337 unsigned int idx_l, idx_r; 335 unsigned int idx_l, idx_r;
338 336
339 switch (((struct hw *)hw)->chip_type) { 337 switch (hw->chip_type) {
340 case ATC20K1: 338 case ATC20K1:
341 idx_l = idx_20k1[desc->type].left; 339 idx_l = idx_20k1[desc->type].left;
342 idx_r = idx_20k1[desc->type].right; 340 idx_r = idx_20k1[desc->type].right;
@@ -360,7 +358,7 @@ static int daio_rsc_init(struct daio *daio,
360 if (desc->type <= DAIO_OUT_MAX) { 358 if (desc->type <= DAIO_OUT_MAX) {
361 daio->rscl.ops = daio->rscr.ops = &daio_out_rsc_ops; 359 daio->rscl.ops = daio->rscr.ops = &daio_out_rsc_ops;
362 } else { 360 } else {
363 switch (((struct hw *)hw)->chip_type) { 361 switch (hw->chip_type) {
364 case ATC20K1: 362 case ATC20K1:
365 daio->rscl.ops = daio->rscr.ops = &daio_in_rsc_ops_20k1; 363 daio->rscl.ops = daio->rscr.ops = &daio_in_rsc_ops_20k1;
366 break; 364 break;
@@ -445,7 +443,7 @@ static int dao_rsc_uninit(struct dao *dao)
445 kfree(dao->imappers); 443 kfree(dao->imappers);
446 dao->imappers = NULL; 444 dao->imappers = NULL;
447 } 445 }
448 ((struct hw *)dao->hw)->dao_put_ctrl_blk(dao->ctrl_blk); 446 dao->hw->dao_put_ctrl_blk(dao->ctrl_blk);
449 dao->hw = dao->ctrl_blk = NULL; 447 dao->hw = dao->ctrl_blk = NULL;
450 daio_rsc_uninit(&dao->daio); 448 daio_rsc_uninit(&dao->daio);
451 449
@@ -502,7 +500,7 @@ error1:
502 500
503static int dai_rsc_uninit(struct dai *dai) 501static int dai_rsc_uninit(struct dai *dai)
504{ 502{
505 ((struct hw *)dai->hw)->dai_put_ctrl_blk(dai->ctrl_blk); 503 dai->hw->dai_put_ctrl_blk(dai->ctrl_blk);
506 dai->hw = dai->ctrl_blk = NULL; 504 dai->hw = dai->ctrl_blk = NULL;
507 daio_rsc_uninit(&dai->daio); 505 daio_rsc_uninit(&dai->daio);
508 return 0; 506 return 0;
@@ -729,10 +727,10 @@ int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr)
729 daio_mgr->commit_write = daio_mgr_commit_write; 727 daio_mgr->commit_write = daio_mgr_commit_write;
730 728
731 for (i = 0; i < 8; i++) { 729 for (i = 0; i < 8; i++) {
732 ((struct hw *)hw)->daio_mgr_dsb_dao(daio_mgr->mgr.ctrl_blk, i); 730 hw->daio_mgr_dsb_dao(daio_mgr->mgr.ctrl_blk, i);
733 ((struct hw *)hw)->daio_mgr_dsb_dai(daio_mgr->mgr.ctrl_blk, i); 731 hw->daio_mgr_dsb_dai(daio_mgr->mgr.ctrl_blk, i);
734 } 732 }
735 ((struct hw *)hw)->daio_mgr_commit_write(hw, daio_mgr->mgr.ctrl_blk); 733 hw->daio_mgr_commit_write(hw, daio_mgr->mgr.ctrl_blk);
736 734
737 *rdaio_mgr = daio_mgr; 735 *rdaio_mgr = daio_mgr;
738 736
diff --git a/sound/pci/ctxfi/ctdaio.h b/sound/pci/ctxfi/ctdaio.h
index e4817de08864..0ebbf350f51a 100644
--- a/sound/pci/ctxfi/ctdaio.h
+++ b/sound/pci/ctxfi/ctdaio.h
@@ -23,6 +23,7 @@
23#include "ctimap.h" 23#include "ctimap.h"
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/list.h> 25#include <linux/list.h>
26#include <sound/core.h>
26 27
27/* Define the descriptor of a daio resource */ 28/* Define the descriptor of a daio resource */
28enum DAIOTYP { 29enum DAIOTYP {
@@ -98,6 +99,7 @@ struct daio_desc {
98 99
99struct daio_mgr { 100struct daio_mgr {
100 struct rsc_mgr mgr; /* Basic resource manager info */ 101 struct rsc_mgr mgr; /* Basic resource manager info */
102 struct snd_card *card; /* pointer to this card */
101 spinlock_t mgr_lock; 103 spinlock_t mgr_lock;
102 spinlock_t imap_lock; 104 spinlock_t imap_lock;
103 struct list_head imappers; 105 struct list_head imappers;
diff --git a/sound/pci/ctxfi/cthardware.h b/sound/pci/ctxfi/cthardware.h
index c5ded6a6654f..54cc9cb75f00 100644
--- a/sound/pci/ctxfi/cthardware.h
+++ b/sound/pci/ctxfi/cthardware.h
@@ -20,6 +20,7 @@
20 20
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/pci.h> 22#include <linux/pci.h>
23#include <sound/core.h>
23 24
24enum CHIPTYP { 25enum CHIPTYP {
25 ATC20K1, 26 ATC20K1,
@@ -184,6 +185,7 @@ struct hw {
184 void *irq_callback_data; 185 void *irq_callback_data;
185 186
186 struct pci_dev *pci; /* the pci kernel structure of this card */ 187 struct pci_dev *pci; /* the pci kernel structure of this card */
188 struct snd_card *card; /* pointer to this card */
187 int irq; 189 int irq;
188 unsigned long io_base; 190 unsigned long io_base;
189 void __iomem *mem_base; 191 void __iomem *mem_base;
diff --git a/sound/pci/ctxfi/ctsrc.h b/sound/pci/ctxfi/ctsrc.h
index 6d95afbbc852..da7573c5db9b 100644
--- a/sound/pci/ctxfi/ctsrc.h
+++ b/sound/pci/ctxfi/ctsrc.h
@@ -23,6 +23,7 @@
23#include "ctimap.h" 23#include "ctimap.h"
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/list.h> 25#include <linux/list.h>
26#include <sound/core.h>
26 27
27#define SRC_STATE_OFF 0x0 28#define SRC_STATE_OFF 0x0
28#define SRC_STATE_INIT 0x4 29#define SRC_STATE_INIT 0x4
@@ -85,6 +86,7 @@ struct src_desc {
85/* Define src manager object */ 86/* Define src manager object */
86struct src_mgr { 87struct src_mgr {
87 struct rsc_mgr mgr; /* Basic resource manager info */ 88 struct rsc_mgr mgr; /* Basic resource manager info */
89 struct snd_card *card; /* pointer to this card */
88 spinlock_t mgr_lock; 90 spinlock_t mgr_lock;
89 91
90 /* request src resource */ 92 /* request src resource */
@@ -123,6 +125,7 @@ struct srcimp_desc {
123 125
124struct srcimp_mgr { 126struct srcimp_mgr {
125 struct rsc_mgr mgr; /* Basic resource manager info */ 127 struct rsc_mgr mgr; /* Basic resource manager info */
128 struct snd_card *card; /* pointer to this card */
126 spinlock_t mgr_lock; 129 spinlock_t mgr_lock;
127 spinlock_t imap_lock; 130 spinlock_t imap_lock;
128 struct list_head imappers; 131 struct list_head imappers;