Commit 9a33a27e authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: ddbridge: use the ddbridge's own dummy fe driver

Cleanup the ddbridge's dummy driver by removing the parts
that aren't needed by ddbridge, adding it to the building
system and changing the binding at the driver to use the
newer function name.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 94ab24a2
......@@ -15,7 +15,6 @@ config DVB_DDBRIDGE
select MEDIA_TUNER_TDA18212 if MEDIA_SUBDRV_AUTOSELECT
select DVB_MXL5XX if MEDIA_SUBDRV_AUTOSELECT
select DVB_CXD2099 if MEDIA_SUBDRV_AUTOSELECT
select DVB_DUMMY_FE if MEDIA_SUBDRV_AUTOSELECT
help
Support for cards with the Digital Devices PCI express bridge:
- Octopus PCIe Bridge
......
......@@ -7,7 +7,7 @@ ddbridge-objs := ddbridge-main.o ddbridge-core.o ddbridge-ci.o \
ddbridge-hw.o ddbridge-i2c.o ddbridge-max.o ddbridge-mci.o \
ddbridge-sx8.o
obj-$(CONFIG_DVB_DDBRIDGE) += ddbridge.o
obj-$(CONFIG_DVB_DDBRIDGE) += ddbridge.o ddbridge-dummy-fe.o
ccflags-y += -I $(srctree)/drivers/media/dvb-frontends/
ccflags-y += -I $(srctree)/drivers/media/tuners/
......@@ -50,7 +50,7 @@
#include "stv6111.h"
#include "lnbh25.h"
#include "cxd2099.h"
#include "dvb_dummy_fe.h"
#include "ddbridge-dummy-fe.h"
/****************************************************************************/
......@@ -1265,7 +1265,7 @@ static int demod_attach_dummy(struct ddb_input *input)
struct ddb_dvb *dvb = &input->port->dvb[input->nr & 1];
struct device *dev = input->port->dev->dev;
dvb->fe = dvb_attach(dvb_dummy_fe_qam_attach);
dvb->fe = dvb_attach(ddbridge_dummy_fe_qam_attach);
if (!dvb->fe) {
dev_err(dev, "QAM dummy attach failed!\n");
return -ENODEV;
......
......@@ -13,12 +13,10 @@
#include <media/dvb_frontend.h>
#include "ddbridge-dummy-fe.h"
struct ddbridge_dummy_fe_state {
struct dvb_frontend frontend;
};
static int ddbridge_dummy_fe_read_status(struct dvb_frontend *fe,
enum fe_status *status)
{
......@@ -88,18 +86,6 @@ static int ddbridge_dummy_fe_init(struct dvb_frontend *fe)
return 0;
}
static int ddbridge_dummy_fe_set_tone(struct dvb_frontend *fe,
enum fe_sec_tone_mode tone)
{
return 0;
}
static int ddbridge_dummy_fe_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage voltage)
{
return 0;
}
static void ddbridge_dummy_fe_release(struct dvb_frontend *fe)
{
struct ddbridge_dummy_fe_state *state = fe->demodulator_priv;
......@@ -107,48 +93,6 @@ static void ddbridge_dummy_fe_release(struct dvb_frontend *fe)
kfree(state);
}
static const struct dvb_frontend_ops ddbridge_dummy_fe_ofdm_ops;
struct dvb_frontend *ddbridge_dummy_fe_ofdm_attach(void)
{
struct ddbridge_dummy_fe_state *state = NULL;
/* allocate memory for the internal state */
state = kzalloc(sizeof(struct ddbridge_dummy_fe_state), GFP_KERNEL);
if (!state)
return NULL;
/* create dvb_frontend */
memcpy(&state->frontend.ops,
&ddbridge_dummy_fe_ofdm_ops,
sizeof(struct dvb_frontend_ops));
state->frontend.demodulator_priv = state;
return &state->frontend;
}
EXPORT_SYMBOL(ddbridge_dummy_fe_ofdm_attach);
static const struct dvb_frontend_ops ddbridge_dummy_fe_qpsk_ops;
struct dvb_frontend *ddbridge_dummy_fe_qpsk_attach(void)
{
struct ddbridge_dummy_fe_state *state = NULL;
/* allocate memory for the internal state */
state = kzalloc(sizeof(struct ddbridge_dummy_fe_state), GFP_KERNEL);
if (!state)
return NULL;
/* create dvb_frontend */
memcpy(&state->frontend.ops,
&ddbridge_dummy_fe_qpsk_ops,
sizeof(struct dvb_frontend_ops));
state->frontend.demodulator_priv = state;
return &state->frontend;
}
EXPORT_SYMBOL(ddbridge_dummy_fe_qpsk_attach);
static const struct dvb_frontend_ops ddbridge_dummy_fe_qam_ops;
struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void)
......@@ -170,45 +114,6 @@ struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void)
}
EXPORT_SYMBOL(ddbridge_dummy_fe_qam_attach);
static const struct dvb_frontend_ops ddbridge_dummy_fe_ofdm_ops = {
.delsys = { SYS_DVBT },
.info = {
.name = "ddbridge dummy DVB-T",
.frequency_min_hz = 0,
.frequency_max_hz = 863250 * kHz,
.frequency_stepsize_hz = 62500,
.caps = FE_CAN_FEC_1_2 |
FE_CAN_FEC_2_3 |
FE_CAN_FEC_3_4 |
FE_CAN_FEC_4_5 |
FE_CAN_FEC_5_6 |
FE_CAN_FEC_6_7 |
FE_CAN_FEC_7_8 |
FE_CAN_FEC_8_9 |
FE_CAN_FEC_AUTO |
FE_CAN_QAM_16 |
FE_CAN_QAM_64 |
FE_CAN_QAM_AUTO |
FE_CAN_TRANSMISSION_MODE_AUTO |
FE_CAN_GUARD_INTERVAL_AUTO |
FE_CAN_HIERARCHY_AUTO,
},
.release = ddbridge_dummy_fe_release,
.init = ddbridge_dummy_fe_init,
.sleep = ddbridge_dummy_fe_sleep,
.set_frontend = ddbridge_dummy_fe_set_frontend,
.get_frontend = ddbridge_dummy_fe_get_frontend,
.read_status = ddbridge_dummy_fe_read_status,
.read_ber = ddbridge_dummy_fe_read_ber,
.read_signal_strength = ddbridge_dummy_fe_read_signal_strength,
.read_snr = ddbridge_dummy_fe_read_snr,
.read_ucblocks = ddbridge_dummy_fe_read_ucblocks,
};
static const struct dvb_frontend_ops ddbridge_dummy_fe_qam_ops = {
.delsys = { SYS_DVBC_ANNEX_A },
.info = {
......@@ -243,44 +148,6 @@ static const struct dvb_frontend_ops ddbridge_dummy_fe_qam_ops = {
.read_ucblocks = ddbridge_dummy_fe_read_ucblocks,
};
static const struct dvb_frontend_ops ddbridge_dummy_fe_qpsk_ops = {
.delsys = { SYS_DVBS },
.info = {
.name = "ddbridge dummy DVB-S",
.frequency_min_hz = 950 * MHz,
.frequency_max_hz = 2150 * MHz,
.frequency_stepsize_hz = 250 * kHz,
.frequency_tolerance_hz = 29500 * kHz,
.symbol_rate_min = 1000000,
.symbol_rate_max = 45000000,
.caps = FE_CAN_INVERSION_AUTO |
FE_CAN_FEC_1_2 |
FE_CAN_FEC_2_3 |
FE_CAN_FEC_3_4 |
FE_CAN_FEC_5_6 |
FE_CAN_FEC_7_8 |
FE_CAN_FEC_AUTO |
FE_CAN_QPSK
},
.release = ddbridge_dummy_fe_release,
.init = ddbridge_dummy_fe_init,
.sleep = ddbridge_dummy_fe_sleep,
.set_frontend = ddbridge_dummy_fe_set_frontend,
.get_frontend = ddbridge_dummy_fe_get_frontend,
.read_status = ddbridge_dummy_fe_read_status,
.read_ber = ddbridge_dummy_fe_read_ber,
.read_signal_strength = ddbridge_dummy_fe_read_signal_strength,
.read_snr = ddbridge_dummy_fe_read_snr,
.read_ucblocks = ddbridge_dummy_fe_read_ucblocks,
.set_voltage = ddbridge_dummy_fe_set_voltage,
.set_tone = ddbridge_dummy_fe_set_tone,
};
MODULE_DESCRIPTION("ddbridge dummy Frontend");
MODULE_AUTHOR("Emard");
MODULE_LICENSE("GPL");
......@@ -11,26 +11,6 @@
#include <linux/dvb/frontend.h>
#include <media/dvb_frontend.h>
#if IS_REACHABLE(CONFIG_DDBRIDGE_DUMMY_FE)
struct dvb_frontend *ddbridge_dummy_fe_ofdm_attach(void);
struct dvb_frontend *ddbridge_dummy_fe_qpsk_attach(void);
struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void);
#else
static inline struct dvb_frontend *ddbridge_dummy_fe_ofdm_attach(void)
{
pr_warn("%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
static inline struct dvb_frontend *ddbridge_dummy_fe_qpsk_attach(void)
{
pr_warn("%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
static inline struct dvb_frontend *ddbridge_dummy_fe_qam_attach(void)
{
pr_warn("%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif /* CONFIG_DDBRIDGE_DUMMY_FE */
#endif // DDBRIDGE_DUMMY_FE_H
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment