From: Thomas Mair <thomas.mair86@googlemail.com>
To: Hans-Frieder Vogt <hfvogt@gmx.net>
Cc: linux-media@vger.kernel.org
Subject: Re: [RFC] tuner callback name in RTL28xxu driver
Date: Sun, 06 May 2012 19:40:13 +0200 [thread overview]
Message-ID: <4FA6B77D.3080107@googlemail.com> (raw)
In-Reply-To: <201205061929.30682.hfvogt@gmx.net>
On 06.05.2012 19:29, Hans-Frieder Vogt wrote:
> Thomas,
>
> in your patch for the RTL28xxu you introduce a tuner callback (see below). You
> called the command FC0012_FE_CALLBACK_UHF_ENABLE.
> Since the argument is currently defined to be true if the frequency is below
> 300MHz, i.e. the argument is true if the frequency is a VHF frequency.
> Therefore I would rather recommend to call the command
> ..._FE_CALLBACK_VHF_ENABLE.
> What do you think?
Yes. I changed that 5 times. That is why it ended up wrong.
I am currently resolving your issues and will rename it too in other patches.
> I am just about to send out a patch for the fc0013 tuner, and since this tuner
> has a lot in common with the fc0012, I intend to put the callback definition
> into a separate fc001x-common.h header. I just like to know if you have any
> objections me renaming the callback command.
>
> Cheers,
> Hans-Frieder
>
>> +
>> +
>> +static int rtl2832u_fc0012_tuner_callback(struct dvb_usb_device *d,
>> + int cmd, int arg)
>> +{
>> + int ret;
>> + u8 val;
>> +
>> + deb_info("%s cmd=%d arg=%d", __func__, cmd, arg);
>> + switch (cmd) {
>> + case FC0012_FE_CALLBACK_UHF_ENABLE:
>> + /* set output values */
>> +
>> + ret = rtl28xx_rd_reg(d, SYS_GPIO_DIR, &val);
>> + if (ret)
>> + goto err;
>> +
>> + val &= 0xbf;
>> +
>> + ret = rtl28xx_wr_reg(d, SYS_GPIO_DIR, val);
>> + if (ret)
>> + goto err;
>> +
>> +
>> + ret = rtl28xx_rd_reg(d, SYS_GPIO_OUT_EN, &val);
>> + if (ret)
>> + goto err;
>> +
>> + val |= 0x40;
>> +
>> + ret = rtl28xx_wr_reg(d, SYS_GPIO_OUT_EN, val);
>> + if (ret)
>> + goto err;
>> +
>> +
>> + ret = rtl28xx_rd_reg(d, SYS_GPIO_OUT_VAL, &val);
>> + if (ret)
>> + goto err;
>> +
>> + if (arg)
>> + val &= 0xbf; /* set GPIO6 low */
>> + else
>> + val |= 0x40; /* set GPIO6 high */
>> +
>> +
>> + ret = rtl28xx_wr_reg(d, SYS_GPIO_OUT_VAL, val);
>> + if (ret)
>> + goto err;
>> + break;
>> + default:
>> + ret = -EINVAL;
>> + goto err;
>> + }
>> + return 0;
>> +
>> +err:
>> + err("%s: failed=%d", __func__, ret);
>> +
>> return ret;
>> }
>>
>
> Hans-Frieder Vogt e-mail: hfvogt <at> gmx .dot. net
next prev parent reply other threads:[~2012-05-06 17:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-06 12:46 [PATCH v3 1/3] Modified RTL28xxU driver to work with RTL2832 Thomas Mair
2012-05-06 15:37 ` Hans-Frieder Vogt
2012-05-06 15:45 ` Hans-Frieder Vogt
2012-05-06 16:27 ` Thomas Mair
2012-05-06 17:29 ` [RFC] tuner callback name in RTL28xxu driver Hans-Frieder Vogt
2012-05-06 17:40 ` Thomas Mair [this message]
2012-05-06 18:53 ` [PATCH v4 1/3] Modified RTL28xxU driver to work with RTL2832 Thomas Mair
2012-05-07 7:59 ` [PATCH v3 " Antti Palosaari
2012-05-07 18:38 ` Thomas Mair
2012-05-07 19:28 ` Antti Palosaari
2012-05-07 21:28 ` Hans-Frieder Vogt
2012-05-07 21:48 ` 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=4FA6B77D.3080107@googlemail.com \
--to=thomas.mair86@googlemail.com \
--cc=hfvogt@gmx.net \
--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.