linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frieder Schrempf <frieder.schrempf@exceet.de>
To: David Lechner <david@lechnology.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: <robh@kernel.org>, <pawel.moll@arm.com>,
	<ijc+devicetree@hellion.org.uk>, <galak@codeaurora.org>,
	<luis@debethencourt.com>, <linux-input@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 0/3] input: pwm-beeper: add feature to set volume level
Date: Fri, 17 Feb 2017 11:01:47 +0100	[thread overview]
Message-ID: <4e1df881-0183-933e-4443-601729700f0c@exceet.de> (raw)
In-Reply-To: <5fc04e9d-7a92-2a34-e9cc-679106481e32@lechnology.com>

On 16.02.2017 22:44, David Lechner wrote:
> On 02/16/2017 03:15 PM, Frieder Schrempf wrote:
>> Hello David,
>>
>> On 20.01.2017 20:11, David Lechner wrote:
>>> On 01/19/2017 03:37 PM, Dmitry Torokhov wrote:
>>>> On Thu, Jan 19, 2017 at 04:24:07PM +0100, Frieder Schrempf wrote:
>>>>> Make the driver accept switching volume levels via sysfs.
>>>>> This can be helpful if the beep/bell sound intensity needs
>>>>> to be adapted to the environment of the device.
>>>>>
>>>>> The number of volume levels available and their values can
>>>>> be specified via device tree (similar to pwm-backlight).
>>>>>
>>>>> The volume adjustment is done by changing the duty cycle of
>>>>> the pwm signal.
>>>>
>>>> I wonder how this all will mesh up with beepers that have dedicated
>>>> amplifiers (support is being added by David Lechner).
>>>
>>> This will work very well with it. I fact, it is a feature I would like
>>> to have but I was not sure about a good way to implement it. Please Cc:
>>> me on future revisions of this series and I will be glad to test it.
>>
>> I have just send v4.
>>>
>>> One thing that would be nice would be for a more generic way to change
>>> the volume from userspace. Having a sysfs attribute on the platform
>>> device will work, but it requires very specific knowledge from any
>>> userspace program that wants to control the volume. Would it be possible
>>> to add an alsa mixer volume control or something like that?
>>
>> An alsa mixer control for the pwm-beeper volume sounds nice, but
>> unfortunately I have no idea how one would implement this, or if this is
>> even possible.
>>>
>
>
> I know it is possible because I have done it. ;-)
>
> https://github.com/ev3dev/lego-linux-drivers/blob/master/evb/evb_sound.c
>
> The driver in the link above does PCM playback using PWM. But, it also
> included an input device similar to pwm-beeper and it includes an ALSA
> volume control specifically for the beeper.

Aha, thanks. Doesn't look too complicated. I think I will play with this 
a bit, when I have time. So maybe the sysfs volume control can be 
replaced with a proper volume mixer control at some point.

  reply	other threads:[~2017-02-17 10:01 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 15:58 [PATCH 1/1] input: pwm-beeper: add feature to set volume via sysfs Schrempf Frieder
2016-04-11 15:21 ` Rob Herring
2016-10-07  9:00   ` Schrempf Frieder
2016-10-07  9:08     ` [PATCH v2 0/3] input: pwm-beeper: add feature to set volume level Schrempf Frieder
2016-10-07  9:08       ` [PATCH v2 1/3] input: pwm-beeper: add feature to set volume via sysfs Schrempf Frieder
2016-10-07  9:08       ` [PATCH v2 2/3] input: pwm-beeper: add documentation for volume devicetree bindings Schrempf Frieder
2016-10-10 15:20         ` Rob Herring
2016-10-11  8:17           ` Schrempf Frieder
2016-10-11 13:39             ` Rob Herring
2017-01-19 14:40               ` Frieder Schrempf
2017-01-19 15:24                 ` [PATCH v3 0/3] input: pwm-beeper: add feature to set volume level Frieder Schrempf
2017-01-19 15:24                   ` [PATCH v3 1/3] input: pwm-beeper: add feature to set volume via sysfs Frieder Schrempf
2017-01-19 21:29                     ` Dmitry Torokhov
2017-02-16 20:37                       ` Frieder Schrempf
2017-01-19 15:24                   ` [PATCH v3 2/3] input: pwm-beeper: add documentation for volume devicetree bindings Frieder Schrempf
2017-01-23 14:40                     ` Rob Herring
2017-01-19 15:24                   ` [PATCH v3 3/3] input: pwm-beeper: add devicetree bindings to set volume levels Frieder Schrempf
2017-01-19 21:30                     ` Dmitry Torokhov
2017-02-16 20:40                       ` Frieder Schrempf
2017-01-19 21:37                   ` [PATCH v3 0/3] input: pwm-beeper: add feature to set volume level Dmitry Torokhov
2017-01-20 19:11                     ` David Lechner
2017-02-16 21:15                       ` Frieder Schrempf
2017-02-16 21:44                         ` David Lechner
2017-02-17 10:01                           ` Frieder Schrempf [this message]
2017-02-16 21:08                   ` [PATCH v4 " Frieder Schrempf
2017-02-16 21:08                     ` [PATCH v4 1/3] input: pwm-beeper: add feature to set volume via sysfs Frieder Schrempf
2017-02-16 21:08                     ` [PATCH v4 2/3] input: pwm-beeper: add documentation for volume devicetree bindings Frieder Schrempf
2017-02-16 21:08                     ` [PATCH v4 3/3] input: pwm-beeper: add devicetree bindings to set volume levels Frieder Schrempf
2017-02-16 23:07                       ` kbuild test robot
2017-02-17  0:14                       ` kbuild test robot
2017-02-17  9:54                     ` [PATCH v5 0/3] input: pwm-beeper: add feature to set volume level Frieder Schrempf
2017-02-17  9:54                       ` [PATCH v5 1/3] input: pwm-beeper: add feature to set volume via sysfs Frieder Schrempf
2017-02-17  9:54                       ` [PATCH v5 2/3] input: pwm-beeper: add documentation for volume devicetree bindings Frieder Schrempf
2017-02-17  9:54                       ` [PATCH v5 3/3] input: pwm-beeper: add devicetree bindings to set volume levels Frieder Schrempf
2016-10-07  9:08       ` [PATCH v2 " Schrempf Frieder

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=4e1df881-0183-933e-4443-601729700f0c@exceet.de \
    --to=frieder.schrempf@exceet.de \
    --cc=david@lechnology.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luis@debethencourt.com \
    --cc=pawel.moll@arm.com \
    --cc=robh@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).