From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754710AbbIIDQ1 (ORCPT ); Tue, 8 Sep 2015 23:16:27 -0400 Received: from nasmtp01.atmel.com ([192.199.1.245]:10300 "EHLO DVREDG01.corp.atmel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753283AbbIIDQT (ORCPT ); Tue, 8 Sep 2015 23:16:19 -0400 Subject: Re: [PATCH 1/2] ASoC: atmel-classd: add the Audio Class D Amplifier code To: Mark Brown References: <1441086101-15303-1-git-send-email-songjun.wu@atmel.com> <1441086101-15303-2-git-send-email-songjun.wu@atmel.com> <20150903113716.GU12027@sirena.org.uk> <55EC0AF5.8060403@atmel.com> <20150907162350.GV5313@sirena.org.uk> <55EEAC01.3080409@atmel.com> <20150908122322.GB9751@sirena.org.uk> CC: , , , , , , , , , , , , From: "Wu, Songjun" Organization: ATMEL Message-ID: <55EFA478.1000109@atmel.com> Date: Wed, 9 Sep 2015 11:16:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150908122322.GB9751@sirena.org.uk> 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 On 9/8/2015 20:23, Mark Brown wrote: > On Tue, Sep 08, 2015 at 05:36:01PM +0800, Wu, Songjun wrote: >> On 9/8/2015 00:23, Mark Brown wrote: > >>> OK, so that's not actually what the code was doing - it had separate >>> enums for bass, mid and treble. If you make this a single enum with all >>> the above options in it that seems like the best way of handling things. > >> A single enum seems not very friendly to user, there are tree EQs, bass, >> medium and treble. >> So I create tree enum controls to control three EQs. >> The 'get' function is replaced by 'classd_get_eq_enum', if user operates one >> of the tree EQ controls, the other two EQs will show 0 dB. > > If you want to have three controls you need to write code so that the > user can only change one of them from 0dB at once, returning an error > otherwise. That was why it looked like they were three separate > controls. > If user operates two or tree controls at the same time, for my understanding, these operations are serial actually in kernel, not parallel, and the last operation will be effective. I only write the function 'classd_get_eq_enum' to get the enumeration value, if user changes one of controls, the other controls will get 0dB. Is my understanding correct?