aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/stm/stm32_sai.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-06 13:56:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-06 13:56:51 -0400
commit920f2ecdf6c3b3526f60fbd38c68597953cad3ee (patch)
tree18188922ba38a5c53ee8d17032eb5c46dffc7fa2 /sound/soc/stm/stm32_sai.h
parent9ced560b82606b35adb33a27012a148d418a4c1f (diff)
parentfc18282cdcba984ab89c74d7e844c10114ae0795 (diff)
Merge tag 'sound-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "This development cycle resulted in a fair amount of changes in both core and driver sides. The most significant change in ALSA core is about PCM. Also the support of of-graph card and the new DAPM widget for DSP are noteworthy changes in ASoC core. And there're lots of small changes splat over the tree, as you can see in diffstat. Below are a few highlights: ALSA core: - Removal of set_fs() hackery from PCM core stuff, and the code reorganization / optimization thereafter - Improved support of PCM ack ops, and a new ABI for improved control/status mmap handling - Lots of constifications in various codes ASoC core: - The support of of-graph card, which may work as a better generic device for a replacement of simple-card - New widget types intended mainly for use with DSPs ASoC drivers: - New drivers for Allwinner V3s SoCs - Ensonic ES8316 codec support - More Intel SKL and KBL works - More device support for Intel SST Atom (mostly for cheap tablets and 2-in-1 devices) - Support for Rockchip PDM controllers - Support for STM32 I2S and S/PDIF controllers - Support for ZTE AUD96P22 codecs HD-audio: - Support of new Realtek codecs (ALC215/ALC285/ALC289), more quirks for HP and Dell machines - A few more fixes for i915 component binding" * tag 'sound-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (418 commits) ALSA: hda - Fix unbalance of i915 module refcount ASoC: Intel: Skylake: Remove driver debugfs exit ASoC: Intel: Skylake: explicitly add the headers sst-dsp.h ALSA: hda/realtek - Remove GPIO_MASK ALSA: hda/realtek - Fix typo of pincfg for Dell quirk ALSA: pcm: add a documentation for tracepoints ALSA: atmel: ac97c: fix error return code in atmel_ac97c_probe() ALSA: x86: fix error return code in hdmi_lpe_audio_probe() ASoC: Intel: Skylake: Add support to read firmware registers ASoC: Intel: Skylake: Add sram address to sst_addr structure ASoC: Intel: Skylake: Debugfs facility to dump module config ASoC: Intel: Skylake: Add debugfs support ASoC: fix semicolon.cocci warnings ASoC: rt5645: Add quirk override by module option ASoC: rsnd: make arrays path and cmd_case static const ASoC: audio-graph-card: add widgets and routing for external amplifier support ASoC: audio-graph-card: update bindings for amplifier support ASoC: rt5665: calibration should be done before jack detection ASoC: rsnd: constify dev_pm_ops structures. ASoC: nau8825: change crosstalk-bypass property to bool type ...
Diffstat (limited to 'sound/soc/stm/stm32_sai.h')
-rw-r--r--sound/soc/stm/stm32_sai.h73
1 files changed, 67 insertions, 6 deletions
diff --git a/sound/soc/stm/stm32_sai.h b/sound/soc/stm/stm32_sai.h
index a801fda5066f..889974dc62d9 100644
--- a/sound/soc/stm/stm32_sai.h
+++ b/sound/soc/stm/stm32_sai.h
@@ -31,6 +31,10 @@
31#define STM_SAI_CLRFR_REGX 0x18 31#define STM_SAI_CLRFR_REGX 0x18
32#define STM_SAI_DR_REGX 0x1C 32#define STM_SAI_DR_REGX 0x1C
33 33
34/* Sub-block A registers, relative to sub-block A address */
35#define STM_SAI_PDMCR_REGX 0x40
36#define STM_SAI_PDMLY_REGX 0x44
37
34/******************** Bit definition for SAI_GCR register *******************/ 38/******************** Bit definition for SAI_GCR register *******************/
35#define SAI_GCR_SYNCIN_SHIFT 0 39#define SAI_GCR_SYNCIN_SHIFT 0
36#define SAI_GCR_SYNCIN_MASK GENMASK(1, SAI_GCR_SYNCIN_SHIFT) 40#define SAI_GCR_SYNCIN_MASK GENMASK(1, SAI_GCR_SYNCIN_SHIFT)
@@ -75,10 +79,11 @@
75#define SAI_XCR1_NODIV BIT(SAI_XCR1_NODIV_SHIFT) 79#define SAI_XCR1_NODIV BIT(SAI_XCR1_NODIV_SHIFT)
76 80
77#define SAI_XCR1_MCKDIV_SHIFT 20 81#define SAI_XCR1_MCKDIV_SHIFT 20
78#define SAI_XCR1_MCKDIV_WIDTH 4 82#define SAI_XCR1_MCKDIV_WIDTH(x) (((x) == SAI_STM32F4) ? 4 : 6)
79#define SAI_XCR1_MCKDIV_MASK GENMASK(24, SAI_XCR1_MCKDIV_SHIFT) 83#define SAI_XCR1_MCKDIV_MASK(x) GENMASK((SAI_XCR1_MCKDIV_SHIFT + (x) - 1),\
84 SAI_XCR1_MCKDIV_SHIFT)
80#define SAI_XCR1_MCKDIV_SET(x) ((x) << SAI_XCR1_MCKDIV_SHIFT) 85#define SAI_XCR1_MCKDIV_SET(x) ((x) << SAI_XCR1_MCKDIV_SHIFT)
81#define SAI_XCR1_MCKDIV_MAX ((1 << SAI_XCR1_MCKDIV_WIDTH) - 1) 86#define SAI_XCR1_MCKDIV_MAX(x) ((1 << SAI_XCR1_MCKDIV_WIDTH(x)) - 1)
82 87
83#define SAI_XCR1_OSR_SHIFT 26 88#define SAI_XCR1_OSR_SHIFT 26
84#define SAI_XCR1_OSR BIT(SAI_XCR1_OSR_SHIFT) 89#define SAI_XCR1_OSR BIT(SAI_XCR1_OSR_SHIFT)
@@ -125,7 +130,6 @@
125#define SAI_XFRCR_FSOFF BIT(SAI_XFRCR_FSOFF_SHIFT) 130#define SAI_XFRCR_FSOFF BIT(SAI_XFRCR_FSOFF_SHIFT)
126 131
127/****************** Bit definition for SAI_XSLOTR register ******************/ 132/****************** Bit definition for SAI_XSLOTR register ******************/
128
129#define SAI_XSLOTR_FBOFF_SHIFT 0 133#define SAI_XSLOTR_FBOFF_SHIFT 0
130#define SAI_XSLOTR_FBOFF_MASK GENMASK(4, SAI_XSLOTR_FBOFF_SHIFT) 134#define SAI_XSLOTR_FBOFF_MASK GENMASK(4, SAI_XSLOTR_FBOFF_SHIFT)
131#define SAI_XSLOTR_FBOFF_SET(x) ((x) << SAI_XSLOTR_FBOFF_SHIFT) 135#define SAI_XSLOTR_FBOFF_SET(x) ((x) << SAI_XSLOTR_FBOFF_SHIFT)
@@ -179,8 +183,65 @@
179#define SAI_XCLRFR_SHIFT 0 183#define SAI_XCLRFR_SHIFT 0
180#define SAI_XCLRFR_MASK GENMASK(6, SAI_XCLRFR_SHIFT) 184#define SAI_XCLRFR_MASK GENMASK(6, SAI_XCLRFR_SHIFT)
181 185
186/****************** Bit definition for SAI_PDMCR register ******************/
187#define SAI_PDMCR_PDMEN BIT(0)
188
189#define SAI_PDMCR_MICNBR_SHIFT 4
190#define SAI_PDMCR_MICNBR_MASK GENMASK(5, SAI_PDMCR_MICNBR_SHIFT)
191#define SAI_PDMCR_MICNBR_SET(x) ((x) << SAI_PDMCR_MICNBR_SHIFT)
192
193#define SAI_PDMCR_CKEN1 BIT(8)
194#define SAI_PDMCR_CKEN2 BIT(9)
195#define SAI_PDMCR_CKEN3 BIT(10)
196#define SAI_PDMCR_CKEN4 BIT(11)
197
198/****************** Bit definition for (SAI_PDMDLY register ****************/
199#define SAI_PDMDLY_1L_SHIFT 0
200#define SAI_PDMDLY_1L_MASK GENMASK(2, SAI_PDMDLY_1L_SHIFT)
201#define SAI_PDMDLY_1L_WIDTH 3
202
203#define SAI_PDMDLY_1R_SHIFT 4
204#define SAI_PDMDLY_1R_MASK GENMASK(6, SAI_PDMDLY_1R_SHIFT)
205#define SAI_PDMDLY_1R_WIDTH 3
206
207#define SAI_PDMDLY_2L_SHIFT 8
208#define SAI_PDMDLY_2L_MASK GENMASK(10, SAI_PDMDLY_2L_SHIFT)
209#define SAI_PDMDLY_2L_WIDTH 3
210
211#define SAI_PDMDLY_2R_SHIFT 12
212#define SAI_PDMDLY_2R_MASK GENMASK(14, SAI_PDMDLY_2R_SHIFT)
213#define SAI_PDMDLY_2R_WIDTH 3
214
215#define SAI_PDMDLY_3L_SHIFT 16
216#define SAI_PDMDLY_3L_MASK GENMASK(18, SAI_PDMDLY_3L_SHIFT)
217#define SAI_PDMDLY_3L_WIDTH 3
218
219#define SAI_PDMDLY_3R_SHIFT 20
220#define SAI_PDMDLY_3R_MASK GENMASK(22, SAI_PDMDLY_3R_SHIFT)
221#define SAI_PDMDLY_3R_WIDTH 3
222
223#define SAI_PDMDLY_4L_SHIFT 24
224#define SAI_PDMDLY_4L_MASK GENMASK(26, SAI_PDMDLY_4L_SHIFT)
225#define SAI_PDMDLY_4L_WIDTH 3
226
227#define SAI_PDMDLY_4R_SHIFT 28
228#define SAI_PDMDLY_4R_MASK GENMASK(30, SAI_PDMDLY_4R_SHIFT)
229#define SAI_PDMDLY_4R_WIDTH 3
230
231#define STM_SAI_IS_F4(ip) ((ip)->conf->version == SAI_STM32F4)
232#define STM_SAI_IS_H7(ip) ((ip)->conf->version == SAI_STM32H7)
233
182enum stm32_sai_version { 234enum stm32_sai_version {
183 SAI_STM32F4 235 SAI_STM32F4,
236 SAI_STM32H7
237};
238
239/**
240 * struct stm32_sai_conf - SAI configuration
241 * @version: SAI version
242 */
243struct stm32_sai_conf {
244 int version;
184}; 245};
185 246
186/** 247/**
@@ -195,6 +256,6 @@ struct stm32_sai_data {
195 struct platform_device *pdev; 256 struct platform_device *pdev;
196 struct clk *clk_x8k; 257 struct clk *clk_x8k;
197 struct clk *clk_x11k; 258 struct clk *clk_x11k;
198 int version; 259 struct stm32_sai_conf *conf;
199 int irq; 260 int irq;
200}; 261};