aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/dvb-frontends/si2168_priv.h
diff options
context:
space:
mode:
authorGravatar Lukas Middendorf <kernel@tuxforce.de> 2021-04-18 01:12:04 +0100
committerGravatar Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-11-19 16:38:38 +0000
commit51c2664ab051908dfb467b922e017a792c489cec (patch)
tree880a146df58241a30861ce70fd7494d089bd265a /drivers/media/dvb-frontends/si2168_priv.h
parentmedia: si2168: drop support for old firmware file name for si2168 B40 (diff)
downloadlinux-51c2664ab051908dfb467b922e017a792c489cec.tar.gz
linux-51c2664ab051908dfb467b922e017a792c489cec.tar.bz2
linux-51c2664ab051908dfb467b922e017a792c489cec.zip
media: media si2168: fully initialize si2168 on resume only when necessary
At connection time (or boot) in si2168_probe(), the firmware is not loaded to the device and the device is not fully activated. It is not useful or sensible to do this full initialization on resume in case it has not been previously initialized and is expected to be in this initialized state. Calling si2168_init() and therefore reading the firmware file for the first time during resume leads to problems and should be avoided. It is however safe to read the firmware file once it has already been read outside of a suspend/resume situation. Add a staus flag 'initialized' to store whether si2168_init() has successfully been called. If initialization fails (e.g. due to missing firmware file), the flag is not set. Register a separate si2168_resume callback which only calls si2168_init() once the 'initialized' flag has been set and it is safe to load the firmware at resume. The first call to si2168_init() will now always happen when the device is actually used for the first time and never during resume. This avoids the unsafe firmware file reading and should also speed up resume by skipping unnecessary device initialization. Link: https://lore.kernel.org/linux-media/20210418001204.7453-3-kernel@tuxforce.de [mchehab: fix several Coding Style issues] Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Lukas Middendorf <kernel@tuxforce.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/dvb-frontends/si2168_priv.h')
-rw-r--r--drivers/media/dvb-frontends/si2168_priv.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/si2168_priv.h b/drivers/media/dvb-frontends/si2168_priv.h
index 4f4d122e3963..3a8976229a4a 100644
--- a/drivers/media/dvb-frontends/si2168_priv.h
+++ b/drivers/media/dvb-frontends/si2168_priv.h
@@ -36,6 +36,7 @@ struct si2168_dev {
u8 ts_mode;
unsigned int active:1;
unsigned int warm:1;
+ unsigned int initialized:1;
unsigned int ts_clock_inv:1;
unsigned int ts_clock_gapped:1;
unsigned int spectral_inversion:1;