aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-03-22 16:33:57 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-03-22 16:38:51 +0100
commit548ad8ee68c034300b714b297fe18b16a8a4f797 (patch)
tree438ee1027e0c26c6dae52f7b34f9a924e227af50
parentmedia: dvb_frontend: don't call dvb_frontend_get_stepsize() twice (diff)
downloadlinux-dev-548ad8ee68c034300b714b297fe18b16a8a4f797.tar.xz
linux-dev-548ad8ee68c034300b714b297fe18b16a8a4f797.zip
media: dvb_frontend: warn if frontend driver has API issues
the kAPI for a frontend can use 3 different tuning methods: 1. The hardware tracks internally frequency shifts via its own internal zigzag logic; 2. The hardware has a custom zigzag method, implemented via fe search() ops; 3. The hardware doesn't have any internal zigzag logic. So, the Kernel needs to implement it. Drivers that use the in-kernel software zigzag are required to provide some parameters for the zigzag code to work. Failing to do that will just make the Kernel to tune several times to the very same frequency, delaying the tuning time for no good reason. This is actually a kAPI violation (and an uAPI one, as the frequency shift is exported to the uAPI). Emit a warning on such case, as the driver needs to be fixed. Link: https://lore.kernel.org/linux-media/6d5941e3ba77439bbc401207cd87d9b8748d5cb8.1616427172.git.mchehab+huawei@kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/media/dvb-core/dvb_frontend.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 6aaa4d5a504d..a6915582d1a6 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -481,6 +481,10 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
struct dvb_frontend_private *fepriv = fe->frontend_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
+ if (fepriv->max_drift)
+ dev_warn_once(fe->dvb->device,
+ "Frontend requested software zigzag, but didn't set the frequency step size\n");
+
/* if we've got no parameters, just keep idling */
if (fepriv->state & FESTATE_IDLE) {
fepriv->delay = 3 * HZ;