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

Commit 7f171123 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

V4L/DVB (6384): Replace TDA9887_SET_CONFIG by TUNER_SET_CONFIG



Currently, the only tuner-specific device that allows special
configurations is tda9887. However, tea5767 also may require some
special configurations (for example, to specify a different Xtal freq).

This patch replaces TDA9887_SET_CONFIG by a more generic internal ioctl
(TUNER_SET_CONFIG). The newer one allows specifying what tuner is
appliable to a configuration set, and allows an arbitrary configuration
struct.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 2d94dfc8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ struct dvb_tuner_ops {
	/** This is support for demods like the mt352 - fills out the supplied buffer with what to write. */
	int (*calc_regs)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p, u8 *buf, int buf_len);

	/** This is to allow setting tuner-specific configs */
	int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);

	int (*get_frequency)(struct dvb_frontend *fe, u32 *frequency);
	int (*get_bandwidth)(struct dvb_frontend *fe, u32 *bandwidth);

+6 −2
Original line number Diff line number Diff line
@@ -3574,8 +3574,12 @@ void __devinit bttv_init_card2(struct bttv *btv)
	}

	if (btv->tda9887_conf) {
		bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
							&btv->tda9887_conf);
		struct v4l2_priv_tun_config tda9887_cfg;

		tda9887_cfg.tuner = TUNER_TDA9887;
		tda9887_cfg.priv = &btv->tda9887_conf;

		bttv_call_i2c_clients(btv, TUNER_SET_CONFIG, &tda9887_cfg);
	}

	btv->svhs = bttv_tvcards[btv->c.type].svhs;
+8 −2
Original line number Diff line number Diff line
@@ -127,8 +127,14 @@ static int attach_inform(struct i2c_client *client)
		}
	}

	if (core->board.tda9887_conf)
		client->driver->command(client, TDA9887_SET_CONFIG, &core->board.tda9887_conf);
	if (core->board.tda9887_conf) {
		struct v4l2_priv_tun_config tda9887_cfg;

		tda9887_cfg.tuner = TUNER_TDA9887;
		tda9887_cfg.priv  = &core->board.tda9887_conf;

		client->driver->command(client, TUNER_SET_CONFIG, &tda9887_cfg);
	}
	return 0;
}

+7 −1
Original line number Diff line number Diff line
@@ -421,6 +421,8 @@ static int attach_inform(struct i2c_client *client)
		case 0x96:
		case 0x94:
		{
			struct v4l2_priv_tun_config tda9887_cfg;

			struct tuner_setup tun_setup;

			tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
@@ -428,7 +430,11 @@ static int attach_inform(struct i2c_client *client)
			tun_setup.addr = client->addr;

			em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup);
			em28xx_i2c_call_clients(dev, TDA9887_SET_CONFIG, &dev->tda9887_conf);

			tda9887_cfg.tuner = TUNER_TDA9887;
			tda9887_cfg.priv = &dev->tda9887_conf;
			em28xx_i2c_call_clients(dev, TUNER_SET_CONFIG,
						&tda9887_cfg);
			break;
		}
		case 0x42:
+0 −5
Original line number Diff line number Diff line
@@ -186,11 +186,6 @@ static void em28xx_config_i2c(struct em28xx *dev)
	f.frequency = 9076;	/* FIXME:remove magic number */
	dev->ctl_freq = f.frequency;
	em28xx_i2c_call_clients(dev, VIDIOC_S_FREQUENCY, &f);

	/* configure tda9887 */


/*	em28xx_i2c_call_clients(dev,VIDIOC_S_STD,&dev->tvnorm->id); */
}

/*
Loading