All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org
Subject: Re: [REVIEW PATCH 13/16] rtl2832_sdr: expose e4000 controls to user
Date: Wed, 26 Feb 2014 18:52:02 +0200	[thread overview]
Message-ID: <530E1BB2.6000203@iki.fi> (raw)
In-Reply-To: <52FE3004.7000700@xs4all.nl>

On 14.02.2014 17:02, Hans Verkuil wrote:
> On 02/11/2014 03:04 AM, Antti Palosaari wrote:
>> E4000 tuner driver provides now some controls. Expose those to
>> userland.
>>
>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>> ---
>>   drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c | 10 ++++++----
>>   1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c b/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c
>> index 9265424..18f8c56 100644
>> --- a/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c
>> +++ b/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c
>> @@ -25,6 +25,7 @@
>>   #include "dvb_frontend.h"
>>   #include "rtl2832_sdr.h"
>>   #include "dvb_usb.h"
>> +#include "e4000.h"
>>
>>   #include <media/v4l2-device.h>
>>   #include <media/v4l2-ioctl.h>
>> @@ -1347,6 +1348,7 @@ struct dvb_frontend *rtl2832_sdr_attach(struct dvb_frontend *fe,
>>   	struct rtl2832_sdr_state *s;
>>   	const struct v4l2_ctrl_ops *ops = &rtl2832_sdr_ctrl_ops;
>>   	struct dvb_usb_device *d = i2c_get_adapdata(i2c);
>> +	struct v4l2_ctrl_handler *hdl;
>>
>>   	s = kzalloc(sizeof(struct rtl2832_sdr_state), GFP_KERNEL);
>>   	if (s == NULL) {
>> @@ -1386,10 +1388,10 @@ struct dvb_frontend *rtl2832_sdr_attach(struct dvb_frontend *fe,
>>   	/* Register controls */
>>   	switch (s->cfg->tuner) {
>>   	case RTL2832_TUNER_E4000:
>> -		v4l2_ctrl_handler_init(&s->hdl, 2);
>> -		s->bandwidth_auto = v4l2_ctrl_new_std(&s->hdl, ops, V4L2_CID_BANDWIDTH_AUTO, 0, 1, 1, 1);
>> -		s->bandwidth = v4l2_ctrl_new_std(&s->hdl, ops, V4L2_CID_BANDWIDTH, 4300000, 11000000, 100000, 4300000);
>> -		v4l2_ctrl_auto_cluster(2, &s->bandwidth_auto, 0, false);
>> +		hdl = e4000_get_ctrl_handler(fe);
>> +		v4l2_ctrl_handler_init(&s->hdl, 0);
>
> Use the same number as is used in e4000: 8.
>
> It's a hint of the number of controls that the handler will contain and it affects
> the number of buckets used for the hash table. Putting in a 0 will result in a single
> bucket which means that all controls end up in a single linked list. Changing it to
> 8 will result in two buckets, which performs a bit better.

OK. I was thinking that if I add handler to handler, I don't need to 
take into account how many controls the tuner handler has. Before you 
ask why there is 2 handlers merged, other having 0 controls, I left it 
that way I can add ADC controls later.

I am now going through that whole SDR patch serie and I will likely post 
fixed version tonight.

regards
Antti

-- 
http://palosaari.fi/

  reply	other threads:[~2014-02-26 16:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11  2:04 [REVIEW PATCH 00/16] SDR API - drivers Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 01/16] e4000: convert DVB tuner to I2C driver model Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 02/16] e4000: implement controls via v4l2 control framework Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 03/16] e4000: fix PLL calc to allow higher frequencies Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 04/16] e4000: implement PLL lock v4l control Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 05/16] e4000: get rid of DVB i2c_gate_ctrl() Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 06/16] e4000: convert to Regmap API Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 07/16] e4000: rename some variables Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 08/16] rtl2832_sdr: Realtek RTL2832 SDR driver module Antti Palosaari
2014-02-14 14:57   ` Hans Verkuil
2014-02-27  0:42     ` Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 09/16] rtl28xxu: constify demod config structs Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 10/16] rtl28xxu: attach SDR extension module Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 11/16] rtl28xxu: fix switch-case style issue Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 12/16] rtl28xxu: use muxed RTL2832 I2C adapters for E4000 and RTL2832_SDR Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 13/16] rtl2832_sdr: expose e4000 controls to user Antti Palosaari
2014-02-14 15:02   ` Hans Verkuil
2014-02-26 16:52     ` Antti Palosaari [this message]
2014-02-11  2:04 ` [REVIEW PATCH 14/16] r820t: add manual gain controls Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 15/16] rtl2832_sdr: expose R820T controls to user Antti Palosaari
2014-02-11  2:04 ` [REVIEW PATCH 16/16] MAINTAINERS: add rtl2832_sdr driver Antti Palosaari
2014-02-11  7:57 ` [REVIEW PATCH 00/16] SDR API - drivers Hans Verkuil
  -- strict thread matches above, loose matches on Subject: below --
2014-02-27  0:30 [REVIEW PATCH 00/16] SDR API - Realtek RTL2832 SDR driver Antti Palosaari
2014-02-27  0:30 ` [REVIEW PATCH 13/16] rtl2832_sdr: expose e4000 controls to user 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=530E1BB2.6000203@iki.fi \
    --to=crope@iki.fi \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.