Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5292574imm; Tue, 16 Oct 2018 08:06:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV61TgAd0cExF35kEp62VeVFUDzB0biWZJYHdsx7mmio1AQ7Jh8g7H7qQmz9amMsQn8abWxuT X-Received: by 2002:a17:902:2867:: with SMTP id e94-v6mr8749353plb.317.1539702408288; Tue, 16 Oct 2018 08:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539702408; cv=none; d=google.com; s=arc-20160816; b=QGH3tg4UNBpma1+ZWcyYOdvzL15mASVgw/XbIu89A6FJDrKYqyfi9DIBpL2T/VtY2m YeCH3pLOb8Grh3kLISCc4GeNRiD0oa21k7sFB8HNhNvyUUYii+b3OyIFPTeRw35GhACI U/Kb+Y2oYpmRgHLZlzJjPyH+ljbFOgEJS/t/iyhZGq2XrIpRqByNSbUG24n1WgVRN/3P HzydrnHBa9dR1z3adTkKa+b874qwX1/y6yx7jCLSpuF3X+4EhVXqpMIj3t9JDhh0P/Zp YHeY8N3yv72XFNQyJ80rgjP++7mhhz4ef6LyS8/lLod1NULy/BSRi7jNC47MAgC7I4IH pJ/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=X15TuaeyemAzdyEHNNrmp8pAevIMTgRN3iaiXS1Ie6c=; b=eKXPs0AdrS/9jyGA9Ni1CQV/USVnfjJCFH8HaMMLvj/kFDXJxb5t8fz84y7Rxv4uQl pYb4GG5zf/dRnF9o4YzFl8qInHHGR3qMLt2WJjMrPpnbSdJSWu3zcUdziMWw3/0hcEsX TVS9uZbViXDcmjJhK9ycDZi+s6LbDtr5fkxNr5mMD+wtcoZ1iEGVcghf3id5EBUHiufC 7MUIjyS9MKm6Lb3kDut6OGAYRyyjeXpBjaw3rTTBZnn0bWE/m9ku7bEwth9MsjlrQZhY ngWglUSQmOKr93dk21aTLXw3OE+NmtykSH4iqx7K6rjCSz2DwQ1LUU9/PgMy/M3Ei8HL T9dA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16-v6si14463978pfi.279.2018.10.16.08.06.29; Tue, 16 Oct 2018 08:06:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727257AbeJPWyu (ORCPT + 99 others); Tue, 16 Oct 2018 18:54:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:55638 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727016AbeJPWys (ORCPT ); Tue, 16 Oct 2018 18:54:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 99598AF71; Tue, 16 Oct 2018 15:03:55 +0000 (UTC) From: Nicolas Saenz Julienne To: gregkh@linuxfoundation.org Cc: eric@anholt.net, stefan.wahren@i2se.com, linux-rpi-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, tiwai@suse.de, nsaenzjulienne@suse.de Subject: [PATCH 1/9] staging: bcm2835-audio: unify FOURCC command definitions Date: Tue, 16 Oct 2018 17:02:20 +0200 Message-Id: <20181016150228.16994-2-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016150228.16994-1-nsaenzjulienne@suse.de> References: <20181016150228.16994-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The device communicates with the audio core using FOURCC codes. The driver was generating them using different macros/expressions. We now use the same macro to create them and centralize all the definitions. Signed-off-by: Nicolas Saenz Julienne --- .../vc04_services/bcm2835-audio/bcm2835-vchiq.c | 13 ++++--------- .../bcm2835-audio/vc_vchi_audioserv_defs.h | 4 +++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c index 781754f36da7..aca7008e1921 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c @@ -89,11 +89,6 @@ static int bcm2835_audio_send_simple(struct bcm2835_audio_instance *instance, return bcm2835_audio_send_msg(instance, &m, wait); } -static const u32 BCM2835_AUDIO_WRITE_COOKIE1 = ('B' << 24 | 'C' << 16 | - 'M' << 8 | 'A'); -static const u32 BCM2835_AUDIO_WRITE_COOKIE2 = ('D' << 24 | 'A' << 16 | - 'T' << 8 | 'A'); - static void audio_vchi_callback(void *param, const VCHI_CALLBACK_REASON_T reason, void *msg_handle) @@ -112,8 +107,8 @@ static void audio_vchi_callback(void *param, instance->result = m.u.result.success; complete(&instance->msg_avail_comp); } else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) { - if (m.u.complete.cookie1 != BCM2835_AUDIO_WRITE_COOKIE1 || - m.u.complete.cookie2 != BCM2835_AUDIO_WRITE_COOKIE2) + if (m.u.complete.cookie1 != VC_AUDIO_WRITE_COOKIE1 || + m.u.complete.cookie2 != VC_AUDIO_WRITE_COOKIE2) dev_err(instance->dev, "invalid cookie\n"); else bcm2835_playback_fifo(instance->alsa_stream, @@ -329,8 +324,8 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream, .type = VC_AUDIO_MSG_TYPE_WRITE, .u.write.count = size, .u.write.max_packet = instance->max_packet, - .u.write.cookie1 = BCM2835_AUDIO_WRITE_COOKIE1, - .u.write.cookie2 = BCM2835_AUDIO_WRITE_COOKIE2, + .u.write.cookie1 = VC_AUDIO_WRITE_COOKIE1, + .u.write.cookie2 = VC_AUDIO_WRITE_COOKIE2, }; unsigned int count; int err, status; diff --git a/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h b/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h index 1a7f0884ac9c..dc62875cfdca 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h +++ b/drivers/staging/vc04_services/bcm2835-audio/vc_vchi_audioserv_defs.h @@ -7,8 +7,10 @@ #define VC_AUDIOSERV_MIN_VER 1 #define VC_AUDIOSERV_VER 2 -/* FourCC code used for VCHI connection */ +/* FourCC codes used for VCHI communication */ #define VC_AUDIO_SERVER_NAME MAKE_FOURCC("AUDS") +#define VC_AUDIO_WRITE_COOKIE1 MAKE_FOURCC("BCMA") +#define VC_AUDIO_WRITE_COOKIE2 MAKE_FOURCC("DATA") /* * List of screens that are currently supported -- 2.19.1