aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/si4713-i2c.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/radio/si4713-i2c.h')
-rw-r--r--drivers/media/radio/si4713-i2c.h66
1 files changed, 32 insertions, 34 deletions
diff --git a/drivers/media/radio/si4713-i2c.h b/drivers/media/radio/si4713-i2c.h
index c6dfa7fb101c..25cdea26343b 100644
--- a/drivers/media/radio/si4713-i2c.h
+++ b/drivers/media/radio/si4713-i2c.h
@@ -16,6 +16,7 @@
16#define SI4713_I2C_H 16#define SI4713_I2C_H
17 17
18#include <media/v4l2-subdev.h> 18#include <media/v4l2-subdev.h>
19#include <media/v4l2-ctrls.h>
19#include <media/si4713.h> 20#include <media/si4713.h>
20 21
21#define SI4713_PRODUCT_NUMBER 0x0D 22#define SI4713_PRODUCT_NUMBER 0x0D
@@ -160,56 +161,33 @@
160#define POWER_UP 0x01 161#define POWER_UP 0x01
161#define POWER_DOWN 0x00 162#define POWER_DOWN 0x00
162 163
163struct rds_info {
164 u32 pi;
165#define MAX_RDS_PTY 31 164#define MAX_RDS_PTY 31
166 u32 pty;
167#define MAX_RDS_DEVIATION 90000 165#define MAX_RDS_DEVIATION 90000
168 u32 deviation; 166
169/* 167/*
170 * PSNAME is known to be defined as 8 character sized (RDS Spec). 168 * PSNAME is known to be defined as 8 character sized (RDS Spec).
171 * However, there is receivers which scroll PSNAME 8xN sized. 169 * However, there is receivers which scroll PSNAME 8xN sized.
172 */ 170 */
173#define MAX_RDS_PS_NAME 96 171#define MAX_RDS_PS_NAME 96
174 u8 ps_name[MAX_RDS_PS_NAME + 1]; 172
175/* 173/*
176 * MAX_RDS_RADIO_TEXT is known to be defined as 32 (2A group) or 64 (2B group) 174 * MAX_RDS_RADIO_TEXT is known to be defined as 32 (2A group) or 64 (2B group)
177 * character sized (RDS Spec). 175 * character sized (RDS Spec).
178 * However, there is receivers which scroll them as well. 176 * However, there is receivers which scroll them as well.
179 */ 177 */
180#define MAX_RDS_RADIO_TEXT 384 178#define MAX_RDS_RADIO_TEXT 384
181 u8 radio_text[MAX_RDS_RADIO_TEXT + 1];
182 u32 enabled;
183};
184 179
185struct limiter_info {
186#define MAX_LIMITER_RELEASE_TIME 102390 180#define MAX_LIMITER_RELEASE_TIME 102390
187 u32 release_time;
188#define MAX_LIMITER_DEVIATION 90000 181#define MAX_LIMITER_DEVIATION 90000
189 u32 deviation;
190 u32 enabled;
191};
192 182
193struct pilot_info {
194#define MAX_PILOT_DEVIATION 90000 183#define MAX_PILOT_DEVIATION 90000
195 u32 deviation;
196#define MAX_PILOT_FREQUENCY 19000 184#define MAX_PILOT_FREQUENCY 19000
197 u32 frequency;
198 u32 enabled;
199};
200 185
201struct acomp_info {
202#define MAX_ACOMP_RELEASE_TIME 1000000 186#define MAX_ACOMP_RELEASE_TIME 1000000
203 u32 release_time;
204#define MAX_ACOMP_ATTACK_TIME 5000 187#define MAX_ACOMP_ATTACK_TIME 5000
205 u32 attack_time;
206#define MAX_ACOMP_THRESHOLD 0 188#define MAX_ACOMP_THRESHOLD 0
207#define MIN_ACOMP_THRESHOLD (-40) 189#define MIN_ACOMP_THRESHOLD (-40)
208 s32 threshold;
209#define MAX_ACOMP_GAIN 20 190#define MAX_ACOMP_GAIN 20
210 u32 gain;
211 u32 enabled;
212};
213 191
214#define SI4713_NUM_SUPPLIES 2 192#define SI4713_NUM_SUPPLIES 2
215 193
@@ -219,21 +197,41 @@ struct acomp_info {
219struct si4713_device { 197struct si4713_device {
220 /* v4l2_subdev and i2c reference (v4l2_subdev priv data) */ 198 /* v4l2_subdev and i2c reference (v4l2_subdev priv data) */
221 struct v4l2_subdev sd; 199 struct v4l2_subdev sd;
200 struct v4l2_ctrl_handler ctrl_handler;
222 /* private data structures */ 201 /* private data structures */
223 struct mutex mutex; 202 struct { /* si4713 control cluster */
203 /* This is one big cluster since the mute control
204 * powers off the device and after unmuting again all
205 * controls need to be set at once. The only way of doing
206 * that is by making it one big cluster. */
207 struct v4l2_ctrl *mute;
208 struct v4l2_ctrl *rds_ps_name;
209 struct v4l2_ctrl *rds_radio_text;
210 struct v4l2_ctrl *rds_pi;
211 struct v4l2_ctrl *rds_deviation;
212 struct v4l2_ctrl *rds_pty;
213 struct v4l2_ctrl *compression_enabled;
214 struct v4l2_ctrl *compression_threshold;
215 struct v4l2_ctrl *compression_gain;
216 struct v4l2_ctrl *compression_attack_time;
217 struct v4l2_ctrl *compression_release_time;
218 struct v4l2_ctrl *pilot_tone_enabled;
219 struct v4l2_ctrl *pilot_tone_freq;
220 struct v4l2_ctrl *pilot_tone_deviation;
221 struct v4l2_ctrl *limiter_enabled;
222 struct v4l2_ctrl *limiter_deviation;
223 struct v4l2_ctrl *limiter_release_time;
224 struct v4l2_ctrl *tune_preemphasis;
225 struct v4l2_ctrl *tune_pwr_level;
226 struct v4l2_ctrl *tune_ant_cap;
227 };
224 struct completion work; 228 struct completion work;
225 struct rds_info rds_info;
226 struct limiter_info limiter_info;
227 struct pilot_info pilot_info;
228 struct acomp_info acomp_info;
229 struct regulator_bulk_data supplies[SI4713_NUM_SUPPLIES]; 229 struct regulator_bulk_data supplies[SI4713_NUM_SUPPLIES];
230 int gpio_reset; 230 int gpio_reset;
231 u32 power_state;
232 u32 rds_enabled;
231 u32 frequency; 233 u32 frequency;
232 u32 preemphasis; 234 u32 preemphasis;
233 u32 mute;
234 u32 power_level;
235 u32 power_state;
236 u32 antenna_capacitor;
237 u32 stereo; 235 u32 stereo;
238 u32 tune_rnl; 236 u32 tune_rnl;
239}; 237};