From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
To: Marcel Hasler <mahasler@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media <linux-media@vger.kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: [PATCH v2 3/3] stk1160: Add module param for setting the record gain.
Date: Sat, 26 Nov 2016 12:08:45 -0300 [thread overview]
Message-ID: <CAAEAJfCfT3MrneZosWBvd5AFatMUBqcKo088YmCMN9oKPhsfVw@mail.gmail.com> (raw)
In-Reply-To: <CAOJOY2OBcdhf+CKuP9wQQ9FiyHCmCUL5ugCTqmF7gyGJ9hd5TA@mail.gmail.com>
On 26 November 2016 at 10:52, Marcel Hasler <mahasler@gmail.com> wrote:
> 2016-11-20 18:36 GMT+01:00 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>:
>> On 27 October 2016 at 17:35, Marcel Hasler <mahasler@gmail.com> wrote:
>>> Allow setting a custom record gain for the internal AC97 codec (if available). This can be
>>> a value between 0 and 15, 8 is the default and should be suitable for most users. The Windows
>>> driver also sets this to 8 without any possibility for changing it.
>>>
>>> Signed-off-by: Marcel Hasler <mahasler@gmail.com>
>>> ---
>>> drivers/media/usb/stk1160/stk1160-ac97.c | 11 ++++++++++-
>>> 1 file changed, 10 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/media/usb/stk1160/stk1160-ac97.c b/drivers/media/usb/stk1160/stk1160-ac97.c
>>> index 6dbc39f..31bdd60d 100644
>>> --- a/drivers/media/usb/stk1160/stk1160-ac97.c
>>> +++ b/drivers/media/usb/stk1160/stk1160-ac97.c
>>> @@ -25,6 +25,11 @@
>>> #include "stk1160.h"
>>> #include "stk1160-reg.h"
>>>
>>> +static u8 gain = 8;
>>> +
>>> +module_param(gain, byte, 0444);
>>> +MODULE_PARM_DESC(gain, "Set capture gain level if AC97 codec is available (0-15, default: 8)");
>>> +
>>> static void stk1160_write_ac97(struct stk1160 *dev, u16 reg, u16 value)
>>> {
>>> /* Set codec register address */
>>> @@ -122,7 +127,11 @@ void stk1160_ac97_setup(struct stk1160 *dev)
>>> stk1160_write_ac97(dev, 0x16, 0x0808); /* Aux volume */
>>> stk1160_write_ac97(dev, 0x1a, 0x0404); /* Record select */
>>> stk1160_write_ac97(dev, 0x02, 0x0000); /* Master volume */
>>> - stk1160_write_ac97(dev, 0x1c, 0x0808); /* Record gain */
>>> +
>>> + /* Record gain */
>>> + gain = (gain > 15) ? 15 : gain;
>>> + stk1160_info("Setting capture gain to %d.", gain);
>>
>> This message doesn't add anything useful, can we drop it?
>>
>
> I think it would make sense to have some kind of feedback, at least
> when the default value has been overridden. How about making this
> conditional?
>
Well, if the user passes a gain, requesting a non-default value, it is
expected that the gain be set by the driver. So printing a message
for something that is just as expected as "the driver will set the
parameter you told him to set".
User messages should only be printed when *unexpected* or otherwise
relevant events happen.
--
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
prev parent reply other threads:[~2016-11-26 15:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1477592284.git.mahasler@gmail.com>
2016-10-27 20:34 ` [PATCH v2 1/3] stk1160: Remove stk1160-mixer and setup internal AC97 codec automatically Marcel Hasler
2016-11-20 17:36 ` Ezequiel Garcia
2016-11-26 13:38 ` Marcel Hasler
2016-11-26 15:04 ` Ezequiel Garcia
2016-10-27 20:34 ` [PATCH v2 2/3] stk1160: Check whether to use AC97 codec or internal ADC Marcel Hasler
2016-11-20 17:36 ` Ezequiel Garcia
2016-11-26 13:49 ` Marcel Hasler
2016-10-27 20:35 ` [PATCH v2 3/3] stk1160: Add module param for setting the record gain Marcel Hasler
2016-11-20 17:36 ` Ezequiel Garcia
2016-11-26 13:52 ` Marcel Hasler
2016-11-26 15:08 ` Ezequiel Garcia [this message]
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=CAAEAJfCfT3MrneZosWBvd5AFatMUBqcKo088YmCMN9oKPhsfVw@mail.gmail.com \
--to=ezequiel@vanguardiasur.com.ar \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=mahasler@gmail.com \
--cc=mchehab@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).