diff mbox series

[RFC,WIP,v3,5/6] media: vidtv: move config structs into a common header

Message ID 20200406232055.1023946-6-dwlsalmeida@gmail.com
State New
Headers show
Series media: vidtv: implement a virtual DVB driver | expand

Commit Message

Daniel Almeida April 6, 2020, 11:20 p.m. UTC
From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>

Move config structs to a common header so they can be used by the bridge
driver and by their respective drivers.

Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
---
 .../media/test_drivers/vidtv/vidtv_common.h   | 19 +++++++++++++++++++
 .../media/test_drivers/vidtv/vidtv_demod.h    |  9 ---------
 .../media/test_drivers/vidtv/vidtv_tuner.c    | 12 ++----------
 3 files changed, 21 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/test_drivers/vidtv/vidtv_common.h b/drivers/media/test_drivers/vidtv/vidtv_common.h
index 43269833ee866..e6b36429cc8de 100644
--- a/drivers/media/test_drivers/vidtv/vidtv_common.h
+++ b/drivers/media/test_drivers/vidtv/vidtv_common.h
@@ -56,6 +56,25 @@  struct vidtv_mpeg_ts {
 	struct vidtv_mpeg_ts_adaption adaption[];
 } __packed;
 
+struct vidtv_tuner_config {
+	struct dvb_frontend *fe;
+	u32 mock_power_up_delay_msec;
+	u32 mock_tune_delay_msec;
+	u32 vidtv_valid_dvb_t_freqs[8];
+	u32 vidtv_valid_dvb_c_freqs[8];
+	u32 vidtv_valid_dvb_s_freqs[8];
+	u8  max_frequency_shift_hz;
+};
+
+struct vidtv_demod_config {
+	struct dvb_frontend *frontend;
+	/* probability of losing the lock due to low snr */
+	u8 drop_tslock_prob_on_low_snr;
+	/* probability of recovering when the signal improves */
+	u8 recover_tslock_prob_on_good_snr;
+	u8 chosen_delsys;
+};
+
 u32 vidtv_memcpy(void *to,
 		 const void *from,
 		 size_t len,
diff --git a/drivers/media/test_drivers/vidtv/vidtv_demod.h b/drivers/media/test_drivers/vidtv/vidtv_demod.h
index 49c2a43f71661..269855efb77f3 100644
--- a/drivers/media/test_drivers/vidtv/vidtv_demod.h
+++ b/drivers/media/test_drivers/vidtv/vidtv_demod.h
@@ -21,15 +21,6 @@  struct vidtv_demod_cnr_to_qual_s {
 	u32 cnr_ok, cnr_good;
 };
 
-struct vidtv_demod_config {
-	struct dvb_frontend *frontend;
-	/* probability of losing the lock due to low snr */
-	u8 drop_tslock_prob_on_low_snr;
-	/* probability of recovering when the signal improves */
-	u8 recover_tslock_prob_on_good_snr;
-	u8 chosen_delsys;
-};
-
 struct vidtv_demod_state {
 	struct dvb_frontend frontend;
 	struct vidtv_demod_config config;
diff --git a/drivers/media/test_drivers/vidtv/vidtv_tuner.c b/drivers/media/test_drivers/vidtv/vidtv_tuner.c
index c948daa66ec73..8b1befc861e33 100644
--- a/drivers/media/test_drivers/vidtv/vidtv_tuner.c
+++ b/drivers/media/test_drivers/vidtv/vidtv_tuner.c
@@ -17,20 +17,12 @@ 
 #include <linux/types.h>
 #include <media/dvb_frontend.h>
 
+#include "vidtv_common.h"
+
 MODULE_DESCRIPTION("Virtual DTV Tuner");
 MODULE_AUTHOR("Daniel W. S. Almeida");
 MODULE_LICENSE("GPL");
 
-struct vidtv_tuner_config {
-	struct dvb_frontend *fe;
-	u32 mock_power_up_delay_msec;
-	u32 mock_tune_delay_msec;
-	u32 vidtv_valid_dvb_t_freqs[8];
-	u32 vidtv_valid_dvb_c_freqs[8];
-	u32 vidtv_valid_dvb_s_freqs[8];
-	u8  max_frequency_shift_hz;
-};
-
 struct vidtv_tuner_cnr_to_qual_s {
 	/* attempt to use the same values as libdvbv5 */
 	u32 modulation;