From f5afc9d4f79ba33cda18e4f2e015ad2042de6d3b Mon Sep 17 00:00:00 2001 From: ShivamKumarJha Date: Tue, 30 Mar 2021 23:03:11 +0530 Subject: [PATCH] Add sound/ modifications Signed-off-by: ShivamKumarJha --- sound/soc/soc-dapm.c | 5 +++++ sound/soc/soc-pcm.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index ec1aa2bbc297..80ca4cd80e3e 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2,6 +2,7 @@ * soc-dapm.c -- ALSA SoC Dynamic Audio Power Management * * Copyright 2005 Wolfson Microelectronics PLC. + * Copyright (C) 2021 XiaoMi, Inc. * Author: Liam Girdwood * * This program is free software; you can redistribute it and/or modify it @@ -1164,6 +1165,10 @@ static __always_inline int is_connected_ep(struct snd_soc_dapm_widget *widget, struct snd_soc_dapm_path *path; int con = 0; + if (NULL == widget) { + printk("is_connected_input_ep: widget is null"); + return 0; + } if (widget->endpoints[dir] >= 0) return widget->endpoints[dir]; diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 471620a11eec..8d3a7a359a68 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2,6 +2,7 @@ * soc-pcm.c -- ALSA SoC PCM * * Copyright 2005 Wolfson Microelectronics PLC. + * Copyright (C) 2021 XiaoMi, Inc. * Copyright 2005 Openedhand Ltd. * Copyright (C) 2010 Slimlogic Ltd. * Copyright (C) 2010 Texas Instruments Inc. @@ -46,6 +47,8 @@ static const struct snd_pcm_hardware no_host_hardware = { SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME, .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE, .period_bytes_min = PAGE_SIZE >> 2, .period_bytes_max = PAGE_SIZE >> 1,