git.samba.org
/
sfrench
/
cifs-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
[sfrench/cifs-2.6.git]
/
drivers
/
media
/
video
/
cx25840
/
cx25840-firmware.c
diff --git
a/drivers/media/video/cx25840/cx25840-firmware.c
b/drivers/media/video/cx25840/cx25840-firmware.c
index 0e86b9d033ac8b6cb2bb302152d4e6ac3f0203ea..620d295947abd5299ac86337eceb3407e1d3527e 100644
(file)
--- a/
drivers/media/video/cx25840/cx25840-firmware.c
+++ b/
drivers/media/video/cx25840/cx25840-firmware.c
@@
-17,7
+17,6
@@
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/i2c.h>
-#include <linux/i2c-algo-bit.h>
#include <linux/firmware.h>
#include <media/v4l2-common.h>
#include <media/cx25840.h>
#include <linux/firmware.h>
#include <media/v4l2-common.h>
#include <media/cx25840.h>
@@
-25,6
+24,7
@@
#include "cx25840-core.h"
#define FWFILE "v4l-cx25840.fw"
#include "cx25840-core.h"
#define FWFILE "v4l-cx25840.fw"
+#define FWFILE_CX23885 "v4l-cx23885-avcore-01.fw"
/*
* Mike Isely <isely@pobox.com> - The FWSEND parameter controls the
/*
* Mike Isely <isely@pobox.com> - The FWSEND parameter controls the
@@
-79,11
+79,9
@@
static int check_fw_load(struct i2c_client *client, int size)
return 0;
}
return 0;
}
-static int fw_write(struct i2c_client *client, u8 *
data, int size)
+static int fw_write(struct i2c_client *client, u8 *data, int size)
{
{
- int sent;
-
- if ((sent = i2c_master_send(client, data, size)) < size) {
+ if (i2c_master_send(client, data, size) < size) {
v4l_err(client, "firmware load i2c failure\n");
return -ENOSYS;
}
v4l_err(client, "firmware load i2c failure\n");
return -ENOSYS;
}
@@
-93,9
+91,13
@@
static int fw_write(struct i2c_client *client, u8 * data, int size)
int cx25840_loadfw(struct i2c_client *client)
{
int cx25840_loadfw(struct i2c_client *client)
{
+ struct cx25840_state *state = i2c_get_clientdata(client);
const struct firmware *fw = NULL;
u8 buffer[4], *ptr;
const struct firmware *fw = NULL;
u8 buffer[4], *ptr;
- int size, send, retval;
+ int size, retval;
+
+ if (state->is_cx23885)
+ firmware = FWFILE_CX23885;
if (request_firmware(&fw, firmware, FWDEV(client)) != 0) {
v4l_err(client, "unable to open firmware %s\n", firmware);
if (request_firmware(&fw, firmware, FWDEV(client)) != 0) {
v4l_err(client, "unable to open firmware %s\n", firmware);
@@
-120,8
+122,7
@@
int cx25840_loadfw(struct i2c_client *client)
while (size > 0) {
ptr[0] = 0x08;
ptr[1] = 0x02;
while (size > 0) {
ptr[0] = 0x08;
ptr[1] = 0x02;
- send = size > (FWSEND - 2) ? FWSEND : size + 2;
- retval = fw_write(client, ptr, send);
+ retval = fw_write(client, ptr, min(FWSEND, size + 2));
if (retval < 0) {
release_firmware(fw);
if (retval < 0) {
release_firmware(fw);