Commit 2f028b15 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/topic/of-graph', 'asoc/topic/pxa',...

Merge remote-tracking branches 'asoc/topic/of-graph', 'asoc/topic/pxa', 'asoc/topic/qcom' and 'asoc/topic/rk808' into asoc-next
...@@ -44,8 +44,7 @@ Required dai-link subnodes: ...@@ -44,8 +44,7 @@ Required dai-link subnodes:
Required CPU/CODEC subnodes properties: Required CPU/CODEC subnodes properties:
-link-name : Name of the dai link. -link-name : Name of the dai link.
-sound-dai : phandle and port of CPU/CODEC -sound-dai : phandle/s and port of CPU/CODEC
-capture-dai : phandle and port of CPU/CODEC
Example: Example:
...@@ -73,7 +72,7 @@ sound: sound { ...@@ -73,7 +72,7 @@ sound: sound {
sound-dai = <&lpass MI2S_PRIMARY>; sound-dai = <&lpass MI2S_PRIMARY>;
}; };
codec { codec {
sound-dai = <&wcd_codec 0>; sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
}; };
}; };
......
msm8916 analog audio CODEC
Bindings for codec Analog IP which is integrated in pmic pm8916,
## Bindings for codec core on pmic:
Required properties
- compatible = "qcom,pm8916-wcd-analog-codec";
- reg: represents the slave base address provided to the peripheral.
- interrupt-parent : The parent interrupt controller.
- interrupts: List of interrupts in given SPMI peripheral.
- interrupt-names: Names specified to above list of interrupts in same
order. List of supported interrupt names are:
"cdc_spk_cnp_int" - Speaker click and pop interrupt.
"cdc_spk_clip_int" - Speaker clip interrupt.
"cdc_spk_ocp_int" - Speaker over current protect interrupt.
"mbhc_ins_rem_det1" - jack insert removal detect interrupt 1.
"mbhc_but_rel_det" - button release interrupt.
"mbhc_but_press_det" - button press event
"mbhc_ins_rem_det" - jack insert removal detect interrupt.
"mbhc_switch_int" - multi button headset interrupt.
"cdc_ear_ocp_int" - Earphone over current protect interrupt.
"cdc_hphr_ocp_int" - Headphone R over current protect interrupt.
"cdc_hphl_ocp_det" - Headphone L over current protect interrupt.
"cdc_ear_cnp_int" - earphone cnp interrupt.
"cdc_hphr_cnp_int" - hphr click and pop interrupt.
"cdc_hphl_cnp_int" - hphl click and pop interrupt.
- clocks: Handle to mclk.
- clock-names: should be "mclk"
- vdd-cdc-io-supply: phandle to VDD_CDC_IO regulator DT node.
- vdd-cdc-tx-rx-cx-supply: phandle to VDD_CDC_TX/RX/CX regulator DT node.
- vdd-micbias-supply: phandle of VDD_MICBIAS supply's regulator DT node.
Optional Properties:
- qcom,micbias1-ext-cap: boolean, present if micbias1 has external capacitor
connected.
- qcom,micbias2-ext-cap: boolean, present if micbias2 has external capacitor
connected.
Example:
spmi_bus {
...
audio-codec@f000{
compatible = "qcom,pm8916-wcd-analog-codec";
reg = <0xf000 0x200>;
reg-names = "pmic-codec-core";
clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
clock-names = "mclk";
interrupt-parent = <&spmi_bus>;
interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
<0x1 0xf0 0x1 IRQ_TYPE_NONE>,
<0x1 0xf0 0x2 IRQ_TYPE_NONE>,
<0x1 0xf0 0x3 IRQ_TYPE_NONE>,
<0x1 0xf0 0x4 IRQ_TYPE_NONE>,
<0x1 0xf0 0x5 IRQ_TYPE_NONE>,
<0x1 0xf0 0x6 IRQ_TYPE_NONE>,
<0x1 0xf0 0x7 IRQ_TYPE_NONE>,
<0x1 0xf1 0x0 IRQ_TYPE_NONE>,
<0x1 0xf1 0x1 IRQ_TYPE_NONE>,
<0x1 0xf1 0x2 IRQ_TYPE_NONE>,
<0x1 0xf1 0x3 IRQ_TYPE_NONE>,
<0x1 0xf1 0x4 IRQ_TYPE_NONE>,
<0x1 0xf1 0x5 IRQ_TYPE_NONE>;
interrupt-names = "cdc_spk_cnp_int",
"cdc_spk_clip_int",
"cdc_spk_ocp_int",
"mbhc_ins_rem_det1",
"mbhc_but_rel_det",
"mbhc_but_press_det",
"mbhc_ins_rem_det",
"mbhc_switch_int",
"cdc_ear_ocp_int",
"cdc_hphr_ocp_int",
"cdc_hphl_ocp_det",
"cdc_ear_cnp_int",
"cdc_hphr_cnp_int",
"cdc_hphl_cnp_int";
VDD-CDC-IO-supply = <&pm8916_l5>;
VDD-CDC-TX-RX-CX-supply = <&pm8916_l5>;
VDD-MICBIAS-supply = <&pm8916_l13>;
#sound-dai-cells = <1>;
};
};
msm8916 digital audio CODEC
## Bindings for codec core in lpass:
Required properties
- compatible = "qcom,msm8916-wcd-digital-codec";
- reg: address space for lpass codec.
- clocks: Handle to mclk and ahbclk
- clock-names: should be "mclk", "ahbix-clk".
Example:
audio-codec@771c000{
compatible = "qcom,msm8916-wcd-digital-codec";
reg = <0x0771c000 0x400>;
clocks = <&gcc GCC_ULTAUDIO_AHBFABRIC_IXFABRIC_CLK>,
<&gcc GCC_CODEC_DIGCODEC_CLK>;
clock-names = "ahbix-clk", "mclk";
#sound-dai-cells = <1>;
};
...@@ -120,7 +120,7 @@ static const struct regulator_linear_range rk808_ldo3_voltage_ranges[] = { ...@@ -120,7 +120,7 @@ static const struct regulator_linear_range rk808_ldo3_voltage_ranges[] = {
static int rk808_buck1_2_get_voltage_sel_regmap(struct regulator_dev *rdev) static int rk808_buck1_2_get_voltage_sel_regmap(struct regulator_dev *rdev)
{ {
struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev); struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev);
int id = rdev->desc->id - RK808_ID_DCDC1; int id = rdev_get_id(rdev);
struct gpio_desc *gpio = pdata->dvs_gpio[id]; struct gpio_desc *gpio = pdata->dvs_gpio[id];
unsigned int val; unsigned int val;
int ret; int ret;
...@@ -193,7 +193,7 @@ static int rk808_buck1_2_set_voltage_sel(struct regulator_dev *rdev, ...@@ -193,7 +193,7 @@ static int rk808_buck1_2_set_voltage_sel(struct regulator_dev *rdev,
unsigned sel) unsigned sel)
{ {
struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev); struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev);
int id = rdev->desc->id - RK808_ID_DCDC1; int id = rdev_get_id(rdev);
struct gpio_desc *gpio = pdata->dvs_gpio[id]; struct gpio_desc *gpio = pdata->dvs_gpio[id];
unsigned int reg = rdev->desc->vsel_reg; unsigned int reg = rdev->desc->vsel_reg;
unsigned old_sel; unsigned old_sel;
...@@ -232,7 +232,7 @@ static int rk808_buck1_2_set_voltage_time_sel(struct regulator_dev *rdev, ...@@ -232,7 +232,7 @@ static int rk808_buck1_2_set_voltage_time_sel(struct regulator_dev *rdev,
unsigned int new_selector) unsigned int new_selector)
{ {
struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev); struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev);
int id = rdev->desc->id - RK808_ID_DCDC1; int id = rdev_get_id(rdev);
struct gpio_desc *gpio = pdata->dvs_gpio[id]; struct gpio_desc *gpio = pdata->dvs_gpio[id];
/* if there is no dvs1/2 pin, we don't need wait extra time here. */ /* if there is no dvs1/2 pin, we don't need wait extra time here. */
...@@ -245,8 +245,7 @@ static int rk808_buck1_2_set_voltage_time_sel(struct regulator_dev *rdev, ...@@ -245,8 +245,7 @@ static int rk808_buck1_2_set_voltage_time_sel(struct regulator_dev *rdev,
static int rk808_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay) static int rk808_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
{ {
unsigned int ramp_value = RK808_RAMP_RATE_10MV_PER_US; unsigned int ramp_value = RK808_RAMP_RATE_10MV_PER_US;
unsigned int reg = rk808_buck_config_regs[rdev->desc->id - unsigned int reg = rk808_buck_config_regs[rdev_get_id(rdev)];
RK808_ID_DCDC1];
switch (ramp_delay) { switch (ramp_delay) {
case 1 ... 2000: case 1 ... 2000:
......
...@@ -1644,25 +1644,43 @@ static inline struct snd_soc_platform *snd_soc_kcontrol_platform( ...@@ -1644,25 +1644,43 @@ static inline struct snd_soc_platform *snd_soc_kcontrol_platform(
int snd_soc_util_init(void); int snd_soc_util_init(void);
void snd_soc_util_exit(void); void snd_soc_util_exit(void);
int snd_soc_of_parse_card_name(struct snd_soc_card *card, #define snd_soc_of_parse_card_name(card, propname) \
snd_soc_of_parse_card_name_from_node(card, NULL, propname)
int snd_soc_of_parse_card_name_from_node(struct snd_soc_card *card,
struct device_node *np,
const char *propname); const char *propname);
int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, #define snd_soc_of_parse_audio_simple_widgets(card, propname)\
snd_soc_of_parse_audio_simple_widgets_from_node(card, NULL, propname)
int snd_soc_of_parse_audio_simple_widgets_from_node(struct snd_soc_card *card,
struct device_node *np,
const char *propname); const char *propname);
int snd_soc_of_parse_tdm_slot(struct device_node *np, int snd_soc_of_parse_tdm_slot(struct device_node *np,
unsigned int *tx_mask, unsigned int *tx_mask,
unsigned int *rx_mask, unsigned int *rx_mask,
unsigned int *slots, unsigned int *slots,
unsigned int *slot_width); unsigned int *slot_width);
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, #define snd_soc_of_parse_audio_prefix(card, codec_conf, of_node, propname) \
snd_soc_of_parse_audio_prefix_from_node(card, NULL, codec_conf, \
of_node, propname)
void snd_soc_of_parse_audio_prefix_from_node(struct snd_soc_card *card,
struct device_node *np,
struct snd_soc_codec_conf *codec_conf, struct snd_soc_codec_conf *codec_conf,
struct device_node *of_node, struct device_node *of_node,
const char *propname); const char *propname);
int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
#define snd_soc_of_parse_audio_routing(card, propname) \
snd_soc_of_parse_audio_routing_from_node(card, NULL, propname)
int snd_soc_of_parse_audio_routing_from_node(struct snd_soc_card *card,
struct device_node *np,
const char *propname); const char *propname);
unsigned int snd_soc_of_parse_daifmt(struct device_node *np, unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
const char *prefix, const char *prefix,
struct device_node **bitclkmaster, struct device_node **bitclkmaster,
struct device_node **framemaster); struct device_node **framemaster);
int snd_soc_get_dai_name(struct of_phandle_args *args,
const char **dai_name);
int snd_soc_of_get_dai_name(struct device_node *of_node, int snd_soc_of_get_dai_name(struct device_node *of_node,
const char **dai_name); const char **dai_name);
int snd_soc_of_get_dai_link_codecs(struct device *dev, int snd_soc_of_get_dai_link_codecs(struct device *dev,
......
...@@ -592,6 +592,13 @@ config SND_SOC_MAX9860 ...@@ -592,6 +592,13 @@ config SND_SOC_MAX9860
depends on I2C depends on I2C
select REGMAP_I2C select REGMAP_I2C
config SND_SOC_MSM8916_WCD_ANALOG
tristate "Qualcomm MSM8916 WCD Analog Codec"
depends on SPMI || COMPILE_TEST
config SND_SOC_MSM8916_WCD_DIGITAL
tristate "Qualcomm MSM8916 WCD DIGITAL Codec"
config SND_SOC_PCM1681 config SND_SOC_PCM1681
tristate "Texas Instruments PCM1681 CODEC" tristate "Texas Instruments PCM1681 CODEC"
depends on I2C depends on I2C
......
...@@ -88,6 +88,8 @@ snd-soc-max9850-objs := max9850.o ...@@ -88,6 +88,8 @@ snd-soc-max9850-objs := max9850.o
snd-soc-max9860-objs := max9860.o snd-soc-max9860-objs := max9860.o
snd-soc-mc13783-objs := mc13783.o snd-soc-mc13783-objs := mc13783.o
snd-soc-ml26124-objs := ml26124.o snd-soc-ml26124-objs := ml26124.o
snd-soc-msm8916-analog-objs := msm8916-wcd-analog.o
snd-soc-msm8916-digital-objs := msm8916-wcd-digital.o
snd-soc-nau8810-objs := nau8810.o snd-soc-nau8810-objs := nau8810.o
snd-soc-nau8825-objs := nau8825.o snd-soc-nau8825-objs := nau8825.o
snd-soc-hdmi-codec-objs := hdmi-codec.o snd-soc-hdmi-codec-objs := hdmi-codec.o
...@@ -216,7 +218,6 @@ snd-soc-wm9705-objs := wm9705.o ...@@ -216,7 +218,6 @@ snd-soc-wm9705-objs := wm9705.o
snd-soc-wm9712-objs := wm9712.o snd-soc-wm9712-objs := wm9712.o
snd-soc-wm9713-objs := wm9713.o snd-soc-wm9713-objs := wm9713.o
snd-soc-wm-hubs-objs := wm_hubs.o snd-soc-wm-hubs-objs := wm_hubs.o
# Amp # Amp
snd-soc-max9877-objs := max9877.o snd-soc-max9877-objs := max9877.o
snd-soc-max98504-objs := max98504.o snd-soc-max98504-objs := max98504.o
...@@ -314,6 +315,8 @@ obj-$(CONFIG_SND_SOC_MAX9850) += snd-soc-max9850.o ...@@ -314,6 +315,8 @@ obj-$(CONFIG_SND_SOC_MAX9850) += snd-soc-max9850.o
obj-$(CONFIG_SND_SOC_MAX9860) += snd-soc-max9860.o obj-$(CONFIG_SND_SOC_MAX9860) += snd-soc-max9860.o
obj-$(CONFIG_SND_SOC_MC13783) += snd-soc-mc13783.o obj-$(CONFIG_SND_SOC_MC13783) += snd-soc-mc13783.o
obj-$(CONFIG_SND_SOC_ML26124) += snd-soc-ml26124.o obj-$(CONFIG_SND_SOC_ML26124) += snd-soc-ml26124.o
obj-$(CONFIG_SND_SOC_MSM8916_WCD_ANALOG) +=snd-soc-msm8916-analog.o
obj-$(CONFIG_SND_SOC_MSM8916_WCD_DIGITAL) +=snd-soc-msm8916-digital.o
obj-$(CONFIG_SND_SOC_NAU8810) += snd-soc-nau8810.o obj-$(CONFIG_SND_SOC_NAU8810) += snd-soc-nau8810.o
obj-$(CONFIG_SND_SOC_NAU8825) += snd-soc-nau8825.o obj-$(CONFIG_SND_SOC_NAU8825) += snd-soc-nau8825.o
obj-$(CONFIG_SND_SOC_HDMI_CODEC) += snd-soc-hdmi-codec.o obj-$(CONFIG_SND_SOC_HDMI_CODEC) += snd-soc-hdmi-codec.o
......
This diff is collapsed.
This diff is collapsed.
...@@ -244,9 +244,9 @@ static const struct snd_soc_dapm_route corgi_audio_map[] = { ...@@ -244,9 +244,9 @@ static const struct snd_soc_dapm_route corgi_audio_map[] = {
{"MICIN", NULL, "Line Jack"}, {"MICIN", NULL, "Line Jack"},
}; };
static const char *jack_function[] = {"Headphone", "Mic", "Line", "Headset", static const char * const jack_function[] = {"Headphone", "Mic", "Line",
"Off"}; "Headset", "Off"};
static const char *spk_function[] = {"On", "Off"}; static const char * const spk_function[] = {"On", "Off"};
static const struct soc_enum corgi_enum[] = { static const struct soc_enum corgi_enum[] = {
SOC_ENUM_SINGLE_EXT(5, jack_function), SOC_ENUM_SINGLE_EXT(5, jack_function),
SOC_ENUM_SINGLE_EXT(2, spk_function), SOC_ENUM_SINGLE_EXT(2, spk_function),
......
...@@ -376,7 +376,7 @@ static const struct snd_soc_dapm_route audio_map[] = { ...@@ -376,7 +376,7 @@ static const struct snd_soc_dapm_route audio_map[] = {
{"VINM", NULL, "Call Mic"}, {"VINM", NULL, "Call Mic"},
}; };
static const char *input_select[] = {"Call Mic", "Headset Mic"}; static const char * const input_select[] = {"Call Mic", "Headset Mic"};
static const struct soc_enum magician_in_sel_enum = static const struct soc_enum magician_in_sel_enum =
SOC_ENUM_SINGLE_EXT(2, input_select); SOC_ENUM_SINGLE_EXT(2, input_select);
......
...@@ -187,7 +187,7 @@ static int mioa701_wm9713_probe(struct platform_device *pdev) ...@@ -187,7 +187,7 @@ static int mioa701_wm9713_probe(struct platform_device *pdev)
mioa701.dev = &pdev->dev; mioa701.dev = &pdev->dev;
rc = devm_snd_soc_register_card(&pdev->dev, &mioa701); rc = devm_snd_soc_register_card(&pdev->dev, &mioa701);
if (!rc) if (!rc)
dev_warn(&pdev->dev, "Be warned that incorrect mixers/muxes setup will" dev_warn(&pdev->dev, "Be warned that incorrect mixers/muxes setup will "
"lead to overheating and possible destruction of your device." "lead to overheating and possible destruction of your device."
" Do not use without a good knowledge of mio's board design!\n"); " Do not use without a good knowledge of mio's board design!\n");
return rc; return rc;
......
...@@ -209,8 +209,8 @@ static const struct snd_soc_dapm_route poodle_audio_map[] = { ...@@ -209,8 +209,8 @@ static const struct snd_soc_dapm_route poodle_audio_map[] = {
{"MICIN", NULL, "Microphone"}, {"MICIN", NULL, "Microphone"},
}; };
static const char *jack_function[] = {"Off", "Headphone"}; static const char * const jack_function[] = {"Off", "Headphone"};
static const char *spk_function[] = {"Off", "On"}; static const char * const spk_function[] = {"Off", "On"};
static const struct soc_enum poodle_enum[] = { static const struct soc_enum poodle_enum[] = {
SOC_ENUM_SINGLE_EXT(2, jack_function), SOC_ENUM_SINGLE_EXT(2, jack_function),
SOC_ENUM_SINGLE_EXT(2, spk_function), SOC_ENUM_SINGLE_EXT(2, spk_function),
......
...@@ -9,12 +9,6 @@ ...@@ -9,12 +9,6 @@
#ifndef _PXA_SSP_H #ifndef _PXA_SSP_H
#define _PXA_SSP_H #define _PXA_SSP_H
/* pxa DAI SSP IDs */
#define PXA_DAI_SSP1 0
#define PXA_DAI_SSP2 1
#define PXA_DAI_SSP3 2
#define PXA_DAI_SSP4 3
/* SSP clock sources */ /* SSP clock sources */
#define PXA_SSP_CLK_PLL 0 #define PXA_SSP_CLK_PLL 0
#define PXA_SSP_CLK_EXT 1 #define PXA_SSP_CLK_EXT 1
......
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
#ifndef _PXA2XX_I2S_H #ifndef _PXA2XX_I2S_H
#define _PXA2XX_I2S_H #define _PXA2XX_I2S_H
/* pxa2xx DAI ID's */
#define PXA2XX_DAI_I2S 0
/* I2S clock */ /* I2S clock */
#define PXA2XX_I2S_SYSCLK 0 #define PXA2XX_I2S_SYSCLK 0
......
...@@ -241,9 +241,9 @@ static const struct snd_soc_dapm_route spitz_audio_map[] = { ...@@ -241,9 +241,9 @@ static const struct snd_soc_dapm_route spitz_audio_map[] = {
{"LINPUT1", NULL, "Line Jack"}, {"LINPUT1", NULL, "Line Jack"},
}; };
static const char *jack_function[] = {"Headphone", "Mic", "Line", "Headset", static const char * const jack_function[] = {"Headphone", "Mic", "Line",
"Off"}; "Headset", "Off"};
static const char *spk_function[] = {"On", "Off"}; static const char * const spk_function[] = {"On", "Off"};
static const struct soc_enum spitz_enum[] = { static const struct soc_enum spitz_enum[] = {
SOC_ENUM_SINGLE_EXT(5, jack_function), SOC_ENUM_SINGLE_EXT(5, jack_function),
SOC_ENUM_SINGLE_EXT(2, spk_function), SOC_ENUM_SINGLE_EXT(2, spk_function),
......
...@@ -170,9 +170,9 @@ static const struct snd_soc_dapm_route audio_map[] = { ...@@ -170,9 +170,9 @@ static const struct snd_soc_dapm_route audio_map[] = {
{"Mic Bias", NULL, "Headset Jack"}, {"Mic Bias", NULL, "Headset Jack"},
}; };
static const char *jack_function[] = {"Headphone", "Mic", "Line", "Headset", static const char * const jack_function[] = {"Headphone", "Mic", "Line",
"Off"}; "Headset", "Off"};
static const char *spk_function[] = {"On", "Off"}; static const char * const spk_function[] = {"On", "Off"};
static const struct soc_enum tosa_enum[] = { static const struct soc_enum tosa_enum[] = {
SOC_ENUM_SINGLE_EXT(5, jack_function), SOC_ENUM_SINGLE_EXT(5, jack_function),
SOC_ENUM_SINGLE_EXT(2, spk_function), SOC_ENUM_SINGLE_EXT(2, spk_function),
......
...@@ -123,20 +123,15 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card) ...@@ -123,20 +123,15 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
link->codec_of_node = of_parse_phandle(codec, "sound-dai", 0);
if (!link->codec_of_node) {
dev_err(card->dev, "error getting codec phandle\n");
return ERR_PTR(-EINVAL);
}
ret = snd_soc_of_get_dai_name(cpu, &link->cpu_dai_name); ret = snd_soc_of_get_dai_name(cpu, &link->cpu_dai_name);
if (ret) { if (ret) {
dev_err(card->dev, "error getting cpu dai name\n"); dev_err(card->dev, "error getting cpu dai name\n");
return ERR_PTR(ret); return ERR_PTR(ret);
} }
ret = snd_soc_of_get_dai_name(codec, &link->codec_dai_name); ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);
if (ret) {
if (ret < 0) {
dev_err(card->dev, "error getting codec dai name\n"); dev_err(card->dev, "error getting codec dai name\n");
return ERR_PTR(ret); return ERR_PTR(ret);
} }
......
...@@ -25,8 +25,7 @@ ...@@ -25,8 +25,7 @@
#include "lpass.h" #include "lpass.h"
struct lpass_pcm_data { struct lpass_pcm_data {
int rdma_ch; int dma_ch;
int wrdma_ch;
int i2s_port; int i2s_port;
}; };
...@@ -95,10 +94,7 @@ static int lpass_platform_pcmops_open(struct snd_pcm_substream *substream) ...@@ -95,10 +94,7 @@ static int lpass_platform_pcmops_open(struct snd_pcm_substream *substream)
return ret; return ret;
} }
if (dir == SNDRV_PCM_STREAM_PLAYBACK) data->dma_ch = dma_ch;
data->rdma_ch = dma_ch;
else
data->wrdma_ch = dma_ch;
snd_soc_set_runtime_hwparams(substream, &lpass_platform_pcm_hardware); snd_soc_set_runtime_hwparams(substream, &lpass_platform_pcm_hardware);
...@@ -125,20 +121,12 @@ static int lpass_platform_pcmops_close(struct snd_pcm_substream *substream) ...@@ -125,20 +121,12 @@ static int lpass_platform_pcmops_close(struct snd_pcm_substream *substream)
snd_soc_platform_get_drvdata(soc_runtime->platform); snd_soc_platform_get_drvdata(soc_runtime->platform);
struct lpass_variant *v = drvdata->variant; struct lpass_variant *v = drvdata->variant;
struct lpass_pcm_data *data; struct lpass_pcm_data *data;
int dma_ch, dir = substream->stream;
data = runtime->private_data; data = runtime->private_data;
v = drvdata->variant; v = drvdata->variant;
drvdata->substream[data->dma_ch] = NULL;
if (dir == SNDRV_PCM_STREAM_PLAYBACK)
dma_ch = data->rdma_ch;
else
dma_ch = data->wrdma_ch;
drvdata->substream[dma_ch] = NULL;
if (v->free_dma_channel) if (v->free_dma_channel)
v->free_dma_channel(drvdata, dma_ch); v->free_dma_channel(drvdata, data->dma_ch);
return 0; return 0;
} }
...@@ -159,10 +147,7 @@ static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream, ...@@ -159,10 +147,7 @@ static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream,
int bitwidth; int bitwidth;
int ret, dma_port = pcm_data->i2s_port + v->dmactl_audif_start; int ret, dma_port = pcm_data->i2s_port + v->dmactl_audif_start;
if (dir == SNDRV_PCM_STREAM_PLAYBACK) ch = pcm_data->dma_ch;
ch = pcm_data->rdma_ch;
else
ch = pcm_data->wrdma_ch;
bitwidth = snd_pcm_format_width(format); bitwidth = snd_pcm_format_width(format);
if (bitwidth < 0) { if (bitwidth < 0) {
...@@ -249,11 +234,7 @@ static int lpass_platform_pcmops_hw_free(struct snd_pcm_substream *substream) ...@@ -249,11 +234,7 @@ static int lpass_platform_pcmops_hw_free(struct snd_pcm_substream *substream)
unsigned int reg; unsigned int reg;
int ret; int ret;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) reg = LPAIF_DMACTL_REG(v, pcm_data->dma_ch, substream->stream);
reg = LPAIF_RDMACTL_REG(v, pcm_data->rdma_ch);
else
reg = LPAIF_WRDMACTL_REG(v, pcm_data->wrdma_ch);
ret = regmap_write(drvdata->lpaif_map, reg, 0); ret = regmap_write(drvdata->lpaif_map, reg, 0);
if (ret) if (ret)
dev_err(soc_runtime->dev, "%s() error writing to rdmactl reg: %d\n", dev_err(soc_runtime->dev, "%s() error writing to rdmactl reg: %d\n",
...@@ -273,10 +254,7 @@ static int lpass_platform_pcmops_prepare(struct snd_pcm_substream *substream) ...@@ -273,10 +254,7 @@ static int lpass_platform_pcmops_prepare(struct snd_pcm_substream *substream)
struct lpass_variant *v = drvdata->variant; struct lpass_variant *v = drvdata->variant;
int ret, ch, dir = substream->stream; int ret, ch, dir = substream->stream;
if (dir == SNDRV_PCM_STREAM_PLAYBACK) ch = pcm_data->dma_ch;
ch = pcm_data->rdma_ch;
else
ch = pcm_data->wrdma_ch;
ret = regmap_write(drvdata->lpaif_map, ret = regmap_write(drvdata->lpaif_map,
LPAIF_DMABASE_REG(v, ch, dir), LPAIF_DMABASE_REG(v, ch, dir),
...@@ -328,10 +306,7 @@ static int lpass_platform_pcmops_trigger(struct snd_pcm_substream *substream, ...@@ -328,10 +306,7 @@ static int lpass_platform_pcmops_trigger(struct snd_pcm_substream *substream,
struct lpass_variant *v = drvdata->variant; struct lpass_variant *v = drvdata->variant;
int ret, ch, dir = substream->stream; int ret, ch, dir = substream->stream;
if (dir == SNDRV_PCM_STREAM_PLAYBACK) ch = pcm_data->dma_ch;
ch = pcm_data->rdma_ch;
else
ch = pcm_data->wrdma_ch;
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
...@@ -406,10 +381,7 @@ static snd_pcm_uframes_t lpass_platform_pcmops_pointer( ...@@ -406,10 +381,7 @@ static snd_pcm_uframes_t lpass_platform_pcmops_pointer(
unsigned int base_addr, curr_addr; unsigned int base_addr, curr_addr;
int ret, ch, dir = substream->stream; int ret, ch, dir = substream->stream;
if (dir == SNDRV_PCM_STREAM_PLAYBACK) ch = pcm_data->dma_ch;
ch = pcm_data->rdma_ch;
else
ch = pcm_data->wrdma_ch;
ret = regmap_read(drvdata->lpaif_map, ret = regmap_read(drvdata->lpaif_map,
LPAIF_DMABASE_REG(v, ch, dir), &base_addr); LPAIF_DMABASE_REG(v, ch, dir), &base_addr);
......
...@@ -58,7 +58,7 @@ static int storm_ops_hw_params(struct snd_pcm_substream *substream, ...@@ -58,7 +58,7 @@ static int storm_ops_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static struct snd_soc_ops storm_soc_ops = { static const struct snd_soc_ops storm_soc_ops = {
.hw_params = storm_ops_hw_params, .hw_params = storm_ops_hw_params,
}; };
......
...@@ -3450,10 +3450,10 @@ void snd_soc_unregister_codec(struct device *dev) ...@@ -3450,10 +3450,10 @@ void snd_soc_unregister_codec(struct device *dev)
EXPORT_SYMBOL_GPL(snd_soc_unregister_codec); EXPORT_SYMBOL_GPL(snd_soc_unregister_codec);
/* Retrieve a card's name from device tree */ /* Retrieve a card's name from device tree */
int snd_soc_of_parse_card_name(struct snd_soc_card *card, int snd_soc_of_parse_card_name_from_node(struct snd_soc_card *card,
struct device_node *np,
const char *propname) const char *propname)
{ {
struct device_node *np;
int ret; int ret;
if (!card->dev) { if (!card->dev) {
...@@ -3461,6 +3461,7 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card, ...@@ -3461,6 +3461,7 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card,
return -EINVAL; return -EINVAL;
} }
if (!np)
np = card->dev->of_node; np = card->dev->of_node;
ret = of_property_read_string_index(np, propname, 0, &card->name); ret = of_property_read_string_index(np, propname, 0, &card->name);
...@@ -3478,7 +3479,7 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card, ...@@ -3478,7 +3479,7 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_soc_of_parse_card_name); EXPORT_SYMBOL_GPL(snd_soc_of_parse_card_name_from_node);
static const struct snd_soc_dapm_widget simple_widgets[] = { static const struct snd_soc_dapm_widget simple_widgets[] = {
SND_SOC_DAPM_MIC("Microphone", NULL), SND_SOC_DAPM_MIC("Microphone", NULL),
...@@ -3487,14 +3488,17 @@ static const struct snd_soc_dapm_widget simple_widgets[] = { ...@@ -3487,14 +3488,17 @@ static const struct snd_soc_dapm_widget simple_widgets[] = {
SND_SOC_DAPM_SPK("Speaker", NULL), SND_SOC_DAPM_SPK("Speaker", NULL),
}; };
int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, int snd_soc_of_parse_audio_simple_widgets_from_node(struct snd_soc_card *card,
struct device_node *np,
const char *propname) const char *propname)
{ {
struct device_node *np = card->dev->of_node;
struct snd_soc_dapm_widget *widgets; struct snd_soc_dapm_widget *widgets;
const char *template, *wname; const char *template, *wname;
int i, j, num_widgets, ret; int i, j, num_widgets, ret;
if (!np)
np = card->dev->of_node;
num_widgets = of_property_count_strings(np, propname); num_widgets = of_property_count_strings(np, propname);
if (num_widgets < 0) { if (num_widgets < 0) {
dev_err(card->dev, dev_err(card->dev,
...@@ -3565,7 +3569,7 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, ...@@ -3565,7 +3569,7 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets); EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets_from_node);
static int snd_soc_of_get_slot_mask(struct device_node *np, static int snd_soc_of_get_slot_mask(struct device_node *np,
const char *prop_name, const char *prop_name,
...@@ -3621,15 +3625,18 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np, ...@@ -3621,15 +3625,18 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
} }
EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot); EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot);
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, void snd_soc_of_parse_audio_prefix_from_node(struct snd_soc_card *card,
struct device_node *np,
struct snd_soc_codec_conf *codec_conf, struct snd_soc_codec_conf *codec_conf,
struct device_node *of_node, struct device_node *of_node,
const char *propname) const char *propname)
{ {
struct device_node *np = card->dev->of_node;
const char *str; const char *str;
int ret; int ret;
if (!np)
np = card->dev->of_node;
ret = of_property_read_string(np, propname, &str); ret = of_property_read_string(np, propname, &str);
if (ret < 0) { if (ret < 0) {
/* no prefix is not error */ /* no prefix is not error */
...@@ -3639,16 +3646,19 @@ void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, ...@@ -3639,16 +3646,19 @@ void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
codec_conf->of_node = of_node; codec_conf->of_node = of_node;
codec_conf->name_prefix = str; codec_conf->name_prefix = str;
} }
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix); EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix_from_node);
int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, int snd_soc_of_parse_audio_routing_from_node(struct snd_soc_card *card,
struct device_node *np,
const char *propname) const char *propname)
{ {
struct device_node *np = card->dev->of_node;
int num_routes; int num_routes;
struct snd_soc_dapm_route *routes; struct snd_soc_dapm_route *routes;
int i, ret; int i, ret;
if (!np)
np = card->dev->of_node;
num_routes = of_property_count_strings(np, propname); num_routes = of_property_count_strings(np, propname);
if (num_routes < 0 || num_routes & 1) { if (num_routes < 0 || num_routes & 1) {
dev_err(card->dev, dev_err(card->dev,
...@@ -3695,7 +3705,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, ...@@ -3695,7 +3705,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_routing); EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_routing_from_node);
unsigned int snd_soc_of_parse_daifmt(struct device_node *np, unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
const char *prefix, const char *prefix,
...@@ -3810,7 +3820,7 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np, ...@@ -3810,7 +3820,7 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
} }
EXPORT_SYMBOL_GPL(snd_soc_of_parse_daifmt); EXPORT_SYMBOL_GPL(snd_soc_of_parse_daifmt);
static int snd_soc_get_dai_name(struct of_phandle_args *args, int snd_soc_get_dai_name(struct of_phandle_args *args,
const char **dai_name) const char **dai_name)
{ {
struct snd_soc_component *pos; struct snd_soc_component *pos;
...@@ -3862,6 +3872,7 @@ static int snd_soc_get_dai_name(struct of_phandle_args *args, ...@@ -3862,6 +3872,7 @@ static int snd_soc_get_dai_name(struct of_phandle_args *args,
mutex_unlock(&client_mutex); mutex_unlock(&client_mutex);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(snd_soc_get_dai_name);
int snd_soc_of_get_dai_name(struct device_node *of_node, int snd_soc_of_get_dai_name(struct device_node *of_node,
const char **dai_name) const char **dai_name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment