From patchwork Sat Jun 23 15:36:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10483717 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 AE4D46023A for ; Sat, 23 Jun 2018 15:36:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1A08288D1 for ; Sat, 23 Jun 2018 15:36:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6792289D1; Sat, 23 Jun 2018 15:36:36 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, 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 474F1288D1 for ; Sat, 23 Jun 2018 15:36:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751706AbeFWPgd (ORCPT ); Sat, 23 Jun 2018 11:36:33 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37203 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751598AbeFWPga (ORCPT ); Sat, 23 Jun 2018 11:36:30 -0400 Received: by mail-wm0-f68.google.com with SMTP id r125-v6so5601489wmg.2 for ; Sat, 23 Jun 2018 08:36:29 -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=H4YH24HxbISWaaTDfSg6eJJDwXrZvR1Gsfu1ECNxX0M=; b=IklV7lZZAdcN4MKuLXfKYI2CKiGmR8T7k1j4t+V0rMVYQaV/jSCx2a2R7nRizoVri4 88PpmDmqgSLpzPz5iXI+aLBLWHNf8EIWt2qOLClZbnWu2j4rGnKlnCrlb1mbWF2G3kQ/ YDwr4vgWhjjABYMWGmxRsrNe00bp9CtAK0uBr9dqJHUYQVEkBjL28czMocKgPMJxTl9y caXrhhCYf2kiw+2ihOtGfocvE3y3nsKGFwJGxInwMB0l85+HlaTjDK1c6cOUVKouYLef Cqzamt6uTsK/j4JF5o+nRT/kXTSK8ODEl9Q7dL6bCqSopQPvTS3+rkwCuH63KaaVz2/U g7YA== 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=H4YH24HxbISWaaTDfSg6eJJDwXrZvR1Gsfu1ECNxX0M=; b=LNBxgWmzmXSlMlxWxQEtS91wT9ZimPefXq8vnycKTbfmOiFvgb17j2sx6UjqCFl9wn sQLpwao2JSpNqiaZnLBZGMVL1ykGjFmlKQ5MpD8PZYm727ZWJmO5Z/5CUjufxSRUF1yR c+uOqK9SvKokdhEXY9zRTJVKmCMbXW1FI5bVBZtMqrdlmgKD9xpgSfGDVyj5s0rBx6Rh BBDmdBSFU26nK9CACPhJJrf9ShS7d+V8QWAK39+SEf3/SA4VO9Hynkfu0e2iVqcMNVIx lGZP1d7Cr8/69JMFWHQmMi+l7vsWNoAoFJq0u5h7p+Eu6TFmQPV7iLIbtIbj98wLcTV/ JJfg== X-Gm-Message-State: APt69E1I8p2K/bsHAW6zL/JcB4FSvPqBj9oEr77Aq3Y82yXQnkXmMeNE 22cJOxRBJWcwiI8nhVTpU2o= X-Google-Smtp-Source: ADUXVKLKDdyJ8QFreL/7DY1v4jM4HZsvn5d26Rn/xPO4FdeZxd5wrHBUK2ufG6yL9Z1RtPKVYz3SOw== X-Received: by 2002:a1c:448:: with SMTP id 69-v6mr5107985wme.31.1529768189015; Sat, 23 Jun 2018 08:36:29 -0700 (PDT) Received: from dvbdev.wuest.de (ip-176-199-71-134.hsi06.unitymediagroup.de. [176.199.71.134]) by smtp.gmail.com with ESMTPSA id o15-v6sm3443156wrm.38.2018.06.23.08.36.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jun 2018 08:36:28 -0700 (PDT) From: Daniel Scheller To: mchehab@kernel.org, mchehab@s-opensource.com Cc: linux-media@vger.kernel.org Subject: [PATCH 12/19] [media] ddbridge/mci: extend mci_command and mci_result structs Date: Sat, 23 Jun 2018 17:36:08 +0200 Message-Id: <20180623153615.27630-13-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180623153615.27630-1-d.scheller.oss@gmail.com> References: <20180623153615.27630-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 Recent FPGA firmware reports more data and values in sent command responses. Adjust the mci_command and mci_result structs including it's unions to match these changes and add a few comments explaining things. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller --- drivers/media/pci/ddbridge/ddbridge-mci.h | 74 +++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 8 deletions(-) diff --git a/drivers/media/pci/ddbridge/ddbridge-mci.h b/drivers/media/pci/ddbridge/ddbridge-mci.h index 2e74f0544717..5e0c9e88b6fc 100644 --- a/drivers/media/pci/ddbridge/ddbridge-mci.h +++ b/drivers/media/pci/ddbridge/ddbridge-mci.h @@ -90,16 +90,30 @@ struct mci_command { union { u32 command_word; struct { - u8 command; - u8 tuner; - u8 demod; - u8 output; + u8 command; + u8 tuner; + u8 demod; + u8 output; }; }; union { u32 params[31]; struct { + /* + * Bit 0: DVB-S Enabled + * Bit 1: DVB-S2 Enabled + * Bit 7: InputStreamID + */ u8 flags; + /* + * Bit 0: QPSK, + * Bit 1: 8PSK/8APSK + * Bit 2: 16APSK + * Bit 3: 32APSK + * Bit 4: 64APSK + * Bit 5: 128APSK + * Bit 6: 256APSK + */ u8 s2_modulation_mask; u8 rsvd1; u8 retry; @@ -108,7 +122,36 @@ struct mci_command { u8 input_stream_id; u8 rsvd2[3]; u32 scrambling_sequence_index; + u32 frequency_range; } dvbs2_search; + + struct { + u8 tap; + u8 rsvd; + u16 point; + } get_iq_symbol; + + struct { + /* + * Bit 0: 0=VTM/1=SCAN + * Bit 1: Set Gain + */ + u8 flags; + u8 roll_off; + u8 rsvd1; + u8 rsvd2; + u32 frequency; + u32 symbol_rate; /* Only in VTM mode */ + u16 gain; + } sx8_start_iq; + + struct { + /* + * Bit 1:0 = STVVGLNA Gain. + * 0 = AGC, 1 = 0dB, 2 = Minimum, 3 = Maximum + */ + u8 flags; + } sx8_input_enable; }; }; @@ -116,34 +159,49 @@ struct mci_result { union { u32 status_word; struct { - u8 status; - u8 rsvd; + u8 status; + u8 mode; u16 time; }; }; union { u32 result[27]; struct { + /* 1 = DVB-S, 2 = DVB-S2X */ u8 standard; /* puncture rate for DVB-S */ u8 pls_code; - /* 7-6: rolloff, 5-2: rsrvd, 1:short, 0:pilots */ + /* 2-0: rolloff */ u8 roll_off; u8 rsvd; + /* actual frequency in Hz */ u32 frequency; + /* actual symbolrate in Hz */ u32 symbol_rate; + /* channel power in dBm x 100 */ s16 channel_power; + /* band power in dBm x 100 */ s16 band_power; + /* + * SNR in dB x 100 + * Note: negative values are valid in DVB-S2 + */ s16 signal_to_noise; s16 rsvd2; + /* + * Counter for packet errors + * (set to 0 on start command) + */ u32 packet_errors; + /* Bit error rate: PreRS in DVB-S, PreBCH in DVB-S2X */ u32 ber_numerator; u32 ber_denominator; } dvbs2_signal_info; + struct { s16 i; s16 q; - } dvbs2_signal_iq; + } iq_symbol; }; u32 version[4]; };