From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEF67C4320A for ; Tue, 17 Aug 2021 13:47:57 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A75D561073 for ; Tue, 17 Aug 2021 13:47:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A75D561073 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F039C1676; Tue, 17 Aug 2021 15:47:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F039C1676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629208074; bh=Bliz11AJYdnG+MyA02dByUqywTBBoRP7rZeeFfqlzN8=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GvJHN2R7tNcXiQSSW3gqIgoRyr8edZg+eIkTZHUppTxG1wErsTBZyPiStWL78dC1e P91xDOJ0S//ThdtDIMq3aScNbvIKJq6PGDJA2Nl4jwLNEth8wJgG/BZ5E9E3L0Ky1U ZMRVZ3EGTo6M0X3YxRJnI5Rga6BVAOBcriqMb3bE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 826C5F8026D; Tue, 17 Aug 2021 15:47:03 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BAD20F80272; Tue, 17 Aug 2021 15:47:01 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 220CDF80134 for ; Tue, 17 Aug 2021 15:46:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 220CDF80134 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="WT0MCc+1"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="G1UqgUpi" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id A159821F5B; Tue, 17 Aug 2021 13:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1629208011; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=flJ6i9QI6PxueimSg8POymS+Z+qOF+vZml9ycXWd3nk=; b=WT0MCc+14r2l69S3NyN941Rb8NLWKFoCczRtzfne6k3XDj9Z4qTi71EQ0RX/DGwCh0o3gu 9q9ZOy4VxFk5Z+vTmBYvBIuDQJCDSW/ySXtuhuc6xSmhqtGQxcnOZ8zFKrvN2wEZuYVNqh NH8L0KiI4L3cw5sK7Af0nOTHhyeF54o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1629208011; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=flJ6i9QI6PxueimSg8POymS+Z+qOF+vZml9ycXWd3nk=; b=G1UqgUpiNjzz13iTwqLKhg03n1FcBesscSuEnLEOajJ+zJjaN7K+FS7nyorP7dKNdjxFPQ jK9NVuqNhUiW3cCQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 8FAF8A3B94; Tue, 17 Aug 2021 13:46:51 +0000 (UTC) Date: Tue, 17 Aug 2021 15:46:51 +0200 Message-ID: From: Takashi Iwai To: David Henningsson Subject: Re: [PATCH v2 1/2] Add rawmidi framing API In-Reply-To: <20210817125132.5737-2-coding@diwic.se> References: <20210817125132.5737-1-coding@diwic.se> <20210817125132.5737-2-coding@diwic.se> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 17 Aug 2021 14:51:31 +0200, David Henningsson wrote: > > --- a/include/rawmidi.h > +++ b/include/rawmidi.h > @@ -79,6 +79,27 @@ typedef enum _snd_rawmidi_type { > SND_RAWMIDI_TYPE_VIRTUAL > } snd_rawmidi_type_t; > > +#define SND_RAWMIDI_CLOCK_NONE (0<<3) > +#define SND_RAWMIDI_CLOCK_REALTIME (1<<3) > +#define SND_RAWMIDI_CLOCK_MONOTONIC (2<<3) > +#define SND_RAWMIDI_CLOCK_MONOTONIC_RAW (3<<3) IMO, better to be like below: enum { SND_RAWMIDI_CLOCK_NONE = 0, SND_RAWMIDI_CLOCK_REALTIME = 1, SND_RAWMIDI_CLOCK_MONOTONIC = 2, SND_RAWMIDI_CLOCK_MONOTONIC_RAW = 3, }; The shift should be done in the function. The enum above can be also typedef'ed for the later reference. > +typedef struct _snd_rawmidi_framing_tstamp { > + /** > + * For now, frame_type is always 0. Midi 2.0 is expected to add new > + * types here. Applications are expected to skip unknown frame types. > + */ > + __u8 frame_type; The 0 frame type should be also defined explicitly, such as SNDRV_RAWMIDI_FRAME_TYPE_XXX. > +int snd_rawmidi_params_set_framing_type(const snd_rawmidi_t *rawmidi, snd_rawmidi_params_t *params, unsigned int val); You can define the enum type to be more specific, too. > +int snd_rawmidi_params_set_clock_type(const snd_rawmidi_t *rawmidi, snd_rawmidi_params_t *params, unsigned int val); Ditto. thanks, Takashi