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

TOMOYO Linux Cross Reference
Linux/sound/pci/cs5535audio/cs5535audio.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 ] ~

Diff markup

Differences between /sound/pci/cs5535audio/cs5535audio.h (Version linux-6.11.5) and /sound/pci/cs5535audio/cs5535audio.h (Version linux-5.8.18)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __SOUND_CS5535AUDIO_H                       2 #ifndef __SOUND_CS5535AUDIO_H
  3 #define __SOUND_CS5535AUDIO_H                       3 #define __SOUND_CS5535AUDIO_H
  4                                                     4 
  5 #define cs_writel(cs5535au, reg, val)   outl(v      5 #define cs_writel(cs5535au, reg, val)   outl(val, (cs5535au)->port + reg)
  6 #define cs_writeb(cs5535au, reg, val)   outb(v      6 #define cs_writeb(cs5535au, reg, val)   outb(val, (cs5535au)->port + reg)
  7 #define cs_readl(cs5535au, reg)         inl((c      7 #define cs_readl(cs5535au, reg)         inl((cs5535au)->port + reg)
  8 #define cs_readw(cs5535au, reg)         inw((c      8 #define cs_readw(cs5535au, reg)         inw((cs5535au)->port + reg)
  9 #define cs_readb(cs5535au, reg)         inb((c      9 #define cs_readb(cs5535au, reg)         inb((cs5535au)->port + reg)
 10                                                    10 
 11 #define CS5535AUDIO_MAX_DESCRIPTORS     128        11 #define CS5535AUDIO_MAX_DESCRIPTORS     128
 12                                                    12 
 13 /* acc_codec bar0 reg addrs */                     13 /* acc_codec bar0 reg addrs */
 14 #define ACC_GPIO_STATUS                 0x00       14 #define ACC_GPIO_STATUS                 0x00
 15 #define ACC_CODEC_STATUS                0x08       15 #define ACC_CODEC_STATUS                0x08
 16 #define ACC_CODEC_CNTL                  0x0C       16 #define ACC_CODEC_CNTL                  0x0C
 17 #define ACC_IRQ_STATUS                  0x12       17 #define ACC_IRQ_STATUS                  0x12
 18 #define ACC_BM0_CMD                     0x20       18 #define ACC_BM0_CMD                     0x20
 19 #define ACC_BM1_CMD                     0x28       19 #define ACC_BM1_CMD                     0x28
 20 #define ACC_BM0_PRD                     0x24       20 #define ACC_BM0_PRD                     0x24
 21 #define ACC_BM1_PRD                     0x2C       21 #define ACC_BM1_PRD                     0x2C
 22 #define ACC_BM0_STATUS                  0x21       22 #define ACC_BM0_STATUS                  0x21
 23 #define ACC_BM1_STATUS                  0x29       23 #define ACC_BM1_STATUS                  0x29
 24 #define ACC_BM0_PNTR                    0x60       24 #define ACC_BM0_PNTR                    0x60
 25 #define ACC_BM1_PNTR                    0x64       25 #define ACC_BM1_PNTR                    0x64
 26                                                    26 
 27 /* acc_codec bar0 reg bits */                      27 /* acc_codec bar0 reg bits */
 28 /* ACC_IRQ_STATUS */                               28 /* ACC_IRQ_STATUS */
 29 #define IRQ_STS                         0          29 #define IRQ_STS                         0
 30 #define WU_IRQ_STS                      1          30 #define WU_IRQ_STS                      1
 31 #define BM0_IRQ_STS                     2          31 #define BM0_IRQ_STS                     2
 32 #define BM1_IRQ_STS                     3          32 #define BM1_IRQ_STS                     3
 33 /* ACC_BMX_STATUS */                               33 /* ACC_BMX_STATUS */
 34 #define EOP                             (1<<0)     34 #define EOP                             (1<<0)
 35 #define BM_EOP_ERR                      (1<<1)     35 #define BM_EOP_ERR                      (1<<1)
 36 /* ACC_BMX_CTL */                                  36 /* ACC_BMX_CTL */
 37 #define BM_CTL_EN                       0x01       37 #define BM_CTL_EN                       0x01
 38 #define BM_CTL_PAUSE                    0x03       38 #define BM_CTL_PAUSE                    0x03
 39 #define BM_CTL_DIS                      0x00       39 #define BM_CTL_DIS                      0x00
 40 #define BM_CTL_BYTE_ORD_LE              0x00       40 #define BM_CTL_BYTE_ORD_LE              0x00
 41 #define BM_CTL_BYTE_ORD_BE              0x04       41 #define BM_CTL_BYTE_ORD_BE              0x04
 42 /* cs5535 specific ac97 codec register defines     42 /* cs5535 specific ac97 codec register defines */
 43 #define CMD_MASK                        0xFF00     43 #define CMD_MASK                        0xFF00FFFF
 44 #define CMD_NEW                         0x0001     44 #define CMD_NEW                         0x00010000
 45 #define STS_NEW                         0x0002     45 #define STS_NEW                         0x00020000
 46 #define PRM_RDY_STS                     0x0080     46 #define PRM_RDY_STS                     0x00800000
 47 #define ACC_CODEC_CNTL_WR_CMD           (~0x80     47 #define ACC_CODEC_CNTL_WR_CMD           (~0x80000000)
 48 #define ACC_CODEC_CNTL_RD_CMD           0x8000     48 #define ACC_CODEC_CNTL_RD_CMD           0x80000000
 49 #define ACC_CODEC_CNTL_LNK_SHUTDOWN     0x0004     49 #define ACC_CODEC_CNTL_LNK_SHUTDOWN     0x00040000
 50 #define ACC_CODEC_CNTL_LNK_WRM_RST      0x0002     50 #define ACC_CODEC_CNTL_LNK_WRM_RST      0x00020000
 51 #define PRD_JMP                         0x2000     51 #define PRD_JMP                         0x2000
 52 #define PRD_EOP                         0x4000     52 #define PRD_EOP                         0x4000
 53 #define PRD_EOT                         0x8000     53 #define PRD_EOT                         0x8000
 54                                                    54 
 55 enum { CS5535AUDIO_DMA_PLAYBACK, CS5535AUDIO_D     55 enum { CS5535AUDIO_DMA_PLAYBACK, CS5535AUDIO_DMA_CAPTURE, NUM_CS5535AUDIO_DMAS };
 56                                                    56 
 57 struct cs5535audio;                                57 struct cs5535audio;
 58                                                    58 
 59 struct cs5535audio_dma_ops {                       59 struct cs5535audio_dma_ops {
 60         int type;                                  60         int type;
 61         void (*enable_dma)(struct cs5535audio      61         void (*enable_dma)(struct cs5535audio *cs5535au);
 62         void (*disable_dma)(struct cs5535audio     62         void (*disable_dma)(struct cs5535audio *cs5535au);
 63         void (*pause_dma)(struct cs5535audio *     63         void (*pause_dma)(struct cs5535audio *cs5535au);
 64         void (*setup_prd)(struct cs5535audio *     64         void (*setup_prd)(struct cs5535audio *cs5535au, u32 prd_addr);
 65         u32 (*read_prd)(struct cs5535audio *cs     65         u32 (*read_prd)(struct cs5535audio *cs5535au);
 66         u32 (*read_dma_pntr)(struct cs5535audi     66         u32 (*read_dma_pntr)(struct cs5535audio *cs5535au);
 67 };                                                 67 };
 68                                                    68 
 69 struct cs5535audio_dma_desc {                      69 struct cs5535audio_dma_desc {
 70         __le32 addr;                               70         __le32 addr;
 71         __le16 size;                               71         __le16 size;
 72         __le16 ctlreserved;                        72         __le16 ctlreserved;
 73 };                                                 73 };
 74                                                    74 
 75 struct cs5535audio_dma {                           75 struct cs5535audio_dma {
 76         const struct cs5535audio_dma_ops *ops;     76         const struct cs5535audio_dma_ops *ops;
 77         struct snd_dma_buffer desc_buf;            77         struct snd_dma_buffer desc_buf;
 78         struct snd_pcm_substream *substream;       78         struct snd_pcm_substream *substream;
 79         unsigned int buf_addr, buf_bytes;          79         unsigned int buf_addr, buf_bytes;
 80         unsigned int period_bytes, periods;        80         unsigned int period_bytes, periods;
 81         u32 saved_prd;                             81         u32 saved_prd;
 82         int pcm_open_flag;                         82         int pcm_open_flag;
 83 };                                                 83 };
 84                                                    84 
 85 struct cs5535audio {                               85 struct cs5535audio {
 86         struct snd_card *card;                     86         struct snd_card *card;
 87         struct snd_ac97 *ac97;                     87         struct snd_ac97 *ac97;
 88         struct snd_pcm *pcm;                       88         struct snd_pcm *pcm;
 89         int irq;                                   89         int irq;
 90         struct pci_dev *pci;                       90         struct pci_dev *pci;
 91         unsigned long port;                        91         unsigned long port;
 92         spinlock_t reg_lock;                       92         spinlock_t reg_lock;
 93         struct snd_pcm_substream *playback_sub     93         struct snd_pcm_substream *playback_substream;
 94         struct snd_pcm_substream *capture_subs     94         struct snd_pcm_substream *capture_substream;
 95         struct cs5535audio_dma dmas[NUM_CS5535     95         struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS];
 96 };                                                 96 };
 97                                                    97 
 98 extern const struct dev_pm_ops snd_cs5535audio     98 extern const struct dev_pm_ops snd_cs5535audio_pm;
 99                                                    99 
100 #ifdef CONFIG_OLPC                                100 #ifdef CONFIG_OLPC
101 void olpc_prequirks(struct snd_card *card,        101 void olpc_prequirks(struct snd_card *card,
102                     struct snd_ac97_template *    102                     struct snd_ac97_template *ac97);
103 int olpc_quirks(struct snd_card *card, struct     103 int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97);
104 void olpc_quirks_cleanup(void);                   104 void olpc_quirks_cleanup(void);
105 void olpc_analog_input(struct snd_ac97 *ac97,     105 void olpc_analog_input(struct snd_ac97 *ac97, int on);
106 void olpc_mic_bias(struct snd_ac97 *ac97, int     106 void olpc_mic_bias(struct snd_ac97 *ac97, int on);
107                                                   107 
108 static inline void olpc_capture_open(struct sn    108 static inline void olpc_capture_open(struct snd_ac97 *ac97)
109 {                                                 109 {
110         /* default to Analog Input off */         110         /* default to Analog Input off */
111         olpc_analog_input(ac97, 0);               111         olpc_analog_input(ac97, 0);
112         /* enable MIC Bias for recording */       112         /* enable MIC Bias for recording */
113         olpc_mic_bias(ac97, 1);                   113         olpc_mic_bias(ac97, 1);
114 }                                                 114 }
115                                                   115 
116 static inline void olpc_capture_close(struct s    116 static inline void olpc_capture_close(struct snd_ac97 *ac97)
117 {                                                 117 {
118         /* disable Analog Input */                118         /* disable Analog Input */
119         olpc_analog_input(ac97, 0);               119         olpc_analog_input(ac97, 0);
120         /* disable the MIC Bias (so the record    120         /* disable the MIC Bias (so the recording LED turns off) */
121         olpc_mic_bias(ac97, 0);                   121         olpc_mic_bias(ac97, 0);
122 }                                                 122 }
123 #else                                             123 #else
124 static inline void olpc_prequirks(struct snd_c    124 static inline void olpc_prequirks(struct snd_card *card,
125                 struct snd_ac97_template *ac97    125                 struct snd_ac97_template *ac97) { }
126 static inline int olpc_quirks(struct snd_card     126 static inline int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)
127 {                                                 127 {
128         return 0;                                 128         return 0;
129 }                                                 129 }
130 static inline void olpc_quirks_cleanup(void) {    130 static inline void olpc_quirks_cleanup(void) { }
131 static inline void olpc_analog_input(struct sn    131 static inline void olpc_analog_input(struct snd_ac97 *ac97, int on) { }
132 static inline void olpc_mic_bias(struct snd_ac    132 static inline void olpc_mic_bias(struct snd_ac97 *ac97, int on) { }
133 static inline void olpc_capture_open(struct sn    133 static inline void olpc_capture_open(struct snd_ac97 *ac97) { }
134 static inline void olpc_capture_close(struct s    134 static inline void olpc_capture_close(struct snd_ac97 *ac97) { }
135 #endif                                            135 #endif
136                                                   136 
137 int snd_cs5535audio_pcm(struct cs5535audio *cs    137 int snd_cs5535audio_pcm(struct cs5535audio *cs5535audio);
138                                                   138 
139 #endif /* __SOUND_CS5535AUDIO_H */                139 #endif /* __SOUND_CS5535AUDIO_H */
140                                                   140 
141                                                   141 

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