img-i2s-out.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. /*
  2. * IMG I2S output controller driver
  3. *
  4. * Copyright (C) 2015 Imagination Technologies Ltd.
  5. *
  6. * Author: Damien Horsley <Damien.Horsley@imgtec.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms and conditions of the GNU General Public License,
  10. * version 2, as published by the Free Software Foundation.
  11. */
  12. #include <linux/clk.h>
  13. #include <linux/init.h>
  14. #include <linux/kernel.h>
  15. #include <linux/module.h>
  16. #include <linux/of.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/pm_runtime.h>
  19. #include <linux/reset.h>
  20. #include <sound/core.h>
  21. #include <sound/dmaengine_pcm.h>
  22. #include <sound/initval.h>
  23. #include <sound/pcm.h>
  24. #include <sound/pcm_params.h>
  25. #include <sound/soc.h>
  26. #define IMG_I2S_OUT_TX_FIFO 0x0
  27. #define IMG_I2S_OUT_CTL 0x4
  28. #define IMG_I2S_OUT_CTL_DATA_EN_MASK BIT(24)
  29. #define IMG_I2S_OUT_CTL_ACTIVE_CHAN_MASK 0xffe000
  30. #define IMG_I2S_OUT_CTL_ACTIVE_CHAN_SHIFT 13
  31. #define IMG_I2S_OUT_CTL_FRM_SIZE_MASK BIT(8)
  32. #define IMG_I2S_OUT_CTL_MASTER_MASK BIT(6)
  33. #define IMG_I2S_OUT_CTL_CLK_MASK BIT(5)
  34. #define IMG_I2S_OUT_CTL_CLK_EN_MASK BIT(4)
  35. #define IMG_I2S_OUT_CTL_FRM_CLK_POL_MASK BIT(3)
  36. #define IMG_I2S_OUT_CTL_BCLK_POL_MASK BIT(2)
  37. #define IMG_I2S_OUT_CTL_ME_MASK BIT(0)
  38. #define IMG_I2S_OUT_CH_CTL 0x4
  39. #define IMG_I2S_OUT_CHAN_CTL_CH_MASK BIT(11)
  40. #define IMG_I2S_OUT_CHAN_CTL_LT_MASK BIT(10)
  41. #define IMG_I2S_OUT_CHAN_CTL_FMT_MASK 0xf0
  42. #define IMG_I2S_OUT_CHAN_CTL_FMT_SHIFT 4
  43. #define IMG_I2S_OUT_CHAN_CTL_JUST_MASK BIT(3)
  44. #define IMG_I2S_OUT_CHAN_CTL_CLKT_MASK BIT(1)
  45. #define IMG_I2S_OUT_CHAN_CTL_ME_MASK BIT(0)
  46. #define IMG_I2S_OUT_CH_STRIDE 0x20
  47. struct img_i2s_out {
  48. void __iomem *base;
  49. struct clk *clk_sys;
  50. struct clk *clk_ref;
  51. struct snd_dmaengine_dai_dma_data dma_data;
  52. struct device *dev;
  53. unsigned int max_i2s_chan;
  54. void __iomem *channel_base;
  55. bool force_clk_active;
  56. unsigned int active_channels;
  57. struct reset_control *rst;
  58. struct snd_soc_dai_driver dai_driver;
  59. };
  60. static int img_i2s_out_suspend(struct device *dev)
  61. {
  62. struct img_i2s_out *i2s = dev_get_drvdata(dev);
  63. if (!i2s->force_clk_active)
  64. clk_disable_unprepare(i2s->clk_ref);
  65. return 0;
  66. }
  67. static int img_i2s_out_resume(struct device *dev)
  68. {
  69. struct img_i2s_out *i2s = dev_get_drvdata(dev);
  70. int ret;
  71. if (!i2s->force_clk_active) {
  72. ret = clk_prepare_enable(i2s->clk_ref);
  73. if (ret) {
  74. dev_err(dev, "clk_enable failed: %d\n", ret);
  75. return ret;
  76. }
  77. }
  78. return 0;
  79. }
  80. static inline void img_i2s_out_writel(struct img_i2s_out *i2s, u32 val,
  81. u32 reg)
  82. {
  83. writel(val, i2s->base + reg);
  84. }
  85. static inline u32 img_i2s_out_readl(struct img_i2s_out *i2s, u32 reg)
  86. {
  87. return readl(i2s->base + reg);
  88. }
  89. static inline void img_i2s_out_ch_writel(struct img_i2s_out *i2s,
  90. u32 chan, u32 val, u32 reg)
  91. {
  92. writel(val, i2s->channel_base + (chan * IMG_I2S_OUT_CH_STRIDE) + reg);
  93. }
  94. static inline u32 img_i2s_out_ch_readl(struct img_i2s_out *i2s, u32 chan,
  95. u32 reg)
  96. {
  97. return readl(i2s->channel_base + (chan * IMG_I2S_OUT_CH_STRIDE) + reg);
  98. }
  99. static inline void img_i2s_out_ch_disable(struct img_i2s_out *i2s, u32 chan)
  100. {
  101. u32 reg;
  102. reg = img_i2s_out_ch_readl(i2s, chan, IMG_I2S_OUT_CH_CTL);
  103. reg &= ~IMG_I2S_OUT_CHAN_CTL_ME_MASK;
  104. img_i2s_out_ch_writel(i2s, chan, reg, IMG_I2S_OUT_CH_CTL);
  105. }
  106. static inline void img_i2s_out_ch_enable(struct img_i2s_out *i2s, u32 chan)
  107. {
  108. u32 reg;
  109. reg = img_i2s_out_ch_readl(i2s, chan, IMG_I2S_OUT_CH_CTL);
  110. reg |= IMG_I2S_OUT_CHAN_CTL_ME_MASK;
  111. img_i2s_out_ch_writel(i2s, chan, reg, IMG_I2S_OUT_CH_CTL);
  112. }
  113. static inline void img_i2s_out_disable(struct img_i2s_out *i2s)
  114. {
  115. u32 reg;
  116. reg = img_i2s_out_readl(i2s, IMG_I2S_OUT_CTL);
  117. reg &= ~IMG_I2S_OUT_CTL_ME_MASK;
  118. img_i2s_out_writel(i2s, reg, IMG_I2S_OUT_CTL);
  119. }
  120. static inline void img_i2s_out_enable(struct img_i2s_out *i2s)
  121. {
  122. u32 reg;
  123. reg = img_i2s_out_readl(i2s, IMG_I2S_OUT_CTL);
  124. reg |= IMG_I2S_OUT_CTL_ME_MASK;
  125. img_i2s_out_writel(i2s, reg, IMG_I2S_OUT_CTL);
  126. }
  127. static void img_i2s_out_reset(struct img_i2s_out *i2s)
  128. {
  129. int i;
  130. u32 core_ctl, chan_ctl;
  131. core_ctl = img_i2s_out_readl(i2s, IMG_I2S_OUT_CTL) &
  132. ~IMG_I2S_OUT_CTL_ME_MASK &
  133. ~IMG_I2S_OUT_CTL_DATA_EN_MASK;
  134. if (!i2s->force_clk_active)
  135. core_ctl &= ~IMG_I2S_OUT_CTL_CLK_EN_MASK;
  136. chan_ctl = img_i2s_out_ch_readl(i2s, 0, IMG_I2S_OUT_CH_CTL) &
  137. ~IMG_I2S_OUT_CHAN_CTL_ME_MASK;
  138. reset_control_assert(i2s->rst);
  139. reset_control_deassert(i2s->rst);
  140. for (i = 0; i < i2s->max_i2s_chan; i++)
  141. img_i2s_out_ch_writel(i2s, i, chan_ctl, IMG_I2S_OUT_CH_CTL);
  142. for (i = 0; i < i2s->active_channels; i++)
  143. img_i2s_out_ch_enable(i2s, i);
  144. img_i2s_out_writel(i2s, core_ctl, IMG_I2S_OUT_CTL);
  145. img_i2s_out_enable(i2s);
  146. }
  147. static int img_i2s_out_trigger(struct snd_pcm_substream *substream, int cmd,
  148. struct snd_soc_dai *dai)
  149. {
  150. struct img_i2s_out *i2s = snd_soc_dai_get_drvdata(dai);
  151. u32 reg;
  152. switch (cmd) {
  153. case SNDRV_PCM_TRIGGER_START:
  154. case SNDRV_PCM_TRIGGER_RESUME:
  155. case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
  156. reg = img_i2s_out_readl(i2s, IMG_I2S_OUT_CTL);
  157. if (!i2s->force_clk_active)
  158. reg |= IMG_I2S_OUT_CTL_CLK_EN_MASK;
  159. reg |= IMG_I2S_OUT_CTL_DATA_EN_MASK;
  160. img_i2s_out_writel(i2s, reg, IMG_I2S_OUT_CTL);
  161. break;
  162. case SNDRV_PCM_TRIGGER_STOP:
  163. case SNDRV_PCM_TRIGGER_SUSPEND:
  164. case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
  165. img_i2s_out_reset(i2s);
  166. break;
  167. default:
  168. return -EINVAL;
  169. }
  170. return 0;
  171. }
  172. static int img_i2s_out_hw_params(struct snd_pcm_substream *substream,
  173. struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
  174. {
  175. struct img_i2s_out *i2s = snd_soc_dai_get_drvdata(dai);
  176. unsigned int channels, i2s_channels;
  177. long pre_div_a, pre_div_b, diff_a, diff_b, rate, clk_rate;
  178. int i;
  179. u32 reg, control_mask, control_set = 0;
  180. snd_pcm_format_t format;
  181. rate = params_rate(params);
  182. format = params_format(params);
  183. channels = params_channels(params);
  184. i2s_channels = channels / 2;
  185. if (format != SNDRV_PCM_FORMAT_S32_LE)
  186. return -EINVAL;
  187. if ((channels < 2) ||
  188. (channels > (i2s->max_i2s_chan * 2)) ||
  189. (channels % 2))
  190. return -EINVAL;
  191. pre_div_a = clk_round_rate(i2s->clk_ref, rate * 256);
  192. if (pre_div_a < 0)
  193. return pre_div_a;
  194. pre_div_b = clk_round_rate(i2s->clk_ref, rate * 384);
  195. if (pre_div_b < 0)
  196. return pre_div_b;
  197. diff_a = abs((pre_div_a / 256) - rate);
  198. diff_b = abs((pre_div_b / 384) - rate);
  199. /* If diffs are equal, use lower clock rate */
  200. if (diff_a > diff_b)
  201. clk_set_rate(i2s->clk_ref, pre_div_b);
  202. else
  203. clk_set_rate(i2s->clk_ref, pre_div_a);
  204. /*
  205. * Another driver (eg alsa machine driver) may have rejected the above
  206. * change. Get the current rate and set the register bit according to
  207. * the new minimum diff
  208. */
  209. clk_rate = clk_get_rate(i2s->clk_ref);
  210. diff_a = abs((clk_rate / 256) - rate);
  211. diff_b = abs((clk_rate / 384) - rate);
  212. if (diff_a > diff_b)
  213. control_set |= IMG_I2S_OUT_CTL_CLK_MASK;
  214. control_set |= ((i2s_channels - 1) <<
  215. IMG_I2S_OUT_CTL_ACTIVE_CHAN_SHIFT) &
  216. IMG_I2S_OUT_CTL_ACTIVE_CHAN_MASK;
  217. control_mask = IMG_I2S_OUT_CTL_CLK_MASK |
  218. IMG_I2S_OUT_CTL_ACTIVE_CHAN_MASK;
  219. img_i2s_out_disable(i2s);
  220. reg = img_i2s_out_readl(i2s, IMG_I2S_OUT_CTL);
  221. reg = (reg & ~control_mask) | control_set;
  222. img_i2s_out_writel(i2s, reg, IMG_I2S_OUT_CTL);
  223. for (i = 0; i < i2s_channels; i++)
  224. img_i2s_out_ch_enable(i2s, i);
  225. for (; i < i2s->max_i2s_chan; i++)
  226. img_i2s_out_ch_disable(i2s, i);
  227. img_i2s_out_enable(i2s);
  228. i2s->active_channels = i2s_channels;
  229. return 0;
  230. }
  231. static int img_i2s_out_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
  232. {
  233. struct img_i2s_out *i2s = snd_soc_dai_get_drvdata(dai);
  234. int i;
  235. bool force_clk_active;
  236. u32 chan_control_mask, control_mask, chan_control_set = 0;
  237. u32 reg, control_set = 0;
  238. force_clk_active = ((fmt & SND_SOC_DAIFMT_CLOCK_MASK) ==
  239. SND_SOC_DAIFMT_CONT);
  240. if (force_clk_active)
  241. control_set |= IMG_I2S_OUT_CTL_CLK_EN_MASK;
  242. switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
  243. case SND_SOC_DAIFMT_CBM_CFM:
  244. break;
  245. case SND_SOC_DAIFMT_CBS_CFS:
  246. control_set |= IMG_I2S_OUT_CTL_MASTER_MASK;
  247. break;
  248. default:
  249. return -EINVAL;
  250. }
  251. switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
  252. case SND_SOC_DAIFMT_NB_NF:
  253. control_set |= IMG_I2S_OUT_CTL_BCLK_POL_MASK;
  254. break;
  255. case SND_SOC_DAIFMT_NB_IF:
  256. control_set |= IMG_I2S_OUT_CTL_BCLK_POL_MASK;
  257. control_set |= IMG_I2S_OUT_CTL_FRM_CLK_POL_MASK;
  258. break;
  259. case SND_SOC_DAIFMT_IB_NF:
  260. break;
  261. case SND_SOC_DAIFMT_IB_IF:
  262. control_set |= IMG_I2S_OUT_CTL_FRM_CLK_POL_MASK;
  263. break;
  264. default:
  265. return -EINVAL;
  266. }
  267. switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
  268. case SND_SOC_DAIFMT_I2S:
  269. chan_control_set |= IMG_I2S_OUT_CHAN_CTL_CLKT_MASK;
  270. break;
  271. case SND_SOC_DAIFMT_LEFT_J:
  272. break;
  273. default:
  274. return -EINVAL;
  275. }
  276. control_mask = IMG_I2S_OUT_CTL_CLK_EN_MASK |
  277. IMG_I2S_OUT_CTL_MASTER_MASK |
  278. IMG_I2S_OUT_CTL_BCLK_POL_MASK |
  279. IMG_I2S_OUT_CTL_FRM_CLK_POL_MASK;
  280. chan_control_mask = IMG_I2S_OUT_CHAN_CTL_CLKT_MASK;
  281. img_i2s_out_disable(i2s);
  282. reg = img_i2s_out_readl(i2s, IMG_I2S_OUT_CTL);
  283. reg = (reg & ~control_mask) | control_set;
  284. img_i2s_out_writel(i2s, reg, IMG_I2S_OUT_CTL);
  285. for (i = 0; i < i2s->active_channels; i++)
  286. img_i2s_out_ch_disable(i2s, i);
  287. for (i = 0; i < i2s->max_i2s_chan; i++) {
  288. reg = img_i2s_out_ch_readl(i2s, i, IMG_I2S_OUT_CH_CTL);
  289. reg = (reg & ~chan_control_mask) | chan_control_set;
  290. img_i2s_out_ch_writel(i2s, i, reg, IMG_I2S_OUT_CH_CTL);
  291. }
  292. for (i = 0; i < i2s->active_channels; i++)
  293. img_i2s_out_ch_enable(i2s, i);
  294. img_i2s_out_enable(i2s);
  295. i2s->force_clk_active = force_clk_active;
  296. return 0;
  297. }
  298. static const struct snd_soc_dai_ops img_i2s_out_dai_ops = {
  299. .trigger = img_i2s_out_trigger,
  300. .hw_params = img_i2s_out_hw_params,
  301. .set_fmt = img_i2s_out_set_fmt
  302. };
  303. static int img_i2s_out_dai_probe(struct snd_soc_dai *dai)
  304. {
  305. struct img_i2s_out *i2s = snd_soc_dai_get_drvdata(dai);
  306. snd_soc_dai_init_dma_data(dai, &i2s->dma_data, NULL);
  307. return 0;
  308. }
  309. static const struct snd_soc_component_driver img_i2s_out_component = {
  310. .name = "img-i2s-out"
  311. };
  312. static int img_i2s_out_dma_prepare_slave_config(struct snd_pcm_substream *st,
  313. struct snd_pcm_hw_params *params, struct dma_slave_config *sc)
  314. {
  315. unsigned int i2s_channels = params_channels(params) / 2;
  316. struct snd_soc_pcm_runtime *rtd = st->private_data;
  317. struct snd_dmaengine_dai_dma_data *dma_data;
  318. int ret;
  319. dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, st);
  320. ret = snd_hwparams_to_dma_slave_config(st, params, sc);
  321. if (ret)
  322. return ret;
  323. sc->dst_addr = dma_data->addr;
  324. sc->dst_addr_width = dma_data->addr_width;
  325. sc->dst_maxburst = 4 * i2s_channels;
  326. return 0;
  327. }
  328. static const struct snd_dmaengine_pcm_config img_i2s_out_dma_config = {
  329. .prepare_slave_config = img_i2s_out_dma_prepare_slave_config
  330. };
  331. static int img_i2s_out_probe(struct platform_device *pdev)
  332. {
  333. struct img_i2s_out *i2s;
  334. struct resource *res;
  335. void __iomem *base;
  336. int i, ret;
  337. unsigned int max_i2s_chan_pow_2;
  338. u32 reg;
  339. struct device *dev = &pdev->dev;
  340. i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL);
  341. if (!i2s)
  342. return -ENOMEM;
  343. platform_set_drvdata(pdev, i2s);
  344. i2s->dev = &pdev->dev;
  345. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  346. base = devm_ioremap_resource(&pdev->dev, res);
  347. if (IS_ERR(base))
  348. return PTR_ERR(base);
  349. i2s->base = base;
  350. if (of_property_read_u32(pdev->dev.of_node, "img,i2s-channels",
  351. &i2s->max_i2s_chan)) {
  352. dev_err(&pdev->dev, "No img,i2s-channels property\n");
  353. return -EINVAL;
  354. }
  355. max_i2s_chan_pow_2 = 1 << get_count_order(i2s->max_i2s_chan);
  356. i2s->channel_base = base + (max_i2s_chan_pow_2 * 0x20);
  357. i2s->rst = devm_reset_control_get(&pdev->dev, "rst");
  358. if (IS_ERR(i2s->rst)) {
  359. if (PTR_ERR(i2s->rst) != -EPROBE_DEFER)
  360. dev_err(&pdev->dev, "No top level reset found\n");
  361. return PTR_ERR(i2s->rst);
  362. }
  363. i2s->clk_sys = devm_clk_get(&pdev->dev, "sys");
  364. if (IS_ERR(i2s->clk_sys)) {
  365. if (PTR_ERR(i2s->clk_sys) != -EPROBE_DEFER)
  366. dev_err(dev, "Failed to acquire clock 'sys'\n");
  367. return PTR_ERR(i2s->clk_sys);
  368. }
  369. i2s->clk_ref = devm_clk_get(&pdev->dev, "ref");
  370. if (IS_ERR(i2s->clk_ref)) {
  371. if (PTR_ERR(i2s->clk_ref) != -EPROBE_DEFER)
  372. dev_err(dev, "Failed to acquire clock 'ref'\n");
  373. return PTR_ERR(i2s->clk_ref);
  374. }
  375. ret = clk_prepare_enable(i2s->clk_sys);
  376. if (ret)
  377. return ret;
  378. reg = IMG_I2S_OUT_CTL_FRM_SIZE_MASK;
  379. img_i2s_out_writel(i2s, reg, IMG_I2S_OUT_CTL);
  380. reg = IMG_I2S_OUT_CHAN_CTL_JUST_MASK |
  381. IMG_I2S_OUT_CHAN_CTL_LT_MASK |
  382. IMG_I2S_OUT_CHAN_CTL_CH_MASK |
  383. (8 << IMG_I2S_OUT_CHAN_CTL_FMT_SHIFT);
  384. for (i = 0; i < i2s->max_i2s_chan; i++)
  385. img_i2s_out_ch_writel(i2s, i, reg, IMG_I2S_OUT_CH_CTL);
  386. img_i2s_out_reset(i2s);
  387. pm_runtime_enable(&pdev->dev);
  388. if (!pm_runtime_enabled(&pdev->dev)) {
  389. ret = img_i2s_out_resume(&pdev->dev);
  390. if (ret)
  391. goto err_pm_disable;
  392. }
  393. i2s->active_channels = 1;
  394. i2s->dma_data.addr = res->start + IMG_I2S_OUT_TX_FIFO;
  395. i2s->dma_data.addr_width = 4;
  396. i2s->dma_data.maxburst = 4;
  397. i2s->dai_driver.probe = img_i2s_out_dai_probe;
  398. i2s->dai_driver.playback.channels_min = 2;
  399. i2s->dai_driver.playback.channels_max = i2s->max_i2s_chan * 2;
  400. i2s->dai_driver.playback.rates = SNDRV_PCM_RATE_8000_192000;
  401. i2s->dai_driver.playback.formats = SNDRV_PCM_FMTBIT_S32_LE;
  402. i2s->dai_driver.ops = &img_i2s_out_dai_ops;
  403. ret = devm_snd_soc_register_component(&pdev->dev,
  404. &img_i2s_out_component, &i2s->dai_driver, 1);
  405. if (ret)
  406. goto err_suspend;
  407. ret = devm_snd_dmaengine_pcm_register(&pdev->dev,
  408. &img_i2s_out_dma_config, 0);
  409. if (ret)
  410. goto err_suspend;
  411. return 0;
  412. err_suspend:
  413. if (!pm_runtime_status_suspended(&pdev->dev))
  414. img_i2s_out_suspend(&pdev->dev);
  415. err_pm_disable:
  416. pm_runtime_disable(&pdev->dev);
  417. clk_disable_unprepare(i2s->clk_sys);
  418. return ret;
  419. }
  420. static int img_i2s_out_dev_remove(struct platform_device *pdev)
  421. {
  422. struct img_i2s_out *i2s = platform_get_drvdata(pdev);
  423. pm_runtime_disable(&pdev->dev);
  424. if (!pm_runtime_status_suspended(&pdev->dev))
  425. img_i2s_out_suspend(&pdev->dev);
  426. clk_disable_unprepare(i2s->clk_sys);
  427. return 0;
  428. }
  429. static const struct of_device_id img_i2s_out_of_match[] = {
  430. { .compatible = "img,i2s-out" },
  431. {}
  432. };
  433. MODULE_DEVICE_TABLE(of, img_i2s_out_of_match);
  434. static const struct dev_pm_ops img_i2s_out_pm_ops = {
  435. SET_RUNTIME_PM_OPS(img_i2s_out_suspend,
  436. img_i2s_out_resume, NULL)
  437. };
  438. static struct platform_driver img_i2s_out_driver = {
  439. .driver = {
  440. .name = "img-i2s-out",
  441. .of_match_table = img_i2s_out_of_match,
  442. .pm = &img_i2s_out_pm_ops
  443. },
  444. .probe = img_i2s_out_probe,
  445. .remove = img_i2s_out_dev_remove
  446. };
  447. module_platform_driver(img_i2s_out_driver);
  448. MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>");
  449. MODULE_DESCRIPTION("IMG I2S Output Driver");
  450. MODULE_LICENSE("GPL v2");