From patchwork Fri Dec 10 12:59:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12669521 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FA3FC433F5 for ; Fri, 10 Dec 2021 12:59:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241391AbhLJNCx (ORCPT ); Fri, 10 Dec 2021 08:02:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241387AbhLJNCw (ORCPT ); Fri, 10 Dec 2021 08:02:52 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B8E4C061746; Fri, 10 Dec 2021 04:59:17 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 62825B827F8; Fri, 10 Dec 2021 12:59:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EF43C00446; Fri, 10 Dec 2021 12:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639141154; bh=1dvmXl8pyYQ0tyABD9NsTZ8C2vZB9e7Jfo4+R07uHwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M3CPClMp+3Dt5zHJGN22jIJ8uR7a7ntRS3AB0hBo+xHvZP0oYn5P4Jbd2Q5GeuhCe 1GXMXbJDehgV6GI5zF1Cgen+Ed4XZjmwSBllN8XTplKbMVfkX5oTh1LEbxzn6M3Z+M zZ2ChYkqui/wyUoNknSMMDRsStZbTKf8xhKJNLGj104iBo32PRlZI5/3bU49OeXjeU +mjNNpaEVIIE24Xv4WS96FlQ3fB64RvgSe/zJqQ9qPQBMGkYsKv1TV9k//PHgndMjX N5e/c4+nLghfgrwU3euUAndTyIv78HKHAWObd8i9I0qWpEz8BItbnUuC5rMfCPLxQz JDTIR/3BE/5Mg== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mvfUV-000GDZ-Tl; Fri, 10 Dec 2021 13:59:11 +0100 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Antti Palosaari , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 1/3] media: si2157: add support for ISDB-T and DTMB Date: Fri, 10 Dec 2021 13:59:08 +0100 Message-Id: X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Those two delivery systems are supported by some of the si2146 tuners, but the current code is missing the setup for those. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH 0/3] at: https://lore.kernel.org/all/cover.1639140967.git.mchehab+huawei@kernel.org/ drivers/media/tuners/si2157.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 7e44cba67c38..aeecb38b147f 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -483,6 +483,12 @@ static int si2157_set_params(struct dvb_frontend *fe) case SYS_DVBC_ANNEX_A: delivery_system = 0x30; break; + case SYS_ISDBT: + delivery_system = 0x40; + break; + case SYS_DTMB: + delivery_system = 0x60; + break; default: ret = -EINVAL; goto err; From patchwork Fri Dec 10 12:59:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12669525 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6413BC433F5 for ; Fri, 10 Dec 2021 12:59:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241416AbhLJNCy (ORCPT ); Fri, 10 Dec 2021 08:02:54 -0500 Received: from sin.source.kernel.org ([145.40.73.55]:55996 "EHLO sin.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241385AbhLJNCw (ORCPT ); Fri, 10 Dec 2021 08:02:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 2E7B7CE2AD3; Fri, 10 Dec 2021 12:59:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B617C341CA; Fri, 10 Dec 2021 12:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639141154; bh=cKoBkhWMvxXH4gLP0isqGKjiBOXQTax0b2GGuxzKRHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rqpHiJjzk7H3PCTAsWi3NJZI7zadvWa0YuFCYINiRaPQQz+NphzSWPRjbQAUptnLO kf2TSxtvDyA5c3O4QhhiZxB/3CAUJdpiczhFKn7Bq6xtZah/xqirCjbT43OY25fK1b 8Zt+/H+QmQ5DfK14dFVeXVraDw+tV9CKbqYdZJypTE6UOXipQ6HVZskPNFqhgSjoNJ hl/TRVIH86k6sYWbFW5cAkulxa5klnpmW7rd1harymHdh02V1pUQUPWZ3AMHQEi7ft 5xMIAOP8MiH3fHN7GXDTRD1yXe1rzKb/twPw6ChJmFOSB9XxYOLehCaiWmo0XXM0L5 nqUKWUK//FQ9w== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mvfUV-000GDc-Uu; Fri, 10 Dec 2021 13:59:11 +0100 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Antti Palosaari , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 2/3] media: si2157: add support for 1.7MHz and 6.1 MHz Date: Fri, 10 Dec 2021 13:59:09 +0100 Message-Id: <76c2ea87882c87bd35066a85cb48292a36a79fce.1639140967.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Some tuners allow setting the bandwidth filter to 1.7MHz and 6.1 MHz. Add support for it upstream, as the narrower is the bandwidth filter, the better. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH 0/3] at: https://lore.kernel.org/all/cover.1639140967.git.mchehab+huawei@kernel.org/ drivers/media/tuners/si2157.c | 4 ++++ drivers/media/tuners/si2157_priv.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index aeecb38b147f..2d3937af4f5f 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -458,8 +458,12 @@ static int si2157_set_params(struct dvb_frontend *fe) goto err; } + if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 1700000) + bandwidth = 0x09; if (c->bandwidth_hz <= 6000000) bandwidth = 0x06; + if (SUPPORTS_1700KHz(dev) && c->bandwidth_hz <= 6100000) + bandwidth = 0x10; else if (c->bandwidth_hz <= 7000000) bandwidth = 0x07; else if (c->bandwidth_hz <= 8000000) diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h index df17a5f03561..24849c8ed398 100644 --- a/drivers/media/tuners/si2157_priv.h +++ b/drivers/media/tuners/si2157_priv.h @@ -66,6 +66,11 @@ struct si2157_cmd { unsigned rlen; }; +#define SUPPORTS_1700KHz(dev) (((dev)->part_id == SI2141) || \ + ((dev)->part_id == SI2147) || \ + ((dev)->part_id == SI2157) || \ + ((dev)->part_id == SI2177)) + /* Old firmware namespace */ #define SI2158_A20_FIRMWARE "dvb-tuner-si2158-a20-01.fw" #define SI2141_A10_FIRMWARE "dvb-tuner-si2141-a10-01.fw" From patchwork Fri Dec 10 12:59:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12669527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22506C4332F for ; Fri, 10 Dec 2021 12:59:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241426AbhLJNCz (ORCPT ); Fri, 10 Dec 2021 08:02:55 -0500 Received: from sin.source.kernel.org ([145.40.73.55]:55988 "EHLO sin.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241382AbhLJNCw (ORCPT ); Fri, 10 Dec 2021 08:02:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id EEF5FCE2AD7; Fri, 10 Dec 2021 12:59:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26EC2C341C8; Fri, 10 Dec 2021 12:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639141154; bh=M8WxNVshpmA5W3dxj8iqnNb+gaiIC0TSGmo6H30/9u8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RpHEot4Kswd7nC3GdIEo92fEe2wX9V9vrhe0HIaAQr0DCzEp52iqhCKRW0xnwyUSV 6ukbjzlkl7m80uvXiqlW6Nnlzys+5+8f0LqTveFdLTDBJR3YD+Q7CR15BRsKFSmH1M OzPElm9OytfClU1TzscaZjeqGSEuXJPTeDPll+lEZYAwk9MSyYvH3BUl/3RzkFXkY8 m2Vs1wik/gDUp2RCcUe5nqbHx38wAuUHsebJPNpv7/hKTXMNqd1/12MjuDax7ijMZX eoPw/op03DqQDUVOLYurkcENL+/nGquBeQ7x9Ke2afP+d9gMSov9ZLV1DJvJqWoAV7 2rFuFMLOeEsfw== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mvfUW-000GDf-0O; Fri, 10 Dec 2021 13:59:12 +0100 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Antti Palosaari , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 3/3] media: si2157: add ATV support for si2158 Date: Fri, 10 Dec 2021 13:59:10 +0100 Message-Id: <9470024c30330d37399aabba31777d134e6c52b0.1639140967.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This device also supports ATV, as it has the same API for setting analog TV tuning parameters. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH 0/3] at: https://lore.kernel.org/all/cover.1639140967.git.mchehab+huawei@kernel.org/ drivers/media/tuners/si2157.c | 2 +- drivers/media/tuners/si2157_priv.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 2d3937af4f5f..481c5c3b577d 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -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; diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h index 24849c8ed398..8579e80f7af7 100644 --- a/drivers/media/tuners/si2157_priv.h +++ b/drivers/media/tuners/si2157_priv.h @@ -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"