Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2aefbc1a authored by Dmitri Belimov's avatar Dmitri Belimov Committed by Mauro Carvalho Chehab
Browse files

[media] tm6000: fix s-video input



Add compatibility for composite and s-video inputs. Some TV cards hasn't
it.

Fix S-Video input, the s-video cable has only video signals no
audio. Call the function of audio configure kill chroma in signal. only
b/w video.

Known bugs:
  - after s-video the audio for radio didn't work, TV crashed hardly
  - after composite TV crashed hardly too.

P.S. After this patch I'll want to rework the procedure of configure
     video. Now it has a lot of junk and dubles.

With my best regards, Dmitry.

Signed-off-by: default avatarBeholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 812738e1
Loading
Loading
Loading
Loading
+28 −18
Original line number Original line Diff line number Diff line
@@ -240,6 +240,8 @@ struct tm6000_board tm6000_boards[] = {
			.has_zl10353    = 1,
			.has_zl10353    = 1,
			.has_eeprom     = 1,
			.has_eeprom     = 1,
			.has_remote     = 1,
			.has_remote     = 1,
			.has_input_comp = 1,
			.has_input_svid = 1,
		},
		},
		.gpio = {
		.gpio = {
			.tuner_reset	= TM6010_GPIO_0,
			.tuner_reset	= TM6010_GPIO_0,
@@ -260,6 +262,8 @@ struct tm6000_board tm6000_boards[] = {
			.has_zl10353    = 0,
			.has_zl10353    = 0,
			.has_eeprom     = 1,
			.has_eeprom     = 1,
			.has_remote     = 1,
			.has_remote     = 1,
			.has_input_comp = 1,
			.has_input_svid = 1,
		},
		},
		.gpio = {
		.gpio = {
			.tuner_reset	= TM6010_GPIO_0,
			.tuner_reset	= TM6010_GPIO_0,
@@ -331,6 +335,9 @@ struct tm6000_board tm6000_boards[] = {
			.has_dvb        = 1,
			.has_dvb        = 1,
			.has_zl10353    = 1,
			.has_zl10353    = 1,
			.has_eeprom     = 1,
			.has_eeprom     = 1,
			.has_remote     = 0,
			.has_input_comp = 0,
			.has_input_svid = 0,
		},
		},
		.gpio = {
		.gpio = {
			.tuner_reset	= TM6010_GPIO_0,
			.tuner_reset	= TM6010_GPIO_0,
@@ -350,6 +357,9 @@ struct tm6000_board tm6000_boards[] = {
			.has_dvb        = 0,
			.has_dvb        = 0,
			.has_zl10353    = 0,
			.has_zl10353    = 0,
			.has_eeprom     = 1,
			.has_eeprom     = 1,
			.has_remote     = 0,
			.has_input_comp = 0,
			.has_input_svid = 0,
		},
		},
		.gpio = {
		.gpio = {
			.tuner_reset	= TM6010_GPIO_0,
			.tuner_reset	= TM6010_GPIO_0,
+0 −2
Original line number Original line Diff line number Diff line
@@ -1161,8 +1161,6 @@ int tm6000_set_standard(struct tm6000_core *dev, v4l2_std_id * norm)
				rc = tm6000_load_std(dev, svideo_stds[i].common,
				rc = tm6000_load_std(dev, svideo_stds[i].common,
						     sizeof(svideo_stds[i].
						     sizeof(svideo_stds[i].
							    common));
							    common));
				tm6000_set_audio_std(dev, svideo_stds[i].audio_default_std);

				goto ret;
				goto ret;
			}
			}
		}
		}
+13 −4
Original line number Original line Diff line number Diff line
@@ -1080,18 +1080,27 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *norm)
static int vidioc_enum_input(struct file *file, void *priv,
static int vidioc_enum_input(struct file *file, void *priv,
				struct v4l2_input *inp)
				struct v4l2_input *inp)
{
{
	struct tm6000_fh   *fh = priv;
	struct tm6000_core *dev = fh->dev;

	switch (inp->index) {
	switch (inp->index) {
	case TM6000_INPUT_TV:
	case TM6000_INPUT_TV:
		inp->type = V4L2_INPUT_TYPE_TUNER;
		inp->type = V4L2_INPUT_TYPE_TUNER;
		strcpy(inp->name, "Television");
		strcpy(inp->name, "Television");
		break;
		break;
	case TM6000_INPUT_COMPOSITE:
	case TM6000_INPUT_COMPOSITE:
		if (dev->caps.has_input_comp) {
			inp->type = V4L2_INPUT_TYPE_CAMERA;
			inp->type = V4L2_INPUT_TYPE_CAMERA;
			strcpy(inp->name, "Composite");
			strcpy(inp->name, "Composite");
		} else
			return -EINVAL;
		break;
		break;
	case TM6000_INPUT_SVIDEO:
	case TM6000_INPUT_SVIDEO:
		if (dev->caps.has_input_svid) {
			inp->type = V4L2_INPUT_TYPE_CAMERA;
			inp->type = V4L2_INPUT_TYPE_CAMERA;
			strcpy(inp->name, "S-Video");
			strcpy(inp->name, "S-Video");
		} else
			return -EINVAL;
		break;
		break;
	default:
	default:
		return -EINVAL;
		return -EINVAL;
+2 −0
Original line number Original line Diff line number Diff line
@@ -129,6 +129,8 @@ struct tm6000_capabilities {
	unsigned int    has_zl10353:1;
	unsigned int    has_zl10353:1;
	unsigned int    has_eeprom:1;
	unsigned int    has_eeprom:1;
	unsigned int    has_remote:1;
	unsigned int    has_remote:1;
	unsigned int    has_input_comp:1;
	unsigned int    has_input_svid:1;
};
};


struct tm6000_dvb {
struct tm6000_dvb {