Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / drivers / media / platform / vivid / vivid-rds-gen.h
blobe55e3b22b7ca409c20e2dd06a9e94017676fcbbd
1 /*
2 * vivid-rds-gen.h - rds (radio data system) generator support functions.
4 * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
6 * This program is free software; you may redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
14 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17 * SOFTWARE.
20 #ifndef _VIVID_RDS_GEN_H_
21 #define _VIVID_RDS_GEN_H_
24 * It takes almost exactly 5 seconds to transmit 57 RDS groups.
25 * Each group has 4 blocks and each block has a payload of 16 bits + a
26 * block identification. The driver will generate the contents of these
27 * 57 groups only when necessary and it will just be played continuously.
29 #define VIVID_RDS_GEN_GROUPS 57
30 #define VIVID_RDS_GEN_BLKS_PER_GRP 4
31 #define VIVID_RDS_GEN_BLOCKS (VIVID_RDS_GEN_BLKS_PER_GRP * VIVID_RDS_GEN_GROUPS)
32 #define VIVID_RDS_NSEC_PER_BLK (u32)(5ull * NSEC_PER_SEC / VIVID_RDS_GEN_BLOCKS)
34 struct vivid_rds_gen {
35 struct v4l2_rds_data data[VIVID_RDS_GEN_BLOCKS];
36 bool use_rbds;
37 u16 picode;
38 u8 pty;
39 bool mono_stereo;
40 bool art_head;
41 bool compressed;
42 bool dyn_pty;
43 bool ta;
44 bool tp;
45 bool ms;
46 char psname[8 + 1];
47 char radiotext[64 + 1];
50 void vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq,
51 bool use_alternate);
52 void vivid_rds_generate(struct vivid_rds_gen *rds);
54 #endif