Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] media: tuner xc5000 - try to avoid firmware load in resume path

xc5000 doesn't load firmware at attach time instead loads it
when it needs to set and change configuration from its init,
frequency, digital and analog mode set interffaces. As a result,
when system is suspended before firmware is loaded, firmware
load can be avoided during resume. Loading formware in this
scenario results in slowpath warnings during resume as it won't
be in the suspend firmware cache.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Shuah Khan and committed by
Mauro Carvalho Chehab
27ccd694 5264a522

+15 -1
+15 -1
drivers/media/tuners/xc5000.c
··· 1293 1293 return 0; 1294 1294 } 1295 1295 1296 + static int xc5000_resume(struct dvb_frontend *fe) 1297 + { 1298 + struct xc5000_priv *priv = fe->tuner_priv; 1299 + 1300 + dprintk(1, "%s()\n", __func__); 1301 + 1302 + /* suspended before firmware is loaded. 1303 + Avoid firmware load in resume path. */ 1304 + if (!priv->firmware) 1305 + return 0; 1306 + 1307 + return xc5000_set_params(fe); 1308 + } 1309 + 1296 1310 static int xc5000_init(struct dvb_frontend *fe) 1297 1311 { 1298 1312 struct xc5000_priv *priv = fe->tuner_priv; ··· 1374 1360 .init = xc5000_init, 1375 1361 .sleep = xc5000_sleep, 1376 1362 .suspend = xc5000_suspend, 1377 - .resume = xc5000_set_params, 1363 + .resume = xc5000_resume, 1378 1364 1379 1365 .set_config = xc5000_set_config, 1380 1366 .set_params = xc5000_set_digital_params,