diff options
author | Antti Palosaari <crope@iki.fi> | 2012-12-08 23:27:49 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-06 09:04:57 -0200 |
commit | ad3a758bb30ab7c71b67930ae7dcc794d517dd6b (patch) | |
tree | 2fcc121512507f8897ea148932a769b1d2dc7f8a /drivers/media/tuners | |
parent | bf97b6373bb10bbde7c0b485b8fc829fec5a4bcf (diff) |
[media] fc0012: use struct for driver config
I need even more configuration options and overloading dvb_attach()
for all those sounds quite stupid. Due to that switch struct and make
room for new options.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/tuners')
-rw-r--r-- | drivers/media/tuners/fc0012.c | 9 | ||||
-rw-r--r-- | drivers/media/tuners/fc0012.h | 20 |
2 files changed, 20 insertions, 9 deletions
diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c index 308135abd54..5ede0c049bc 100644 --- a/drivers/media/tuners/fc0012.c +++ b/drivers/media/tuners/fc0012.c @@ -436,8 +436,7 @@ static const struct dvb_tuner_ops fc0012_tuner_ops = { }; struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe, - struct i2c_adapter *i2c, u8 i2c_address, int dual_master, - enum fc001x_xtal_freq xtal_freq) + struct i2c_adapter *i2c, const struct fc0012_config *cfg) { struct fc0012_priv *priv = NULL; @@ -446,9 +445,9 @@ struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe, return NULL; priv->i2c = i2c; - priv->dual_master = dual_master; - priv->addr = i2c_address; - priv->xtal_freq = xtal_freq; + priv->dual_master = cfg->dual_master; + priv->addr = cfg->i2c_address; + priv->xtal_freq = cfg->xtal_freq; info("Fitipower FC0012 successfully attached."); diff --git a/drivers/media/tuners/fc0012.h b/drivers/media/tuners/fc0012.h index 4dbd5efe884..41946f82d02 100644 --- a/drivers/media/tuners/fc0012.h +++ b/drivers/media/tuners/fc0012.h @@ -24,17 +24,29 @@ #include "dvb_frontend.h" #include "fc001x-common.h" +struct fc0012_config { + /* + * I2C address + */ + u8 i2c_address; + + /* + * clock + */ + enum fc001x_xtal_freq xtal_freq; + + int dual_master; +}; + #if defined(CONFIG_MEDIA_TUNER_FC0012) || \ (defined(CONFIG_MEDIA_TUNER_FC0012_MODULE) && defined(MODULE)) extern struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, - u8 i2c_address, int dual_master, - enum fc001x_xtal_freq xtal_freq); + const struct fc0012_config *cfg); #else static inline struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, - u8 i2c_address, int dual_master, - enum fc001x_xtal_freq xtal_freq) + const struct fc0012_config *cfg) { printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); return NULL; |