Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751235AbeABRPj (ORCPT + 1 other); Tue, 2 Jan 2018 12:15:39 -0500 Received: from mga14.intel.com ([192.55.52.115]:52815 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbeABRPi (ORCPT ); Tue, 2 Jan 2018 12:15:38 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,498,1508828400"; d="scan'208";a="6888611" Subject: Re: [alsa-devel] [PATCH 15/27] ALSA: hda - Use timecounter_initialize interface To: Sagar Arun Kamble , Richard Cochran Cc: Takashi Iwai , Vinod Koul , alsa-devel@alsa-project.org, Thomas Gleixner , linux-kernel@vger.kernel.org References: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com> <1513323522-15021-16-git-send-email-sagar.a.kamble@intel.com> <20171215165125.avkz25eek56i5md4@localhost> <20171228164944.crphv46zegvwautk@localhost> <1a9a1507-7ca3-459b-c2ce-02fc2afad2ff@intel.com> From: Pierre-Louis Bossart Message-ID: <3c5734a2-8f97-4a8b-26d4-42852cc86352@linux.intel.com> Date: Tue, 2 Jan 2018 11:15:45 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1a9a1507-7ca3-459b-c2ce-02fc2afad2ff@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 1/2/18 12:03 AM, Sagar Arun Kamble wrote: > > > On 12/28/2017 10:19 PM, Richard Cochran wrote: >> On Tue, Dec 26, 2017 at 01:07:35PM +0530, Sagar Arun Kamble wrote: >>>> Or can we provide simpler versions for covering some defaults?  At >>>> least reducing the number of arguments would make things easier. >>> Thought about specifying 1. cyclecounter read func 2. frequency 3. >>> width of >>> counter as parameters here >>> which can get rid of mult, shift params. But this is not easy as most >>> of the >>> drivers do not specify >>> cyclecounter frequency and instead hard-code the mult/shift factors. >> You are talking about using clocks_calc_mult_shift() here, right? (See >> the usage example in drivers/net/ethernet/ti/cpts.c). > Yes >> This is a good idea, and it is worth getting the driver authors' input >> to figure out the correct parameters. I wrote the code for HDaudio and I remember wasting time trying to figure out the gory details of the cycle counter stuff when all I wanted was a conversion from a 24MHz counter to ns values using a 125/3 operation in the right order - as explained in the comments If there was a helper to set those mult/shift values it'd make the HDaudio code clearer (and also help support newer modes of operation with a 12 and 6 MHz MCLK). The initial proposal with hard-coded values in arguments instead of structure members didn't really make the code clearer. >> >> I bet we can use that almost everywhere.  If there are any drivers >> that cannot be converted, then we can leave some sort of low level >> legacy initialization method. > Agree >> Thanks, >> Richard >> > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel