From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753211AbdATTLH (ORCPT ); Fri, 20 Jan 2017 14:11:07 -0500 Received: from vern.gendns.com ([206.190.152.46]:55057 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752961AbdATTLF (ORCPT ); Fri, 20 Jan 2017 14:11:05 -0500 Subject: Re: [PATCH v3 0/3] input: pwm-beeper: add feature to set volume level To: Dmitry Torokhov , Frieder Schrempf References: <0e2dec4d-7550-9495-f12a-020391183304@exceet.de> <20170119213700.GC13542@dtor-ws> 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 From: David Lechner Message-ID: <43679b65-8710-4255-2006-8c47dd755497@lechnology.com> Date: Fri, 20 Jan 2017 13:11:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170119213700.GC13542@dtor-ws> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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?