Skip to content

Commit dc0416c

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

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

drivers/gpu/drm/apple/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ config DRM_APPLE
1212
select MULTIPLEXER
1313
help
1414
Say Y if you have an Apple Silicon chipset.
15+
16+
config DRM_APPLE_AUDIO
17+
bool "DisplayPort/HDMI Audio support"
18+
default y
19+
depends on DRM_APPLE
20+
depends on SND
21+
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)