Skip to content

Commit 2ab9c96

Browse files
committed
Merge tag 'media/v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: - some fixes at si2157 tuning logic - a warning fix on atomisp when used with clang * tag 'media/v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: si2157: add support for DVB-C Annex C media: si2157: fix bandwidth stored in dev media: si2157: fix 6MHz & 6.1MHz bandwidth setting media: atomisp: Do not define input_system_cfg2400_t twice
2 parents 49008f0 + 8d4ff81 commit 2ab9c96

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

drivers/media/tuners/si2157.c

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ static int si2157_set_params(struct dvb_frontend *fe)
446446
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
447447
int ret;
448448
struct si2157_cmd cmd;
449-
u8 bandwidth, delivery_system;
449+
u8 bw, delivery_system;
450+
u32 bandwidth;
450451
u32 if_frequency = 5000000;
451452

452453
dev_dbg(&client->dev,
@@ -458,18 +459,22 @@ static int si2157_set_params(struct dvb_frontend *fe)
458459
goto err;
459460
}
460461

461-
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;
467-
else if (c->bandwidth_hz <= 7000000)
468-
bandwidth = 0x07;
469-
else if (c->bandwidth_hz <= 8000000)
470-
bandwidth = 0x08;
471-
else
472-
bandwidth = 0x0f;
462+
if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 1700000) {
463+
bandwidth = 1700000;
464+
bw = 9;
465+
} else if (c->bandwidth_hz <= 6000000) {
466+
bandwidth = 6000000;
467+
bw = 6;
468+
} else if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 6100000) {
469+
bandwidth = 6100000;
470+
bw = 10;
471+
} else if (c->bandwidth_hz <= 7000000) {
472+
bandwidth = 7000000;
473+
bw = 7;
474+
} else {
475+
bandwidth = 8000000;
476+
bw = 8;
477+
}
473478

474479
switch (c->delivery_system) {
475480
case SYS_ATSC:
@@ -485,6 +490,7 @@ static int si2157_set_params(struct dvb_frontend *fe)
485490
delivery_system = 0x20;
486491
break;
487492
case SYS_DVBC_ANNEX_A:
493+
case SYS_DVBC_ANNEX_C:
488494
delivery_system = 0x30;
489495
break;
490496
case SYS_ISDBT:
@@ -499,7 +505,7 @@ static int si2157_set_params(struct dvb_frontend *fe)
499505
}
500506

501507
memcpy(cmd.args, "\x14\x00\x03\x07\x00\x00", 6);
502-
cmd.args[4] = delivery_system | bandwidth;
508+
cmd.args[4] = delivery_system | bw;
503509
if (dev->inversion)
504510
cmd.args[5] = 0x01;
505511
cmd.wlen = 6;

drivers/staging/media/atomisp/pci/isp2400_input_system_local.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
#include "isp_acquisition_defs.h"
3030
#include "input_system_ctrl_defs.h"
3131

32-
typedef struct input_system_cfg2400_s input_system_cfg2400_t;
33-
3432
struct target_cfg2400_s {
3533
input_switch_cfg_channel_t input_switch_channel_cfg;
3634
target_isp_cfg_t target_isp_cfg;

0 commit comments

Comments
 (0)