ux500_msp_dai.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2012
  3. *
  4. * Author: Ola Lilja <ola.o.lilja@stericsson.com>,
  5. * Roger Nilsson <roger.xr.nilsson@stericsson.com>
  6. * for ST-Ericsson.
  7. *
  8. * License terms:
  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 published
  12. * by the Free Software Foundation.
  13. */
  14. #ifndef UX500_msp_dai_H
  15. #define UX500_msp_dai_H
  16. #include <linux/types.h>
  17. #include <linux/spinlock.h>
  18. #include "ux500_msp_i2s.h"
  19. #define UX500_NBR_OF_DAI 4
  20. #define UX500_I2S_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | \
  21. SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
  22. #define UX500_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE)
  23. #define FRAME_PER_SINGLE_SLOT_8_KHZ 31
  24. #define FRAME_PER_SINGLE_SLOT_16_KHZ 124
  25. #define FRAME_PER_SINGLE_SLOT_44_1_KHZ 63
  26. #define FRAME_PER_SINGLE_SLOT_48_KHZ 49
  27. #define FRAME_PER_2_SLOTS 31
  28. #define FRAME_PER_8_SLOTS 138
  29. #define FRAME_PER_16_SLOTS 277
  30. #define UX500_MSP_INTERNAL_CLOCK_FREQ 40000000
  31. #define UX500_MSP1_INTERNAL_CLOCK_FREQ UX500_MSP_INTERNAL_CLOCK_FREQ
  32. #define UX500_MSP_MIN_CHANNELS 1
  33. #define UX500_MSP_MAX_CHANNELS 8
  34. #define PLAYBACK_CONFIGURED 1
  35. #define CAPTURE_CONFIGURED 2
  36. enum ux500_msp_clock_id {
  37. UX500_MSP_MASTER_CLOCK,
  38. };
  39. struct ux500_msp_i2s_drvdata {
  40. struct ux500_msp *msp;
  41. struct regulator *reg_vape;
  42. unsigned int fmt;
  43. unsigned int tx_mask;
  44. unsigned int rx_mask;
  45. int slots;
  46. int slot_width;
  47. /* Clocks */
  48. unsigned int master_clk;
  49. struct clk *clk;
  50. struct clk *pclk;
  51. /* Regulators */
  52. int vape_opp_constraint;
  53. };
  54. int ux500_msp_dai_set_data_delay(struct snd_soc_dai *dai, int delay);
  55. #endif