public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: [REVIEW PATCH 02/16] e4000: implement controls via v4l2 control framework
Date: Thu, 13 Mar 2014 17:17:50 +0200	[thread overview]
Message-ID: <5321CC1E.3080509@iki.fi> (raw)
In-Reply-To: <20140313105727.43c3d689@samsung.com>

On 13.03.2014 15:57, Mauro Carvalho Chehab wrote:
> Em Thu, 27 Feb 2014 02:30:11 +0200
> Antti Palosaari <crope@iki.fi> escreveu:
>
>> Implement gain and bandwidth controls using v4l2 control framework.
>> Pointer to control handler is provided by exported symbol.
>>
>> Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
>> Cc: Hans Verkuil <hverkuil@xs4all.nl>
>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>> ---
>>   drivers/media/tuners/e4000.c      | 210 +++++++++++++++++++++++++++++++++++++-
>>   drivers/media/tuners/e4000.h      |  14 +++
>>   drivers/media/tuners/e4000_priv.h |  75 ++++++++++++++
>>   3 files changed, 298 insertions(+), 1 deletion(-)
>
> ...
>> diff --git a/drivers/media/tuners/e4000.h b/drivers/media/tuners/e4000.h
>> index e74b8b2..989f2ea 100644
>> --- a/drivers/media/tuners/e4000.h
>> +++ b/drivers/media/tuners/e4000.h
>> @@ -40,4 +40,18 @@ struct e4000_config {
>>   	u32 clock;
>>   };
>>
>> +#if IS_ENABLED(CONFIG_MEDIA_TUNER_E4000)
>> +extern struct v4l2_ctrl_handler *e4000_get_ctrl_handler(
>> +		struct dvb_frontend *fe
>> +);
>> +#else
>> +static inline struct v4l2_ctrl_handler *e4000_get_ctrl_handler(
>> +		struct dvb_frontend *fe
>> +)
>> +{
>> +	pr_warn("%s: driver disabled by Kconfig\n", __func__);
>> +	return NULL;
>> +}
>> +#endif
>> +
>>   #endif
>
> There are two things to be noticed here:
>
> 1) Please don't add any EXPORT_SYMBOL() on a pure I2C module. You
> should, instead, use the subdev calls, in order to callback a
> function provided by the module;

That means, I have to implement it as a V4L subdev driver then...

Is there any problem to leave as it is? It just only provides control 
handler using that export. If you look those existing dvb frontend or 
tuner drivers there is many kind of resources exported just similarly 
(example DibCom PID filters, af9033 pid filters), so I cannot see why 
that should be different.

> 2) As you're now using request_module(), you don't need to use
> #if IS_ENABLED() anymore. It is up to the module to register
> itself as a V4L2 subdevice. The caller module should use the
> subdevice interface to run the callbacks.
>
> If you don't to that, you'll have several issues with the
> building system.

So basically you are saying I should implement that driver as a V4L 
subdev too?

regards
Antti

-- 
http://palosaari.fi/

  reply	other threads:[~2014-03-13 15:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27  0:30 [REVIEW PATCH 00/16] SDR API - Realtek RTL2832 SDR driver Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 01/16] e4000: convert DVB tuner to I2C driver model Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 02/16] e4000: implement controls via v4l2 control framework Antti Palosaari
2014-03-13 13:57   ` Mauro Carvalho Chehab
2014-03-13 15:17     ` Antti Palosaari [this message]
2014-03-13 16:05       ` Antti Palosaari
2014-03-13 16:40       ` Mauro Carvalho Chehab
2014-02-27  0:30 ` [REVIEW PATCH 03/16] e4000: fix PLL calc to allow higher frequencies Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 04/16] e4000: implement PLL lock v4l control Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 05/16] e4000: get rid of DVB i2c_gate_ctrl() Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 06/16] e4000: convert to Regmap API Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 07/16] e4000: rename some variables Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 08/16] rtl2832_sdr: Realtek RTL2832 SDR driver module Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 09/16] rtl28xxu: constify demod config structs Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 10/16] rtl28xxu: attach SDR extension module Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 11/16] rtl28xxu: fix switch-case style issue Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 12/16] rtl28xxu: use muxed RTL2832 I2C adapters for E4000 and RTL2832_SDR Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 13/16] rtl2832_sdr: expose e4000 controls to user Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 14/16] r820t: add manual gain controls Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 15/16] rtl2832_sdr: expose R820T controls to user Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 16/16] MAINTAINERS: add rtl2832_sdr driver Antti Palosaari
  -- strict thread matches above, loose matches on Subject: below --
2014-02-11  2:04 [REVIEW PATCH 00/16] SDR API - drivers Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 02/16] e4000: implement controls via v4l2 control framework Antti Palosaari

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=5321CC1E.3080509@iki.fi \
    --to=crope@iki.fi \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    /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