From 3c4e04153f9aacfb34e8c5c884c1424e08994aaf Mon Sep 17 00:00:00 2001 From: Daniel Scheller Date: Sun, 9 Jul 2017 15:42:43 -0400 Subject: media: dvb-frontends: MaxLinear MxL5xx DVB-S/S2 tuner-demodulator driver This adds the frontend driver for the MaxLinear MxL5xx family of tuner- demodulators, as used on Digital Devices MaxS4/8 four/eight-tuner cards. The driver was picked from the dddvb vendor driver package and - judging solely from the diff - has undergone a 100% rework: - Silly #define's used to pass multiple values to functions were expanded. This resulted in macro/register names not being usable anymore for such occurences, but makes the code WAY more read-, understand- and maintainable. - CamelCase was changed to kernel_case - All typedef were removed - Overall code style was fixed, besides >80char lines in _defs.h and _regs.h, checkpatch is happy. - Also, signal stat acquisition was made to comply with the DVB API ways to do these things. Permission to reuse and mainline the driver code was formally granted by Ralph Metzler . Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/mxl5xx.h | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 drivers/media/dvb-frontends/mxl5xx.h (limited to 'drivers/media/dvb-frontends/mxl5xx.h') diff --git a/drivers/media/dvb-frontends/mxl5xx.h b/drivers/media/dvb-frontends/mxl5xx.h new file mode 100644 index 000000000000..532e08111537 --- /dev/null +++ b/drivers/media/dvb-frontends/mxl5xx.h @@ -0,0 +1,41 @@ +#ifndef _MXL5XX_H_ +#define _MXL5XX_H_ + +#include +#include + +#include "dvb_frontend.h" + +struct mxl5xx_cfg { + u8 adr; + u8 type; + u32 cap; + u32 clk; + u32 ts_clk; + + u8 *fw; + u32 fw_len; + + int (*fw_read)(void *priv, u8 *buf, u32 len); + void *fw_priv; +}; + +#if IS_REACHABLE(CONFIG_DVB_MXL5XX) + +extern struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c, + struct mxl5xx_cfg *cfg, u32 demod, u32 tuner, + int (**fn_set_input)(struct dvb_frontend *, int)); + +#else + +static inline struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c, + struct mxl5xx_cfg *cfg, u32 demod, u32 tuner, + int (**fn_set_input)(struct dvb_frontend *, int)) +{ + pr_warn("%s: driver disabled by Kconfig\n", __func__); + return NULL; +} + +#endif /* CONFIG_DVB_MXL5XX */ + +#endif /* _MXL5XX_H_ */ -- cgit v1.2.3