From: Marek Vasut <marex@denx.de>
To: Traut Manuel LCPF-CH <Manuel.Traut@mt.com>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Frieder Schrempf" <frieder.schrempf@kontron.de>,
"Thierry Reding" <thierry.reding@gmail.com>,
"linux-pwm@vger.kernel.org" <linux-pwm@vger.kernel.org>
Subject: Re: AW: AW: [PATCH] Input: pwm-beeper - Support volume setting via sysfs
Date: Mon, 15 May 2023 19:28:50 +0200 [thread overview]
Message-ID: <d77e8c22-27af-b0c3-df76-59adb6a2d678@denx.de> (raw)
In-Reply-To: <AS8PR03MB76216EADE882B038464E9E76FA789@AS8PR03MB7621.eurprd03.prod.outlook.com>
On 5/15/23 17:24, Traut Manuel LCPF-CH wrote:
> Hi Marek,
Hi,
>>> I tend to not change existing user-space interfaces. I would prefer to have an additional event or using sysfs.
>> I am increasingly concerned about the race condition between change of volume (via sysfs) and frequency (via SND_TONE) . So I would be banking toward additional event, like SND_TONE_WITH_VOLUME or something along those lines.
>
> SND_TONE_WITH_VOLUME is also ok from my side. But implementing some locking shall also be possible.
>
>>>> NOTE: This uses approach similar to [1], except it is much simpler.
>>>> [1]
>>>> https://patchwork.kernel.org/project/linux-input/cover/20230201152128
>>>> .614439-1-manuel.traut@mt.com/
>>>
>>> This one is more complex, because the mapping between duty cycle and volume is not linear. Probably it depends also on the used beeper hardware which values are doing a significant change in volume. Therefore the patchset introduced a mapping between volume levels and duty cycle times in the device-tree to allow user-space applications to control the beeper volume hardware independently.
>
>> I wonder whether this mapping shouldn't be considered policy and left to userspace to deal with, instead of swamping the kernel or DT with it ?
> How could a Linux distribution detect which mapping is required to be installed?
> For me it seems to be easier to have the device-specific information in the device-tree.
The alternative might be to have volume in 0..65535 range (i.e. the top
16 MSbits) and be done with it, then the PWM subsystem is responsible
for mapping this to 0..50% of PWM duty cycle .
next prev parent reply other threads:[~2023-05-15 17:32 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-12 18:55 [PATCH] Input: pwm-beeper - Support volume setting via sysfs Marek Vasut
2023-05-13 1:12 ` Jeff LaBundy
2023-05-13 1:51 ` Marek Vasut
2023-05-13 21:02 ` Marek Vasut
2023-07-31 5:36 ` Dmitry Torokhov
2023-07-31 6:21 ` Takashi Iwai
2023-07-31 11:49 ` Marek Vasut
2023-07-31 12:15 ` Takashi Iwai
2023-07-31 14:05 ` Marek Vasut
2023-07-31 14:20 ` Takashi Iwai
2023-07-31 14:36 ` Marek Vasut
2023-07-31 16:24 ` Dmitry Torokhov
2023-07-31 17:49 ` Marek Vasut
2023-08-01 2:56 ` Jeff LaBundy
2023-08-01 6:11 ` Takashi Iwai
2023-08-01 11:38 ` Marek Vasut
2023-08-01 12:25 ` Takashi Iwai
2023-08-01 7:28 ` Dmitry Torokhov
2023-08-01 11:51 ` Marek Vasut
2023-08-11 4:19 ` Jeff LaBundy
2023-08-11 7:52 ` Takashi Iwai
2023-08-11 10:47 ` Traut Manuel LCPF-CH
2023-08-15 21:33 ` Dmitry Torokhov
2023-08-17 10:50 ` Marek Vasut
2023-08-11 12:39 ` John Watts
2023-08-14 2:26 ` Marek Vasut
2023-05-15 6:50 ` AW: EXTERNAL - " Traut Manuel LCPF-CH
2023-05-15 13:36 ` Marek Vasut
2023-05-15 14:25 ` Jeff LaBundy
2023-05-15 17:27 ` Marek Vasut
2023-05-15 15:24 ` AW: AW: " Traut Manuel LCPF-CH
2023-05-15 17:28 ` Marek Vasut [this message]
2023-06-14 6:45 ` Uwe Kleine-König
2023-06-14 9:30 ` Marek Vasut
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=d77e8c22-27af-b0c3-df76-59adb6a2d678@denx.de \
--to=marex@denx.de \
--cc=Manuel.Traut@mt.com \
--cc=dmitry.torokhov@gmail.com \
--cc=frieder.schrempf@kontron.de \
--cc=linux-input@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/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).