Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1963f737 authored by Banajit Goswami's avatar Banajit Goswami
Browse files

ASoC: msm: qdsp6v2: add support for ALAC and APE offload



Add ALAC and APE to supported offload formats and send media
format block for both formats through compress driver.

Change-Id: I22b7cf38684250d2f8d6f9aefcd43452bb18e7f9
Signed-off-by: default avatarSatya Krishna Pindiproli <satyak@codeaurora.org>
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent aaac9717
Loading
Loading
Loading
Loading
+39 −2
Original line number Diff line number Diff line
@@ -96,7 +96,9 @@
#define SND_AUDIOCODEC_WMA_PRO               ((__u32) 0x00000017)
#define SND_AUDIOCODEC_DTS                   ((__u32) 0x00000018)
#define SND_AUDIOCODEC_EAC3                  ((__u32) 0x00000019)
#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_EAC3
#define SND_AUDIOCODEC_ALAC                  ((__u32) 0x00000020)
#define SND_AUDIOCODEC_APE                   ((__u32) 0x00000021)
#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_APE

/*
 * Profile and modes are listed with bit masks. This allows for a
@@ -358,6 +360,38 @@ struct snd_dec_flac {
	__u16 max_frame_size;
} __attribute__((packed, aligned(4)));

struct snd_dec_vorbis {
	__u32 bit_stream_fmt;
};

struct snd_dec_alac {
	__u32 frame_length;
	__u8 compatible_version;
	__u8 bit_depth;
	__u8 pb;
	__u8 mb;
	__u8 kb;
	__u8 num_channels;
	__u16 max_run;
	__u32 max_frame_bytes;
	__u32 avg_bit_rate;
	__u32 sample_rate;
	__u32 channel_layout_tag;
};

struct snd_dec_ape {
	__u16 compatible_version;
	__u16 compression_level;
	__u32 format_flags;
	__u32 blocks_per_frame;
	__u32 final_frame_blocks;
	__u32 total_frames;
	__u16 bits_per_sample;
	__u16 num_channels;
	__u32 sample_rate;
	__u32 seek_table_present;
};

union snd_codec_options {
	struct snd_enc_wma wma;
	struct snd_enc_vorbis vorbis;
@@ -366,7 +400,10 @@ union snd_codec_options {
	struct snd_enc_generic generic;
	struct snd_dec_ddp ddp;
	struct snd_dec_flac flac_dec;
} __attribute__((packed, aligned(4)));
	struct snd_dec_vorbis vorbis_dec;
	struct snd_dec_alac alac;
	struct snd_dec_ape ape;
};

/** struct snd_codec_desc - description of codec capabilities
 * @max_ch: Maximum number of audio channels