Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755047AbdLOHkg (ORCPT ); Fri, 15 Dec 2017 02:40:36 -0500 Received: from mga06.intel.com ([134.134.136.31]:56944 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754380AbdLOHfu (ORCPT ); Fri, 15 Dec 2017 02:35:50 -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,403,1508828400"; d="scan'208";a="158949359" From: Sagar Arun Kamble To: linux-kernel@vger.kernel.org Cc: Sagar Arun Kamble , Richard Cochran , Jaroslav Kysela , Takashi Iwai , Thomas Gleixner , Vinod Koul , alsa-devel@alsa-project.org Subject: [PATCH 15/27] ALSA: hda - Use timecounter_initialize interface Date: Fri, 15 Dec 2017 13:08:30 +0530 Message-Id: <1513323522-15021-16-git-send-email-sagar.a.kamble@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com> References: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1717 Lines: 53 With new interface timecounter_initialize we can initialize timecounter fields and underlying cyclecounter together. Update azx timecounter init with this new function. Signed-off-by: Sagar Arun Kamble Cc: Richard Cochran Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Thomas Gleixner Cc: Vinod Koul Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org --- sound/hda/hdac_stream.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c index 9426c1a..ad91dde 100644 --- a/sound/hda/hdac_stream.c +++ b/sound/hda/hdac_stream.c @@ -477,12 +477,8 @@ static void azx_timecounter_init(struct hdac_stream *azx_dev, bool force, u64 last) { struct timecounter *tc = &azx_dev->tc; - struct cyclecounter *cc = &azx_dev->tc.cc; u64 nsec; - cc->read = azx_cc_read; - cc->mask = CLOCKSOURCE_MASK(32); - /* * Converting from 24 MHz to ns means applying a 125/3 factor. * To avoid any saturation issues in intermediate operations, @@ -493,11 +489,13 @@ static void azx_timecounter_init(struct hdac_stream *azx_dev, * overflows occur after about 4 hours or less, not a option. */ - cc->mult = 125; /* saturation after 195 years */ - cc->shift = 0; - nsec = 0; /* audio time is elapsed time since trigger */ - timecounter_init(tc, nsec); + timecounter_initialize(tc, + azx_cc_read, + CLOCKSOURCE_MASK(32), + 125, /* saturation after 195 years */ + 0, + nsec); if (force) { /* * force timecounter to use predefined value, -- 1.9.1