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

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

Version: ~ [ linux-5.3-rc5 ] ~ [ linux-5.2.9 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.67 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.139 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.189 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.189 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.72 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**
  2  * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved.
  3  *
  4  * This source file is released under GPL v2 license (no other versions).
  5  * See the COPYING file included in the main directory of this source
  6  * distribution for the license terms and conditions.
  7  *
  8  * @File        ctsrc.h
  9  *
 10  * @Brief
 11  * This file contains the definition of the Sample Rate Convertor
 12  * resource management object.
 13  *
 14  * @Author      Liu Chun
 15  * @Date        May 13 2008
 16  *
 17  */
 18 
 19 #ifndef CTSRC_H
 20 #define CTSRC_H
 21 
 22 #include "ctresource.h"
 23 #include "ctimap.h"
 24 #include <linux/spinlock.h>
 25 #include <linux/list.h>
 26 #include <sound/core.h>
 27 
 28 #define SRC_STATE_OFF   0x0
 29 #define SRC_STATE_INIT  0x4
 30 #define SRC_STATE_RUN   0x5
 31 
 32 #define SRC_SF_U8       0x0
 33 #define SRC_SF_S16      0x1
 34 #define SRC_SF_S24      0x2
 35 #define SRC_SF_S32      0x3
 36 #define SRC_SF_F32      0x4
 37 
 38 /* Define the descriptor of a src resource */
 39 enum SRCMODE {
 40         MEMRD,          /* Read data from host memory */
 41         MEMWR,          /* Write data to host memory */
 42         ARCRW,          /* Read from and write to audio ring channel */
 43         NUM_SRCMODES
 44 };
 45 
 46 struct src_rsc_ops;
 47 
 48 struct src {
 49         struct rsc rsc; /* Basic resource info */
 50         struct src *intlv; /* Pointer to next interleaved SRC in a series */
 51         const struct src_rsc_ops *ops; /* SRC specific operations */
 52         /* Number of contiguous srcs for interleaved usage */
 53         unsigned char multi;
 54         unsigned char mode; /* Working mode of this SRC resource */
 55 };
 56 
 57 struct src_rsc_ops {
 58         int (*set_state)(struct src *src, unsigned int state);
 59         int (*set_bm)(struct src *src, unsigned int bm);
 60         int (*set_sf)(struct src *src, unsigned int sf);
 61         int (*set_pm)(struct src *src, unsigned int pm);
 62         int (*set_rom)(struct src *src, unsigned int rom);
 63         int (*set_vo)(struct src *src, unsigned int vo);
 64         int (*set_st)(struct src *src, unsigned int st);
 65         int (*set_bp)(struct src *src, unsigned int bp);
 66         int (*set_cisz)(struct src *src, unsigned int cisz);
 67         int (*set_ca)(struct src *src, unsigned int ca);
 68         int (*set_sa)(struct src *src, unsigned int sa);
 69         int (*set_la)(struct src *src, unsigned int la);
 70         int (*set_pitch)(struct src *src, unsigned int pitch);
 71         int (*set_clr_zbufs)(struct src *src);
 72         int (*commit_write)(struct src *src);
 73         int (*get_ca)(struct src *src);
 74         int (*init)(struct src *src);
 75         struct src* (*next_interleave)(struct src *src);
 76 };
 77 
 78 /* Define src resource request description info */
 79 struct src_desc {
 80         /* Number of contiguous master srcs for interleaved usage */
 81         unsigned char multi;
 82         unsigned char msr;
 83         unsigned char mode; /* Working mode of the requested srcs */
 84 };
 85 
 86 /* Define src manager object */
 87 struct src_mgr {
 88         struct rsc_mgr mgr;     /* Basic resource manager info */
 89         struct snd_card *card;  /* pointer to this card */
 90         spinlock_t mgr_lock;
 91 
 92          /* request src resource */
 93         int (*get_src)(struct src_mgr *mgr,
 94                        const struct src_desc *desc, struct src **rsrc);
 95         /* return src resource */
 96         int (*put_src)(struct src_mgr *mgr, struct src *src);
 97         int (*src_enable_s)(struct src_mgr *mgr, struct src *src);
 98         int (*src_enable)(struct src_mgr *mgr, struct src *src);
 99         int (*src_disable)(struct src_mgr *mgr, struct src *src);
100         int (*commit_write)(struct src_mgr *mgr);
101 };
102 
103 /* Define the descriptor of a SRC Input Mapper resource */
104 struct srcimp_mgr;
105 struct srcimp_rsc_ops;
106 
107 struct srcimp {
108         struct rsc rsc;
109         unsigned char idx[8];
110         struct imapper *imappers;
111         unsigned int mapped; /* A bit-map indicating which conj rsc is mapped */
112         struct srcimp_mgr *mgr;
113         const struct srcimp_rsc_ops *ops;
114 };
115 
116 struct srcimp_rsc_ops {
117         int (*map)(struct srcimp *srcimp, struct src *user, struct rsc *input);
118         int (*unmap)(struct srcimp *srcimp);
119 };
120 
121 /* Define SRCIMP resource request description info */
122 struct srcimp_desc {
123         unsigned int msr;
124 };
125 
126 struct srcimp_mgr {
127         struct rsc_mgr mgr;     /* Basic resource manager info */
128         struct snd_card *card;  /* pointer to this card */
129         spinlock_t mgr_lock;
130         spinlock_t imap_lock;
131         struct list_head imappers;
132         struct imapper *init_imap;
133         unsigned int init_imap_added;
134 
135          /* request srcimp resource */
136         int (*get_srcimp)(struct srcimp_mgr *mgr,
137                           const struct srcimp_desc *desc,
138                           struct srcimp **rsrcimp);
139         /* return srcimp resource */
140         int (*put_srcimp)(struct srcimp_mgr *mgr, struct srcimp *srcimp);
141         int (*imap_add)(struct srcimp_mgr *mgr, struct imapper *entry);
142         int (*imap_delete)(struct srcimp_mgr *mgr, struct imapper *entry);
143 };
144 
145 /* Constructor and destructor of SRC resource manager */
146 int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr);
147 int src_mgr_destroy(struct src_mgr *src_mgr);
148 /* Constructor and destructor of SRCIMP resource manager */
149 int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrc_mgr);
150 int srcimp_mgr_destroy(struct srcimp_mgr *srcimp_mgr);
151 
152 #endif /* CTSRC_H */
153 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp