summaryrefslogtreecommitdiff
path: root/firmware/lib/include
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2017-12-12 14:05:19 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-01-05 21:14:11 -0800
commitde818cc08fab92ad389dc92f31687f3314a1a03a (patch)
tree88ac00585794cf8be66601ea9cd5f38e34d88d13 /firmware/lib/include
parent5142132f44bbee683c830fdb837bbedb00bad8ba (diff)
downloadvboot-de818cc08fab92ad389dc92f31687f3314a1a03a.tar.gz
firmware: simplify audio
Vboot firmware previously supported a rather complex audio looping library. Our original intent was to allow developers to flash a custom beep sequence / tune as an easter egg. We never fully supported that, but the code to allow it lived on. Get rid of that. Vboot also previously made no assumptions about the frequency of VbExGetTimer(), which was only used by the vboot_audio library. So it spent 10ms every boot measuring the frequency. Which is silly now, because depthcharge implements that as a microsecond timer. Get rid of that measurement and define the timer as a microsecond timer. BUG=chromium:611535 BRANCH=none TEST=make -j runtests; build bob firmware and boot it Change-Id: I350246874fb36b00149423696285cfcaca0fc526 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/847311 Reviewed-by: Shelley Chen <shchen@chromium.org>
Diffstat (limited to 'firmware/lib/include')
-rw-r--r--firmware/lib/include/vboot_audio.h13
-rw-r--r--firmware/lib/include/vboot_audio_private.h57
2 files changed, 3 insertions, 67 deletions
diff --git a/firmware/lib/include/vboot_audio.h b/firmware/lib/include/vboot_audio.h
index afcac140..05f22f92 100644
--- a/firmware/lib/include/vboot_audio.h
+++ b/firmware/lib/include/vboot_audio.h
@@ -10,22 +10,15 @@
#include "vboot_api.h"
-typedef struct VbAudioContext VbAudioContext;
-
/**
- * Initialization function. Returns context for processing dev-mode delay.
+ * Initialization function.
*/
-VbAudioContext *VbAudioOpen(VbCommonParams *cparams);
+void vb2_audio_start(struct vb2_context *ctx);
/**
* Caller should loop without extra delay until this returns false.
*/
-int VbAudioLooping(VbAudioContext *audio);
-
-/**
- * Caller should call this prior to booting.
- */
-void VbAudioClose(VbAudioContext *audio);
+int vb2_audio_looping(void);
#endif /* VBOOT_REFERENCE_VBOOT_AUDIO_H_ */
diff --git a/firmware/lib/include/vboot_audio_private.h b/firmware/lib/include/vboot_audio_private.h
deleted file mode 100644
index 902bc62e..00000000
--- a/firmware/lib/include/vboot_audio_private.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- *
- * Private declarations for vboot_audio.c. Defined here for easier testing.
- */
-
-#ifndef VBOOT_REFERENCE_VBOOT_AUDIO_PRIVATE_H_
-#define VBOOT_REFERENCE_VBOOT_AUDIO_PRIVATE_H_
-
-#include "vboot_api.h"
-#include "vboot_audio.h"
-
-typedef struct VbDevMusicNote {
- uint16_t msec;
- uint16_t frequency;
-} __attribute__((packed)) VbDevMusicNote;
-
-typedef struct VbDevMusic {
- uint8_t sig[4]; /* "$SND" */
- uint32_t checksum; /* crc32 over count & all notes */
- uint32_t count; /* number of notes */
- VbDevMusicNote notes[1]; /* gcc allows [0], MSVC doesn't */
- /* more VbDevMusicNotes follow immediately */
-} __attribute__((packed)) VbDevMusic;
-
-struct VbAudioContext {
- /* note tracking */
- VbDevMusicNote *music_notes;
- uint32_t note_count;
- uint32_t next_note;
-
- /* implementation flags */
- int background_beep;
- int free_notes_when_done;
-
- /* sound tracking */
- uint16_t current_frequency;
- uint64_t play_until;
- uint64_t last_time;
-};
-
-#ifdef FOR_TEST
-#define CUSTOM_MUSIC
-#endif
-
-#ifdef CUSTOM_MUSIC
-void *VbExGetMusicPtr(void);
-uint32_t VbExMaxMusicSize(void);
-#define CUSTOM_MUSIC_NOTES VbExGetMusicPtr()
-#define CUSTOM_MUSIC_MAXSIZE VbExMaxMusicSize()
-#else
-#define CUSTOM_MUSIC_NOTES 0
-#define CUSTOM_MUSIC_MAXSIZE 0
-#endif
-
-#endif /* VBOOT_REFERENCE_VBOOT_AUDIO_PRIVATE_H_ */