[PATCH v2 0/3] ASoC: rt1015: fix compilation errors and warnings
![](https://secure.gravatar.com/avatar/faa8bc619c3465d9f7c23cdd6f9b3474.jpg?s=120&d=mm&r=g)
The series fixes compilation errors and warnings discovered in the thread https://patchwork.kernel.org/patch/11622319/.
The original patch: (1) adds acpi.h for fixing implicit declaration of function 'ACPI_PTR' (2) sorts header inclusions in alphabetical
The compilation errors and warnings are likely introduced by (2).
The 1st and 2nd patches fix the newly discovered errors and warnings. The 3rd patch is the same as the original patch.
Tzung-Bi Shih (3): ASoC: core: move definition of enum snd_soc_bias_level ASoC: dapm: declare missing structure prototypes ASoC: rt1015: add missing header inclusion
include/sound/soc-dapm.h | 20 ++++++++++++++++++++ include/sound/soc.h | 18 ------------------ sound/soc/codecs/rt1015.c | 17 +++++++++-------- 3 files changed, 29 insertions(+), 26 deletions(-)
![](https://secure.gravatar.com/avatar/faa8bc619c3465d9f7c23cdd6f9b3474.jpg?s=120&d=mm&r=g)
To fix compilation error:
- error: field 'XXX' has incomplete type
Moves definition of enum snd_soc_bias_level from soc.h to soc-dapm.h.
Signed-off-by: Tzung-Bi Shih tzungbi@google.com --- include/sound/soc-dapm.h | 18 ++++++++++++++++++ include/sound/soc.h | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index cc3dcb815282..75467f2ed405 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -376,6 +376,24 @@ struct snd_soc_dapm_widget_list; struct snd_soc_dapm_update; enum snd_soc_dapm_direction;
+/* + * Bias levels + * + * @ON: Bias is fully on for audio playback and capture operations. + * @PREPARE: Prepare for audio operations. Called before DAPM switching for + * stream start and stop operations. + * @STANDBY: Low power standby state when no playback/capture operations are + * in progress. NOTE: The transition time between STANDBY and ON + * should be as fast as possible and no longer than 10ms. + * @OFF: Power Off. No restrictions on transition times. + */ +enum snd_soc_bias_level { + SND_SOC_BIAS_OFF = 0, + SND_SOC_BIAS_STANDBY = 1, + SND_SOC_BIAS_PREPARE = 2, + SND_SOC_BIAS_ON = 3, +}; + int dapm_regulator_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); int dapm_clock_event(struct snd_soc_dapm_widget *w, diff --git a/include/sound/soc.h b/include/sound/soc.h index 33aceadebd03..6791b7570a67 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -368,24 +368,6 @@ #define SOC_ENUM_SINGLE_VIRT_DECL(name, xtexts) \ const struct soc_enum name = SOC_ENUM_SINGLE_VIRT(ARRAY_SIZE(xtexts), xtexts)
-/* - * Bias levels - * - * @ON: Bias is fully on for audio playback and capture operations. - * @PREPARE: Prepare for audio operations. Called before DAPM switching for - * stream start and stop operations. - * @STANDBY: Low power standby state when no playback/capture operations are - * in progress. NOTE: The transition time between STANDBY and ON - * should be as fast as possible and no longer than 10ms. - * @OFF: Power Off. No restrictions on transition times. - */ -enum snd_soc_bias_level { - SND_SOC_BIAS_OFF = 0, - SND_SOC_BIAS_STANDBY = 1, - SND_SOC_BIAS_PREPARE = 2, - SND_SOC_BIAS_ON = 3, -}; - struct device_node; struct snd_jack; struct snd_soc_card;
![](https://secure.gravatar.com/avatar/faa8bc619c3465d9f7c23cdd6f9b3474.jpg?s=120&d=mm&r=g)
To fix compilation warnings:
- struct 'snd_soc_pcm_runtime' declared inside parameter list will not be visible outside of this definition or declaration - struct 'soc_enum' declared inside parameter list will not be visible outside of this definition or declaration
Declares the missing structure prototypes.
Signed-off-by: Tzung-Bi Shih tzungbi@google.com --- include/sound/soc-dapm.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 75467f2ed405..c3039e97929a 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -16,6 +16,8 @@ #include <sound/asoc.h>
struct device; +struct snd_soc_pcm_runtime; +struct soc_enum;
/* widget has no PM register bit */ #define SND_SOC_NOPM -1
![](https://secure.gravatar.com/avatar/faa8bc619c3465d9f7c23cdd6f9b3474.jpg?s=120&d=mm&r=g)
To fix compilation error:
error: implicit declaration of function 'ACPI_PTR' [-Werror,-Wimplicit-function-declaration] .acpi_match_table = ACPI_PTR(rt1015_acpi_match), ^
Adds the missing header "acpi.h" inclusion and sorts in alphabetical.
Signed-off-by: Tzung-Bi Shih tzungbi@google.com --- sound/soc/codecs/rt1015.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c index 1f61b4aa4353..548f68649064 100644 --- a/sound/soc/codecs/rt1015.c +++ b/sound/soc/codecs/rt1015.c @@ -8,23 +8,24 @@ // //
+#include <linux/acpi.h> +#include <linux/delay.h> +#include <linux/firmware.h> #include <linux/fs.h> +#include <linux/gpio.h> +#include <linux/i2c.h> +#include <linux/init.h> #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/init.h> -#include <linux/delay.h> +#include <linux/platform_device.h> #include <linux/pm.h> #include <linux/regmap.h> -#include <linux/i2c.h> -#include <linux/platform_device.h> -#include <linux/firmware.h> -#include <linux/gpio.h> #include <sound/core.h> +#include <sound/initval.h> #include <sound/pcm.h> #include <sound/pcm_params.h> -#include <sound/soc.h> #include <sound/soc-dapm.h> -#include <sound/initval.h> +#include <sound/soc.h> #include <sound/tlv.h>
#include "rl6231.h"
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
On Thu, 25 Jun 2020 23:35:40 +0800, Tzung-Bi Shih wrote:
The series fixes compilation errors and warnings discovered in the thread https://patchwork.kernel.org/patch/11622319/.
The original patch: (1) adds acpi.h for fixing implicit declaration of function 'ACPI_PTR' (2) sorts header inclusions in alphabetical
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: core: move definition of enum snd_soc_bias_level commit: 10e834099d38dd2c02bf2bd5feaa3997cfcf139f [2/3] ASoC: dapm: declare missing structure prototypes commit: 3d62ef4280a377bb2ccaee4e8f6c5093f5b8f9d4 [3/3] ASoC: rt1015: add missing header inclusion commit: 72ac4a4bef48e67bb26bc5a01d68c8163def013d
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
![](https://secure.gravatar.com/avatar/faa8bc619c3465d9f7c23cdd6f9b3474.jpg?s=120&d=mm&r=g)
On Fri, Jun 26, 2020 at 3:12 AM Mark Brown broonie@kernel.org wrote:
On Thu, 25 Jun 2020 23:35:40 +0800, Tzung-Bi Shih wrote:
The series fixes compilation errors and warnings discovered in the thread https://patchwork.kernel.org/patch/11622319/.
The original patch: (1) adds acpi.h for fixing implicit declaration of function 'ACPI_PTR' (2) sorts header inclusions in alphabetical
I am wondering if it is a better practice (next time) to separate the original patch into 2 patches.
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
On Mon, Jun 29, 2020 at 01:48:41PM +0800, Tzung-Bi Shih wrote:
On Fri, Jun 26, 2020 at 3:12 AM Mark Brown broonie@kernel.org wrote:
The original patch: (1) adds acpi.h for fixing implicit declaration of function 'ACPI_PTR' (2) sorts header inclusions in alphabetical
I am wondering if it is a better practice (next time) to separate the original patch into 2 patches.
Yes.
participants (2)
-
Mark Brown
-
Tzung-Bi Shih