Skip to content

Commit 456beee

Browse files
committed
drm: apple: Add Kconfig option for audio
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 85f95b0 commit 456beee

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

drivers/gpu/drm/apple/Kconfig

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ config DRM_APPLE
44
depends on DRM && OF && ARM64
55
depends on ARCH_APPLE || COMPILE_TEST
66
depends on APPLE_RTKIT
7-
depends on SND
87
select DRM_KMS_HELPER
98
select DRM_KMS_DMA_HELPER
109
select DRM_GEM_DMA_HELPER
1110
select VIDEOMODE_HELPERS
1211
select MULTIPLEXER
13-
select SND_PCM
1412
help
1513
Say Y if you have an Apple Silicon chipset.
14+
15+
config DRM_APPLE_AUDIO
16+
bool "DisplayPort/HDMI Audio support"
17+
default y
18+
depends on DRM_APPLE
19+
depends on SND
20+
select SND_PCM

drivers/gpu/drm/apple/parser.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#include <linux/string.h>
88
#include <linux/slab.h>
99

10+
#if IS_ENABLED(CONFIG_DRM_APPLE_AUDIO)
1011
#include <sound/pcm.h> // for sound format masks
12+
#endif
1113

1214
#include "parser.h"
1315
#include "trace.h"
@@ -119,6 +121,7 @@ static int skip(struct dcp_parse_ctx *handle)
119121
}
120122
}
121123

124+
#if IS_ENABLED(CONFIG_DRM_APPLE_AUDIO)
122125
static int skip_pair(struct dcp_parse_ctx *handle)
123126
{
124127
int ret;
@@ -151,6 +154,7 @@ static bool consume_string(struct dcp_parse_ctx *ctx, const char *specimen)
151154
skip(ctx);
152155
return true;
153156
}
157+
#endif
154158

155159
/* Caller must free the result */
156160
static char *parse_string(struct dcp_parse_ctx *handle)
@@ -201,6 +205,7 @@ static int parse_bool(struct dcp_parse_ctx *handle, bool *b)
201205
return 0;
202206
}
203207

208+
#if IS_ENABLED(CONFIG_DRM_APPLE_AUDIO)
204209
static int parse_blob(struct dcp_parse_ctx *handle, size_t size, u8 const **blob)
205210
{
206211
const struct dcp_parse_tag *tag = parse_tag_of_type(handle, DCP_TYPE_BLOB);
@@ -220,6 +225,7 @@ static int parse_blob(struct dcp_parse_ctx *handle, size_t size, u8 const **blob
220225
*blob = out;
221226
return 0;
222227
}
228+
#endif
223229

224230
struct iterator {
225231
struct dcp_parse_ctx *handle;
@@ -680,6 +686,7 @@ int parse_epic_service_init(struct dcp_parse_ctx *handle, const char **name,
680686
return ret;
681687
}
682688

689+
#if IS_ENABLED(CONFIG_DRM_APPLE_AUDIO)
683690
static int parse_sample_rate_bit(struct dcp_parse_ctx *handle, unsigned int *ratebit)
684691
{
685692
s64 rate;
@@ -983,6 +990,7 @@ int parse_sound_mode(struct dcp_parse_ctx *handle,
983990
return 0;
984991
}
985992
EXPORT_SYMBOL_GPL(parse_sound_mode);
993+
#endif
986994

987995
int parse_system_log_mnits(struct dcp_parse_ctx *handle, struct dcp_system_ev_mnits *entry)
988996
{

0 commit comments

Comments
 (0)