From: Antti Palosaari <crope@iki.fi>
To: Hans Verkuil <hverkuil@xs4all.nl>, linux-media@vger.kernel.org
Subject: Re: [PATCH 10/13] hackrf: add support for transmitter
Date: Fri, 16 Oct 2015 11:59:37 +0300 [thread overview]
Message-ID: <5620BC79.9040004@iki.fi> (raw)
In-Reply-To: <5620BB1D.3050703@xs4all.nl>
On 10/16/2015 11:53 AM, Hans Verkuil wrote:
> On 09/04/2015 12:06 PM, Hans Verkuil wrote:
>> Hi Antti,
>>
>> Two comments, see below:
>>
>> On 09/01/2015 11:59 PM, Antti Palosaari wrote:
>>> HackRF SDR device has both receiver and transmitter. There is limitation
>>> that receiver and transmitter cannot be used at the same time
>>> (half-duplex operation). That patch implements transmitter support to
>>> existing receiver only driver.
>>>
>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>>> ---
>>> drivers/media/usb/hackrf/hackrf.c | 923 ++++++++++++++++++++++++++------------
>>> 1 file changed, 648 insertions(+), 275 deletions(-)
>>>
>>> diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c
>>> -static unsigned int hackrf_convert_stream(struct hackrf_dev *dev,
>>> - void *dst, void *src, unsigned int src_len)
>>> +void hackrf_copy_stream(struct hackrf_dev *dev, void *dst,
>>
>> Is there any reason 'static' was removed here? It's not used externally as
>> far as I can tell.
>>
>>> + void *src, unsigned int src_len)
>>> {
>>> memcpy(dst, src, src_len);
>>>
>>
>> <snip>
>>
>>> +static int hackrf_s_modulator(struct file *file, void *fh,
>>> + const struct v4l2_modulator *a)
>>> +{
>>> + struct hackrf_dev *dev = video_drvdata(file);
>>> + int ret;
>>> +
>>> + dev_dbg(dev->dev, "index=%d\n", a->index);
>>> +
>>> + if (a->index == 0)
>>> + ret = 0;
>>> + else if (a->index == 1)
>>> + ret = 0;
>>> + else
>>> + ret = -EINVAL;
>>> +
>>> + return ret;
>>> +}
>>
>> Why implement this at all? It's not doing anything. I'd just drop s_modulator
>> support.
>>
>> If there is a reason why you do need it, then simplify it to:
>>
>> return a->index > 1 ? -EINVAL : 0;
>
> Oops, I was wrong. You need this regardless for the simple reason that the spec
> mandates it. And indeed without s_modulator v4l2-compliance will fail.
>
> I've put back this function, but replacing the index check with the one-liner I
> suggested above.
>
> I'm merging this hackrf patch series with that change and a small fix for the
> krobot 'unused intf' warning, so you don't need to do anything.
>
> Thanks for doing this work!
OK, good! Update also documentation changelog / history kernel version
number to one which is correct (~4.0 => 4.4).
regards
Antti
--
http://palosaari.fi/
next prev parent reply other threads:[~2015-10-16 8:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-01 21:59 [PATCHv4 00/13] SDR transmitter API Antti Palosaari
2015-09-01 21:59 ` [PATCH 01/13] v4l2: rename V4L2_TUNER_ADC to V4L2_TUNER_SDR Antti Palosaari
2015-09-01 21:59 ` [PATCH 02/13] v4l2: add RF gain control Antti Palosaari
2015-09-01 21:59 ` [PATCH 03/13] DocBook: document tuner " Antti Palosaari
2015-09-01 21:59 ` [PATCH 04/13] v4l2: add support for SDR transmitter Antti Palosaari
2015-09-17 9:47 ` Hans Verkuil
2015-09-01 21:59 ` [PATCH 05/13] DocBook: document " Antti Palosaari
2015-09-01 21:59 ` [PATCH 06/13] v4l: add type field to v4l2_modulator struct Antti Palosaari
2015-09-01 21:59 ` [PATCH 07/13] DocBook: add modulator type field Antti Palosaari
2015-09-04 10:40 ` Hans Verkuil
2015-09-01 21:59 ` [PATCH 08/13] hackrf: add control for RF amplifier Antti Palosaari
2015-09-01 21:59 ` [PATCH 09/13] hackrf: switch to single function which configures everything Antti Palosaari
2015-09-01 21:59 ` [PATCH 10/13] hackrf: add support for transmitter Antti Palosaari
2015-09-04 10:06 ` Hans Verkuil
2015-10-16 8:53 ` Hans Verkuil
2015-10-16 8:59 ` Antti Palosaari [this message]
2015-10-16 9:14 ` Hans Verkuil
2015-09-01 21:59 ` [PATCH 11/13] hackrf: do not set human readable name for formats Antti Palosaari
2015-09-01 21:59 ` [PATCH 12/13] DocBook: add SDR specific info to G_TUNER / S_TUNER Antti Palosaari
2015-09-01 21:59 ` [PATCH 13/13] DocBook: add SDR specific info to G_MODULATOR / S_MODULATOR Antti Palosaari
2015-09-04 10:26 ` Hans Verkuil
2015-09-04 19:24 ` 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=5620BC79.9040004@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 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).