media: si2157: add ATV support for si2158
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 10 Dec 2021 12:52:42 +0000 (13:52 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 14 Dec 2021 15:19:05 +0000 (16:19 +0100)
This device also supports ATV, as it has the same API for
setting analog TV tuning parameters.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/tuners/si2157.c
drivers/media/tuners/si2157_priv.h

index 2d3937af4f5fac3f153d805f486738bcd25c4e32..481c5c3b577debc2a19702d99fe3016539686a41 100644 (file)
@@ -576,7 +576,7 @@ static int si2157_set_analog_params(struct dvb_frontend *fe,
        u8 color = 0;    /* 0=NTSC/PAL, 0x10=SECAM */
        u8 invert_analog = 1; /* analog tuner spectrum; 0=normal, 1=inverted */
 
-       if (dev->part_id != SI2157) {
+       if (!SUPPORTS_ATV_IF(dev)) {
                dev_info(&client->dev, "Analog tuning not supported yet for Si21%d\n",
                         dev->part_id);
                ret = -EINVAL;
index 24849c8ed3989ee36ceedb778dfc0f06bbb4bcc1..8579e80f7af70b51e381cf276614f6b72fd3dd11 100644 (file)
@@ -71,6 +71,9 @@ struct si2157_cmd {
                               ((dev)->part_id == SI2157) || \
                               ((dev)->part_id == SI2177))
 
+#define SUPPORTS_ATV_IF(dev) (((dev)->part_id == SI2157) || \
+                             ((dev)->part_id == SI2158))
+
 /* Old firmware namespace */
 #define SI2158_A20_FIRMWARE "dvb-tuner-si2158-a20-01.fw"
 #define SI2141_A10_FIRMWARE "dvb-tuner-si2141-a10-01.fw"