diff options
author | Robert Schlabbach <robert_s@gmx.net> | 2022-01-06 23:51:39 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-01-10 15:56:25 +0100 |
commit | 9658105d0e5b1437db161b4227721065d44585b9 (patch) | |
tree | 372a06fa28ce1bfa0c1bbb743f7db32b46e24c82 /drivers/media/tuners | |
parent | 95c4cd1d19e3e1d4894457a6f015e3a045bc9b06 (diff) |
media: si2157: fix bandwidth stored in dev
Make digital tuning store the bandwidth in Hz in the private dev struct,
rather than the hardware-specific bandwidth property code, so that the
get_bandwidth() function returns the bandwidth in Hz, just as it already
does when using analog tuning.
Link: https://lore.kernel.org/linux-media/trinity-931c0e68-88af-46cc-91a1-986754798a4f-1641509499366@3c-app-gmx-bap68
Reported-by: Robert Schlabbach <robert_s@gmx.net>
Signed-off-by: Robert Schlabbach <robert_s@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/tuners')
-rw-r--r-- | drivers/media/tuners/si2157.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 76dc10dd2518..b1e00b635dbf 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -446,7 +446,8 @@ static int si2157_set_params(struct dvb_frontend *fe) struct dtv_frontend_properties *c = &fe->dtv_property_cache; int ret; struct si2157_cmd cmd; - u8 bandwidth, delivery_system; + u8 bw, delivery_system; + u32 bandwidth; u32 if_frequency = 5000000; dev_dbg(&client->dev, @@ -458,16 +459,22 @@ static int si2157_set_params(struct dvb_frontend *fe) goto err; } - if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 1700000) - bandwidth = 9; - else if (c->bandwidth_hz <= 6000000) - bandwidth = 6; - else if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 6100000) - bandwidth = 10; - else if (c->bandwidth_hz <= 7000000) - bandwidth = 7; - else - bandwidth = 8; + if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 1700000) { + bandwidth = 1700000; + bw = 9; + } else if (c->bandwidth_hz <= 6000000) { + bandwidth = 6000000; + bw = 6; + } else if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 6100000) { + bandwidth = 6100000; + bw = 10; + } else if (c->bandwidth_hz <= 7000000) { + bandwidth = 7000000; + bw = 7; + } else { + bandwidth = 8000000; + bw = 8; + } switch (c->delivery_system) { case SYS_ATSC: @@ -497,7 +504,7 @@ static int si2157_set_params(struct dvb_frontend *fe) } memcpy(cmd.args, "\x14\x00\x03\x07\x00\x00", 6); - cmd.args[4] = delivery_system | bandwidth; + cmd.args[4] = delivery_system | bw; if (dev->inversion) cmd.args[5] = 0x01; cmd.wlen = 6; |