diff options
Diffstat (limited to 'sound/pci/ctxfi/ctdaio.c')
-rw-r--r-- | sound/pci/ctxfi/ctdaio.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c index 84f86bf63b8f..c1c3f8816fff 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 | ||
141 | static int dao_spdif_get_spos(struct dao *dao, unsigned int *spos) | 141 | static 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 | ||
147 | static int dao_spdif_set_spos(struct dao *dao, unsigned int spos) | 147 | static 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 | ||
153 | static int dao_commit_write(struct dao *dao) | 153 | static 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 = { | |||
277 | static int dai_set_srt_srcl(struct dai *dai, struct rsc *src) | 277 | static 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 | ||
285 | static int dai_set_srt_srcr(struct dai *dai, struct rsc *src) | 284 | static 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 | ||
304 | static int dai_set_enb_src(struct dai *dai, unsigned int enb) | 302 | static 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 | ||
310 | static int dai_set_enb_srt(struct dai *dai, unsigned int enb) | 308 | static 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 | ||
316 | static int dai_commit_write(struct dai *dai) | 314 | static 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 | } |
@@ -331,12 +329,12 @@ static struct dai_rsc_ops dai_ops = { | |||
331 | 329 | ||
332 | static int daio_rsc_init(struct daio *daio, | 330 | static int daio_rsc_init(struct daio *daio, |
333 | const struct daio_desc *desc, | 331 | const struct daio_desc *desc, |
334 | void *hw) | 332 | struct hw *hw) |
335 | { | 333 | { |
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 | ||
503 | static int dai_rsc_uninit(struct dai *dai) | 501 | static 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; |
@@ -541,7 +539,8 @@ static int get_daio_rsc(struct daio_mgr *mgr, | |||
541 | err = daio_mgr_get_rsc(&mgr->mgr, desc->type); | 539 | err = daio_mgr_get_rsc(&mgr->mgr, desc->type); |
542 | spin_unlock_irqrestore(&mgr->mgr_lock, flags); | 540 | spin_unlock_irqrestore(&mgr->mgr_lock, flags); |
543 | if (err) { | 541 | if (err) { |
544 | printk(KERN_ERR "Can't meet DAIO resource request!\n"); | 542 | dev_err(mgr->card->dev, |
543 | "Can't meet DAIO resource request!\n"); | ||
545 | return err; | 544 | return err; |
546 | } | 545 | } |
547 | 546 | ||
@@ -692,7 +691,7 @@ static int daio_mgr_commit_write(struct daio_mgr *mgr) | |||
692 | return 0; | 691 | return 0; |
693 | } | 692 | } |
694 | 693 | ||
695 | int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr) | 694 | int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr) |
696 | { | 695 | { |
697 | int err, i; | 696 | int err, i; |
698 | struct daio_mgr *daio_mgr; | 697 | struct daio_mgr *daio_mgr; |
@@ -727,12 +726,13 @@ int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr) | |||
727 | daio_mgr->imap_add = daio_imap_add; | 726 | daio_mgr->imap_add = daio_imap_add; |
728 | daio_mgr->imap_delete = daio_imap_delete; | 727 | daio_mgr->imap_delete = daio_imap_delete; |
729 | daio_mgr->commit_write = daio_mgr_commit_write; | 728 | daio_mgr->commit_write = daio_mgr_commit_write; |
729 | daio_mgr->card = hw->card; | ||
730 | 730 | ||
731 | for (i = 0; i < 8; i++) { | 731 | for (i = 0; i < 8; i++) { |
732 | ((struct hw *)hw)->daio_mgr_dsb_dao(daio_mgr->mgr.ctrl_blk, i); | 732 | 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); | 733 | hw->daio_mgr_dsb_dai(daio_mgr->mgr.ctrl_blk, i); |
734 | } | 734 | } |
735 | ((struct hw *)hw)->daio_mgr_commit_write(hw, daio_mgr->mgr.ctrl_blk); | 735 | hw->daio_mgr_commit_write(hw, daio_mgr->mgr.ctrl_blk); |
736 | 736 | ||
737 | *rdaio_mgr = daio_mgr; | 737 | *rdaio_mgr = daio_mgr; |
738 | 738 | ||