xref: /openbmc/linux/drivers/media/i2c/max2175.h (revision 5d0e4d78)
1 /*
2  * Maxim Integrated MAX2175 RF to Bits tuner driver
3  *
4  * This driver & most of the hard coded values are based on the reference
5  * application delivered by Maxim for this device.
6  *
7  * Copyright (C) 2016 Maxim Integrated Products
8  * Copyright (C) 2017 Renesas Electronics Corporation
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
12  * as published by the Free Software Foundation.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  */
19 
20 #ifndef __MAX2175_H__
21 #define __MAX2175_H__
22 
23 #define MAX2175_EU_XTAL_FREQ	36864000	/* In Hz */
24 #define MAX2175_NA_XTAL_FREQ	40186125	/* In Hz */
25 
26 enum max2175_region {
27 	MAX2175_REGION_EU = 0,	/* Europe */
28 	MAX2175_REGION_NA,	/* North America */
29 };
30 
31 enum max2175_band {
32 	MAX2175_BAND_AM = 0,
33 	MAX2175_BAND_FM,
34 	MAX2175_BAND_VHF,
35 	MAX2175_BAND_L,
36 };
37 
38 enum max2175_eu_mode {
39 	/* EU modes */
40 	MAX2175_EU_FM_1_2 = 0,
41 	MAX2175_DAB_1_2,
42 
43 	/*
44 	 * Other possible modes to add in future
45 	 * MAX2175_DAB_1_0,
46 	 * MAX2175_DAB_1_3,
47 	 * MAX2175_EU_FM_2_2,
48 	 * MAX2175_EU_FMHD_4_0,
49 	 * MAX2175_EU_AM_1_0,
50 	 * MAX2175_EU_AM_2_2,
51 	 */
52 };
53 
54 enum max2175_na_mode {
55 	/* NA modes */
56 	MAX2175_NA_FM_1_0 = 0,
57 	MAX2175_NA_FM_2_0,
58 
59 	/*
60 	 * Other possible modes to add in future
61 	 * MAX2175_NA_FMHD_1_0,
62 	 * MAX2175_NA_FMHD_1_2,
63 	 * MAX2175_NA_AM_1_0,
64 	 * MAX2175_NA_AM_1_2,
65 	 */
66 };
67 
68 /* Supported I2S modes */
69 enum {
70 	MAX2175_I2S_MODE0 = 0,
71 	MAX2175_I2S_MODE1,
72 	MAX2175_I2S_MODE2,
73 	MAX2175_I2S_MODE3,
74 	MAX2175_I2S_MODE4,
75 };
76 
77 /* Coefficient table groups */
78 enum {
79 	MAX2175_CH_MSEL = 0,
80 	MAX2175_EQ_MSEL,
81 	MAX2175_AA_MSEL,
82 };
83 
84 /* HSLS LO injection polarity */
85 enum {
86 	MAX2175_LO_BELOW_DESIRED = 0,
87 	MAX2175_LO_ABOVE_DESIRED,
88 };
89 
90 /* Channel FSM modes */
91 enum max2175_csm_mode {
92 	MAX2175_LOAD_TO_BUFFER = 0,
93 	MAX2175_PRESET_TUNE,
94 	MAX2175_SEARCH,
95 	MAX2175_AF_UPDATE,
96 	MAX2175_JUMP_FAST_TUNE,
97 	MAX2175_CHECK,
98 	MAX2175_LOAD_AND_SWAP,
99 	MAX2175_END,
100 	MAX2175_BUFFER_PLUS_PRESET_TUNE,
101 	MAX2175_BUFFER_PLUS_SEARCH,
102 	MAX2175_BUFFER_PLUS_AF_UPDATE,
103 	MAX2175_BUFFER_PLUS_JUMP_FAST_TUNE,
104 	MAX2175_BUFFER_PLUS_CHECK,
105 	MAX2175_BUFFER_PLUS_LOAD_AND_SWAP,
106 	MAX2175_NO_ACTION
107 };
108 
109 #endif /* __MAX2175_H__ */
110