1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 14:44:57 +00:00
serenity/Kernel/Devices/Audio/IntelHDA/Format.h
Jelle Raaijmakers dd8fa73da1 Kernel: Add support for Intel HDA
This is an implementation that tries to follow the spec as closely as
possible, and works with Qemu's Intel HDA and some bare metal HDA
controllers out there. Compiling with `INTEL_HDA_DEBUG=on` will provide
a lot of detailed information that could help us getting this to work
on more bare metal controllers as well :^)

Output format is limited to `i16` samples for now.
2023-03-25 21:27:03 +01:00

23 lines
409 B
C++

/*
* Copyright (c) 2023, Jelle Raaijmakers <jelle@gmta.nl>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Error.h>
#include <AK/Types.h>
namespace Kernel::Audio::IntelHDA {
struct FormatParameters {
u32 sample_rate;
u8 pcm_bits;
u8 number_of_channels;
};
ErrorOr<u16> encode_format(FormatParameters format);
ErrorOr<FormatParameters> decode_format(u16 format);
}