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

TOMOYO Linux Cross Reference
Linux/sound/pci/ctxfi/ctatc.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        ctatc.h
  6  *
  7  * @Brief
  8  * This file contains the definition of the device resource management object.
  9  *
 10  * @Author      Liu Chun
 11  * @Date        Mar 28 2008
 12  */
 13 
 14 #ifndef CTATC_H
 15 #define CTATC_H
 16 
 17 #include <linux/types.h>
 18 #include <linux/mutex.h>
 19 #include <linux/pci.h>
 20 #include <linux/timer.h>
 21 #include <sound/core.h>
 22 
 23 #include "ctvmem.h"
 24 #include "cthardware.h"
 25 #include "ctresource.h"
 26 
 27 enum CTALSADEVS {               /* Types of alsa devices */
 28         FRONT,
 29         SURROUND,
 30         CLFE,
 31         SIDE,
 32         IEC958,
 33         MIXER,
 34         NUM_CTALSADEVS          /* This should always be the last */
 35 };
 36 
 37 struct ct_atc_chip_sub_details {
 38         u16 subsys;
 39         const char *nm_model;
 40 };
 41 
 42 struct ct_atc_chip_details {
 43         u16 vendor;
 44         u16 device;
 45         const struct ct_atc_chip_sub_details *sub_details;
 46         const char *nm_card;
 47 };
 48 
 49 struct ct_atc;
 50 struct ct_timer;
 51 struct ct_timer_instance;
 52 
 53 /* alsa pcm stream descriptor */
 54 struct ct_atc_pcm {
 55         struct snd_pcm_substream *substream;
 56         void (*interrupt)(struct ct_atc_pcm *apcm);
 57         struct ct_timer_instance *timer;
 58         unsigned int started:1;
 59 
 60         /* Only mono and interleaved modes are supported now. */
 61         struct ct_vm_block *vm_block;
 62         void *src;              /* SRC for interacting with host memory */
 63         void **srccs;           /* SRCs for sample rate conversion */
 64         void **srcimps;         /* SRC Input Mappers */
 65         void **amixers;         /* AMIXERs for routing converted data */
 66         void *mono;             /* A SUM resource for mixing chs to one */
 67         unsigned char n_srcc;   /* Number of converting SRCs */
 68         unsigned char n_srcimp; /* Number of SRC Input Mappers */
 69         unsigned char n_amixer; /* Number of AMIXERs */
 70 };
 71 
 72 /* Chip resource management object */
 73 struct ct_atc {
 74         struct pci_dev *pci;
 75         struct snd_card *card;
 76         unsigned int rsr; /* reference sample rate in Hz */
 77         unsigned int msr; /* master sample rate in rsr */
 78         unsigned int pll_rate; /* current rate of Phase Lock Loop */
 79 
 80         int chip_type;
 81         int model;
 82         const char *chip_name;
 83         const char *model_name;
 84 
 85         struct ct_vm *vm; /* device virtual memory manager for this card */
 86         int (*map_audio_buffer)(struct ct_atc *atc, struct ct_atc_pcm *apcm);
 87         void (*unmap_audio_buffer)(struct ct_atc *atc, struct ct_atc_pcm *apcm);
 88         unsigned long (*get_ptp_phys)(struct ct_atc *atc, int index);
 89 
 90         struct mutex atc_mutex;
 91 
 92         int (*pcm_playback_prepare)(struct ct_atc *atc,
 93                                     struct ct_atc_pcm *apcm);
 94         int (*pcm_playback_start)(struct ct_atc *atc, struct ct_atc_pcm *apcm);
 95         int (*pcm_playback_stop)(struct ct_atc *atc, struct ct_atc_pcm *apcm);
 96         int (*pcm_playback_position)(struct ct_atc *atc,
 97                                      struct ct_atc_pcm *apcm);
 98         int (*spdif_passthru_playback_prepare)(struct ct_atc *atc,
 99                                                struct ct_atc_pcm *apcm);
100         int (*pcm_capture_prepare)(struct ct_atc *atc, struct ct_atc_pcm *apcm);
101         int (*pcm_capture_start)(struct ct_atc *atc, struct ct_atc_pcm *apcm);
102         int (*pcm_capture_stop)(struct ct_atc *atc, struct ct_atc_pcm *apcm);
103         int (*pcm_capture_position)(struct ct_atc *atc,
104                                     struct ct_atc_pcm *apcm);
105         int (*pcm_release_resources)(struct ct_atc *atc,
106                                      struct ct_atc_pcm *apcm);
107         int (*select_line_in)(struct ct_atc *atc);
108         int (*select_mic_in)(struct ct_atc *atc);
109         int (*select_digit_io)(struct ct_atc *atc);
110         int (*line_front_unmute)(struct ct_atc *atc, unsigned char state);
111         int (*line_surround_unmute)(struct ct_atc *atc, unsigned char state);
112         int (*line_clfe_unmute)(struct ct_atc *atc, unsigned char state);
113         int (*line_rear_unmute)(struct ct_atc *atc, unsigned char state);
114         int (*line_in_unmute)(struct ct_atc *atc, unsigned char state);
115         int (*mic_unmute)(struct ct_atc *atc, unsigned char state);
116         int (*spdif_out_unmute)(struct ct_atc *atc, unsigned char state);
117         int (*spdif_in_unmute)(struct ct_atc *atc, unsigned char state);
118         int (*spdif_out_get_status)(struct ct_atc *atc, unsigned int *status);
119         int (*spdif_out_set_status)(struct ct_atc *atc, unsigned int status);
120         int (*spdif_out_passthru)(struct ct_atc *atc, unsigned char state);
121         struct capabilities (*capabilities)(struct ct_atc *atc);
122         int (*output_switch_get)(struct ct_atc *atc);
123         int (*output_switch_put)(struct ct_atc *atc, int position);
124         int (*mic_source_switch_get)(struct ct_atc *atc);
125         int (*mic_source_switch_put)(struct ct_atc *atc, int position);
126 
127         /* Don't touch! Used for internal object. */
128         void *rsc_mgrs[NUM_RSCTYP]; /* chip resource managers */
129         void *mixer;            /* internal mixer object */
130         struct hw *hw;          /* chip specific hardware access object */
131         void **daios;           /* digital audio io resources */
132         void **pcm;             /* SUMs for collecting all pcm stream */
133         void **srcs;            /* Sample Rate Converters for input signal */
134         void **srcimps;         /* input mappers for SRCs */
135         unsigned char n_daio;
136         unsigned char n_src;
137         unsigned char n_srcimp;
138         unsigned char n_pcm;
139 
140         struct ct_timer *timer;
141 
142 #ifdef CONFIG_PM_SLEEP
143         int (*suspend)(struct ct_atc *atc);
144         int (*resume)(struct ct_atc *atc);
145 #define NUM_PCMS (NUM_CTALSADEVS - 1)
146         struct snd_pcm *pcms[NUM_PCMS];
147 #endif
148 };
149 
150 
151 int ct_atc_create(struct snd_card *card, struct pci_dev *pci,
152                   unsigned int rsr, unsigned int msr, int chip_type,
153                   unsigned int subsysid, struct ct_atc **ratc);
154 int ct_atc_create_alsa_devs(struct ct_atc *atc);
155 
156 #endif /* CTATC_H */
157 

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