Skip to content

Commit

Permalink
[media] af9015: Fix max I2C message size when used with tda18271
Browse files Browse the repository at this point in the history
Changeset 1724c8f added an option to change
the maximum I2C size to 8 bytes. However, it forgot to replace the previous
usage at af9015 to use the newly defined macro value
(TDA18271_16_BYTE_CHUNK_INIT).

A latter changeset (e350d44) extended the
possible values for .small_i2c field and, instead of using a random sequence
of numbers, it used a number that makes more sense (e. g. the actual limit,
in terms of bytes).

However, as af9015 were using .small_i2c = 1, this become undefined, and the
restriction of a max size of 16 was gone.

While here, fix the reported msg size at tda18271-common.c.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Tested-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed Oct 27, 2010
1 parent dc69798 commit 7655e59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/media/common/tuners/tda18271-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ int tda18271_write_regs(struct dvb_frontend *fe, int idx, int len)

if (ret != 1)
tda_err("ERROR: idx = 0x%x, len = %d, "
"i2c_transfer returned: %d\n", idx, len, ret);
"i2c_transfer returned: %d\n", idx, max, ret);

return (ret == 1 ? 0 : ret);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/af9015.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ static struct qt1010_config af9015_qt1010_config = {

static struct tda18271_config af9015_tda18271_config = {
.gate = TDA18271_GATE_DIGITAL,
.small_i2c = 1,
.small_i2c = TDA18271_16_BYTE_CHUNK_INIT,
};

static struct mxl5005s_config af9015_mxl5003_config = {
Expand Down

0 comments on commit 7655e59

Please sign in to comment.