linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>
Cc: kstewart@linuxfoundation.org, sean@mess.org,
	linux-kernel@vger.kernel.org, tglx@linutronix.de,
	linux-kernel-mentees@lists.linuxfoundation.org,
	allison@lohutok.net, linux-media@vger.kernel.org
Subject: Re: [Linux-kernel-mentees] [RFC, WIP, v4 04/11] media: vidtv: move config structs into a separate header
Date: Sat, 2 May 2020 08:02:48 +0200	[thread overview]
Message-ID: <20200502080248.559cb0b9@coco.lan> (raw)
In-Reply-To: <20200502032216.197977-5-dwlsalmeida@gmail.com>

Em Sat,  2 May 2020 00:22:09 -0300
"Daniel W. S. Almeida" <dwlsalmeida@gmail.com> escreveu:

> From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>
> 
> 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 <dwlsalmeida@gmail.com>
> ---
>  .../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 <dwlsalmeida@gmail.com>
> + */
> +
> +#ifndef VIDTV_CONFIG_H
> +#define VIDTV_CONFIG_H
> +
> +#include <linux/types.h>
> +#include <media/dvb_frontend.h>
> +
> +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 <linux/i2c.h>
>  #include <media/dvb_frontend.h>
>  #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 <linux/types.h>
>  #include <media/dvb_frontend.h>
>  
> +#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
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  reply	other threads:[~2020-05-02  6:02 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02  3:22 [Linux-kernel-mentees] [RFC, WIP, v4 00/11] media: vidtv: implement a virtual DVB driver Daniel W. S. Almeida
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 01/11] media: vidtv: add Kconfig entry Daniel W. S. Almeida
2020-05-02  4:58   ` Mauro Carvalho Chehab
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 02/11] media: vidtv: implement a tuner driver Daniel W. S. Almeida
2020-05-02  5:27   ` Mauro Carvalho Chehab
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 03/11] media: vidtv: implement a demodulator driver Daniel W. S. Almeida
2020-05-02  5:58   ` Mauro Carvalho Chehab
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 04/11] media: vidtv: move config structs into a separate header Daniel W. S. Almeida
2020-05-02  6:02   ` Mauro Carvalho Chehab [this message]
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 05/11] media: vidtv: add a bridge driver Daniel W. S. Almeida
2020-05-02  6:30   ` Mauro Carvalho Chehab
2020-05-02 21:12     ` Daniel W. S. Almeida
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 06/11] media: vidtv: add wrappers for memcpy and memset Daniel W. S. Almeida
2020-05-02  6:40   ` Mauro Carvalho Chehab
2020-05-03  7:06     ` Mauro Carvalho Chehab
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 07/11] media: vidtv: add MPEG TS common code Daniel W. S. Almeida
2020-05-02  7:09   ` Mauro Carvalho Chehab
2020-05-02 22:22     ` Daniel W. S. Almeida
2020-05-03  9:50       ` Mauro Carvalho Chehab
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 08/11] media: vidtv: implement a PSI generator Daniel W. S. Almeida
2020-05-03  7:51   ` Mauro Carvalho Chehab
2020-05-06  6:28     ` Daniel W. S. Almeida
2020-05-06  8:36       ` Mauro Carvalho Chehab
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 09/11] media: vidtv: implement a PES packetizer Daniel W. S. Almeida
2020-05-03  8:16   ` Mauro Carvalho Chehab
2020-05-06  6:55     ` Daniel W. S. Almeida
2020-05-06  8:59       ` Mauro Carvalho Chehab
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 10/11] media: vidtv: Implement a SMPTE 302M encoder Daniel W. S. Almeida
2020-05-03  8:57   ` Mauro Carvalho Chehab
2020-05-02  3:22 ` [Linux-kernel-mentees] [RFC, WIP, v4 11/11] media: vidtv: Add a MPEG Transport Stream Multiplexer Daniel W. S. Almeida
2020-05-03  9:13   ` Mauro Carvalho Chehab
2020-05-06  7:05     ` Daniel W. S. Almeida
2020-05-06  9:01       ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200502080248.559cb0b9@coco.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=allison@lohutok.net \
    --cc=dwlsalmeida@gmail.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sean@mess.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).