OSDN Git Service

media: cxd2841er: avoid too many status inquires
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Sun, 6 Oct 2019 12:48:23 +0000 (09:48 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 16 Oct 2019 15:24:30 +0000 (12:24 -0300)
commitd9aeaa6d4ca44df5fae745fd47aede8b3f6137f1
treef85a064ffa23d2bdf9d759b6365ff76c531656aa
parent75564e3a5016651f1c7f8eec63b557e24d6d1e17
media: cxd2841er: avoid too many status inquires

I2C ops are expensive, as the I2C bus typical speed is 100kbps.

Also, stats reading take some time, as it requires to retrieve a
certain number of packets to complete.

While we don't know the minimal for CXD2841er, trying to do it
too quickly is still a very bad idea.

So, add some sanity logic there, preventing to retrieve stats
faster than one second.

This shouldn't cause any issues with well behavior apps, as they
usually take stats on a polling rate slower than 1 second.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
drivers/media/dvb-frontends/cxd2841er.c