Skip to content

Commit 95c4cd1

Browse files
robert-scmchehab
authored andcommitted
media: si2157: fix 6MHz & 6.1MHz bandwidth setting
Commit 98c65a3 ("media: si2157: add support for 1.7MHz and 6.1 MHz") introduced two bugs: The 6.1MHz setting was always used for any bandwidth less than 7MHz due to missing "else" keywords, and then the setting was not specified as decimal 10, but as hexadecimal 0x10, which makes the tuner refuse the tune command. In sum, it is not possible to tune to any channels of less than 7MHz bandwidth anymore. Add the missing "else" keywords and convert all bandwidth settings to decimal to avoid any future decimal vs. hexadecimal confusion. Remove the use of the undefined bandwidth setting 0x0f for bandwidths greater than 8MHz, which is also refused by the tune command, in favour of using the default bandwidth setting 8 for any bandwidths greater than 7MHz. Link: https://lore.kernel.org/linux-media/trinity-d0015ea1-1da5-4c7d-a75b-781fb26dc339-1641509387112@3c-app-gmx-bap68 Fixes: 98c65a3 ("media: si2157: add support for 1.7MHz and 6.1 MHz") 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>
1 parent a89eeb9 commit 95c4cd1

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

drivers/media/tuners/si2157.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -459,17 +459,15 @@ static int si2157_set_params(struct dvb_frontend *fe)
459459
}
460460

461461
if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 1700000)
462-
bandwidth = 0x09;
463-
if (c->bandwidth_hz <= 6000000)
464-
bandwidth = 0x06;
465-
if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 6100000)
466-
bandwidth = 0x10;
462+
bandwidth = 9;
463+
else if (c->bandwidth_hz <= 6000000)
464+
bandwidth = 6;
465+
else if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 6100000)
466+
bandwidth = 10;
467467
else if (c->bandwidth_hz <= 7000000)
468-
bandwidth = 0x07;
469-
else if (c->bandwidth_hz <= 8000000)
470-
bandwidth = 0x08;
468+
bandwidth = 7;
471469
else
472-
bandwidth = 0x0f;
470+
bandwidth = 8;
473471

474472
switch (c->delivery_system) {
475473
case SYS_ATSC:

0 commit comments

Comments
 (0)