From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750816AbdBNFCa (ORCPT ); Tue, 14 Feb 2017 00:02:30 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:45640 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750708AbdBNFC3 (ORCPT ); Tue, 14 Feb 2017 00:02:29 -0500 X-Auth-Info: 3etL6moI/s3Cjd5Lfyc2XPgXoViYPHKy7rgqATA49NM= Subject: Re: [PATCH] Input: pwm-beeper: support customized freq for SND_BELL To: Dmitry Torokhov References: <1486444894-18321-1-git-send-email-hs@denx.de> <20170207181309.GC38092@dtor-ws> <850c2508720a41b3bfb95cd7093433a4@SI-MBX1030.de.bosch.com> <20170214042748.GC19688@dtor-ws> Cc: "Jonas Mark (ST-FIR/ENG1)" , Heiko Schocher , "linux-input@vger.kernel.org" , "GUAN Ben (ST-FIR/ENG1-Zhu)" , "devicetree@vger.kernel.org" , Thierry Reding , "linux-kernel@vger.kernel.org" , Boris Brezillon , Rob Herring , Manfred Schlaegl , Mark Rutland Reply-To: hs@denx.de From: Heiko Schocher Message-ID: <58A28F5E.1020401@denx.de> Date: Tue, 14 Feb 2017 06:02:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20170214042748.GC19688@dtor-ws> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Dmitry, Am 14.02.2017 um 05:27 schrieb Dmitry Torokhov: > On Wed, Feb 08, 2017 at 10:11:21AM +0000, Jonas Mark (ST-FIR/ENG1) wrote: >> Hello Dmitry, >> >>>> extend the pwm-beeper driver to support customized frequency >>>> for SND_BELL from device tree. >>> >>> No, SND_BELL is literally SND_TONE @1000Hz. There should be no >>> customizing. If applications want to use different frequency then should >>> be using SND_TONE. >> >> We are not aiming for an application shortcut here. Instead, changing >> the bell frequency shall be a system setting. That is, every >> application which wants to make a bell sound shall use the alternative >> frequency. >> >> The reason why we are deviating from the default 1000 Hz is that on >> our hardware we are using a loudspeaker which is rated for 2.7 kHz. >> That is, it will only sound at the specified volume and frequency if >> you feed it with a 2.7 kHz square wave. If you deviate from it, e.g. >> by using 1000 Hz, the output will be dim and squeaky. Worst case, >> SND_BELL would be completely silent on our system. So the only bell >> sound we can reliably generate on our system has 2.7 kHz. > > OK, fair enough. Please address Rob's comments on binding and resend. Done already, just waited for more comments before sending v2. > Also I am not sure why you needed to change the switch statement around, > you only need to replace 1000 with value from the attribute. Hmm.. the resulting code looks cleaner to me ... First we check all the reasons for returning an error code, after that, we can do the functions work ... but I can revert this part ... should I ? > Oh, and please use device_property_*() API instead of of_*(). Thanks! Good tip, changed. bye, Heiko -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany