From patchwork Wed Dec 17 17:29:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Cussins X-Patchwork-Id: 5508541 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 531099F1CD for ; Wed, 17 Dec 2014 17:30:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8635F20A25 for ; Wed, 17 Dec 2014 17:30:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B74C820A22 for ; Wed, 17 Dec 2014 17:30:34 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A641B261467; Wed, 17 Dec 2014 18:30:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 7976E2606D9; Wed, 17 Dec 2014 18:30:04 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D469E261295; Wed, 17 Dec 2014 18:30:02 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by alsa0.perex.cz (Postfix) with ESMTP id 83DB72606B2 for ; Wed, 17 Dec 2014 18:29:56 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1BA1720F59 for ; Wed, 17 Dec 2014 12:29:56 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 17 Dec 2014 12:29:56 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=eml.cc; h= x-sasl-enc:from:to:cc:subject:date:message-id:in-reply-to :references; s=mesmtp; bh=H8yb76ZVSOq5vTJz0LuYC+nf+Cw=; b=fkXwkV qw8jYGVbRHfJAfG07Md8Chj9UAPjMNhIn8Imygw7KN/aAGdLYj7YqoYlCupYmfxY pEM6cp7kF9JPsoZddpkuCt4eM3TvRrDA5IL5qkdJsozqGMvchQ5t3PwRF0T76Lrq /ZWJ3qoHPqb4OPXYJuS9A4hL/7MfageZTU1Mg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:cc:subject:date :message-id:in-reply-to:references; s=smtpout; bh=H8yb76ZVSOq5vT Jz0LuYC+nf+Cw=; b=AkYFGi9mt3b2vE2/48Xlk/FkfZJxdPVMs2qvAGIHnMH6dG LX7xW7ZgYOJccszhlcayWFyGUX0/dSJHN7swW/WUhHLKJ91QyPYZhDreAPfEVU3W OnSTw5IRjWpbUAOqCEkrLXT88SKlG5RXJRf1PTL8dsn2QEYpnhZKLcBNmUHK0= X-Sasl-enc: Nb0vIhYluZ8oIspAWeI3+4m9h1PxG6WuJFXYU72iyLEC 1418837395 Received: from fiercex.lan (unknown [217.169.4.223]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B5F1C0027F; Wed, 17 Dec 2014 12:29:55 -0500 (EST) From: Tim Cussins To: alsa-devel@alsa-project.org Date: Wed, 17 Dec 2014 17:29:24 +0000 Message-Id: <1418837365-19398-2-git-send-email-timcussins@eml.cc> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1418837365-19398-1-git-send-email-timcussins@eml.cc> References: <1418837365-19398-1-git-send-email-timcussins@eml.cc> Cc: tiwai@suse.de, nstoughton@aether.com, Tim Cussins , pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH v2 2/3] snd_pcm_start_at: Add snd_pcm_ops so that driver can handle start_at requests. X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Provide members for starting and cancelling the timer. Add state to snd_pcm_runtime that tracks current timer: This allows us to cancel on state-change, or subsequent start_at call. Signed-off-by: Tim Cussins diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 1e7f74a..e7d5ded 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -73,6 +73,8 @@ struct snd_pcm_ops { snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream); int (*wall_clock)(struct snd_pcm_substream *substream, struct timespec *audio_ts); + int (*start_at)(struct snd_pcm_substream *substream, int audio_tstamp_type, const struct timespec *ts); + int (*start_at_cancel)(struct snd_pcm_substream *substream); int (*copy)(struct snd_pcm_substream *substream, int channel, snd_pcm_uframes_t pos, void __user *buf, snd_pcm_uframes_t count); @@ -364,6 +366,10 @@ struct snd_pcm_runtime { #ifdef CONFIG_SND_PCM_XRUN_DEBUG struct snd_pcm_hwptr_log *hwptr_log; #endif + + int start_at_timer_running; /* 0 if no timer is running, 1 if running */ + int start_at_timer_tstamp_class; /* tstamp class of current timer */ + void* start_at_timer_data; /* data associated with current timer */ }; struct snd_pcm_group { /* keep linked substreams */