From patchwork Sun Aug 20 10:41:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9911079 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 AB171603F3 for ; Sun, 20 Aug 2017 10:41:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A53E287D5 for ; Sun, 20 Aug 2017 10:41:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C5FF287DE; Sun, 20 Aug 2017 10:41:40 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 A5875287D3 for ; Sun, 20 Aug 2017 10:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752527AbdHTKlT (ORCPT ); Sun, 20 Aug 2017 06:41:19 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:36923 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752420AbdHTKlS (ORCPT ); Sun, 20 Aug 2017 06:41:18 -0400 Received: by mail-wr0-f196.google.com with SMTP id z91so13149675wrc.4 for ; Sun, 20 Aug 2017 03:41:17 -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=3UXxkKP/Bt6quaI4QG77e06wGBJM64jfzzPp+3j7U2g=; b=dBH4Jtzy+pOqPcEl4h7tNF2gA9J2vyZXGfPqtt1i353vroLwXYjC/A+jRGLNFT2Znj uFKdUb5AjS7Cs7ue+1hAJea395t3miTLiIUwvP8UJAeIDu4X5E1hLVV0Dbe4mU4J9IhU zIPlVFBbV9Hee27hSaJdLlKJ5LDhlQcdFEnL2rIzTcq9XWBF9I1a5YOdy8s0T1QMoD2S 5V4JeQ7bvUFbUkSiObhOSjgOpTWxfkV94HkzCSdJhYDvBxqCapbGFDMOAnMYMTJSsNUh QzOTZWsAR+ZWbSC10ATO1ahL+OMrgdae78P+o3vSnTABTC4t25hUDozm3QXwrB4Tml3a KSwQ== 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=3UXxkKP/Bt6quaI4QG77e06wGBJM64jfzzPp+3j7U2g=; b=TXUvWDcn4dAYrpMDr4c/HCtskIYP+YStE2N4PTVnWgC6haaAHWFPzQpR+OqA4jgSN6 cF9IevflQTiPP5F9bnC74RG43FSEZ85ZEWhxi2kbZ5VfuPLL8CRjRqyhb6Kjp5RlaEXO 5gcJ4Yrm5utsoOq3vGrXROmW2b9+8fjD9m2pmVIOt7MUElzUBjvdlYGWMBc47WHlZGKC LcwBs0Fg1/UsPT7tJWg/qXp/sqbpV7mKVfbLLuV8mH7Yk/e2i23ILMNCVD46GfDFY7ok XYgT2/+fto6Tl05ijBz33386CchNbnlnWz0I5SRaUBrGmFgPctIVQGwb2wE5iVp7VOn9 EISw== X-Gm-Message-State: AHYfb5iQZ2ly1b/HxcUlKpBvSIhpQQLoy3TcYLMBBz6M90jrwPD6r3GG ejVOm1xWmbkHeEYO X-Received: by 10.28.156.10 with SMTP id f10mr4648953wme.35.1503225676951; Sun, 20 Aug 2017 03:41:16 -0700 (PDT) Received: from dvbdev.wuest.de (ip-84-118-193-88.unity-media.net. [84.118.193.88]) by smtp.gmail.com with ESMTPSA id l3sm5777601wrc.4.2017.08.20.03.41.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 20 Aug 2017 03:41:16 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Cc: jasmin@anw.at, rjkm@metzlerbros.de Subject: [PATCH 1/6] [media] ddbridge: fix gap handling Date: Sun, 20 Aug 2017 12:41:09 +0200 Message-Id: <20170820104114.6515-2-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170820104114.6515-1-d.scheller.oss@gmail.com> References: <20170820104114.6515-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 Force gap setting if given by attribute and enable gap for older regmaps. Also, setting a gap value of 128 via sysfs will now disable gap. Signed-off-by: Daniel Scheller --- drivers/media/pci/ddbridge/ddbridge-core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index c290d3fecc8d..98a12c644e44 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -336,6 +336,7 @@ static void calc_con(struct ddb_output *output, u32 *con, u32 *con2, u32 flags) if (output->port->gap != 0xffffffff) { flags |= 1; gap = output->port->gap; + max_bitrate = 0; } if (dev->link[0].info->type == DDB_OCTOPUS_CI && output->port->nr > 1) { *con = 0x10c; @@ -372,6 +373,7 @@ static void calc_con(struct ddb_output *output, u32 *con, u32 *con2, u32 flags) *con |= 0x810; /* 96 MBit/s and gap */ max_bitrate = 96000; } + *con |= 0x10; /* enable gap */ } } if (max_bitrate > 0) { @@ -3203,8 +3205,10 @@ static ssize_t gap_store(struct device *device, struct device_attribute *attr, if (sscanf(buf, "%u\n", &val) != 1) return -EINVAL; - if (val > 20) + if (val > 128) return -EINVAL; + if (val == 128) + val = 0xffffffff; dev->port[num].gap = val; return count; }