| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * i2c tv tuner chip device driver |
|---|
| 3 | 4 | * core core, i.e. kernel interfaces, registering and so on |
|---|
| .. | .. |
|---|
| 94 | 95 | } while (0) |
|---|
| 95 | 96 | |
|---|
| 96 | 97 | /* |
|---|
| 97 | | - * Internal struct used inside the driver |
|---|
| 98 | + * Internal enums/struct used inside the driver |
|---|
| 98 | 99 | */ |
|---|
| 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 | +}; |
|---|
| 99 | 147 | |
|---|
| 100 | 148 | struct tuner { |
|---|
| 101 | 149 | /* device */ |
|---|
| .. | .. |
|---|
| 685 | 733 | */ |
|---|
| 686 | 734 | if (t->type == TUNER_TDA9887) { |
|---|
| 687 | 735 | 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; |
|---|
| 688 | 737 | 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; |
|---|
| 689 | 739 | ret = media_entity_pads_init(&t->sd.entity, |
|---|
| 690 | 740 | IF_VID_DEC_PAD_NUM_PADS, |
|---|
| 691 | 741 | &t->pad[0]); |
|---|
| 692 | 742 | t->sd.entity.function = MEDIA_ENT_F_IF_VID_DECODER; |
|---|
| 693 | 743 | } else { |
|---|
| 694 | 744 | t->pad[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK; |
|---|
| 745 | + t->pad[TUNER_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG; |
|---|
| 695 | 746 | t->pad[TUNER_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE; |
|---|
| 747 | + t->pad[TUNER_PAD_OUTPUT].sig_type = PAD_SIGNAL_ANALOG; |
|---|
| 696 | 748 | t->pad[TUNER_PAD_AUD_OUT].flags = MEDIA_PAD_FL_SOURCE; |
|---|
| 749 | + t->pad[TUNER_PAD_AUD_OUT].sig_type = PAD_SIGNAL_AUDIO; |
|---|
| 697 | 750 | ret = media_entity_pads_init(&t->sd.entity, TUNER_NUM_PADS, |
|---|
| 698 | 751 | &t->pad[0]); |
|---|
| 699 | 752 | t->sd.entity.function = MEDIA_ENT_F_TUNER; |
|---|