Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1421850ybz; Fri, 1 May 2020 23:04:44 -0700 (PDT) X-Google-Smtp-Source: APiQypLcrfvW/hEcu2UM946+Bk6LpJKe5T82B0Cta4iBLKJWF3UpYQZiCvoypqg88H1li1pz7PNg X-Received: by 2002:a17:906:2548:: with SMTP id j8mr6268824ejb.378.1588399484555; Fri, 01 May 2020 23:04:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588399484; cv=none; d=google.com; s=arc-20160816; b=vMbtzu4NemKcjFlJrl6uakS3ksNAFIEfWzFCRbsT/hhbwwXL2OjiKhZj9z2p774dxb IPbIVRlpMqpusqhbbNaj3hUcnQ1Fa60SEK0jIqI31zRW0L+QfRSTM7xWQ2lbKH2LKxEW CJW4CkHlQSciWfl2y9RLuNURU2NMgMazv6R8v1mCceeBdyZ8VkjhCWAbD3pZWUqD36Ff +tUNxJXI5qAE+Tv9MoL3t/5ldfVvIwbEG5PhTp/9jNVmFKQhJXKOw0qUz0fIam4YxNHg BZTA/B8hgI7DFONr1eemFYSMJmZ2m0R2FR+LrghsJbdXRiD2bS4O+ZKwXBCUz6aKUceS AbYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=MdUn0hWb+A6LD6FFyZRn56fLo3E7FQevzStdYrVeZ3A=; b=sLbRWX4heVAgNOb9CR2Gz8tqA+M0uL7mIq/xZqo8obfDxOls8fEotbbT36rkpwNf3Z LaLCLdl0PCH4T/lgJewtucf2n8h0N5iP6hN3IOyJC6Tu3oE03MtydS8990tOsIw4OAhl BAfjNsfhRMih4b2VY1r4LKm/UKtypIMsOnHrzIm3yem3Als92u0ReWm3d4eqmPBFGvY0 052sgbkXdfnINtpXP4bNyBdwhBsbcvcA7g7f2X1sbpuvXzm4kGBfoJ25DkyUqaaQODdE jbIbBVLddF0Wex8t2HfH03xYdSNZ6k/GfKmitYhyIkpgQak9sPwUvQuGHBhOuxncK7kW o07A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kYEbQx2Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si2949460edw.78.2020.05.01.23.04.21; Fri, 01 May 2020 23:04:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kYEbQx2Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726845AbgEBGCy (ORCPT + 99 others); Sat, 2 May 2020 02:02:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:48920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726468AbgEBGCy (ORCPT ); Sat, 2 May 2020 02:02:54 -0400 Received: from coco.lan (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 639402137B; Sat, 2 May 2020 06:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588399373; bh=X6Pyfnz26T+hJ29/OcUlpITVEM0zBDu0xTBVgr1Bm5A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kYEbQx2Qfw6A2h8FmLpSpJ3fdgdQMJkl5xKb69ugUjEsYdVnVO66/c8tNwZKSEm+W hyjvg0FCHhATdwVklcTu6GQJhziRZpyV8tHDOsDqLWHjT6u4WLxz0sAGo9xYe20ODo GQWsOXAKaH1Rd89ab60jvu0fHPVKFf1yiMcpinOI= Date: Sat, 2 May 2020 08:02:48 +0200 From: Mauro Carvalho Chehab To: "Daniel W. S. Almeida" Cc: sean@mess.org, kstewart@linuxfoundation.org, allison@lohutok.net, tglx@linutronix.de, linux-media@vger.kernel.org, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [RFC, WIP, v4 04/11] media: vidtv: move config structs into a separate header Message-ID: <20200502080248.559cb0b9@coco.lan> In-Reply-To: <20200502032216.197977-5-dwlsalmeida@gmail.com> References: <20200502032216.197977-1-dwlsalmeida@gmail.com> <20200502032216.197977-5-dwlsalmeida@gmail.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sat, 2 May 2020 00:22:09 -0300 "Daniel W. S. Almeida" escreveu: > From: "Daniel W. S. Almeida" > > Move config structs to a common header so they can be used by the bridge > driver and by their respective drivers. > > Signed-off-by: Daniel W. S. Almeida > --- > .../media/test-drivers/vidtv/vidtv_config.h | 35 +++++++++++++++++++ > .../media/test-drivers/vidtv/vidtv_demod.c | 1 + > .../media/test-drivers/vidtv/vidtv_demod.h | 9 ----- > .../media/test-drivers/vidtv/vidtv_tuner.c | 12 ++----- Hmm... We generally use "foo.h" for kAPI definitions (like config structs) and "foo-priv.h" for internal structs used within the driver. So, I would be expecting a "vidtv_tuner.h" with kAPI definitions for "vid_tuner.c" and a "vidtv_demod.h" for kAPI definitions for the "vidtv_demod.c" driver. > 4 files changed, 38 insertions(+), 19 deletions(-) > create mode 100644 drivers/media/test-drivers/vidtv/vidtv_config.h > > diff --git a/drivers/media/test-drivers/vidtv/vidtv_config.h b/drivers/media/test-drivers/vidtv/vidtv_config.h > new file mode 100644 > index 0000000000000..7b95bf2444556 > --- /dev/null > +++ b/drivers/media/test-drivers/vidtv/vidtv_config.h > @@ -0,0 +1,35 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * The Virtual DTV test driver serves as a reference DVB driver and helps > + * validate the existing APIs in the media subsystem. It can also aid > + * developers working on userspace applications. > + * > + * Written by Daniel W. S. Almeida > + */ > + > +#ifndef VIDTV_CONFIG_H > +#define VIDTV_CONFIG_H > + > +#include > +#include > + > +struct vidtv_tuner_config { > + struct dvb_frontend *fe; > + u32 mock_power_up_delay_msec; > + u32 mock_tune_delay_msec; > + u32 vidtv_valid_dvb_t_freqs[8]; > + u32 vidtv_valid_dvb_c_freqs[8]; > + u32 vidtv_valid_dvb_s_freqs[8]; > + u8 max_frequency_shift_hz; > +}; > + > +struct vidtv_demod_config { > + struct dvb_frontend *frontend; > + /* probability of losing the lock due to low snr */ > + u8 drop_tslock_prob_on_low_snr; > + /* probability of recovering when the signal improves */ > + u8 recover_tslock_prob_on_good_snr; > + u8 chosen_delsys; > +}; > + > +#endif //VIDTV_CONFIG_H > diff --git a/drivers/media/test-drivers/vidtv/vidtv_demod.c b/drivers/media/test-drivers/vidtv/vidtv_demod.c > index e5f157e4bbe48..15436e565a7b0 100644 > --- a/drivers/media/test-drivers/vidtv/vidtv_demod.c > +++ b/drivers/media/test-drivers/vidtv/vidtv_demod.c > @@ -19,6 +19,7 @@ > #include > #include > #include "vidtv_demod.h" > +#include "vidtv_config.h" > > MODULE_DESCRIPTION("Virtual DVB Demodulator Driver"); > MODULE_AUTHOR("Daniel W. S. Almeida"); > diff --git a/drivers/media/test-drivers/vidtv/vidtv_demod.h b/drivers/media/test-drivers/vidtv/vidtv_demod.h > index 49c2a43f71661..269855efb77f3 100644 > --- a/drivers/media/test-drivers/vidtv/vidtv_demod.h > +++ b/drivers/media/test-drivers/vidtv/vidtv_demod.h > @@ -21,15 +21,6 @@ struct vidtv_demod_cnr_to_qual_s { > u32 cnr_ok, cnr_good; > }; > > -struct vidtv_demod_config { > - struct dvb_frontend *frontend; > - /* probability of losing the lock due to low snr */ > - u8 drop_tslock_prob_on_low_snr; > - /* probability of recovering when the signal improves */ > - u8 recover_tslock_prob_on_good_snr; > - u8 chosen_delsys; > -}; > - > struct vidtv_demod_state { > struct dvb_frontend frontend; > struct vidtv_demod_config config; > diff --git a/drivers/media/test-drivers/vidtv/vidtv_tuner.c b/drivers/media/test-drivers/vidtv/vidtv_tuner.c > index a790508f935b3..ece4a94b0c3ac 100644 > --- a/drivers/media/test-drivers/vidtv/vidtv_tuner.c > +++ b/drivers/media/test-drivers/vidtv/vidtv_tuner.c > @@ -17,20 +17,12 @@ > #include > #include > > +#include "vidtv_config.h" > + > MODULE_DESCRIPTION("Virtual DTV Tuner"); > MODULE_AUTHOR("Daniel W. S. Almeida"); > MODULE_LICENSE("GPL"); > > -struct vidtv_tuner_config { > - struct dvb_frontend *fe; > - u32 mock_power_up_delay_msec; > - u32 mock_tune_delay_msec; > - u32 vidtv_valid_dvb_t_freqs[8]; > - u32 vidtv_valid_dvb_c_freqs[8]; > - u32 vidtv_valid_dvb_s_freqs[8]; > - u8 max_frequency_shift_hz; > -}; > - > struct vidtv_tuner_cnr_to_qual_s { > /* attempt to use the same values as libdvbv5 */ > u32 modulation; Thanks, Mauro