vivid-rds-gen.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * vivid-rds-gen.h - rds (radio data system) generator support functions.
  4. *
  5. * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  6. */
  7. #ifndef _VIVID_RDS_GEN_H_
  8. #define _VIVID_RDS_GEN_H_
  9. /*
  10. * It takes almost exactly 5 seconds to transmit 57 RDS groups.
  11. * Each group has 4 blocks and each block has a payload of 16 bits + a
  12. * block identification. The driver will generate the contents of these
  13. * 57 groups only when necessary and it will just be played continuously.
  14. */
  15. #define VIVID_RDS_GEN_GROUPS 57
  16. #define VIVID_RDS_GEN_BLKS_PER_GRP 4
  17. #define VIVID_RDS_GEN_BLOCKS (VIVID_RDS_GEN_BLKS_PER_GRP * VIVID_RDS_GEN_GROUPS)
  18. #define VIVID_RDS_NSEC_PER_BLK (u32)(5ull * NSEC_PER_SEC / VIVID_RDS_GEN_BLOCKS)
  19. struct vivid_rds_gen {
  20. struct v4l2_rds_data data[VIVID_RDS_GEN_BLOCKS];
  21. bool use_rbds;
  22. u16 picode;
  23. u8 pty;
  24. bool mono_stereo;
  25. bool art_head;
  26. bool compressed;
  27. bool dyn_pty;
  28. bool ta;
  29. bool tp;
  30. bool ms;
  31. char psname[8 + 1];
  32. char radiotext[64 + 1];
  33. };
  34. void vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq,
  35. bool use_alternate);
  36. void vivid_rds_generate(struct vivid_rds_gen *rds);
  37. #endif