Skip to content

Commit

Permalink
[media] dvb_usb_v2: clean firmware downloading routines
Browse files Browse the repository at this point in the history
Remove Cypress USB-interface firmware downloading routines.
That is common module and having single vendor chip routines
in common module is wrong. Just move those elsewhere.

Move single function out from the dvb_usb_firmware.c and
remove that file.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Aug 4, 2012
1 parent 21f5a32 commit a0d72d2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 195 deletions.
19 changes: 0 additions & 19 deletions drivers/media/dvb/dvb-usb/dvb_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,6 @@ struct dvb_usb_device_properties {
#define DVB_USB_IS_AN_I2C_ADAPTER 0x01
int caps;

#define DEVICE_SPECIFIC 0
#define CYPRESS_AN2135 1
#define CYPRESS_AN2235 2
#define CYPRESS_FX2 3
int usb_ctrl;

int size_of_priv;

const char *firmware;
Expand Down Expand Up @@ -398,17 +392,4 @@ extern int dvb_usbv2_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16,
int);
extern int dvb_usbv2_generic_write(struct dvb_usb_device *, u8 *, u16);

/* commonly used firmware download types and function */
struct hexline {
u8 len;
u32 addr;
u8 type;
u8 data[255];
u8 chk;
};
extern int usbv2_cypress_load_firmware(struct usb_device *udev,
const struct firmware *fw, int type);
extern int dvb_usbv2_get_hexline(const struct firmware *fw, struct hexline *hx,
int *pos);

#endif
176 changes: 0 additions & 176 deletions drivers/media/dvb/dvb-usb/dvb_usb_firmware.c

This file was deleted.

42 changes: 42 additions & 0 deletions drivers/media/dvb/dvb-usb/dvb_usb_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,48 @@ module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage,
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 ret;
const struct firmware *fw = NULL;
const char *name;

/* resolve firmware name */
name = d->props.firmware;
if (d->props.get_firmware_name) {
ret = d->props.get_firmware_name(d, &name);
if (ret < 0)
return ret;
}

if (!d->props.download_firmware) {
ret = -EINVAL;
goto err;
}

ret = request_firmware(&fw, name, &d->udev->dev);
if (ret < 0) {
err("did not find the firmware file. (%s) " \
"Please see linux/Documentation/dvb/ for more" \
" details on firmware-problems. (%d)", name, ret);
goto err;
}

info("downloading firmware from file '%s'", name);

ret = d->props.download_firmware(d, fw);

release_firmware(fw);

if (ret < 0)
goto err;

return 0;
err:
pr_debug("%s: failed=%d\n", __func__, ret);
return ret;
}

static int dvb_usb_adapter_init(struct dvb_usb_device *d)
{
struct dvb_usb_adapter *adap;
Expand Down

0 comments on commit a0d72d2

Please sign in to comment.