Commit 0a6ecbb4 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] go7007: drop firmware name in board config, make configs const

The firmware is always the same, so drop it from the board configs. Also make
the board configs const.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ac41fa2a
...@@ -624,7 +624,8 @@ EXPORT_SYMBOL(go7007_parse_video_stream); ...@@ -624,7 +624,8 @@ EXPORT_SYMBOL(go7007_parse_video_stream);
/* /*
* Allocate a new go7007 struct. Used by the hardware-specific probe. * Allocate a new go7007 struct. Used by the hardware-specific probe.
*/ */
struct go7007 *go7007_alloc(struct go7007_board_info *board, struct device *dev) struct go7007 *go7007_alloc(const struct go7007_board_info *board,
struct device *dev)
{ {
struct go7007 *go; struct go7007 *go;
int i; int i;
...@@ -677,7 +678,7 @@ EXPORT_SYMBOL(go7007_alloc); ...@@ -677,7 +678,7 @@ EXPORT_SYMBOL(go7007_alloc);
void go7007_update_board(struct go7007 *go) void go7007_update_board(struct go7007 *go)
{ {
struct go7007_board_info *board = go->board_info; const struct go7007_board_info *board = go->board_info;
if (board->sensor_flags & GO7007_SENSOR_TV) { if (board->sensor_flags & GO7007_SENSOR_TV) {
go->standard = GO7007_STD_NTSC; go->standard = GO7007_STD_NTSC;
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include "go7007-priv.h" #include "go7007-priv.h"
#define GO7007_FW_NAME "go7007/go7007tv.bin"
/* Constants used in the source firmware image to describe code segments */ /* Constants used in the source firmware image to describe code segments */
#define FLAG_MODE_MJPEG (1) #define FLAG_MODE_MJPEG (1)
...@@ -1568,10 +1570,10 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen) ...@@ -1568,10 +1570,10 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen)
default: default:
return -1; return -1;
} }
if (request_firmware(&fw_entry, go->board_info->firmware, go->dev)) { if (request_firmware(&fw_entry, GO7007_FW_NAME, go->dev)) {
dev_err(go->dev, dev_err(go->dev,
"unable to load firmware from file \"%s\"\n", "unable to load firmware from file \"%s\"\n",
go->board_info->firmware); GO7007_FW_NAME);
return -1; return -1;
} }
code = kzalloc(codespace * 2, GFP_KERNEL); code = kzalloc(codespace * 2, GFP_KERNEL);
...@@ -1586,7 +1588,7 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen) ...@@ -1586,7 +1588,7 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen)
if (chunk_len + 2 > srclen) { if (chunk_len + 2 > srclen) {
dev_err(go->dev, dev_err(go->dev,
"firmware file \"%s\" appears to be corrupted\n", "firmware file \"%s\" appears to be corrupted\n",
go->board_info->firmware); GO7007_FW_NAME);
goto fw_failed; goto fw_failed;
} }
if (chunk_flags & mode_flag) { if (chunk_flags & mode_flag) {
...@@ -1622,3 +1624,5 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen) ...@@ -1622,3 +1624,5 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen)
release_firmware(fw_entry); release_firmware(fw_entry);
return -1; return -1;
} }
MODULE_FIRMWARE(GO7007_FW_NAME);
...@@ -75,7 +75,6 @@ struct go7007; ...@@ -75,7 +75,6 @@ struct go7007;
#define GO7007_AUDIO_OKI_MODE (1<<17) #define GO7007_AUDIO_OKI_MODE (1<<17)
struct go7007_board_info { struct go7007_board_info {
char *firmware;
unsigned int flags; unsigned int flags;
int hpi_buffer_cap; int hpi_buffer_cap;
unsigned int sensor_flags; unsigned int sensor_flags;
...@@ -151,7 +150,7 @@ enum go7007_parser_state { ...@@ -151,7 +150,7 @@ enum go7007_parser_state {
struct go7007 { struct go7007 {
struct device *dev; struct device *dev;
u8 bus_info[32]; u8 bus_info[32];
struct go7007_board_info *board_info; const struct go7007_board_info *board_info;
unsigned int board_id; unsigned int board_id;
int tuner_type; int tuner_type;
int channel_number; /* for multi-channel boards like Adlink PCI-MPG24 */ int channel_number; /* for multi-channel boards like Adlink PCI-MPG24 */
...@@ -273,7 +272,7 @@ int go7007_reset_encoder(struct go7007 *go); ...@@ -273,7 +272,7 @@ int go7007_reset_encoder(struct go7007 *go);
int go7007_register_encoder(struct go7007 *go, unsigned num_i2c_devs); int go7007_register_encoder(struct go7007 *go, unsigned num_i2c_devs);
int go7007_start_encoder(struct go7007 *go); int go7007_start_encoder(struct go7007 *go);
void go7007_parse_video_stream(struct go7007 *go, u8 *buf, int length); void go7007_parse_video_stream(struct go7007 *go, u8 *buf, int length);
struct go7007 *go7007_alloc(struct go7007_board_info *board, struct go7007 *go7007_alloc(const struct go7007_board_info *board,
struct device *dev); struct device *dev);
void go7007_update_board(struct go7007 *go); void go7007_update_board(struct go7007 *go);
......
...@@ -63,7 +63,7 @@ struct go7007_usb_board { ...@@ -63,7 +63,7 @@ struct go7007_usb_board {
}; };
struct go7007_usb { struct go7007_usb {
struct go7007_usb_board *board; const struct go7007_usb_board *board;
struct mutex i2c_lock; struct mutex i2c_lock;
struct usb_device *usbdev; struct usb_device *usbdev;
struct urb *video_urbs[8]; struct urb *video_urbs[8];
...@@ -73,10 +73,9 @@ struct go7007_usb { ...@@ -73,10 +73,9 @@ struct go7007_usb {
/*********************** Product specification data ***********************/ /*********************** Product specification data ***********************/
static struct go7007_usb_board board_matrix_ii = { static const struct go7007_usb_board board_matrix_ii = {
.flags = GO7007_USB_EZUSB, .flags = GO7007_USB_EZUSB,
.main_info = { .main_info = {
.firmware = "go7007/go7007tv.bin",
.flags = GO7007_BOARD_HAS_AUDIO | .flags = GO7007_BOARD_HAS_AUDIO |
GO7007_BOARD_USE_ONBOARD_I2C, GO7007_BOARD_USE_ONBOARD_I2C,
.audio_flags = GO7007_AUDIO_I2S_MODE_1 | .audio_flags = GO7007_AUDIO_I2S_MODE_1 |
...@@ -114,10 +113,9 @@ static struct go7007_usb_board board_matrix_ii = { ...@@ -114,10 +113,9 @@ static struct go7007_usb_board board_matrix_ii = {
}, },
}; };
static struct go7007_usb_board board_matrix_reload = { static const struct go7007_usb_board board_matrix_reload = {
.flags = GO7007_USB_EZUSB, .flags = GO7007_USB_EZUSB,
.main_info = { .main_info = {
.firmware = "go7007/go7007tv.bin",
.flags = GO7007_BOARD_HAS_AUDIO | .flags = GO7007_BOARD_HAS_AUDIO |
GO7007_BOARD_USE_ONBOARD_I2C, GO7007_BOARD_USE_ONBOARD_I2C,
.audio_flags = GO7007_AUDIO_I2S_MODE_1 | .audio_flags = GO7007_AUDIO_I2S_MODE_1 |
...@@ -152,10 +150,9 @@ static struct go7007_usb_board board_matrix_reload = { ...@@ -152,10 +150,9 @@ static struct go7007_usb_board board_matrix_reload = {
}, },
}; };
static struct go7007_usb_board board_star_trek = { static const struct go7007_usb_board board_star_trek = {
.flags = GO7007_USB_EZUSB | GO7007_USB_EZUSB_I2C, .flags = GO7007_USB_EZUSB | GO7007_USB_EZUSB_I2C,
.main_info = { .main_info = {
.firmware = "go7007/go7007tv.bin",
.flags = GO7007_BOARD_HAS_AUDIO, /* | .flags = GO7007_BOARD_HAS_AUDIO, /* |
GO7007_BOARD_HAS_TUNER, */ GO7007_BOARD_HAS_TUNER, */
.sensor_flags = GO7007_SENSOR_656 | .sensor_flags = GO7007_SENSOR_656 |
...@@ -200,10 +197,9 @@ static struct go7007_usb_board board_star_trek = { ...@@ -200,10 +197,9 @@ static struct go7007_usb_board board_star_trek = {
}, },
}; };
static struct go7007_usb_board board_px_tv402u = { static const struct go7007_usb_board board_px_tv402u = {
.flags = GO7007_USB_EZUSB | GO7007_USB_EZUSB_I2C, .flags = GO7007_USB_EZUSB | GO7007_USB_EZUSB_I2C,
.main_info = { .main_info = {
.firmware = "go7007/go7007tv.bin",
.flags = GO7007_BOARD_HAS_AUDIO | .flags = GO7007_BOARD_HAS_AUDIO |
GO7007_BOARD_HAS_TUNER, GO7007_BOARD_HAS_TUNER,
.sensor_flags = GO7007_SENSOR_656 | .sensor_flags = GO7007_SENSOR_656 |
...@@ -275,10 +271,9 @@ static struct go7007_usb_board board_px_tv402u = { ...@@ -275,10 +271,9 @@ static struct go7007_usb_board board_px_tv402u = {
}, },
}; };
static struct go7007_usb_board board_xmen = { static const struct go7007_usb_board board_xmen = {
.flags = 0, .flags = 0,
.main_info = { .main_info = {
.firmware = "go7007/go7007tv.bin",
.flags = GO7007_BOARD_USE_ONBOARD_I2C, .flags = GO7007_BOARD_USE_ONBOARD_I2C,
.hpi_buffer_cap = 0, .hpi_buffer_cap = 0,
.sensor_flags = GO7007_SENSOR_VREF_POLAR, .sensor_flags = GO7007_SENSOR_VREF_POLAR,
...@@ -310,10 +305,9 @@ static struct go7007_usb_board board_xmen = { ...@@ -310,10 +305,9 @@ static struct go7007_usb_board board_xmen = {
}, },
}; };
static struct go7007_usb_board board_matrix_revolution = { static const struct go7007_usb_board board_matrix_revolution = {
.flags = GO7007_USB_EZUSB, .flags = GO7007_USB_EZUSB,
.main_info = { .main_info = {
.firmware = "go7007/go7007tv.bin",
.flags = GO7007_BOARD_HAS_AUDIO | .flags = GO7007_BOARD_HAS_AUDIO |
GO7007_BOARD_USE_ONBOARD_I2C, GO7007_BOARD_USE_ONBOARD_I2C,
.audio_flags = GO7007_AUDIO_I2S_MODE_1 | .audio_flags = GO7007_AUDIO_I2S_MODE_1 |
...@@ -348,10 +342,9 @@ static struct go7007_usb_board board_matrix_revolution = { ...@@ -348,10 +342,9 @@ static struct go7007_usb_board board_matrix_revolution = {
}, },
}; };
static struct go7007_usb_board board_lifeview_lr192 = { static const struct go7007_usb_board board_lifeview_lr192 = {
.flags = GO7007_USB_EZUSB, .flags = GO7007_USB_EZUSB,
.main_info = { .main_info = {
.firmware = "go7007/go7007tv.bin",
.flags = GO7007_BOARD_HAS_AUDIO | .flags = GO7007_BOARD_HAS_AUDIO |
GO7007_BOARD_USE_ONBOARD_I2C, GO7007_BOARD_USE_ONBOARD_I2C,
.audio_flags = GO7007_AUDIO_I2S_MODE_1 | .audio_flags = GO7007_AUDIO_I2S_MODE_1 |
...@@ -376,10 +369,9 @@ static struct go7007_usb_board board_lifeview_lr192 = { ...@@ -376,10 +369,9 @@ static struct go7007_usb_board board_lifeview_lr192 = {
}, },
}; };
static struct go7007_usb_board board_endura = { static const struct go7007_usb_board board_endura = {
.flags = 0, .flags = 0,
.main_info = { .main_info = {
.firmware = "go7007/go7007tv.bin",
.flags = 0, .flags = 0,
.audio_flags = GO7007_AUDIO_I2S_MODE_1 | .audio_flags = GO7007_AUDIO_I2S_MODE_1 |
GO7007_AUDIO_I2S_MASTER | GO7007_AUDIO_I2S_MASTER |
...@@ -401,10 +393,9 @@ static struct go7007_usb_board board_endura = { ...@@ -401,10 +393,9 @@ static struct go7007_usb_board board_endura = {
}, },
}; };
static struct go7007_usb_board board_adlink_mpg24 = { static const struct go7007_usb_board board_adlink_mpg24 = {
.flags = 0, .flags = 0,
.main_info = { .main_info = {
.firmware = "go7007/go7007tv.bin",
.flags = GO7007_BOARD_USE_ONBOARD_I2C, .flags = GO7007_BOARD_USE_ONBOARD_I2C,
.audio_flags = GO7007_AUDIO_I2S_MODE_1 | .audio_flags = GO7007_AUDIO_I2S_MODE_1 |
GO7007_AUDIO_I2S_MASTER | GO7007_AUDIO_I2S_MASTER |
...@@ -434,10 +425,9 @@ static struct go7007_usb_board board_adlink_mpg24 = { ...@@ -434,10 +425,9 @@ static struct go7007_usb_board board_adlink_mpg24 = {
}, },
}; };
static struct go7007_usb_board board_sensoray_2250 = { static const struct go7007_usb_board board_sensoray_2250 = {
.flags = GO7007_USB_EZUSB | GO7007_USB_EZUSB_I2C, .flags = GO7007_USB_EZUSB | GO7007_USB_EZUSB_I2C,
.main_info = { .main_info = {
.firmware = "go7007/go7007tv.bin",
.audio_flags = GO7007_AUDIO_I2S_MODE_1 | .audio_flags = GO7007_AUDIO_I2S_MODE_1 |
GO7007_AUDIO_I2S_MASTER | GO7007_AUDIO_I2S_MASTER |
GO7007_AUDIO_WORD_16, GO7007_AUDIO_WORD_16,
...@@ -486,8 +476,6 @@ static struct go7007_usb_board board_sensoray_2250 = { ...@@ -486,8 +476,6 @@ static struct go7007_usb_board board_sensoray_2250 = {
}, },
}; };
MODULE_FIRMWARE("go7007/go7007tv.bin");
static const struct usb_device_id go7007_usb_id_table[] = { static const struct usb_device_id go7007_usb_id_table[] = {
{ {
.match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION | .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION |
...@@ -1041,7 +1029,7 @@ static int go7007_usb_probe(struct usb_interface *intf, ...@@ -1041,7 +1029,7 @@ static int go7007_usb_probe(struct usb_interface *intf,
{ {
struct go7007 *go; struct go7007 *go;
struct go7007_usb *usb; struct go7007_usb *usb;
struct go7007_usb_board *board; const struct go7007_usb_board *board;
struct usb_device *usbdev = interface_to_usbdev(intf); struct usb_device *usbdev = interface_to_usbdev(intf);
unsigned num_i2c_devs; unsigned num_i2c_devs;
char *name; char *name;
......
...@@ -64,8 +64,7 @@ struct saa7134_go7007 { ...@@ -64,8 +64,7 @@ struct saa7134_go7007 {
dma_addr_t bottom_dma; dma_addr_t bottom_dma;
}; };
static struct go7007_board_info board_voyager = { static const struct go7007_board_info board_voyager = {
.firmware = "go7007/go7007tv.bin",
.flags = 0, .flags = 0,
.sensor_flags = GO7007_SENSOR_656 | .sensor_flags = GO7007_SENSOR_656 |
GO7007_SENSOR_VALID_ENABLE | GO7007_SENSOR_VALID_ENABLE |
......
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