From patchwork Sun Apr 9 19:38:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9671733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFDB5600CB for ; Sun, 9 Apr 2017 19:38:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA97F26E8A for ; Sun, 9 Apr 2017 19:38:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F8CE27F10; Sun, 9 Apr 2017 19:38:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A1DC26E8A for ; Sun, 9 Apr 2017 19:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752629AbdDITiv (ORCPT ); Sun, 9 Apr 2017 15:38:51 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34902 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752586AbdDITin (ORCPT ); Sun, 9 Apr 2017 15:38:43 -0400 Received: by mail-wr0-f196.google.com with SMTP id t20so26640548wra.2 for ; Sun, 09 Apr 2017 12:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JtDgGbWOf+NJRoFu6Wtqv6BeV71hMMnFe9E2Y/a1YMc=; b=m6fr7fOIJLpHint4S1uUcOGeTvaV/CN4wvuOdfGAtefaU22pxTMyQQdRJy/om3OBaZ f2IGKUyZUV8jc5EKTupgIWuykBdhoI2KRi5GhLtk0dF3EbxNT2L0hHWwRW83KWmoIlJU NYylJ79NRAEgYtAC1qonG540hnh23m4TuTig/wL+mTBKk5bC64A4ZKSX2/gE+U3IsTIt sAb20OwbKZK++QBafCfcbEEVBLskT8IIchd8wEiCs8NPR6b8dKCkMMS+fH5pq325phGx FXCY3GyDCZ5eJn63y/WyH2nERAaH8X0+RJfetZ2vKvuqIryVwuXW1uc47ZVtyXKBzcGP 5MaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JtDgGbWOf+NJRoFu6Wtqv6BeV71hMMnFe9E2Y/a1YMc=; b=PhSNg3xtRTfE4pTQw9QA6EuaW3yL9kBp9NuUBKUleNSHApkpeGaRq7nKWnopFg0lzQ 6NxLSlvVjwYplBRXgK4Ckka1+jORAIwg2pO9CVccQqpaG4DfEqJiPcjwJ6k0IBIe+t+5 hHMr6kP3yGTb5eYBw2tzPeLjvJbSx7uvrJwfxOWlx1AbrULs8gulcXk1WeemLx6meRbr 8O+JJQ6FAik7V+/bxmej9gV3DeSUFXZHaA470khkmC3Guvv/oGbbgGhHesk7fQMADzHS Jc1sKA2MJMjmRBqb1QoYU1eSWFB9K3EHb+7P7HvzQvjmLpSsIAkySOZm1NtlhHD3UJv1 auKw== X-Gm-Message-State: AFeK/H22eUNEYW7ndl5S8OvDCw+E8pcUzjR+YmMD1FrvWz3deQ/wktBUjQjmoX7Gr8Ww4g== X-Received: by 10.223.135.13 with SMTP id a13mr44208569wra.87.1491766722140; Sun, 09 Apr 2017 12:38:42 -0700 (PDT) Received: from dvbdev.wuest.de (ip-37-24-178-151.hsi14.unitymediagroup.de. [37.24.178.151]) by smtp.gmail.com with ESMTPSA id f135sm7441407wmd.7.2017.04.09.12.38.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 09 Apr 2017 12:38:41 -0700 (PDT) From: Daniel Scheller To: aospan@netup.ru, serjk@netup.ru, mchehab@kernel.org, linux-media@vger.kernel.org Cc: rjkm@metzlerbros.de Subject: [PATCH 12/19] [media] dvb-frontends/cxd2841er: make lock wait in set_fe_tc() optional Date: Sun, 9 Apr 2017 21:38:21 +0200 Message-Id: <20170409193828.18458-13-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170409193828.18458-1-d.scheller.oss@gmail.com> References: <20170409193828.18458-1-d.scheller.oss@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Scheller Don't wait for FE_HAS_LOCK in set_frontend_tc() and thus don't hammer the lock status register with inquiries when CXD2841ER_NO_WAIT_LOCK is set in the configuration, which also unneccessarily blocks applications until a TS LOCK has been acquired. Rather, API and applications will check for a TS LOCK by utilising the tune fe_op, read_status and get_frontend ops, which is sufficient. Signed-off-by: Daniel Scheller Acked-by: Abylay Ospan --- drivers/media/dvb-frontends/cxd2841er.c | 4 ++++ drivers/media/dvb-frontends/cxd2841er.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c index 894cb5a..67d4399 100644 --- a/drivers/media/dvb-frontends/cxd2841er.c +++ b/drivers/media/dvb-frontends/cxd2841er.c @@ -3460,6 +3460,10 @@ static int cxd2841er_set_frontend_tc(struct dvb_frontend *fe) cxd2841er_tuner_set(fe); cxd2841er_tune_done(priv); + + if (priv->flags & CXD2841ER_NO_WAIT_LOCK) + goto done; + timeout = 2500; while (timeout > 0) { ret = cxd2841er_read_status_tc(fe, &status); diff --git a/drivers/media/dvb-frontends/cxd2841er.h b/drivers/media/dvb-frontends/cxd2841er.h index 061e551..d77b59f 100644 --- a/drivers/media/dvb-frontends/cxd2841er.h +++ b/drivers/media/dvb-frontends/cxd2841er.h @@ -29,6 +29,7 @@ #define CXD2841ER_TS_SERIAL 4 /* bit 2 */ #define CXD2841ER_ASCOT 8 /* bit 3 */ #define CXD2841ER_EARLY_TUNE 16 /* bit 4 */ +#define CXD2841ER_NO_WAIT_LOCK 32 /* bit 5 */ enum cxd2841er_xtal { SONY_XTAL_20500, /* 20.5 MHz */