diff options
Diffstat (limited to 'drivers/media/dvb/frontends/cx24116.c')
-rw-r--r-- | drivers/media/dvb/frontends/cx24116.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/cx24116.c b/drivers/media/dvb/frontends/cx24116.c index 2410d8b59b6b..95c6465b87a1 100644 --- a/drivers/media/dvb/frontends/cx24116.c +++ b/drivers/media/dvb/frontends/cx24116.c | |||
@@ -137,7 +137,7 @@ MODULE_PARM_DESC(toneburst, "DiSEqC toneburst 0=OFF, 1=TONE CACHE, "\ | |||
137 | /* SNR measurements */ | 137 | /* SNR measurements */ |
138 | static int esno_snr; | 138 | static int esno_snr; |
139 | module_param(esno_snr, int, 0644); | 139 | module_param(esno_snr, int, 0644); |
140 | MODULE_PARM_DESC(debug, "SNR return units, 0=PERCENTAGE 0-100, "\ | 140 | MODULE_PARM_DESC(esno_snr, "SNR return units, 0=PERCENTAGE 0-100, "\ |
141 | "1=ESNO(db * 10) (default:0)"); | 141 | "1=ESNO(db * 10) (default:0)"); |
142 | 142 | ||
143 | enum cmds { | 143 | enum cmds { |
@@ -566,7 +566,7 @@ static int cx24116_load_firmware(struct dvb_frontend *fe, | |||
566 | { | 566 | { |
567 | struct cx24116_state *state = fe->demodulator_priv; | 567 | struct cx24116_state *state = fe->demodulator_priv; |
568 | struct cx24116_cmd cmd; | 568 | struct cx24116_cmd cmd; |
569 | int i, ret; | 569 | int i, ret, len, max, remaining; |
570 | unsigned char vers[4]; | 570 | unsigned char vers[4]; |
571 | 571 | ||
572 | dprintk("%s\n", __func__); | 572 | dprintk("%s\n", __func__); |
@@ -603,8 +603,21 @@ static int cx24116_load_firmware(struct dvb_frontend *fe, | |||
603 | cx24116_writereg(state, 0xF5, 0x00); | 603 | cx24116_writereg(state, 0xF5, 0x00); |
604 | cx24116_writereg(state, 0xF6, 0x00); | 604 | cx24116_writereg(state, 0xF6, 0x00); |
605 | 605 | ||
606 | /* write the entire firmware as one transaction */ | 606 | /* Split firmware to the max I2C write len and write. |
607 | cx24116_writeregN(state, 0xF7, fw->data, fw->size); | 607 | * Writes whole firmware as one write when i2c_wr_max is set to 0. */ |
608 | if (state->config->i2c_wr_max) | ||
609 | max = state->config->i2c_wr_max; | ||
610 | else | ||
611 | max = INT_MAX; /* enough for 32k firmware */ | ||
612 | |||
613 | for (remaining = fw->size; remaining > 0; remaining -= max - 1) { | ||
614 | len = remaining; | ||
615 | if (len > max - 1) | ||
616 | len = max - 1; | ||
617 | |||
618 | cx24116_writeregN(state, 0xF7, &fw->data[fw->size - remaining], | ||
619 | len); | ||
620 | } | ||
608 | 621 | ||
609 | cx24116_writereg(state, 0xF4, 0x10); | 622 | cx24116_writereg(state, 0xF4, 0x10); |
610 | cx24116_writereg(state, 0xF0, 0x00); | 623 | cx24116_writereg(state, 0xF0, 0x00); |