~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/pci/ctxfi/ctdaio.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved.
  4  *
  5  * @File        ctdaio.h
  6  *
  7  * @Brief
  8  * This file contains the definition of Digital Audio Input Output
  9  * resource management object.
 10  *
 11  * @Author      Liu Chun
 12  * @Date        May 23 2008
 13  */
 14 
 15 #ifndef CTDAIO_H
 16 #define CTDAIO_H
 17 
 18 #include "ctresource.h"
 19 #include "ctimap.h"
 20 #include <linux/spinlock.h>
 21 #include <linux/list.h>
 22 #include <sound/core.h>
 23 
 24 /* Define the descriptor of a daio resource */
 25 enum DAIOTYP {
 26         LINEO1,
 27         LINEO2,
 28         LINEO3,
 29         LINEO4,
 30         SPDIFOO,        /* S/PDIF Out (Flexijack/Optical) */
 31         LINEIM,
 32         SPDIFIO,        /* S/PDIF In (Flexijack/Optical) on the card */
 33         MIC,            /* Dedicated mic on Titanium HD */
 34         SPDIFI1,        /* S/PDIF In on internal Drive Bay */
 35         NUM_DAIOTYP
 36 };
 37 
 38 struct dao_rsc_ops;
 39 struct dai_rsc_ops;
 40 struct daio_mgr;
 41 
 42 struct daio {
 43         struct rsc rscl;        /* Basic resource info for left TX/RX */
 44         struct rsc rscr;        /* Basic resource info for right TX/RX */
 45         enum DAIOTYP type;
 46 };
 47 
 48 struct dao {
 49         struct daio daio;
 50         const struct dao_rsc_ops *ops;  /* DAO specific operations */
 51         struct imapper **imappers;
 52         struct daio_mgr *mgr;
 53         struct hw *hw;
 54         void *ctrl_blk;
 55 };
 56 
 57 struct dai {
 58         struct daio daio;
 59         const struct dai_rsc_ops *ops;  /* DAI specific operations */
 60         struct hw *hw;
 61         void *ctrl_blk;
 62 };
 63 
 64 struct dao_desc {
 65         unsigned int msr:4;
 66         unsigned int passthru:1;
 67 };
 68 
 69 struct dao_rsc_ops {
 70         int (*set_spos)(struct dao *dao, unsigned int spos);
 71         int (*commit_write)(struct dao *dao);
 72         int (*get_spos)(struct dao *dao, unsigned int *spos);
 73         int (*reinit)(struct dao *dao, const struct dao_desc *desc);
 74         int (*set_left_input)(struct dao *dao, struct rsc *input);
 75         int (*set_right_input)(struct dao *dao, struct rsc *input);
 76         int (*clear_left_input)(struct dao *dao);
 77         int (*clear_right_input)(struct dao *dao);
 78 };
 79 
 80 struct dai_rsc_ops {
 81         int (*set_srt_srcl)(struct dai *dai, struct rsc *src);
 82         int (*set_srt_srcr)(struct dai *dai, struct rsc *src);
 83         int (*set_srt_msr)(struct dai *dai, unsigned int msr);
 84         int (*set_enb_src)(struct dai *dai, unsigned int enb);
 85         int (*set_enb_srt)(struct dai *dai, unsigned int enb);
 86         int (*commit_write)(struct dai *dai);
 87 };
 88 
 89 /* Define daio resource request description info */
 90 struct daio_desc {
 91         unsigned int type:4;
 92         unsigned int msr:4;
 93         unsigned int passthru:1;
 94 };
 95 
 96 struct daio_mgr {
 97         struct rsc_mgr mgr;     /* Basic resource manager info */
 98         struct snd_card *card;  /* pointer to this card */
 99         spinlock_t mgr_lock;
100         spinlock_t imap_lock;
101         struct list_head imappers;
102         struct imapper *init_imap;
103         unsigned int init_imap_added;
104 
105          /* request one daio resource */
106         int (*get_daio)(struct daio_mgr *mgr,
107                         const struct daio_desc *desc, struct daio **rdaio);
108         /* return one daio resource */
109         int (*put_daio)(struct daio_mgr *mgr, struct daio *daio);
110         int (*daio_enable)(struct daio_mgr *mgr, struct daio *daio);
111         int (*daio_disable)(struct daio_mgr *mgr, struct daio *daio);
112         int (*imap_add)(struct daio_mgr *mgr, struct imapper *entry);
113         int (*imap_delete)(struct daio_mgr *mgr, struct imapper *entry);
114         int (*commit_write)(struct daio_mgr *mgr);
115 };
116 
117 /* Constructor and destructor of daio resource manager */
118 int daio_mgr_create(struct hw *hw, void **ptr);
119 int daio_mgr_destroy(void *ptr);
120 
121 #endif /* CTDAIO_H */
122 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php