Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250247
b: refs/heads/master
c: 107d7b1
h: refs/heads/master
i:
  250245: 8d366c7
  250243: 2518641
  250239: 745c185
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent a80914e commit 771ed38
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3b1af19647f375efb96cbd0589f9279caea7023
refs/heads/master: 107d7b181ddeaeea92d1aa25f2e1e5a3acb7da40
17 changes: 14 additions & 3 deletions trunk/drivers/media/dvb/frontends/cx24116.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ static int cx24116_load_firmware(struct dvb_frontend *fe,
{
struct cx24116_state *state = fe->demodulator_priv;
struct cx24116_cmd cmd;
int i, ret;
int i, ret, len, remaining;
unsigned char vers[4];

dprintk("%s\n", __func__);
Expand Down Expand Up @@ -603,8 +603,19 @@ static int cx24116_load_firmware(struct dvb_frontend *fe,
cx24116_writereg(state, 0xF5, 0x00);
cx24116_writereg(state, 0xF6, 0x00);

/* write the entire firmware as one transaction */
cx24116_writeregN(state, 0xF7, fw->data, fw->size);
/* Split firmware to the max I2C write len and write.
* This overflows 16 bit intentionally in order to get max write
* len when i2c_wr_max is set to 0. */
for (remaining = fw->size; remaining > 0;
remaining -= (u16) (state->config->i2c_wr_max - 1)) {

len = remaining;
if (len > (u16) (state->config->i2c_wr_max - 1))
len = (u16) (state->config->i2c_wr_max - 1);

cx24116_writeregN(state, 0xF7, &fw->data[fw->size - remaining],
len);
}

cx24116_writereg(state, 0xF4, 0x10);
cx24116_writereg(state, 0xF0, 0x00);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/media/dvb/frontends/cx24116.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ struct cx24116_config {

/* Need to set MPEG parameters */
u8 mpg_clk_pos_pol:0x02;

/* max bytes I2C provider can write at once */
u16 i2c_wr_max;
};

#if defined(CONFIG_DVB_CX24116) || \
Expand Down

0 comments on commit 771ed38

Please sign in to comment.