tegra30_i2s.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. /*
  2. * tegra30_i2s.c - Tegra30 I2S driver
  3. *
  4. * Author: Stephen Warren <swarren@nvidia.com>
  5. * Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved.
  6. *
  7. * Based on code copyright/by:
  8. *
  9. * Copyright (c) 2009-2010, NVIDIA Corporation.
  10. * Scott Peterson <speterson@nvidia.com>
  11. *
  12. * Copyright (C) 2010 Google, Inc.
  13. * Iliyan Malchev <malchev@google.com>
  14. *
  15. * This program is free software; you can redistribute it and/or modify it
  16. * under the terms and conditions of the GNU General Public License,
  17. * version 2, as published by the Free Software Foundation.
  18. *
  19. * This program is distributed in the hope it will be useful, but WITHOUT
  20. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  21. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  22. * more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  26. */
  27. #include <linux/clk.h>
  28. #include <linux/device.h>
  29. #include <linux/io.h>
  30. #include <linux/module.h>
  31. #include <linux/of.h>
  32. #include <linux/platform_device.h>
  33. #include <linux/pm_runtime.h>
  34. #include <linux/regmap.h>
  35. #include <linux/slab.h>
  36. #include <sound/core.h>
  37. #include <sound/pcm.h>
  38. #include <sound/pcm_params.h>
  39. #include <sound/soc.h>
  40. #include <sound/dmaengine_pcm.h>
  41. #include "tegra30_ahub.h"
  42. #include "tegra30_i2s.h"
  43. #define DRV_NAME "tegra30-i2s"
  44. static int tegra30_i2s_runtime_suspend(struct device *dev)
  45. {
  46. struct tegra30_i2s *i2s = dev_get_drvdata(dev);
  47. regcache_cache_only(i2s->regmap, true);
  48. clk_disable_unprepare(i2s->clk_i2s);
  49. return 0;
  50. }
  51. static int tegra30_i2s_runtime_resume(struct device *dev)
  52. {
  53. struct tegra30_i2s *i2s = dev_get_drvdata(dev);
  54. int ret;
  55. ret = clk_prepare_enable(i2s->clk_i2s);
  56. if (ret) {
  57. dev_err(dev, "clk_enable failed: %d\n", ret);
  58. return ret;
  59. }
  60. regcache_cache_only(i2s->regmap, false);
  61. return 0;
  62. }
  63. static int tegra30_i2s_startup(struct snd_pcm_substream *substream,
  64. struct snd_soc_dai *dai)
  65. {
  66. struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
  67. int ret;
  68. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
  69. ret = tegra30_ahub_allocate_tx_fifo(&i2s->playback_fifo_cif,
  70. &i2s->playback_dma_data.addr,
  71. &i2s->playback_dma_data.slave_id);
  72. i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
  73. i2s->playback_dma_data.maxburst = 4;
  74. tegra30_ahub_set_rx_cif_source(i2s->playback_i2s_cif,
  75. i2s->playback_fifo_cif);
  76. } else {
  77. ret = tegra30_ahub_allocate_rx_fifo(&i2s->capture_fifo_cif,
  78. &i2s->capture_dma_data.addr,
  79. &i2s->capture_dma_data.slave_id);
  80. i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
  81. i2s->capture_dma_data.maxburst = 4;
  82. tegra30_ahub_set_rx_cif_source(i2s->capture_fifo_cif,
  83. i2s->capture_i2s_cif);
  84. }
  85. return ret;
  86. }
  87. static void tegra30_i2s_shutdown(struct snd_pcm_substream *substream,
  88. struct snd_soc_dai *dai)
  89. {
  90. struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
  91. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
  92. tegra30_ahub_unset_rx_cif_source(i2s->playback_i2s_cif);
  93. tegra30_ahub_free_tx_fifo(i2s->playback_fifo_cif);
  94. } else {
  95. tegra30_ahub_unset_rx_cif_source(i2s->capture_fifo_cif);
  96. tegra30_ahub_free_rx_fifo(i2s->capture_fifo_cif);
  97. }
  98. }
  99. static int tegra30_i2s_set_fmt(struct snd_soc_dai *dai,
  100. unsigned int fmt)
  101. {
  102. struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
  103. unsigned int mask, val;
  104. switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
  105. case SND_SOC_DAIFMT_NB_NF:
  106. break;
  107. default:
  108. return -EINVAL;
  109. }
  110. mask = TEGRA30_I2S_CTRL_MASTER_ENABLE;
  111. switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
  112. case SND_SOC_DAIFMT_CBS_CFS:
  113. val = TEGRA30_I2S_CTRL_MASTER_ENABLE;
  114. break;
  115. case SND_SOC_DAIFMT_CBM_CFM:
  116. break;
  117. default:
  118. return -EINVAL;
  119. }
  120. mask |= TEGRA30_I2S_CTRL_FRAME_FORMAT_MASK |
  121. TEGRA30_I2S_CTRL_LRCK_MASK;
  122. switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
  123. case SND_SOC_DAIFMT_DSP_A:
  124. val |= TEGRA30_I2S_CTRL_FRAME_FORMAT_FSYNC;
  125. val |= TEGRA30_I2S_CTRL_LRCK_L_LOW;
  126. break;
  127. case SND_SOC_DAIFMT_DSP_B:
  128. val |= TEGRA30_I2S_CTRL_FRAME_FORMAT_FSYNC;
  129. val |= TEGRA30_I2S_CTRL_LRCK_R_LOW;
  130. break;
  131. case SND_SOC_DAIFMT_I2S:
  132. val |= TEGRA30_I2S_CTRL_FRAME_FORMAT_LRCK;
  133. val |= TEGRA30_I2S_CTRL_LRCK_L_LOW;
  134. break;
  135. case SND_SOC_DAIFMT_RIGHT_J:
  136. val |= TEGRA30_I2S_CTRL_FRAME_FORMAT_LRCK;
  137. val |= TEGRA30_I2S_CTRL_LRCK_L_LOW;
  138. break;
  139. case SND_SOC_DAIFMT_LEFT_J:
  140. val |= TEGRA30_I2S_CTRL_FRAME_FORMAT_LRCK;
  141. val |= TEGRA30_I2S_CTRL_LRCK_L_LOW;
  142. break;
  143. default:
  144. return -EINVAL;
  145. }
  146. pm_runtime_get_sync(dai->dev);
  147. regmap_update_bits(i2s->regmap, TEGRA30_I2S_CTRL, mask, val);
  148. pm_runtime_put(dai->dev);
  149. return 0;
  150. }
  151. static int tegra30_i2s_hw_params(struct snd_pcm_substream *substream,
  152. struct snd_pcm_hw_params *params,
  153. struct snd_soc_dai *dai)
  154. {
  155. struct device *dev = dai->dev;
  156. struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
  157. unsigned int mask, val, reg;
  158. int ret, sample_size, srate, i2sclock, bitcnt;
  159. if (params_channels(params) != 2)
  160. return -EINVAL;
  161. mask = TEGRA30_I2S_CTRL_BIT_SIZE_MASK;
  162. switch (params_format(params)) {
  163. case SNDRV_PCM_FORMAT_S16_LE:
  164. val = TEGRA30_I2S_CTRL_BIT_SIZE_16;
  165. sample_size = 16;
  166. break;
  167. default:
  168. return -EINVAL;
  169. }
  170. regmap_update_bits(i2s->regmap, TEGRA30_I2S_CTRL, mask, val);
  171. srate = params_rate(params);
  172. /* Final "* 2" required by Tegra hardware */
  173. i2sclock = srate * params_channels(params) * sample_size * 2;
  174. bitcnt = (i2sclock / (2 * srate)) - 1;
  175. if (bitcnt < 0 || bitcnt > TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_MASK_US)
  176. return -EINVAL;
  177. ret = clk_set_rate(i2s->clk_i2s, i2sclock);
  178. if (ret) {
  179. dev_err(dev, "Can't set I2S clock rate: %d\n", ret);
  180. return ret;
  181. }
  182. val = bitcnt << TEGRA30_I2S_TIMING_CHANNEL_BIT_COUNT_SHIFT;
  183. if (i2sclock % (2 * srate))
  184. val |= TEGRA30_I2S_TIMING_NON_SYM_ENABLE;
  185. regmap_write(i2s->regmap, TEGRA30_I2S_TIMING, val);
  186. val = (0 << TEGRA30_AUDIOCIF_CTRL_FIFO_THRESHOLD_SHIFT) |
  187. (1 << TEGRA30_AUDIOCIF_CTRL_AUDIO_CHANNELS_SHIFT) |
  188. (1 << TEGRA30_AUDIOCIF_CTRL_CLIENT_CHANNELS_SHIFT) |
  189. TEGRA30_AUDIOCIF_CTRL_AUDIO_BITS_16 |
  190. TEGRA30_AUDIOCIF_CTRL_CLIENT_BITS_16;
  191. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
  192. val |= TEGRA30_AUDIOCIF_CTRL_DIRECTION_RX;
  193. reg = TEGRA30_I2S_CIF_RX_CTRL;
  194. } else {
  195. val |= TEGRA30_AUDIOCIF_CTRL_DIRECTION_TX;
  196. reg = TEGRA30_I2S_CIF_TX_CTRL;
  197. }
  198. regmap_write(i2s->regmap, reg, val);
  199. val = (1 << TEGRA30_I2S_OFFSET_RX_DATA_OFFSET_SHIFT) |
  200. (1 << TEGRA30_I2S_OFFSET_TX_DATA_OFFSET_SHIFT);
  201. regmap_write(i2s->regmap, TEGRA30_I2S_OFFSET, val);
  202. return 0;
  203. }
  204. static void tegra30_i2s_start_playback(struct tegra30_i2s *i2s)
  205. {
  206. tegra30_ahub_enable_tx_fifo(i2s->playback_fifo_cif);
  207. regmap_update_bits(i2s->regmap, TEGRA30_I2S_CTRL,
  208. TEGRA30_I2S_CTRL_XFER_EN_TX,
  209. TEGRA30_I2S_CTRL_XFER_EN_TX);
  210. }
  211. static void tegra30_i2s_stop_playback(struct tegra30_i2s *i2s)
  212. {
  213. tegra30_ahub_disable_tx_fifo(i2s->playback_fifo_cif);
  214. regmap_update_bits(i2s->regmap, TEGRA30_I2S_CTRL,
  215. TEGRA30_I2S_CTRL_XFER_EN_TX, 0);
  216. }
  217. static void tegra30_i2s_start_capture(struct tegra30_i2s *i2s)
  218. {
  219. tegra30_ahub_enable_rx_fifo(i2s->capture_fifo_cif);
  220. regmap_update_bits(i2s->regmap, TEGRA30_I2S_CTRL,
  221. TEGRA30_I2S_CTRL_XFER_EN_RX,
  222. TEGRA30_I2S_CTRL_XFER_EN_RX);
  223. }
  224. static void tegra30_i2s_stop_capture(struct tegra30_i2s *i2s)
  225. {
  226. tegra30_ahub_disable_rx_fifo(i2s->capture_fifo_cif);
  227. regmap_update_bits(i2s->regmap, TEGRA30_I2S_CTRL,
  228. TEGRA30_I2S_CTRL_XFER_EN_RX, 0);
  229. }
  230. static int tegra30_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
  231. struct snd_soc_dai *dai)
  232. {
  233. struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
  234. switch (cmd) {
  235. case SNDRV_PCM_TRIGGER_START:
  236. case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
  237. case SNDRV_PCM_TRIGGER_RESUME:
  238. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  239. tegra30_i2s_start_playback(i2s);
  240. else
  241. tegra30_i2s_start_capture(i2s);
  242. break;
  243. case SNDRV_PCM_TRIGGER_STOP:
  244. case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
  245. case SNDRV_PCM_TRIGGER_SUSPEND:
  246. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  247. tegra30_i2s_stop_playback(i2s);
  248. else
  249. tegra30_i2s_stop_capture(i2s);
  250. break;
  251. default:
  252. return -EINVAL;
  253. }
  254. return 0;
  255. }
  256. static int tegra30_i2s_probe(struct snd_soc_dai *dai)
  257. {
  258. struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
  259. dai->capture_dma_data = &i2s->capture_dma_data;
  260. dai->playback_dma_data = &i2s->playback_dma_data;
  261. return 0;
  262. }
  263. static struct snd_soc_dai_ops tegra30_i2s_dai_ops = {
  264. .startup = tegra30_i2s_startup,
  265. .shutdown = tegra30_i2s_shutdown,
  266. .set_fmt = tegra30_i2s_set_fmt,
  267. .hw_params = tegra30_i2s_hw_params,
  268. .trigger = tegra30_i2s_trigger,
  269. };
  270. static const struct snd_soc_dai_driver tegra30_i2s_dai_template = {
  271. .probe = tegra30_i2s_probe,
  272. .playback = {
  273. .stream_name = "Playback",
  274. .channels_min = 2,
  275. .channels_max = 2,
  276. .rates = SNDRV_PCM_RATE_8000_96000,
  277. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  278. },
  279. .capture = {
  280. .stream_name = "Capture",
  281. .channels_min = 2,
  282. .channels_max = 2,
  283. .rates = SNDRV_PCM_RATE_8000_96000,
  284. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  285. },
  286. .ops = &tegra30_i2s_dai_ops,
  287. .symmetric_rates = 1,
  288. };
  289. static const struct snd_soc_component_driver tegra30_i2s_component = {
  290. .name = DRV_NAME,
  291. };
  292. static bool tegra30_i2s_wr_rd_reg(struct device *dev, unsigned int reg)
  293. {
  294. switch (reg) {
  295. case TEGRA30_I2S_CTRL:
  296. case TEGRA30_I2S_TIMING:
  297. case TEGRA30_I2S_OFFSET:
  298. case TEGRA30_I2S_CH_CTRL:
  299. case TEGRA30_I2S_SLOT_CTRL:
  300. case TEGRA30_I2S_CIF_RX_CTRL:
  301. case TEGRA30_I2S_CIF_TX_CTRL:
  302. case TEGRA30_I2S_FLOWCTL:
  303. case TEGRA30_I2S_TX_STEP:
  304. case TEGRA30_I2S_FLOW_STATUS:
  305. case TEGRA30_I2S_FLOW_TOTAL:
  306. case TEGRA30_I2S_FLOW_OVER:
  307. case TEGRA30_I2S_FLOW_UNDER:
  308. case TEGRA30_I2S_LCOEF_1_4_0:
  309. case TEGRA30_I2S_LCOEF_1_4_1:
  310. case TEGRA30_I2S_LCOEF_1_4_2:
  311. case TEGRA30_I2S_LCOEF_1_4_3:
  312. case TEGRA30_I2S_LCOEF_1_4_4:
  313. case TEGRA30_I2S_LCOEF_1_4_5:
  314. case TEGRA30_I2S_LCOEF_2_4_0:
  315. case TEGRA30_I2S_LCOEF_2_4_1:
  316. case TEGRA30_I2S_LCOEF_2_4_2:
  317. return true;
  318. default:
  319. return false;
  320. };
  321. }
  322. static bool tegra30_i2s_volatile_reg(struct device *dev, unsigned int reg)
  323. {
  324. switch (reg) {
  325. case TEGRA30_I2S_FLOW_STATUS:
  326. case TEGRA30_I2S_FLOW_TOTAL:
  327. case TEGRA30_I2S_FLOW_OVER:
  328. case TEGRA30_I2S_FLOW_UNDER:
  329. return true;
  330. default:
  331. return false;
  332. };
  333. }
  334. static const struct regmap_config tegra30_i2s_regmap_config = {
  335. .reg_bits = 32,
  336. .reg_stride = 4,
  337. .val_bits = 32,
  338. .max_register = TEGRA30_I2S_LCOEF_2_4_2,
  339. .writeable_reg = tegra30_i2s_wr_rd_reg,
  340. .readable_reg = tegra30_i2s_wr_rd_reg,
  341. .volatile_reg = tegra30_i2s_volatile_reg,
  342. .cache_type = REGCACHE_RBTREE,
  343. };
  344. static int tegra30_i2s_platform_probe(struct platform_device *pdev)
  345. {
  346. struct tegra30_i2s *i2s;
  347. u32 cif_ids[2];
  348. struct resource *mem, *memregion;
  349. void __iomem *regs;
  350. int ret;
  351. i2s = devm_kzalloc(&pdev->dev, sizeof(struct tegra30_i2s), GFP_KERNEL);
  352. if (!i2s) {
  353. dev_err(&pdev->dev, "Can't allocate tegra30_i2s\n");
  354. ret = -ENOMEM;
  355. goto err;
  356. }
  357. dev_set_drvdata(&pdev->dev, i2s);
  358. i2s->dai = tegra30_i2s_dai_template;
  359. i2s->dai.name = dev_name(&pdev->dev);
  360. ret = of_property_read_u32_array(pdev->dev.of_node,
  361. "nvidia,ahub-cif-ids", cif_ids,
  362. ARRAY_SIZE(cif_ids));
  363. if (ret < 0)
  364. goto err;
  365. i2s->playback_i2s_cif = cif_ids[0];
  366. i2s->capture_i2s_cif = cif_ids[1];
  367. i2s->clk_i2s = clk_get(&pdev->dev, NULL);
  368. if (IS_ERR(i2s->clk_i2s)) {
  369. dev_err(&pdev->dev, "Can't retrieve i2s clock\n");
  370. ret = PTR_ERR(i2s->clk_i2s);
  371. goto err;
  372. }
  373. mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  374. if (!mem) {
  375. dev_err(&pdev->dev, "No memory resource\n");
  376. ret = -ENODEV;
  377. goto err_clk_put;
  378. }
  379. memregion = devm_request_mem_region(&pdev->dev, mem->start,
  380. resource_size(mem), DRV_NAME);
  381. if (!memregion) {
  382. dev_err(&pdev->dev, "Memory region already claimed\n");
  383. ret = -EBUSY;
  384. goto err_clk_put;
  385. }
  386. regs = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
  387. if (!regs) {
  388. dev_err(&pdev->dev, "ioremap failed\n");
  389. ret = -ENOMEM;
  390. goto err_clk_put;
  391. }
  392. i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
  393. &tegra30_i2s_regmap_config);
  394. if (IS_ERR(i2s->regmap)) {
  395. dev_err(&pdev->dev, "regmap init failed\n");
  396. ret = PTR_ERR(i2s->regmap);
  397. goto err_clk_put;
  398. }
  399. regcache_cache_only(i2s->regmap, true);
  400. pm_runtime_enable(&pdev->dev);
  401. if (!pm_runtime_enabled(&pdev->dev)) {
  402. ret = tegra30_i2s_runtime_resume(&pdev->dev);
  403. if (ret)
  404. goto err_pm_disable;
  405. }
  406. ret = snd_soc_register_component(&pdev->dev, &tegra30_i2s_component,
  407. &i2s->dai, 1);
  408. if (ret) {
  409. dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
  410. ret = -ENOMEM;
  411. goto err_suspend;
  412. }
  413. ret = tegra_pcm_platform_register(&pdev->dev);
  414. if (ret) {
  415. dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
  416. goto err_unregister_component;
  417. }
  418. return 0;
  419. err_unregister_component:
  420. snd_soc_unregister_component(&pdev->dev);
  421. err_suspend:
  422. if (!pm_runtime_status_suspended(&pdev->dev))
  423. tegra30_i2s_runtime_suspend(&pdev->dev);
  424. err_pm_disable:
  425. pm_runtime_disable(&pdev->dev);
  426. err_clk_put:
  427. clk_put(i2s->clk_i2s);
  428. err:
  429. return ret;
  430. }
  431. static int tegra30_i2s_platform_remove(struct platform_device *pdev)
  432. {
  433. struct tegra30_i2s *i2s = dev_get_drvdata(&pdev->dev);
  434. pm_runtime_disable(&pdev->dev);
  435. if (!pm_runtime_status_suspended(&pdev->dev))
  436. tegra30_i2s_runtime_suspend(&pdev->dev);
  437. tegra_pcm_platform_unregister(&pdev->dev);
  438. snd_soc_unregister_component(&pdev->dev);
  439. clk_put(i2s->clk_i2s);
  440. return 0;
  441. }
  442. #ifdef CONFIG_PM_SLEEP
  443. static int tegra30_i2s_suspend(struct device *dev)
  444. {
  445. struct tegra30_i2s *i2s = dev_get_drvdata(dev);
  446. regcache_mark_dirty(i2s->regmap);
  447. return 0;
  448. }
  449. static int tegra30_i2s_resume(struct device *dev)
  450. {
  451. struct tegra30_i2s *i2s = dev_get_drvdata(dev);
  452. int ret;
  453. ret = pm_runtime_get_sync(dev);
  454. if (ret < 0)
  455. return ret;
  456. ret = regcache_sync(i2s->regmap);
  457. pm_runtime_put(dev);
  458. return ret;
  459. }
  460. #endif
  461. static const struct of_device_id tegra30_i2s_of_match[] = {
  462. { .compatible = "nvidia,tegra30-i2s", },
  463. {},
  464. };
  465. static const struct dev_pm_ops tegra30_i2s_pm_ops = {
  466. SET_RUNTIME_PM_OPS(tegra30_i2s_runtime_suspend,
  467. tegra30_i2s_runtime_resume, NULL)
  468. SET_SYSTEM_SLEEP_PM_OPS(tegra30_i2s_suspend, tegra30_i2s_resume)
  469. };
  470. static struct platform_driver tegra30_i2s_driver = {
  471. .driver = {
  472. .name = DRV_NAME,
  473. .owner = THIS_MODULE,
  474. .of_match_table = tegra30_i2s_of_match,
  475. .pm = &tegra30_i2s_pm_ops,
  476. },
  477. .probe = tegra30_i2s_platform_probe,
  478. .remove = tegra30_i2s_platform_remove,
  479. };
  480. module_platform_driver(tegra30_i2s_driver);
  481. MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>");
  482. MODULE_DESCRIPTION("Tegra30 I2S ASoC driver");
  483. MODULE_LICENSE("GPL");
  484. MODULE_ALIAS("platform:" DRV_NAME);
  485. MODULE_DEVICE_TABLE(of, tegra30_i2s_of_match);