Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 858132b0 authored by Karthikeyan Mani's avatar Karthikeyan Mani
Browse files

ASoC: wcd9xxx: Add support to build codecs as module



Add support to build, load and unload wcd9335 and
wcd934x codec modules separately from the kernel.

CRs-fixed: 2068879
Change-Id: I15f0b495691b7708894b512efedf677bf0f7d871
Signed-off-by: default avatarKarthikeyan Mani <kmani@codeaurora.org>
parent f5312af8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -15,6 +15,7 @@
#define __WCD_DSP_MGR_H__

#include <linux/types.h>
#include <linux/device.h>

/*
 * These enums correspond to the component types
@@ -133,4 +134,6 @@ struct wdsp_mgr_ops {
	int (*resume)(struct device *wdsp_dev);
};

int wcd_dsp_mgr_init(void);
void wcd_dsp_mgr_exit(void);
#endif /* end of __WCD_DSP_MGR_H__ */
+6 −5
Original line number Diff line number Diff line
@@ -880,19 +880,20 @@ config SND_SOC_WCD934X_DSD

config SND_SOC_WCD9335
        tristate
	depends on WCD9335_CODEC
	select SND_SOC_WCD9XXX
	select SND_SOC_WCD_MBHC
	select SND_SOC_WCD_MBHC_LEGACY
	select SND_SOC_WCD_CPE

config SND_SOC_WCD934X
        tristate
	depends on WCD934X_CODEC
	select SND_SOC_WCD9XXX_V2
	select SND_SOC_WCD9XXX
	select AUDIO_EXT_CLK
	select SND_SOC_WCD_DSP_MGR
	select SND_SOC_WCD_SPI
	select SND_SOC_WCD934X_MBHC
        select SND_SOC_WCD934X_DSD
	select WCD_DSP_GLINK

config SND_SOC_WCD934X_MBHC
        tristate
@@ -913,9 +914,9 @@ config SND_SOC_WSA881X_ANALOG
        tristate
	select REGMAP_I2C

config SND_SOC_WCD9XXX_V2
config SND_SOC_WCD9XXX
	tristate
	default y if SND_SOC_WCD9335=y
	default y if SND_SOC_WCD9335=y || SND_SOC_WCD934X=y

config SND_SOC_WCD_CPE
	tristate
+8 −15
Original line number Diff line number Diff line
@@ -160,25 +160,25 @@ snd-soc-uda134x-objs := uda134x.o
snd-soc-uda1380-objs := uda1380.o
snd-soc-wcd9335-objs := wcd9335.o
snd-soc-wcd934x-objs := wcd934x.o
snd-soc-wcd9xxx-v2-objs := wcd9xxx-common-v2.o wcd9xxx-resmgr-v2.o wcdcal-hwdep.o
snd-soc-wcd9xxx-objs := wcd9xxx-common-v2.o wcd9xxx-resmgr-v2.o \
			wcdcal-hwdep.o wcd-dsp-mgr.o wcd-dsp-utils.o \
			wcd9xxx-soc-init.o
ifeq ($(CONFIG_COMMON_CLK_MSM), y)
	audio-ext-clock-objs := audio-ext-clk.o
	snd-soc-wcd9xxx-objs += audio-ext-clk.o
endif

ifeq ($(CONFIG_COMMON_CLK_QCOM), y)
	audio-ext-clock-up-objs := audio-ext-clk-up.o
	snd-soc-wcd9xxx-objs += audio-ext-clk-up.o
endif
snd-soc-wcd-cpe-objs := wcd_cpe_services.o wcd_cpe_core.o
snd-soc-wsa881x-objs := wsa881x.o wsa881x-tables.o wsa881x-regmap.o wsa881x-temp-sensor.o
ifeq ($(CONFIG_SND_SOC_WCD_MBHC_LEGACY), y)
ifneq (,$(filter $(CONFIG_SND_SOC_WCD_MBHC_LEGACY),y m))
	snd-soc-wcd-mbhc-objs := wcd-mbhc-v2.o wcd-mbhc-legacy.o
else ifeq ($(CONFIG_SND_SOC_WCD_MBHC_ADC), y)
else ifneq (,$(filter $(CONFIG_SND_SOC_WCD_MBHC_ADC),y m))
	snd-soc-wcd-mbhc-objs := wcd-mbhc-v2.o wcd-mbhc-adc.o
endif
snd-soc-wsa881x-analog-objs := wsa881x-analog.o wsa881x-tables-analog.o
snd-soc-wsa881x-analog-objs += wsa881x-regmap-analog.o wsa881x-irq.o
snd-soc-wcd-dsp-utils-objs := wcd-dsp-utils.o
snd-soc-wcd-dsp-mgr-objs := wcd-dsp-mgr.o
snd-soc-wcd-spi-objs := wcd-spi.o
snd-soc-wl1273-objs := wl1273.o
snd-soc-wm-adsp-objs := wm_adsp.o
@@ -406,19 +406,12 @@ obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o
obj-$(CONFIG_SND_SOC_WCD9320)	+= snd-soc-wcd9320.o
obj-$(CONFIG_SND_SOC_WCD9335)	+= snd-soc-wcd9335.o
obj-$(CONFIG_SND_SOC_WCD934X)	+= wcd934x/
ifeq ($(CONFIG_COMMON_CLK_MSM), y)
	obj-$(CONFIG_AUDIO_EXT_CLK)	+= audio-ext-clock.o
endif
ifeq ($(CONFIG_COMMON_CLK_QCOM), y)
	obj-$(CONFIG_AUDIO_EXT_CLK)     += audio-ext-clock-up.o
endif
obj-$(CONFIG_SND_SOC_WCD9XXX_V2) += snd-soc-wcd9xxx-v2.o
obj-$(CONFIG_SND_SOC_WCD9XXX) += snd-soc-wcd9xxx.o
obj-$(CONFIG_SND_SOC_WCD_CPE)   += snd-soc-wcd-cpe.o
obj-$(CONFIG_SND_SOC_WCD_MBHC)  += snd-soc-wcd-mbhc.o
obj-$(CONFIG_SND_SOC_WSA881X)	+= snd-soc-wsa881x.o
obj-$(CONFIG_SND_SOC_WSA881X_ANALOG)	+= snd-soc-wsa881x-analog.o
obj-$(CONFIG_SND_SOC_WL1273)	+= snd-soc-wl1273.o
obj-$(CONFIG_SND_SOC_WCD_DSP_MGR)	+= snd-soc-wcd-dsp-mgr.o snd-soc-wcd-dsp-utils.o
obj-$(CONFIG_SND_SOC_WCD_SPI)  += snd-soc-wcd-spi.o
obj-$(CONFIG_SND_SOC_WM0010)	+= snd-soc-wm0010.o
obj-$(CONFIG_SND_SOC_WM1250_EV1) += snd-soc-wm1250-ev1.o
+3 −4
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <linux/of_gpio.h>
#include <dt-bindings/clock/qcom,audio-ext-clk.h>
#include <sound/q6afe-v2.h>
#include "audio-ext-clk-up.h"

enum audio_clk_mux {
	AP_CLK2,
@@ -611,17 +612,15 @@ static struct platform_driver audio_ref_clk_driver = {
	.remove = audio_ref_clk_remove,
};

static int __init audio_ref_clk_platform_init(void)
int audio_ref_clk_platform_init(void)
{
	return platform_driver_register(&audio_ref_clk_driver);
}
module_init(audio_ref_clk_platform_init);

static void __exit audio_ref_clk_platform_exit(void)
void audio_ref_clk_platform_exit(void)
{
	platform_driver_unregister(&audio_ref_clk_driver);
}
module_exit(audio_ref_clk_platform_exit);

MODULE_DESCRIPTION("Audio Ref Up Clock module platform driver");
MODULE_LICENSE("GPL v2");
+20 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */

#ifndef __AUDIO_EXT_CLK_UP_H_
#define __AUDIO_EXT_CLK_UP_H_

int audio_ref_clk_platform_init(void);
void audio_ref_clk_platform_exit(void);

#endif
Loading