xref: /linux/drivers/media/dvb-frontends/au8522.h (revision 58e16d792a6a8c6b750f637a4649967fcac853dc)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3     Auvitek AU8522 QAM/8VSB demodulator driver
4 
5     Copyright (C) 2008 Steven Toth <stoth@linuxtv.org>
6 
7 
8 */
9 
10 #ifndef __AU8522_H__
11 #define __AU8522_H__
12 
13 #include <linux/dvb/frontend.h>
14 
15 enum au8522_if_freq {
16 	AU8522_IF_6MHZ = 0,
17 	AU8522_IF_4MHZ,
18 	AU8522_IF_3_25MHZ,
19 };
20 
21 struct au8522_led_config {
22 	u16 vsb8_strong;
23 	u16 qam64_strong;
24 	u16 qam256_strong;
25 
26 	u16 gpio_output;
27 	/* unset hi bits, set low bits */
28 	u16 gpio_output_enable;
29 	u16 gpio_output_disable;
30 
31 	u16 gpio_leds;
32 	u8 *led_states;
33 	unsigned int num_led_states;
34 };
35 
36 struct au8522_config {
37 	/* the demodulator's i2c address */
38 	u8 demod_address;
39 
40 	/* Return lock status based on tuner lock, or demod lock */
41 #define AU8522_TUNERLOCKING 0
42 #define AU8522_DEMODLOCKING 1
43 	u8 status_mode;
44 
45 	struct au8522_led_config *led_cfg;
46 
47 	enum au8522_if_freq vsb_if;
48 	enum au8522_if_freq qam_if;
49 };
50 
51 #if IS_REACHABLE(CONFIG_DVB_AU8522_DTV)
52 extern struct dvb_frontend *au8522_attach(const struct au8522_config *config,
53 					  struct i2c_adapter *i2c);
54 #else
55 static inline
au8522_attach(const struct au8522_config * config,struct i2c_adapter * i2c)56 struct dvb_frontend *au8522_attach(const struct au8522_config *config,
57 				   struct i2c_adapter *i2c)
58 {
59 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
60 	return NULL;
61 }
62 #endif /* CONFIG_DVB_AU8522 */
63 
64 /* Other modes may need to be added later */
65 enum au8522_video_input {
66 	AU8522_COMPOSITE_CH1 = 1,
67 	AU8522_COMPOSITE_CH2,
68 	AU8522_COMPOSITE_CH3,
69 	AU8522_COMPOSITE_CH4,
70 	AU8522_COMPOSITE_CH4_SIF,
71 	AU8522_SVIDEO_CH13,
72 	AU8522_SVIDEO_CH24,
73 };
74 
75 enum au8522_audio_input {
76 	AU8522_AUDIO_NONE,
77 	AU8522_AUDIO_SIF,
78 };
79 #endif /* __AU8522_H__ */
80