fsi.c 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  1. /*
  2. * Fifo-attached Serial Interface (FSI) support for SH7724
  3. *
  4. * Copyright (C) 2009 Renesas Solutions Corp.
  5. * Kuninori Morimoto <morimoto.kuninori@renesas.com>
  6. *
  7. * Based on ssi.c
  8. * Copyright (c) 2007 Manuel Lauss <mano@roarinelk.homelinux.net>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/delay.h>
  15. #include <linux/pm_runtime.h>
  16. #include <linux/io.h>
  17. #include <linux/slab.h>
  18. #include <sound/soc.h>
  19. #include <sound/sh_fsi.h>
  20. /* PortA/PortB register */
  21. #define REG_DO_FMT 0x0000
  22. #define REG_DOFF_CTL 0x0004
  23. #define REG_DOFF_ST 0x0008
  24. #define REG_DI_FMT 0x000C
  25. #define REG_DIFF_CTL 0x0010
  26. #define REG_DIFF_ST 0x0014
  27. #define REG_CKG1 0x0018
  28. #define REG_CKG2 0x001C
  29. #define REG_DIDT 0x0020
  30. #define REG_DODT 0x0024
  31. #define REG_MUTE_ST 0x0028
  32. #define REG_OUT_SEL 0x0030
  33. /* master register */
  34. #define MST_CLK_RST 0x0210
  35. #define MST_SOFT_RST 0x0214
  36. #define MST_FIFO_SZ 0x0218
  37. /* core register (depend on FSI version) */
  38. #define A_MST_CTLR 0x0180
  39. #define B_MST_CTLR 0x01A0
  40. #define CPU_INT_ST 0x01F4
  41. #define CPU_IEMSK 0x01F8
  42. #define CPU_IMSK 0x01FC
  43. #define INT_ST 0x0200
  44. #define IEMSK 0x0204
  45. #define IMSK 0x0208
  46. /* DO_FMT */
  47. /* DI_FMT */
  48. #define CR_BWS_24 (0x0 << 20) /* FSI2 */
  49. #define CR_BWS_16 (0x1 << 20) /* FSI2 */
  50. #define CR_BWS_20 (0x2 << 20) /* FSI2 */
  51. #define CR_DTMD_PCM (0x0 << 8) /* FSI2 */
  52. #define CR_DTMD_SPDIF_PCM (0x1 << 8) /* FSI2 */
  53. #define CR_DTMD_SPDIF_STREAM (0x2 << 8) /* FSI2 */
  54. #define CR_MONO (0x0 << 4)
  55. #define CR_MONO_D (0x1 << 4)
  56. #define CR_PCM (0x2 << 4)
  57. #define CR_I2S (0x3 << 4)
  58. #define CR_TDM (0x4 << 4)
  59. #define CR_TDM_D (0x5 << 4)
  60. /* DOFF_CTL */
  61. /* DIFF_CTL */
  62. #define IRQ_HALF 0x00100000
  63. #define FIFO_CLR 0x00000001
  64. /* DOFF_ST */
  65. #define ERR_OVER 0x00000010
  66. #define ERR_UNDER 0x00000001
  67. #define ST_ERR (ERR_OVER | ERR_UNDER)
  68. /* CKG1 */
  69. #define ACKMD_MASK 0x00007000
  70. #define BPFMD_MASK 0x00000700
  71. #define DIMD (1 << 4)
  72. #define DOMD (1 << 0)
  73. /* A/B MST_CTLR */
  74. #define BP (1 << 4) /* Fix the signal of Biphase output */
  75. #define SE (1 << 0) /* Fix the master clock */
  76. /* CLK_RST */
  77. #define B_CLK 0x00000010
  78. #define A_CLK 0x00000001
  79. /* IO SHIFT / MACRO */
  80. #define BI_SHIFT 12
  81. #define BO_SHIFT 8
  82. #define AI_SHIFT 4
  83. #define AO_SHIFT 0
  84. #define AB_IO(param, shift) (param << shift)
  85. /* SOFT_RST */
  86. #define PBSR (1 << 12) /* Port B Software Reset */
  87. #define PASR (1 << 8) /* Port A Software Reset */
  88. #define IR (1 << 4) /* Interrupt Reset */
  89. #define FSISR (1 << 0) /* Software Reset */
  90. /* OUT_SEL (FSI2) */
  91. #define DMMD (1 << 4) /* SPDIF output timing 0: Biphase only */
  92. /* 1: Biphase and serial */
  93. /* FIFO_SZ */
  94. #define FIFO_SZ_MASK 0x7
  95. #define FSI_RATES SNDRV_PCM_RATE_8000_96000
  96. #define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE)
  97. typedef int (*set_rate_func)(struct device *dev, int is_porta, int rate, int enable);
  98. /*
  99. * FSI driver use below type name for variable
  100. *
  101. * xxx_len : data length
  102. * xxx_width : data width
  103. * xxx_offset : data offset
  104. * xxx_num : number of data
  105. */
  106. /*
  107. * struct
  108. */
  109. struct fsi_stream {
  110. struct snd_pcm_substream *substream;
  111. int fifo_max_num;
  112. int buff_offset;
  113. int buff_len;
  114. int period_len;
  115. int period_num;
  116. int uerr_num;
  117. int oerr_num;
  118. };
  119. struct fsi_priv {
  120. void __iomem *base;
  121. struct fsi_master *master;
  122. struct fsi_stream playback;
  123. struct fsi_stream capture;
  124. int chan_num:16;
  125. int clk_master:1;
  126. long rate;
  127. };
  128. struct fsi_core {
  129. int ver;
  130. u32 int_st;
  131. u32 iemsk;
  132. u32 imsk;
  133. u32 a_mclk;
  134. u32 b_mclk;
  135. };
  136. struct fsi_master {
  137. void __iomem *base;
  138. int irq;
  139. struct fsi_priv fsia;
  140. struct fsi_priv fsib;
  141. struct fsi_core *core;
  142. struct sh_fsi_platform_info *info;
  143. spinlock_t lock;
  144. };
  145. /*
  146. * basic read write function
  147. */
  148. static void __fsi_reg_write(u32 reg, u32 data)
  149. {
  150. /* valid data area is 24bit */
  151. data &= 0x00ffffff;
  152. __raw_writel(data, reg);
  153. }
  154. static u32 __fsi_reg_read(u32 reg)
  155. {
  156. return __raw_readl(reg);
  157. }
  158. static void __fsi_reg_mask_set(u32 reg, u32 mask, u32 data)
  159. {
  160. u32 val = __fsi_reg_read(reg);
  161. val &= ~mask;
  162. val |= data & mask;
  163. __fsi_reg_write(reg, val);
  164. }
  165. #define fsi_reg_write(p, r, d)\
  166. __fsi_reg_write((u32)(p->base + REG_##r), d)
  167. #define fsi_reg_read(p, r)\
  168. __fsi_reg_read((u32)(p->base + REG_##r))
  169. #define fsi_reg_mask_set(p, r, m, d)\
  170. __fsi_reg_mask_set((u32)(p->base + REG_##r), m, d)
  171. #define fsi_master_read(p, r) _fsi_master_read(p, MST_##r)
  172. #define fsi_core_read(p, r) _fsi_master_read(p, p->core->r)
  173. static u32 _fsi_master_read(struct fsi_master *master, u32 reg)
  174. {
  175. u32 ret;
  176. unsigned long flags;
  177. spin_lock_irqsave(&master->lock, flags);
  178. ret = __fsi_reg_read((u32)(master->base + reg));
  179. spin_unlock_irqrestore(&master->lock, flags);
  180. return ret;
  181. }
  182. #define fsi_master_mask_set(p, r, m, d) _fsi_master_mask_set(p, MST_##r, m, d)
  183. #define fsi_core_mask_set(p, r, m, d) _fsi_master_mask_set(p, p->core->r, m, d)
  184. static void _fsi_master_mask_set(struct fsi_master *master,
  185. u32 reg, u32 mask, u32 data)
  186. {
  187. unsigned long flags;
  188. spin_lock_irqsave(&master->lock, flags);
  189. __fsi_reg_mask_set((u32)(master->base + reg), mask, data);
  190. spin_unlock_irqrestore(&master->lock, flags);
  191. }
  192. /*
  193. * basic function
  194. */
  195. static struct fsi_master *fsi_get_master(struct fsi_priv *fsi)
  196. {
  197. return fsi->master;
  198. }
  199. static int fsi_is_clk_master(struct fsi_priv *fsi)
  200. {
  201. return fsi->clk_master;
  202. }
  203. static int fsi_is_port_a(struct fsi_priv *fsi)
  204. {
  205. return fsi->master->base == fsi->base;
  206. }
  207. static struct snd_soc_dai *fsi_get_dai(struct snd_pcm_substream *substream)
  208. {
  209. struct snd_soc_pcm_runtime *rtd = substream->private_data;
  210. return rtd->cpu_dai;
  211. }
  212. static struct fsi_priv *fsi_get_priv_frm_dai(struct snd_soc_dai *dai)
  213. {
  214. struct fsi_master *master = snd_soc_dai_get_drvdata(dai);
  215. if (dai->id == 0)
  216. return &master->fsia;
  217. else
  218. return &master->fsib;
  219. }
  220. static struct fsi_priv *fsi_get_priv(struct snd_pcm_substream *substream)
  221. {
  222. return fsi_get_priv_frm_dai(fsi_get_dai(substream));
  223. }
  224. static set_rate_func fsi_get_info_set_rate(struct fsi_master *master)
  225. {
  226. if (!master->info)
  227. return NULL;
  228. return master->info->set_rate;
  229. }
  230. static u32 fsi_get_info_flags(struct fsi_priv *fsi)
  231. {
  232. int is_porta = fsi_is_port_a(fsi);
  233. struct fsi_master *master = fsi_get_master(fsi);
  234. if (!master->info)
  235. return 0;
  236. return is_porta ? master->info->porta_flags :
  237. master->info->portb_flags;
  238. }
  239. static inline int fsi_stream_is_play(int stream)
  240. {
  241. return stream == SNDRV_PCM_STREAM_PLAYBACK;
  242. }
  243. static inline int fsi_is_play(struct snd_pcm_substream *substream)
  244. {
  245. return fsi_stream_is_play(substream->stream);
  246. }
  247. static inline struct fsi_stream *fsi_get_stream(struct fsi_priv *fsi,
  248. int is_play)
  249. {
  250. return is_play ? &fsi->playback : &fsi->capture;
  251. }
  252. static u32 fsi_get_port_shift(struct fsi_priv *fsi, int is_play)
  253. {
  254. int is_porta = fsi_is_port_a(fsi);
  255. u32 shift;
  256. if (is_porta)
  257. shift = is_play ? AO_SHIFT : AI_SHIFT;
  258. else
  259. shift = is_play ? BO_SHIFT : BI_SHIFT;
  260. return shift;
  261. }
  262. static void fsi_stream_push(struct fsi_priv *fsi,
  263. int is_play,
  264. struct snd_pcm_substream *substream,
  265. u32 buffer_len,
  266. u32 period_len)
  267. {
  268. struct fsi_stream *io = fsi_get_stream(fsi, is_play);
  269. io->substream = substream;
  270. io->buff_len = buffer_len;
  271. io->buff_offset = 0;
  272. io->period_len = period_len;
  273. io->period_num = 0;
  274. io->oerr_num = -1; /* ignore 1st err */
  275. io->uerr_num = -1; /* ignore 1st err */
  276. }
  277. static void fsi_stream_pop(struct fsi_priv *fsi, int is_play)
  278. {
  279. struct fsi_stream *io = fsi_get_stream(fsi, is_play);
  280. struct snd_soc_dai *dai = fsi_get_dai(io->substream);
  281. if (io->oerr_num > 0)
  282. dev_err(dai->dev, "over_run = %d\n", io->oerr_num);
  283. if (io->uerr_num > 0)
  284. dev_err(dai->dev, "under_run = %d\n", io->uerr_num);
  285. io->substream = NULL;
  286. io->buff_len = 0;
  287. io->buff_offset = 0;
  288. io->period_len = 0;
  289. io->period_num = 0;
  290. io->oerr_num = 0;
  291. io->uerr_num = 0;
  292. }
  293. static int fsi_get_fifo_data_num(struct fsi_priv *fsi, int is_play)
  294. {
  295. u32 status;
  296. int data_num;
  297. status = is_play ?
  298. fsi_reg_read(fsi, DOFF_ST) :
  299. fsi_reg_read(fsi, DIFF_ST);
  300. data_num = 0x1ff & (status >> 8);
  301. data_num *= fsi->chan_num;
  302. return data_num;
  303. }
  304. static int fsi_len2num(int len, int width)
  305. {
  306. return len / width;
  307. }
  308. #define fsi_num2offset(a, b) fsi_num2len(a, b)
  309. static int fsi_num2len(int num, int width)
  310. {
  311. return num * width;
  312. }
  313. static int fsi_get_frame_width(struct fsi_priv *fsi, int is_play)
  314. {
  315. struct fsi_stream *io = fsi_get_stream(fsi, is_play);
  316. struct snd_pcm_substream *substream = io->substream;
  317. struct snd_pcm_runtime *runtime = substream->runtime;
  318. return frames_to_bytes(runtime, 1) / fsi->chan_num;
  319. }
  320. static void fsi_count_fifo_err(struct fsi_priv *fsi)
  321. {
  322. u32 ostatus = fsi_reg_read(fsi, DOFF_ST);
  323. u32 istatus = fsi_reg_read(fsi, DIFF_ST);
  324. if (ostatus & ERR_OVER)
  325. fsi->playback.oerr_num++;
  326. if (ostatus & ERR_UNDER)
  327. fsi->playback.uerr_num++;
  328. if (istatus & ERR_OVER)
  329. fsi->capture.oerr_num++;
  330. if (istatus & ERR_UNDER)
  331. fsi->capture.uerr_num++;
  332. fsi_reg_write(fsi, DOFF_ST, 0);
  333. fsi_reg_write(fsi, DIFF_ST, 0);
  334. }
  335. /*
  336. * dma function
  337. */
  338. static u8 *fsi_dma_get_area(struct fsi_priv *fsi, int stream)
  339. {
  340. int is_play = fsi_stream_is_play(stream);
  341. struct fsi_stream *io = fsi_get_stream(fsi, is_play);
  342. return io->substream->runtime->dma_area + io->buff_offset;
  343. }
  344. static void fsi_dma_soft_push16(struct fsi_priv *fsi, int num)
  345. {
  346. u16 *start;
  347. int i;
  348. start = (u16 *)fsi_dma_get_area(fsi, SNDRV_PCM_STREAM_PLAYBACK);
  349. for (i = 0; i < num; i++)
  350. fsi_reg_write(fsi, DODT, ((u32)*(start + i) << 8));
  351. }
  352. static void fsi_dma_soft_pop16(struct fsi_priv *fsi, int num)
  353. {
  354. u16 *start;
  355. int i;
  356. start = (u16 *)fsi_dma_get_area(fsi, SNDRV_PCM_STREAM_CAPTURE);
  357. for (i = 0; i < num; i++)
  358. *(start + i) = (u16)(fsi_reg_read(fsi, DIDT) >> 8);
  359. }
  360. static void fsi_dma_soft_push32(struct fsi_priv *fsi, int num)
  361. {
  362. u32 *start;
  363. int i;
  364. start = (u32 *)fsi_dma_get_area(fsi, SNDRV_PCM_STREAM_PLAYBACK);
  365. for (i = 0; i < num; i++)
  366. fsi_reg_write(fsi, DODT, *(start + i));
  367. }
  368. static void fsi_dma_soft_pop32(struct fsi_priv *fsi, int num)
  369. {
  370. u32 *start;
  371. int i;
  372. start = (u32 *)fsi_dma_get_area(fsi, SNDRV_PCM_STREAM_CAPTURE);
  373. for (i = 0; i < num; i++)
  374. *(start + i) = fsi_reg_read(fsi, DIDT);
  375. }
  376. /*
  377. * irq function
  378. */
  379. static void fsi_irq_enable(struct fsi_priv *fsi, int is_play)
  380. {
  381. u32 data = AB_IO(1, fsi_get_port_shift(fsi, is_play));
  382. struct fsi_master *master = fsi_get_master(fsi);
  383. fsi_core_mask_set(master, imsk, data, data);
  384. fsi_core_mask_set(master, iemsk, data, data);
  385. }
  386. static void fsi_irq_disable(struct fsi_priv *fsi, int is_play)
  387. {
  388. u32 data = AB_IO(1, fsi_get_port_shift(fsi, is_play));
  389. struct fsi_master *master = fsi_get_master(fsi);
  390. fsi_core_mask_set(master, imsk, data, 0);
  391. fsi_core_mask_set(master, iemsk, data, 0);
  392. }
  393. static u32 fsi_irq_get_status(struct fsi_master *master)
  394. {
  395. return fsi_core_read(master, int_st);
  396. }
  397. static void fsi_irq_clear_status(struct fsi_priv *fsi)
  398. {
  399. u32 data = 0;
  400. struct fsi_master *master = fsi_get_master(fsi);
  401. data |= AB_IO(1, fsi_get_port_shift(fsi, 0));
  402. data |= AB_IO(1, fsi_get_port_shift(fsi, 1));
  403. /* clear interrupt factor */
  404. fsi_core_mask_set(master, int_st, data, 0);
  405. }
  406. /*
  407. * SPDIF master clock function
  408. *
  409. * These functions are used later FSI2
  410. */
  411. static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable)
  412. {
  413. struct fsi_master *master = fsi_get_master(fsi);
  414. u32 mask, val;
  415. if (master->core->ver < 2) {
  416. pr_err("fsi: register access err (%s)\n", __func__);
  417. return;
  418. }
  419. mask = BP | SE;
  420. val = enable ? mask : 0;
  421. fsi_is_port_a(fsi) ?
  422. fsi_core_mask_set(master, a_mclk, mask, val) :
  423. fsi_core_mask_set(master, b_mclk, mask, val);
  424. }
  425. /*
  426. * ctrl function
  427. */
  428. static void fsi_clk_ctrl(struct fsi_priv *fsi, int enable)
  429. {
  430. u32 val = fsi_is_port_a(fsi) ? (1 << 0) : (1 << 4);
  431. struct fsi_master *master = fsi_get_master(fsi);
  432. if (enable)
  433. fsi_master_mask_set(master, CLK_RST, val, val);
  434. else
  435. fsi_master_mask_set(master, CLK_RST, val, 0);
  436. }
  437. static void fsi_fifo_init(struct fsi_priv *fsi,
  438. int is_play,
  439. struct snd_soc_dai *dai)
  440. {
  441. struct fsi_master *master = fsi_get_master(fsi);
  442. struct fsi_stream *io = fsi_get_stream(fsi, is_play);
  443. u32 shift, i;
  444. /* get on-chip RAM capacity */
  445. shift = fsi_master_read(master, FIFO_SZ);
  446. shift >>= fsi_get_port_shift(fsi, is_play);
  447. shift &= FIFO_SZ_MASK;
  448. io->fifo_max_num = 256 << shift;
  449. dev_dbg(dai->dev, "fifo = %d words\n", io->fifo_max_num);
  450. /*
  451. * The maximum number of sample data varies depending
  452. * on the number of channels selected for the format.
  453. *
  454. * FIFOs are used in 4-channel units in 3-channel mode
  455. * and in 8-channel units in 5- to 7-channel mode
  456. * meaning that more FIFOs than the required size of DPRAM
  457. * are used.
  458. *
  459. * ex) if 256 words of DP-RAM is connected
  460. * 1 channel: 256 (256 x 1 = 256)
  461. * 2 channels: 128 (128 x 2 = 256)
  462. * 3 channels: 64 ( 64 x 3 = 192)
  463. * 4 channels: 64 ( 64 x 4 = 256)
  464. * 5 channels: 32 ( 32 x 5 = 160)
  465. * 6 channels: 32 ( 32 x 6 = 192)
  466. * 7 channels: 32 ( 32 x 7 = 224)
  467. * 8 channels: 32 ( 32 x 8 = 256)
  468. */
  469. for (i = 1; i < fsi->chan_num; i <<= 1)
  470. io->fifo_max_num >>= 1;
  471. dev_dbg(dai->dev, "%d channel %d store\n",
  472. fsi->chan_num, io->fifo_max_num);
  473. /*
  474. * set interrupt generation factor
  475. * clear FIFO
  476. */
  477. if (is_play) {
  478. fsi_reg_write(fsi, DOFF_CTL, IRQ_HALF);
  479. fsi_reg_mask_set(fsi, DOFF_CTL, FIFO_CLR, FIFO_CLR);
  480. } else {
  481. fsi_reg_write(fsi, DIFF_CTL, IRQ_HALF);
  482. fsi_reg_mask_set(fsi, DIFF_CTL, FIFO_CLR, FIFO_CLR);
  483. }
  484. }
  485. static void fsi_soft_all_reset(struct fsi_master *master)
  486. {
  487. /* port AB reset */
  488. fsi_master_mask_set(master, SOFT_RST, PASR | PBSR, 0);
  489. mdelay(10);
  490. /* soft reset */
  491. fsi_master_mask_set(master, SOFT_RST, FSISR, 0);
  492. fsi_master_mask_set(master, SOFT_RST, FSISR, FSISR);
  493. mdelay(10);
  494. }
  495. static int fsi_fifo_data_ctrl(struct fsi_priv *fsi, int stream)
  496. {
  497. struct snd_pcm_runtime *runtime;
  498. struct snd_pcm_substream *substream = NULL;
  499. int is_play = fsi_stream_is_play(stream);
  500. struct fsi_stream *io = fsi_get_stream(fsi, is_play);
  501. int data_residue_num;
  502. int data_num;
  503. int data_num_max;
  504. int ch_width;
  505. int over_period;
  506. void (*fn)(struct fsi_priv *fsi, int size);
  507. if (!fsi ||
  508. !io->substream ||
  509. !io->substream->runtime)
  510. return -EINVAL;
  511. over_period = 0;
  512. substream = io->substream;
  513. runtime = substream->runtime;
  514. /* FSI FIFO has limit.
  515. * So, this driver can not send periods data at a time
  516. */
  517. if (io->buff_offset >=
  518. fsi_num2offset(io->period_num + 1, io->period_len)) {
  519. over_period = 1;
  520. io->period_num = (io->period_num + 1) % runtime->periods;
  521. if (0 == io->period_num)
  522. io->buff_offset = 0;
  523. }
  524. /* get 1 channel data width */
  525. ch_width = fsi_get_frame_width(fsi, is_play);
  526. /* get residue data number of alsa */
  527. data_residue_num = fsi_len2num(io->buff_len - io->buff_offset,
  528. ch_width);
  529. if (is_play) {
  530. /*
  531. * for play-back
  532. *
  533. * data_num_max : number of FSI fifo free space
  534. * data_num : number of ALSA residue data
  535. */
  536. data_num_max = io->fifo_max_num * fsi->chan_num;
  537. data_num_max -= fsi_get_fifo_data_num(fsi, is_play);
  538. data_num = data_residue_num;
  539. switch (ch_width) {
  540. case 2:
  541. fn = fsi_dma_soft_push16;
  542. break;
  543. case 4:
  544. fn = fsi_dma_soft_push32;
  545. break;
  546. default:
  547. return -EINVAL;
  548. }
  549. } else {
  550. /*
  551. * for capture
  552. *
  553. * data_num_max : number of ALSA free space
  554. * data_num : number of data in FSI fifo
  555. */
  556. data_num_max = data_residue_num;
  557. data_num = fsi_get_fifo_data_num(fsi, is_play);
  558. switch (ch_width) {
  559. case 2:
  560. fn = fsi_dma_soft_pop16;
  561. break;
  562. case 4:
  563. fn = fsi_dma_soft_pop32;
  564. break;
  565. default:
  566. return -EINVAL;
  567. }
  568. }
  569. data_num = min(data_num, data_num_max);
  570. fn(fsi, data_num);
  571. /* update buff_offset */
  572. io->buff_offset += fsi_num2offset(data_num, ch_width);
  573. if (over_period)
  574. snd_pcm_period_elapsed(substream);
  575. return 0;
  576. }
  577. static int fsi_data_pop(struct fsi_priv *fsi)
  578. {
  579. return fsi_fifo_data_ctrl(fsi, SNDRV_PCM_STREAM_CAPTURE);
  580. }
  581. static int fsi_data_push(struct fsi_priv *fsi)
  582. {
  583. return fsi_fifo_data_ctrl(fsi, SNDRV_PCM_STREAM_PLAYBACK);
  584. }
  585. static irqreturn_t fsi_interrupt(int irq, void *data)
  586. {
  587. struct fsi_master *master = data;
  588. u32 int_st = fsi_irq_get_status(master);
  589. /* clear irq status */
  590. fsi_master_mask_set(master, SOFT_RST, IR, 0);
  591. fsi_master_mask_set(master, SOFT_RST, IR, IR);
  592. if (int_st & AB_IO(1, AO_SHIFT))
  593. fsi_data_push(&master->fsia);
  594. if (int_st & AB_IO(1, BO_SHIFT))
  595. fsi_data_push(&master->fsib);
  596. if (int_st & AB_IO(1, AI_SHIFT))
  597. fsi_data_pop(&master->fsia);
  598. if (int_st & AB_IO(1, BI_SHIFT))
  599. fsi_data_pop(&master->fsib);
  600. fsi_count_fifo_err(&master->fsia);
  601. fsi_count_fifo_err(&master->fsib);
  602. fsi_irq_clear_status(&master->fsia);
  603. fsi_irq_clear_status(&master->fsib);
  604. return IRQ_HANDLED;
  605. }
  606. /*
  607. * dai ops
  608. */
  609. static int fsi_dai_startup(struct snd_pcm_substream *substream,
  610. struct snd_soc_dai *dai)
  611. {
  612. struct fsi_priv *fsi = fsi_get_priv(substream);
  613. u32 flags = fsi_get_info_flags(fsi);
  614. u32 data;
  615. int is_play = fsi_is_play(substream);
  616. pm_runtime_get_sync(dai->dev);
  617. /* clock inversion (CKG2) */
  618. data = 0;
  619. if (SH_FSI_LRM_INV & flags)
  620. data |= 1 << 12;
  621. if (SH_FSI_BRM_INV & flags)
  622. data |= 1 << 8;
  623. if (SH_FSI_LRS_INV & flags)
  624. data |= 1 << 4;
  625. if (SH_FSI_BRS_INV & flags)
  626. data |= 1 << 0;
  627. fsi_reg_write(fsi, CKG2, data);
  628. /* irq clear */
  629. fsi_irq_disable(fsi, is_play);
  630. fsi_irq_clear_status(fsi);
  631. /* fifo init */
  632. fsi_fifo_init(fsi, is_play, dai);
  633. return 0;
  634. }
  635. static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
  636. struct snd_soc_dai *dai)
  637. {
  638. struct fsi_priv *fsi = fsi_get_priv(substream);
  639. int is_play = fsi_is_play(substream);
  640. struct fsi_master *master = fsi_get_master(fsi);
  641. set_rate_func set_rate = fsi_get_info_set_rate(master);
  642. fsi_irq_disable(fsi, is_play);
  643. if (fsi_is_clk_master(fsi)) {
  644. fsi_clk_ctrl(fsi, 0);
  645. set_rate(dai->dev, fsi_is_port_a(fsi), fsi->rate, 0);
  646. }
  647. fsi->rate = 0;
  648. pm_runtime_put_sync(dai->dev);
  649. }
  650. static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
  651. struct snd_soc_dai *dai)
  652. {
  653. struct fsi_priv *fsi = fsi_get_priv(substream);
  654. struct snd_pcm_runtime *runtime = substream->runtime;
  655. int is_play = fsi_is_play(substream);
  656. int ret = 0;
  657. switch (cmd) {
  658. case SNDRV_PCM_TRIGGER_START:
  659. fsi_stream_push(fsi, is_play, substream,
  660. frames_to_bytes(runtime, runtime->buffer_size),
  661. frames_to_bytes(runtime, runtime->period_size));
  662. ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi);
  663. fsi_irq_enable(fsi, is_play);
  664. break;
  665. case SNDRV_PCM_TRIGGER_STOP:
  666. fsi_irq_disable(fsi, is_play);
  667. fsi_stream_pop(fsi, is_play);
  668. break;
  669. }
  670. return ret;
  671. }
  672. static int fsi_set_fmt_dai(struct fsi_priv *fsi, unsigned int fmt)
  673. {
  674. u32 data = 0;
  675. switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
  676. case SND_SOC_DAIFMT_I2S:
  677. data = CR_I2S;
  678. fsi->chan_num = 2;
  679. break;
  680. case SND_SOC_DAIFMT_LEFT_J:
  681. data = CR_PCM;
  682. fsi->chan_num = 2;
  683. break;
  684. default:
  685. return -EINVAL;
  686. }
  687. fsi_reg_write(fsi, DO_FMT, data);
  688. fsi_reg_write(fsi, DI_FMT, data);
  689. return 0;
  690. }
  691. static int fsi_set_fmt_spdif(struct fsi_priv *fsi)
  692. {
  693. struct fsi_master *master = fsi_get_master(fsi);
  694. u32 data = 0;
  695. if (master->core->ver < 2)
  696. return -EINVAL;
  697. data = CR_BWS_16 | CR_DTMD_SPDIF_PCM | CR_PCM;
  698. fsi->chan_num = 2;
  699. fsi_spdif_clk_ctrl(fsi, 1);
  700. fsi_reg_mask_set(fsi, OUT_SEL, DMMD, DMMD);
  701. fsi_reg_write(fsi, DO_FMT, data);
  702. fsi_reg_write(fsi, DI_FMT, data);
  703. return 0;
  704. }
  705. static int fsi_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
  706. {
  707. struct fsi_priv *fsi = fsi_get_priv_frm_dai(dai);
  708. struct fsi_master *master = fsi_get_master(fsi);
  709. set_rate_func set_rate = fsi_get_info_set_rate(master);
  710. u32 flags = fsi_get_info_flags(fsi);
  711. u32 data = 0;
  712. int ret;
  713. pm_runtime_get_sync(dai->dev);
  714. /* set master/slave audio interface */
  715. switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
  716. case SND_SOC_DAIFMT_CBM_CFM:
  717. data = DIMD | DOMD;
  718. fsi->clk_master = 1;
  719. break;
  720. case SND_SOC_DAIFMT_CBS_CFS:
  721. break;
  722. default:
  723. ret = -EINVAL;
  724. goto set_fmt_exit;
  725. }
  726. if (fsi_is_clk_master(fsi) && !set_rate) {
  727. dev_err(dai->dev, "platform doesn't have set_rate\n");
  728. ret = -EINVAL;
  729. goto set_fmt_exit;
  730. }
  731. fsi_reg_mask_set(fsi, CKG1, (DIMD | DOMD), data);
  732. /* set format */
  733. switch (flags & SH_FSI_FMT_MASK) {
  734. case SH_FSI_FMT_DAI:
  735. ret = fsi_set_fmt_dai(fsi, fmt & SND_SOC_DAIFMT_FORMAT_MASK);
  736. break;
  737. case SH_FSI_FMT_SPDIF:
  738. ret = fsi_set_fmt_spdif(fsi);
  739. break;
  740. default:
  741. ret = -EINVAL;
  742. }
  743. set_fmt_exit:
  744. pm_runtime_put_sync(dai->dev);
  745. return ret;
  746. }
  747. static int fsi_dai_hw_params(struct snd_pcm_substream *substream,
  748. struct snd_pcm_hw_params *params,
  749. struct snd_soc_dai *dai)
  750. {
  751. struct fsi_priv *fsi = fsi_get_priv(substream);
  752. struct fsi_master *master = fsi_get_master(fsi);
  753. set_rate_func set_rate = fsi_get_info_set_rate(master);
  754. int fsi_ver = master->core->ver;
  755. long rate = params_rate(params);
  756. int ret;
  757. if (!fsi_is_clk_master(fsi))
  758. return 0;
  759. ret = set_rate(dai->dev, fsi_is_port_a(fsi), rate, 1);
  760. if (ret < 0) /* error */
  761. return ret;
  762. fsi->rate = rate;
  763. if (ret > 0) {
  764. u32 data = 0;
  765. switch (ret & SH_FSI_ACKMD_MASK) {
  766. default:
  767. /* FALL THROUGH */
  768. case SH_FSI_ACKMD_512:
  769. data |= (0x0 << 12);
  770. break;
  771. case SH_FSI_ACKMD_256:
  772. data |= (0x1 << 12);
  773. break;
  774. case SH_FSI_ACKMD_128:
  775. data |= (0x2 << 12);
  776. break;
  777. case SH_FSI_ACKMD_64:
  778. data |= (0x3 << 12);
  779. break;
  780. case SH_FSI_ACKMD_32:
  781. if (fsi_ver < 2)
  782. dev_err(dai->dev, "unsupported ACKMD\n");
  783. else
  784. data |= (0x4 << 12);
  785. break;
  786. }
  787. switch (ret & SH_FSI_BPFMD_MASK) {
  788. default:
  789. /* FALL THROUGH */
  790. case SH_FSI_BPFMD_32:
  791. data |= (0x0 << 8);
  792. break;
  793. case SH_FSI_BPFMD_64:
  794. data |= (0x1 << 8);
  795. break;
  796. case SH_FSI_BPFMD_128:
  797. data |= (0x2 << 8);
  798. break;
  799. case SH_FSI_BPFMD_256:
  800. data |= (0x3 << 8);
  801. break;
  802. case SH_FSI_BPFMD_512:
  803. data |= (0x4 << 8);
  804. break;
  805. case SH_FSI_BPFMD_16:
  806. if (fsi_ver < 2)
  807. dev_err(dai->dev, "unsupported ACKMD\n");
  808. else
  809. data |= (0x7 << 8);
  810. break;
  811. }
  812. fsi_reg_mask_set(fsi, CKG1, (ACKMD_MASK | BPFMD_MASK) , data);
  813. udelay(10);
  814. fsi_clk_ctrl(fsi, 1);
  815. ret = 0;
  816. }
  817. return ret;
  818. }
  819. static struct snd_soc_dai_ops fsi_dai_ops = {
  820. .startup = fsi_dai_startup,
  821. .shutdown = fsi_dai_shutdown,
  822. .trigger = fsi_dai_trigger,
  823. .set_fmt = fsi_dai_set_fmt,
  824. .hw_params = fsi_dai_hw_params,
  825. };
  826. /*
  827. * pcm ops
  828. */
  829. static struct snd_pcm_hardware fsi_pcm_hardware = {
  830. .info = SNDRV_PCM_INFO_INTERLEAVED |
  831. SNDRV_PCM_INFO_MMAP |
  832. SNDRV_PCM_INFO_MMAP_VALID |
  833. SNDRV_PCM_INFO_PAUSE,
  834. .formats = FSI_FMTS,
  835. .rates = FSI_RATES,
  836. .rate_min = 8000,
  837. .rate_max = 192000,
  838. .channels_min = 1,
  839. .channels_max = 2,
  840. .buffer_bytes_max = 64 * 1024,
  841. .period_bytes_min = 32,
  842. .period_bytes_max = 8192,
  843. .periods_min = 1,
  844. .periods_max = 32,
  845. .fifo_size = 256,
  846. };
  847. static int fsi_pcm_open(struct snd_pcm_substream *substream)
  848. {
  849. struct snd_pcm_runtime *runtime = substream->runtime;
  850. int ret = 0;
  851. snd_soc_set_runtime_hwparams(substream, &fsi_pcm_hardware);
  852. ret = snd_pcm_hw_constraint_integer(runtime,
  853. SNDRV_PCM_HW_PARAM_PERIODS);
  854. return ret;
  855. }
  856. static int fsi_hw_params(struct snd_pcm_substream *substream,
  857. struct snd_pcm_hw_params *hw_params)
  858. {
  859. return snd_pcm_lib_malloc_pages(substream,
  860. params_buffer_bytes(hw_params));
  861. }
  862. static int fsi_hw_free(struct snd_pcm_substream *substream)
  863. {
  864. return snd_pcm_lib_free_pages(substream);
  865. }
  866. static snd_pcm_uframes_t fsi_pointer(struct snd_pcm_substream *substream)
  867. {
  868. struct snd_pcm_runtime *runtime = substream->runtime;
  869. struct fsi_priv *fsi = fsi_get_priv(substream);
  870. struct fsi_stream *io = fsi_get_stream(fsi, fsi_is_play(substream));
  871. long location;
  872. location = (io->buff_offset - 1);
  873. if (location < 0)
  874. location = 0;
  875. return bytes_to_frames(runtime, location);
  876. }
  877. static struct snd_pcm_ops fsi_pcm_ops = {
  878. .open = fsi_pcm_open,
  879. .ioctl = snd_pcm_lib_ioctl,
  880. .hw_params = fsi_hw_params,
  881. .hw_free = fsi_hw_free,
  882. .pointer = fsi_pointer,
  883. };
  884. /*
  885. * snd_soc_platform
  886. */
  887. #define PREALLOC_BUFFER (32 * 1024)
  888. #define PREALLOC_BUFFER_MAX (32 * 1024)
  889. static void fsi_pcm_free(struct snd_pcm *pcm)
  890. {
  891. snd_pcm_lib_preallocate_free_for_all(pcm);
  892. }
  893. static int fsi_pcm_new(struct snd_card *card,
  894. struct snd_soc_dai *dai,
  895. struct snd_pcm *pcm)
  896. {
  897. /*
  898. * dont use SNDRV_DMA_TYPE_DEV, since it will oops the SH kernel
  899. * in MMAP mode (i.e. aplay -M)
  900. */
  901. return snd_pcm_lib_preallocate_pages_for_all(
  902. pcm,
  903. SNDRV_DMA_TYPE_CONTINUOUS,
  904. snd_dma_continuous_data(GFP_KERNEL),
  905. PREALLOC_BUFFER, PREALLOC_BUFFER_MAX);
  906. }
  907. /*
  908. * alsa struct
  909. */
  910. static struct snd_soc_dai_driver fsi_soc_dai[] = {
  911. {
  912. .name = "fsia-dai",
  913. .playback = {
  914. .rates = FSI_RATES,
  915. .formats = FSI_FMTS,
  916. .channels_min = 1,
  917. .channels_max = 8,
  918. },
  919. .capture = {
  920. .rates = FSI_RATES,
  921. .formats = FSI_FMTS,
  922. .channels_min = 1,
  923. .channels_max = 8,
  924. },
  925. .ops = &fsi_dai_ops,
  926. },
  927. {
  928. .name = "fsib-dai",
  929. .playback = {
  930. .rates = FSI_RATES,
  931. .formats = FSI_FMTS,
  932. .channels_min = 1,
  933. .channels_max = 8,
  934. },
  935. .capture = {
  936. .rates = FSI_RATES,
  937. .formats = FSI_FMTS,
  938. .channels_min = 1,
  939. .channels_max = 8,
  940. },
  941. .ops = &fsi_dai_ops,
  942. },
  943. };
  944. static struct snd_soc_platform_driver fsi_soc_platform = {
  945. .ops = &fsi_pcm_ops,
  946. .pcm_new = fsi_pcm_new,
  947. .pcm_free = fsi_pcm_free,
  948. };
  949. /*
  950. * platform function
  951. */
  952. static int fsi_probe(struct platform_device *pdev)
  953. {
  954. struct fsi_master *master;
  955. const struct platform_device_id *id_entry;
  956. struct resource *res;
  957. unsigned int irq;
  958. int ret;
  959. id_entry = pdev->id_entry;
  960. if (!id_entry) {
  961. dev_err(&pdev->dev, "unknown fsi device\n");
  962. return -ENODEV;
  963. }
  964. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  965. irq = platform_get_irq(pdev, 0);
  966. if (!res || (int)irq <= 0) {
  967. dev_err(&pdev->dev, "Not enough FSI platform resources.\n");
  968. ret = -ENODEV;
  969. goto exit;
  970. }
  971. master = kzalloc(sizeof(*master), GFP_KERNEL);
  972. if (!master) {
  973. dev_err(&pdev->dev, "Could not allocate master\n");
  974. ret = -ENOMEM;
  975. goto exit;
  976. }
  977. master->base = ioremap_nocache(res->start, resource_size(res));
  978. if (!master->base) {
  979. ret = -ENXIO;
  980. dev_err(&pdev->dev, "Unable to ioremap FSI registers.\n");
  981. goto exit_kfree;
  982. }
  983. /* master setting */
  984. master->irq = irq;
  985. master->info = pdev->dev.platform_data;
  986. master->core = (struct fsi_core *)id_entry->driver_data;
  987. spin_lock_init(&master->lock);
  988. /* FSI A setting */
  989. master->fsia.base = master->base;
  990. master->fsia.master = master;
  991. /* FSI B setting */
  992. master->fsib.base = master->base + 0x40;
  993. master->fsib.master = master;
  994. pm_runtime_enable(&pdev->dev);
  995. dev_set_drvdata(&pdev->dev, master);
  996. pm_runtime_get_sync(&pdev->dev);
  997. fsi_soft_all_reset(master);
  998. pm_runtime_put_sync(&pdev->dev);
  999. ret = request_irq(irq, &fsi_interrupt, IRQF_DISABLED,
  1000. id_entry->name, master);
  1001. if (ret) {
  1002. dev_err(&pdev->dev, "irq request err\n");
  1003. goto exit_iounmap;
  1004. }
  1005. ret = snd_soc_register_platform(&pdev->dev, &fsi_soc_platform);
  1006. if (ret < 0) {
  1007. dev_err(&pdev->dev, "cannot snd soc register\n");
  1008. goto exit_free_irq;
  1009. }
  1010. ret = snd_soc_register_dais(&pdev->dev, fsi_soc_dai,
  1011. ARRAY_SIZE(fsi_soc_dai));
  1012. if (ret < 0) {
  1013. dev_err(&pdev->dev, "cannot snd dai register\n");
  1014. goto exit_snd_soc;
  1015. }
  1016. return ret;
  1017. exit_snd_soc:
  1018. snd_soc_unregister_platform(&pdev->dev);
  1019. exit_free_irq:
  1020. free_irq(irq, master);
  1021. exit_iounmap:
  1022. iounmap(master->base);
  1023. pm_runtime_disable(&pdev->dev);
  1024. exit_kfree:
  1025. kfree(master);
  1026. master = NULL;
  1027. exit:
  1028. return ret;
  1029. }
  1030. static int fsi_remove(struct platform_device *pdev)
  1031. {
  1032. struct fsi_master *master;
  1033. master = dev_get_drvdata(&pdev->dev);
  1034. free_irq(master->irq, master);
  1035. pm_runtime_disable(&pdev->dev);
  1036. snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(fsi_soc_dai));
  1037. snd_soc_unregister_platform(&pdev->dev);
  1038. iounmap(master->base);
  1039. kfree(master);
  1040. return 0;
  1041. }
  1042. static int fsi_runtime_nop(struct device *dev)
  1043. {
  1044. /* Runtime PM callback shared between ->runtime_suspend()
  1045. * and ->runtime_resume(). Simply returns success.
  1046. *
  1047. * This driver re-initializes all registers after
  1048. * pm_runtime_get_sync() anyway so there is no need
  1049. * to save and restore registers here.
  1050. */
  1051. return 0;
  1052. }
  1053. static struct dev_pm_ops fsi_pm_ops = {
  1054. .runtime_suspend = fsi_runtime_nop,
  1055. .runtime_resume = fsi_runtime_nop,
  1056. };
  1057. static struct fsi_core fsi1_core = {
  1058. .ver = 1,
  1059. /* Interrupt */
  1060. .int_st = INT_ST,
  1061. .iemsk = IEMSK,
  1062. .imsk = IMSK,
  1063. };
  1064. static struct fsi_core fsi2_core = {
  1065. .ver = 2,
  1066. /* Interrupt */
  1067. .int_st = CPU_INT_ST,
  1068. .iemsk = CPU_IEMSK,
  1069. .imsk = CPU_IMSK,
  1070. .a_mclk = A_MST_CTLR,
  1071. .b_mclk = B_MST_CTLR,
  1072. };
  1073. static struct platform_device_id fsi_id_table[] = {
  1074. { "sh_fsi", (kernel_ulong_t)&fsi1_core },
  1075. { "sh_fsi2", (kernel_ulong_t)&fsi2_core },
  1076. {},
  1077. };
  1078. MODULE_DEVICE_TABLE(platform, fsi_id_table);
  1079. static struct platform_driver fsi_driver = {
  1080. .driver = {
  1081. .name = "fsi-pcm-audio",
  1082. .pm = &fsi_pm_ops,
  1083. },
  1084. .probe = fsi_probe,
  1085. .remove = fsi_remove,
  1086. .id_table = fsi_id_table,
  1087. };
  1088. static int __init fsi_mobile_init(void)
  1089. {
  1090. return platform_driver_register(&fsi_driver);
  1091. }
  1092. static void __exit fsi_mobile_exit(void)
  1093. {
  1094. platform_driver_unregister(&fsi_driver);
  1095. }
  1096. module_init(fsi_mobile_init);
  1097. module_exit(fsi_mobile_exit);
  1098. MODULE_LICENSE("GPL");
  1099. MODULE_DESCRIPTION("SuperH onchip FSI audio driver");
  1100. MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");
  1101. MODULE_ALIAS("platform:fsi-pcm-audio");