1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 21:11:34 +03:00
mobile-nixos/devices/motorola-addison/kernel/0002-Allow-building-qualcomm-audio-without-CONFIG_DEBUG_F.patch
Samuel Dionne-Riel 4c11bf2c50 motorola-addison: Reduce size of the kernel
The patches added here are required to build under some conditions, but
not all are ended up needed as CONFIG_DEBUG_FS is required to be active
otherwise the kernel doesn't even boot :/

The kernel size was reduced by:

 * Removing tracing support
 * Removing unneeded exfat and sdcardfs filesystems
 * Removing all sound support
 * Removing video input (camera) support

The latter options seem awfully shortsighted, until you remember that a goal is
to eventually deal with booting our own kernels through kexec.

The Moto Z Play device's boot partition size is putting us in a hard
spot.
2019-12-04 17:39:46 -05:00

168 lines
5.9 KiB
Diff

From fdc7172e522c9a4c9d16467688a8913b18fb39d3 Mon Sep 17 00:00:00 2001
From: Samuel Dionne-Riel <samuel@dionne-riel.com>
Date: Wed, 4 Dec 2019 02:57:47 -0500
Subject: [PATCH 2/6] Allow building qualcomm audio without CONFIG_DEBUG_FS
---
drivers/misc/qcom/qdsp6v2/audio_alac.c | 4 ++++
drivers/misc/qcom/qdsp6v2/audio_ape.c | 4 ++++
drivers/misc/qcom/qdsp6v2/audio_g711alaw.c | 4 ++++
drivers/misc/qcom/qdsp6v2/audio_g711mlaw.c | 4 ++++
sound/soc/codecs/wm_adsp.h | 4 +---
5 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/qcom/qdsp6v2/audio_alac.c b/drivers/misc/qcom/qdsp6v2/audio_alac.c
index 646d37da1ba3..fef5352f58bc 100644
--- a/drivers/misc/qcom/qdsp6v2/audio_alac.c
+++ b/drivers/misc/qcom/qdsp6v2/audio_alac.c
@@ -19,6 +19,7 @@
static struct miscdevice audio_alac_misc;
static struct ws_mgr audio_alac_ws_mgr;
+#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_alac_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -29,6 +30,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | S_IRUGO,
NULL, (void *)data, &audio_alac_debug_fops);
}
+#endif
static int alac_channel_map(u8 *channel_mapping, uint32_t channels);
@@ -336,11 +338,13 @@ static int audio_open(struct inode *inode, struct file *file)
goto fail;
}
+#ifdef CONFIG_DEBUG_FS
snprintf(name, sizeof(name), "msm_alac_%04x", audio->ac->session);
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("debugfs_create_file failed\n");
+#endif
pr_debug("%s:alacdec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);
diff --git a/drivers/misc/qcom/qdsp6v2/audio_ape.c b/drivers/misc/qcom/qdsp6v2/audio_ape.c
index 737151279c27..c824d68569d0 100644
--- a/drivers/misc/qcom/qdsp6v2/audio_ape.c
+++ b/drivers/misc/qcom/qdsp6v2/audio_ape.c
@@ -19,6 +19,7 @@
static struct miscdevice audio_ape_misc;
static struct ws_mgr audio_ape_ws_mgr;
+#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_ape_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -28,6 +29,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | S_IRUGO,
NULL, (void *)data, &audio_ape_debug_fops);
}
+#endif
static long audio_ioctl_shared(struct file *file, unsigned int cmd,
void *arg)
@@ -317,11 +319,13 @@ static int audio_open(struct inode *inode, struct file *file)
goto fail;
}
+#ifdef CONFIG_DEBUG_FS
snprintf(name, sizeof(name), "msm_ape_%04x", audio->ac->session);
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("debugfs_create_file failed\n");
+#endif
pr_debug("%s:apedec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);
diff --git a/drivers/misc/qcom/qdsp6v2/audio_g711alaw.c b/drivers/misc/qcom/qdsp6v2/audio_g711alaw.c
index 10df85f50ac1..535395e15a08 100644
--- a/drivers/misc/qcom/qdsp6v2/audio_g711alaw.c
+++ b/drivers/misc/qcom/qdsp6v2/audio_g711alaw.c
@@ -19,6 +19,7 @@
static struct miscdevice audio_g711alaw_misc;
static struct ws_mgr audio_g711_ws_mgr;
+#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_g711_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -29,6 +30,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | S_IRUGO,
NULL, (void *)data, &audio_g711_debug_fops);
}
+#endif
static int g711_channel_map(u8 *channel_mapping, uint32_t channels);
@@ -286,11 +288,13 @@ static int audio_open(struct inode *inode, struct file *file)
goto fail;
}
+#ifdef CONFIG_DEBUG_FS
snprintf(name, sizeof(name), "msm_g711_%04x", audio->ac->session);
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("%s: debugfs_create_file failed\n", __func__);
+#endif
pr_debug("%s: g711dec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);
diff --git a/drivers/misc/qcom/qdsp6v2/audio_g711mlaw.c b/drivers/misc/qcom/qdsp6v2/audio_g711mlaw.c
index 33fb3685965e..b6727f9a22cc 100644
--- a/drivers/misc/qcom/qdsp6v2/audio_g711mlaw.c
+++ b/drivers/misc/qcom/qdsp6v2/audio_g711mlaw.c
@@ -19,6 +19,7 @@
static struct miscdevice audio_g711mlaw_misc;
static struct ws_mgr audio_g711_ws_mgr;
+#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_g711_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -29,6 +30,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | S_IRUGO,
NULL, (void *)data, &audio_g711_debug_fops);
}
+#endif
static int g711_channel_map(u8 *channel_mapping, uint32_t channels);
@@ -285,11 +287,13 @@ static int audio_open(struct inode *inode, struct file *file)
goto fail;
}
+#ifdef CONFIG_DEBUG_FS
snprintf(name, sizeof(name), "msm_g711_%04x", audio->ac->session);
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("%s: debugfs_create_file failed\n", __func__);
+#endif
pr_debug("%s: g711dec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);
diff --git a/sound/soc/codecs/wm_adsp.h b/sound/soc/codecs/wm_adsp.h
index b09e4c9c4cc1..3012ed1d5d73 100644
--- a/sound/soc/codecs/wm_adsp.h
+++ b/sound/soc/codecs/wm_adsp.h
@@ -186,9 +186,7 @@ static inline void wm_adsp_init_debugfs(struct wm_adsp *dsp,
{
}
-void wm_adsp_cleanup_debugfs(struct wm_adsp *dsp)
-{
-}
+void wm_adsp_cleanup_debugfs(struct wm_adsp *dsp);
#endif
int wm_adsp1_event(struct snd_soc_dapm_widget *w,
--
2.23.0