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

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

~ [ 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