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

TOMOYO Linux Cross Reference
Linux/sound/soc/bcm/cygnus-ssp.h

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ 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.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ 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) 2014-2015 Broadcom Corporation
  3  *
  4  * This program is free software; you can redistribute it and/or
  5  * modify it under the terms of the GNU General Public License as
  6  * published by the Free Software Foundation version 2.
  7  *
  8  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  9  * kind, whether express or implied; without even the implied warranty
 10  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 11  * GNU General Public License for more details.
 12  */
 13 #ifndef __CYGNUS_SSP_H__
 14 #define __CYGNUS_SSP_H__
 15 
 16 #define CYGNUS_TDM_DAI_MAX_SLOTS 16
 17 
 18 #define CYGNUS_MAX_PLAYBACK_PORTS 4
 19 #define CYGNUS_MAX_CAPTURE_PORTS 3
 20 #define CYGNUS_MAX_I2S_PORTS 3
 21 #define CYGNUS_MAX_PORTS  CYGNUS_MAX_PLAYBACK_PORTS
 22 #define CYGNUS_AUIDO_MAX_NUM_CLKS 3
 23 
 24 #define CYGNUS_SSP_FRAMEBITS_DIV 1
 25 
 26 #define CYGNUS_SSPMODE_I2S 0
 27 #define CYGNUS_SSPMODE_TDM 1
 28 #define CYGNUS_SSPMODE_UNKNOWN -1
 29 
 30 #define CYGNUS_SSP_CLKSRC_PLL      0
 31 
 32 /* Max string length of our dt property names */
 33 #define PROP_LEN_MAX 40
 34 
 35 struct ringbuf_regs {
 36         unsigned rdaddr;
 37         unsigned wraddr;
 38         unsigned baseaddr;
 39         unsigned endaddr;
 40         unsigned fmark;   /* freemark for play, fullmark for caputure */
 41         unsigned period_bytes;
 42         unsigned buf_size;
 43 };
 44 
 45 #define RINGBUF_REG_PLAYBACK(num) ((struct ringbuf_regs) { \
 46         .rdaddr = SRC_RBUF_ ##num## _RDADDR_OFFSET, \
 47         .wraddr = SRC_RBUF_ ##num## _WRADDR_OFFSET, \
 48         .baseaddr = SRC_RBUF_ ##num## _BASEADDR_OFFSET, \
 49         .endaddr = SRC_RBUF_ ##num## _ENDADDR_OFFSET, \
 50         .fmark = SRC_RBUF_ ##num## _FREE_MARK_OFFSET, \
 51         .period_bytes = 0, \
 52         .buf_size = 0, \
 53 })
 54 
 55 #define RINGBUF_REG_CAPTURE(num) ((struct ringbuf_regs)  { \
 56         .rdaddr = DST_RBUF_ ##num## _RDADDR_OFFSET, \
 57         .wraddr = DST_RBUF_ ##num## _WRADDR_OFFSET, \
 58         .baseaddr = DST_RBUF_ ##num## _BASEADDR_OFFSET, \
 59         .endaddr = DST_RBUF_ ##num## _ENDADDR_OFFSET, \
 60         .fmark = DST_RBUF_ ##num## _FULL_MARK_OFFSET, \
 61         .period_bytes = 0, \
 62         .buf_size = 0, \
 63 })
 64 
 65 enum cygnus_audio_port_type {
 66         PORT_TDM,
 67         PORT_SPDIF,
 68 };
 69 
 70 struct cygnus_ssp_regs {
 71         u32 i2s_stream_cfg;
 72         u32 i2s_cfg;
 73         u32 i2s_cap_stream_cfg;
 74         u32 i2s_cap_cfg;
 75         u32 i2s_mclk_cfg;
 76 
 77         u32 bf_destch_ctrl;
 78         u32 bf_destch_cfg;
 79         u32 bf_sourcech_ctrl;
 80         u32 bf_sourcech_cfg;
 81         u32 bf_sourcech_grp;
 82 };
 83 
 84 struct cygnus_track_clk {
 85         bool cap_en;
 86         bool play_en;
 87         bool cap_clk_en;
 88         bool play_clk_en;
 89 };
 90 
 91 struct cygnus_aio_port {
 92         int portnum;
 93         int mode;
 94         bool is_slave;
 95         int streams_on;   /* will be 0 if both capture and play are off */
 96         int fsync_width;
 97         int port_type;
 98 
 99         u32 mclk;
100         u32 lrclk;
101         u32 bit_per_frame;
102         u32 pll_clk_num;
103 
104         struct cygnus_audio *cygaud;
105         struct cygnus_ssp_regs regs;
106 
107         struct ringbuf_regs play_rb_regs;
108         struct ringbuf_regs capture_rb_regs;
109 
110         struct snd_pcm_substream *play_stream;
111         struct snd_pcm_substream *capture_stream;
112 
113         struct cygnus_track_clk clk_trace;
114 };
115 
116 
117 struct cygnus_audio {
118         struct cygnus_aio_port  portinfo[CYGNUS_MAX_PORTS];
119 
120         int irq_num;
121         void __iomem *audio;
122         struct device *dev;
123         void __iomem *i2s_in;
124 
125         struct clk *audio_clk[CYGNUS_AUIDO_MAX_NUM_CLKS];
126         int active_ports;
127         unsigned long vco_rate;
128 };
129 
130 extern int cygnus_ssp_get_mode(struct snd_soc_dai *cpu_dai);
131 extern int cygnus_ssp_add_pll_tweak_controls(struct snd_soc_pcm_runtime *rtd);
132 extern int cygnus_ssp_set_custom_fsync_width(struct snd_soc_dai *cpu_dai,
133                                                 int len);
134 extern int cygnus_soc_platform_register(struct device *dev,
135                                         struct cygnus_audio *cygaud);
136 extern int cygnus_soc_platform_unregister(struct device *dev);
137 extern int cygnus_ssp_set_custom_fsync_width(struct snd_soc_dai *cpu_dai,
138         int len);
139 #endif
140 

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