Skip to content

Commit

Permalink
[media] tuner/xc2028: Add I2C flush callback
Browse files Browse the repository at this point in the history
When loading the firmware, complete each chunk by sending an I2C flush
command to the frontend. Some devices like the tm6000 seem to require
this to properly flush the I2C buffers.

The current code in tm6000 executes the flush command once after each
I2C transfer, which slows down the firmware loading especially when
loading large BASE type images.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Thierry Reding authored and Mauro Carvalho Chehab committed Aug 31, 2011
1 parent 69d232a commit 4d37ece
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/media/common/tuners/tuner-xc2028.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,13 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type,
p += len;
size -= len;
}

/* silently fail if the frontend doesn't support I2C flush */
rc = do_tuner_callback(fe, XC2028_I2C_FLUSH, 0);
if ((rc < 0) && (rc != -EINVAL)) {
tuner_err("error executing flush: %d\n", rc);
return rc;
}
}
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/media/common/tuners/tuner-xc2028.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct xc2028_config {
/* xc2028 commands for callback */
#define XC2028_TUNER_RESET 0
#define XC2028_RESET_CLK 1
#define XC2028_I2C_FLUSH 2

#if defined(CONFIG_MEDIA_TUNER_XC2028) || (defined(CONFIG_MEDIA_TUNER_XC2028_MODULE) && defined(MODULE))
extern struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
Expand Down

0 comments on commit 4d37ece

Please sign in to comment.