hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/media/v4l2-core/tuner-core.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * i2c tv tuner chip device driver
34 * core core, i.e. kernel interfaces, registering and so on
....@@ -94,8 +95,55 @@
9495 } while (0)
9596
9697 /*
97
- * Internal struct used inside the driver
98
+ * Internal enums/struct used inside the driver
9899 */
100
+
101
+/**
102
+ * enum tuner_pad_index - tuner pad index for MEDIA_ENT_F_TUNER
103
+ *
104
+ * @TUNER_PAD_RF_INPUT:
105
+ * Radiofrequency (RF) sink pad, usually linked to a RF connector entity.
106
+ * @TUNER_PAD_OUTPUT:
107
+ * tuner video output source pad. Contains the video chrominance
108
+ * and luminance or the hole bandwidth of the signal converted to
109
+ * an Intermediate Frequency (IF) or to baseband (on zero-IF tuners).
110
+ * @TUNER_PAD_AUD_OUT:
111
+ * Tuner audio output source pad. Tuners used to decode analog TV
112
+ * signals have an extra pad for audio output. Old tuners use an
113
+ * analog stage with a saw filter for the audio IF frequency. The
114
+ * output of the pad is, in this case, the audio IF, with should be
115
+ * decoded either by the bridge chipset (that's the case of cx2388x
116
+ * chipsets) or may require an external IF sound processor, like
117
+ * msp34xx. On modern silicon tuners, the audio IF decoder is usually
118
+ * incorporated at the tuner. On such case, the output of this pad
119
+ * is an audio sampled data.
120
+ * @TUNER_NUM_PADS:
121
+ * Number of pads of the tuner.
122
+ */
123
+enum tuner_pad_index {
124
+ TUNER_PAD_RF_INPUT,
125
+ TUNER_PAD_OUTPUT,
126
+ TUNER_PAD_AUD_OUT,
127
+ TUNER_NUM_PADS
128
+};
129
+
130
+/**
131
+ * enum if_vid_dec_pad_index - video IF-PLL pad index
132
+ * for MEDIA_ENT_F_IF_VID_DECODER
133
+ *
134
+ * @IF_VID_DEC_PAD_IF_INPUT:
135
+ * video Intermediate Frequency (IF) sink pad
136
+ * @IF_VID_DEC_PAD_OUT:
137
+ * IF-PLL video output source pad. Contains the video chrominance
138
+ * and luminance IF signals.
139
+ * @IF_VID_DEC_PAD_NUM_PADS:
140
+ * Number of pads of the video IF-PLL.
141
+ */
142
+enum if_vid_dec_pad_index {
143
+ IF_VID_DEC_PAD_IF_INPUT,
144
+ IF_VID_DEC_PAD_OUT,
145
+ IF_VID_DEC_PAD_NUM_PADS
146
+};
99147
100148 struct tuner {
101149 /* device */
....@@ -685,15 +733,20 @@
685733 */
686734 if (t->type == TUNER_TDA9887) {
687735 t->pad[IF_VID_DEC_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK;
736
+ t->pad[IF_VID_DEC_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG;
688737 t->pad[IF_VID_DEC_PAD_OUT].flags = MEDIA_PAD_FL_SOURCE;
738
+ t->pad[IF_VID_DEC_PAD_OUT].sig_type = PAD_SIGNAL_ANALOG;
689739 ret = media_entity_pads_init(&t->sd.entity,
690740 IF_VID_DEC_PAD_NUM_PADS,
691741 &t->pad[0]);
692742 t->sd.entity.function = MEDIA_ENT_F_IF_VID_DECODER;
693743 } else {
694744 t->pad[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK;
745
+ t->pad[TUNER_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG;
695746 t->pad[TUNER_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE;
747
+ t->pad[TUNER_PAD_OUTPUT].sig_type = PAD_SIGNAL_ANALOG;
696748 t->pad[TUNER_PAD_AUD_OUT].flags = MEDIA_PAD_FL_SOURCE;
749
+ t->pad[TUNER_PAD_AUD_OUT].sig_type = PAD_SIGNAL_AUDIO;
697750 ret = media_entity_pads_init(&t->sd.entity, TUNER_NUM_PADS,
698751 &t->pad[0]);
699752 t->sd.entity.function = MEDIA_ENT_F_TUNER;