Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: ctxfi: added reference of snd_card

added a pointer of snd_card in some of the structures to get a
reference of the card from other functions.
these references of snd_card will be initialised in the next patch
of this series and as of now these snd_card will be used to print the
the device information when we convert the pr_* macros to dev_* in a
later patch of this series.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Sudip Mukherjee and committed by
Takashi Iwai
3d0fdc86 b6bfe86f

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