Compilation was disabled as it was failing with allyesconfig.
Rename duplicate functions and enable building.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Say Y if you own a USB DVB device.
+config DVB_USB_V2
+ tristate "Support for various USB DVB devices v2"
+ depends on DVB_CORE && USB && I2C && RC_CORE
+ help
+ By enabling this you will be able to choose the various supported
+ USB1.1 and USB2.0 DVB devices.
+
+ Almost every USB device needs a firmware, please look into
+ <file:Documentation/dvb/README.dvb-usb>.
+
+ For a complete list of supported USB devices see the LinuxTV DVB Wiki:
+ <http://www.linuxtv.org/wiki/index.php/DVB_USB>
+
+ Say Y if you own a USB DVB device.
+
config DVB_USB_DEBUG
bool "Enable extended debug support for all DVB-USB devices"
depends on DVB_USB
dvb-usb-objs = dvb-usb-firmware.o dvb-usb-init.o dvb-usb-urb.o dvb-usb-i2c.o dvb-usb-dvb.o dvb-usb-remote.o usb-urb.o
obj-$(CONFIG_DVB_USB) += dvb-usb.o
+dvb_usbv2-objs = dvb_usb_init.o dvb_usb_urb.o dvb_usb_dvb.o dvb_usb_remote.o usb_urb.o
+obj-$(CONFIG_DVB_USB_V2) += dvb_usbv2.o
+
dvb-usb-vp7045-objs = vp7045.o vp7045-fe.o
obj-$(CONFIG_DVB_USB_VP7045) += dvb-usb-vp7045.o
#include "dvb_usb.h"
-extern int dvb_usb_disable_rc_polling;
+extern int dvb_usbv2_disable_rc_polling;
/* commonly used methods */
-extern int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff);
+extern int dvb_usbv2_device_power_ctrl(struct dvb_usb_device *d, int onoff);
-extern int usb_urb_init(struct usb_data_stream *stream,
+extern int usb_urb_initv2(struct usb_data_stream *stream,
struct usb_data_stream_properties *props);
-extern int usb_urb_exit(struct usb_data_stream *stream);
-extern int usb_urb_submit(struct usb_data_stream *stream,
+extern int usb_urb_exitv2(struct usb_data_stream *stream);
+extern int usb_urb_submitv2(struct usb_data_stream *stream,
struct usb_data_stream_properties *props);
-extern int usb_urb_kill(struct usb_data_stream *stream);
+extern int usb_urb_killv2(struct usb_data_stream *stream);
-extern int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap);
-extern int dvb_usb_adapter_stream_exit(struct dvb_usb_adapter *adap);
+extern int dvb_usbv2_adapter_stream_init(struct dvb_usb_adapter *adap);
+extern int dvb_usbv2_adapter_stream_exit(struct dvb_usb_adapter *adap);
-extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap);
-extern int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap);
-extern int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap);
-extern int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap);
+extern int dvb_usbv2_adapter_dvb_init(struct dvb_usb_adapter *adap);
+extern int dvb_usbv2_adapter_dvb_exit(struct dvb_usb_adapter *adap);
+extern int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap);
+extern int dvb_usbv2_adapter_frontend_exit(struct dvb_usb_adapter *adap);
-extern int dvb_usb_remote_init(struct dvb_usb_device *);
-extern int dvb_usb_remote_exit(struct dvb_usb_device *);
+extern int dvb_usbv2_remote_init(struct dvb_usb_device *);
+extern int dvb_usbv2_remote_exit(struct dvb_usb_device *);
#endif
dvb_dmx_swfilter_raw(&adap->demux, buffer, length);
}
-int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap)
+int dvb_usbv2_adapter_stream_init(struct dvb_usb_adapter *adap)
{
int ret;
struct usb_data_stream_properties stream_props;
/* FIXME: can be removed as set later in anyway */
adap->stream.complete = dvb_usb_data_complete;
- return usb_urb_init(&adap->stream, &stream_props);
+ return usb_urb_initv2(&adap->stream, &stream_props);
}
-int dvb_usb_adapter_stream_exit(struct dvb_usb_adapter *adap)
+int dvb_usbv2_adapter_stream_exit(struct dvb_usb_adapter *adap)
{
- usb_urb_exit(&adap->stream);
+ usb_urb_exitv2(&adap->stream);
return 0;
}
/* stop feed before setting a new pid if there will be no pid anymore */
if (newfeedcount == 0) {
pr_debug("%s: stop feeding\n", __func__);
- usb_urb_kill(&adap->stream);
+ usb_urb_killv2(&adap->stream);
if (adap->props.streaming_ctrl != NULL) {
ret = adap->props.streaming_ctrl(adap, 0);
pr_debug("%s: submitting all URBs\n", __func__);
- usb_urb_submit(&adap->stream, &stream_props);
+ usb_urb_submitv2(&adap->stream, &stream_props);
pr_debug("%s: controlling pid parser\n", __func__);
if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER &&
return dvb_usb_ctrl_feed(dvbdmxfeed, 0);
}
-int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap)
+int dvb_usbv2_adapter_dvb_init(struct dvb_usb_adapter *adap)
{
int ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->name,
adap->dev->props.owner,
return ret;
}
-int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap)
+int dvb_usbv2_adapter_dvb_exit(struct dvb_usb_adapter *adap)
{
if (adap->state & DVB_USB_ADAP_STATE_DVB) {
pr_debug("%s: unregistering DVB part\n", __func__);
int ret;
struct dvb_usb_adapter *adap = fe->dvb->priv;
- ret = dvb_usb_device_power_ctrl(adap->dev, 1);
+ ret = dvb_usbv2_device_power_ctrl(adap->dev, 1);
if (ret < 0)
goto err;
goto err;
}
- ret = dvb_usb_device_power_ctrl(adap->dev, 0);
+ ret = dvb_usbv2_device_power_ctrl(adap->dev, 0);
if (ret < 0)
goto err;
return ret;
}
-int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap)
+int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap)
{
int ret, i, count_registered = 0;
return ret;
}
-int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap)
+int dvb_usbv2_adapter_frontend_exit(struct dvb_usb_adapter *adap)
{
int i;
*/
#include "dvb_usb_common.h"
-int dvb_usb_disable_rc_polling;
-module_param_named(disable_rc_polling, dvb_usb_disable_rc_polling, int, 0644);
+int dvb_usbv2_disable_rc_polling;
+module_param_named(disable_rc_polling, dvb_usbv2_disable_rc_polling, int, 0644);
MODULE_PARM_DESC(disable_rc_polling,
"disable remote control polling (default: 0).");
MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a" \
" PID filter, if any (default: 0).");
-int dvb_usb_download_firmware(struct dvb_usb_device *d)
+int dvb_usbv2_download_firmware(struct dvb_usb_device *d)
{
int ret;
const struct firmware *fw = NULL;
return ret;
}
-int dvb_usb_i2c_init(struct dvb_usb_device *d)
+int dvb_usbv2_i2c_init(struct dvb_usb_device *d)
{
int ret = 0;
return ret;
}
-int dvb_usb_i2c_exit(struct dvb_usb_device *d)
+int dvb_usbv2_i2c_exit(struct dvb_usb_device *d)
{
if (d->state & DVB_USB_STATE_I2C)
i2c_del_adapter(&d->i2c_adap);
return 0;
}
-static int dvb_usb_adapter_init(struct dvb_usb_device *d)
+static int dvb_usbv2_adapter_init(struct dvb_usb_device *d)
{
struct dvb_usb_adapter *adap;
int ret, n, adapter_count;
adap->max_feed_count = adap->props.pid_filter_count;
}
- ret = dvb_usb_adapter_stream_init(adap);
+ ret = dvb_usbv2_adapter_stream_init(adap);
if (ret)
return ret;
- ret = dvb_usb_adapter_dvb_init(adap);
+ ret = dvb_usbv2_adapter_dvb_init(adap);
if (ret)
return ret;
- ret = dvb_usb_adapter_frontend_init(adap);
+ ret = dvb_usbv2_adapter_frontend_init(adap);
if (ret)
return ret;
return ret;
}
-static int dvb_usb_adapter_exit(struct dvb_usb_device *d)
+static int dvb_usbv2_adapter_exit(struct dvb_usb_device *d)
{
int n;
for (n = 0; n < d->num_adapters_initialized; n++) {
- dvb_usb_adapter_frontend_exit(&d->adapter[n]);
- dvb_usb_adapter_dvb_exit(&d->adapter[n]);
- dvb_usb_adapter_stream_exit(&d->adapter[n]);
+ dvb_usbv2_adapter_frontend_exit(&d->adapter[n]);
+ dvb_usbv2_adapter_dvb_exit(&d->adapter[n]);
+ dvb_usbv2_adapter_stream_exit(&d->adapter[n]);
}
d->num_adapters_initialized = 0;
}
/* general initialization functions */
-static int dvb_usb_exit(struct dvb_usb_device *d)
+static int dvb_usbv2_exit(struct dvb_usb_device *d)
{
pr_debug("%s: state before exiting everything: %x\n", __func__, d->state);
- dvb_usb_remote_exit(d);
- dvb_usb_adapter_exit(d);
- dvb_usb_i2c_exit(d);
+ dvb_usbv2_remote_exit(d);
+ dvb_usbv2_adapter_exit(d);
+ dvb_usbv2_i2c_exit(d);
pr_debug("%s: state should be zero now: %x\n", __func__, d->state);
d->state = DVB_USB_STATE_INIT;
kfree(d->priv);
return 0;
}
-static int dvb_usb_init(struct dvb_usb_device *d)
+static int dvb_usbv2_init(struct dvb_usb_device *d)
{
int ret = 0;
d->state = DVB_USB_STATE_INIT;
/* check the capabilities and set appropriate variables */
- dvb_usb_device_power_ctrl(d, 1);
+ dvb_usbv2_device_power_ctrl(d, 1);
/* read config */
if (d->props.read_config) {
goto err;
}
- ret = dvb_usb_i2c_init(d);
+ ret = dvb_usbv2_i2c_init(d);
if (ret == 0)
- ret = dvb_usb_adapter_init(d);
+ ret = dvb_usbv2_adapter_init(d);
if (ret) {
- dvb_usb_exit(d);
+ dvb_usbv2_exit(d);
return ret;
}
if (d->props.init)
d->props.init(d);
- ret = dvb_usb_remote_init(d);
+ ret = dvb_usbv2_remote_init(d);
if (ret)
pr_err("%s: could not initialize remote control\n",
KBUILD_MODNAME);
- dvb_usb_device_power_ctrl(d, 0);
+ dvb_usbv2_device_power_ctrl(d, 0);
return 0;
err:
return ret;
}
-int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff)
+int dvb_usbv2_device_power_ctrl(struct dvb_usb_device *d, int onoff)
{
if (onoff)
d->powered++;
if (cold) {
pr_info("%s: found a '%s' in cold state\n",
KBUILD_MODNAME, d->name);
- ret = dvb_usb_download_firmware(d);
+ ret = dvb_usbv2_download_firmware(d);
if (ret == 0) {
;
} else if (ret == RECONNECTS_USB) {
pr_info("%s: found a '%s' in warm state\n", KBUILD_MODNAME, d->name);
- ret = dvb_usb_init(d);
+ ret = dvb_usbv2_init(d);
if (ret < 0)
goto err_usb_driver_release_interface;
usb_set_intfdata(intf, NULL);
if (d) {
name = d->name;
- dvb_usb_exit(d);
+ dvb_usbv2_exit(d);
}
pr_info("%s: '%s' successfully deinitialized and disconnected\n",
/* when the parameter has been set to 1 via sysfs while the
* driver was running, or when bulk mode is enabled after IR init
*/
- if (dvb_usb_disable_rc_polling || d->rc.bulk_mode)
+ if (dvb_usbv2_disable_rc_polling || d->rc.bulk_mode)
return;
ret = d->rc.query(d);
msecs_to_jiffies(d->rc.interval));
}
-int dvb_usb_remote_init(struct dvb_usb_device *d)
+int dvb_usbv2_remote_init(struct dvb_usb_device *d)
{
int ret;
struct rc_dev *dev;
- if (dvb_usb_disable_rc_polling || !d->props.get_rc_config)
+ if (dvb_usbv2_disable_rc_polling || !d->props.get_rc_config)
return 0;
ret = d->props.get_rc_config(d, &d->rc);
return ret;
}
-int dvb_usb_remote_exit(struct dvb_usb_device *d)
+int dvb_usbv2_remote_exit(struct dvb_usb_device *d)
{
if (d->state & DVB_USB_STATE_REMOTE) {
cancel_delayed_work_sync(&d->rc_query_work);
usb_submit_urb(urb, GFP_ATOMIC);
}
-int usb_urb_kill(struct usb_data_stream *stream)
+int usb_urb_killv2(struct usb_data_stream *stream)
{
int i;
for (i = 0; i < stream->urbs_submitted; i++) {
return 0;
}
-int usb_urb_submit(struct usb_data_stream *stream,
+int usb_urb_submitv2(struct usb_data_stream *stream,
struct usb_data_stream_properties *props)
{
int i, ret;
if (ret) {
pr_err("%s: could not submit URB no. %d - get them " \
"all back\n", KBUILD_MODNAME, i);
- usb_urb_kill(stream);
+ usb_urb_killv2(stream);
return ret;
}
stream->urbs_submitted++;
{
int i;
- usb_urb_kill(stream);
+ usb_urb_killv2(stream);
for (i = 0; i < stream->urbs_initialized; i++) {
if (stream->urb_list[i] != NULL) {
return 0;
}
-int usb_urb_init(struct usb_data_stream *stream,
+int usb_urb_initv2(struct usb_data_stream *stream,
struct usb_data_stream_properties *props)
{
int ret;
}
}
-int usb_urb_exit(struct usb_data_stream *stream)
+int usb_urb_exitv2(struct usb_data_stream *stream)
{
usb_urb_free_urbs(stream);
usb_free_stream_buffers(stream);