Commit 5c190154 authored by Mark Brown's avatar Mark Brown

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

Merge remote-tracking branches 'asoc/topic/pistachio', 'asoc/topic/pxa', 'asoc/topic/rsnd', 'asoc/topic/rt274' and 'asoc/topic/rt286' into asoc-next
...@@ -351,6 +351,7 @@ Required properties: ...@@ -351,6 +351,7 @@ Required properties:
- "renesas,rcar_sound-r8a7793" (R-Car M2-N) - "renesas,rcar_sound-r8a7793" (R-Car M2-N)
- "renesas,rcar_sound-r8a7794" (R-Car E2) - "renesas,rcar_sound-r8a7794" (R-Car E2)
- "renesas,rcar_sound-r8a7795" (R-Car H3) - "renesas,rcar_sound-r8a7795" (R-Car H3)
- "renesas,rcar_sound-r8a7796" (R-Car M3-W)
- reg : Should contain the register physical address. - reg : Should contain the register physical address.
required register is required register is
SRU/ADG/SSI if generation1 SRU/ADG/SSI if generation1
......
This diff is collapsed.
...@@ -275,9 +275,10 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic) ...@@ -275,9 +275,10 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic)
regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf); regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf);
*mic = buf & 0x80000000; *mic = buf & 0x80000000;
} }
if (!*mic) {
snd_soc_dapm_disable_pin(dapm, "HV"); snd_soc_dapm_disable_pin(dapm, "HV");
snd_soc_dapm_disable_pin(dapm, "VREF"); snd_soc_dapm_disable_pin(dapm, "VREF");
}
if (!*hp) if (!*hp)
snd_soc_dapm_disable_pin(dapm, "LDO1"); snd_soc_dapm_disable_pin(dapm, "LDO1");
snd_soc_dapm_sync(dapm); snd_soc_dapm_sync(dapm);
......
...@@ -122,26 +122,26 @@ static struct snd_soc_dai_driver pistachio_internal_dac_dais[] = { ...@@ -122,26 +122,26 @@ static struct snd_soc_dai_driver pistachio_internal_dac_dais[] = {
}, },
}; };
static int pistachio_internal_dac_codec_probe(struct snd_soc_codec *codec) static int pistachio_internal_dac_codec_probe(struct snd_soc_component *component)
{ {
struct pistachio_internal_dac *dac = snd_soc_codec_get_drvdata(codec); struct pistachio_internal_dac *dac = snd_soc_component_get_drvdata(component);
snd_soc_codec_init_regmap(codec, dac->regmap); snd_soc_component_init_regmap(component, dac->regmap);
return 0; return 0;
} }
static const struct snd_soc_codec_driver pistachio_internal_dac_driver = { static const struct snd_soc_component_driver pistachio_internal_dac_driver = {
.probe = pistachio_internal_dac_codec_probe, .probe = pistachio_internal_dac_codec_probe,
.idle_bias_off = true, .controls = pistachio_internal_dac_snd_controls,
.component_driver = { .num_controls = ARRAY_SIZE(pistachio_internal_dac_snd_controls),
.controls = pistachio_internal_dac_snd_controls, .dapm_widgets = pistachio_internal_dac_widgets,
.num_controls = ARRAY_SIZE(pistachio_internal_dac_snd_controls), .num_dapm_widgets = ARRAY_SIZE(pistachio_internal_dac_widgets),
.dapm_widgets = pistachio_internal_dac_widgets, .dapm_routes = pistachio_internal_dac_routes,
.num_dapm_widgets = ARRAY_SIZE(pistachio_internal_dac_widgets), .num_dapm_routes = ARRAY_SIZE(pistachio_internal_dac_routes),
.dapm_routes = pistachio_internal_dac_routes, .use_pmdown_time = 1,
.num_dapm_routes = ARRAY_SIZE(pistachio_internal_dac_routes), .endianness = 1,
}, .non_legacy_dai_naming = 1,
}; };
static int pistachio_internal_dac_probe(struct platform_device *pdev) static int pistachio_internal_dac_probe(struct platform_device *pdev)
...@@ -202,11 +202,12 @@ static int pistachio_internal_dac_probe(struct platform_device *pdev) ...@@ -202,11 +202,12 @@ static int pistachio_internal_dac_probe(struct platform_device *pdev)
pm_runtime_enable(dev); pm_runtime_enable(dev);
pm_runtime_idle(dev); pm_runtime_idle(dev);
ret = snd_soc_register_codec(dev, &pistachio_internal_dac_driver, ret = devm_snd_soc_register_component(dev,
&pistachio_internal_dac_driver,
pistachio_internal_dac_dais, pistachio_internal_dac_dais,
ARRAY_SIZE(pistachio_internal_dac_dais)); ARRAY_SIZE(pistachio_internal_dac_dais));
if (ret) { if (ret) {
dev_err(dev, "failed to register codec: %d\n", ret); dev_err(dev, "failed to register component: %d\n", ret);
goto err_pwr; goto err_pwr;
} }
...@@ -225,7 +226,6 @@ static int pistachio_internal_dac_remove(struct platform_device *pdev) ...@@ -225,7 +226,6 @@ static int pistachio_internal_dac_remove(struct platform_device *pdev)
{ {
struct pistachio_internal_dac *dac = dev_get_drvdata(&pdev->dev); struct pistachio_internal_dac *dac = dev_get_drvdata(&pdev->dev);
snd_soc_unregister_codec(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
pistachio_internal_dac_pwr_off(dac); pistachio_internal_dac_pwr_off(dac);
regulator_disable(dac->supply); regulator_disable(dac->supply);
......
...@@ -377,7 +377,6 @@ static int mmp_sspa_probe(struct snd_soc_dai *dai) ...@@ -377,7 +377,6 @@ static int mmp_sspa_probe(struct snd_soc_dai *dai)
#define MMP_SSPA_FORMATS (SNDRV_PCM_FMTBIT_S8 | \ #define MMP_SSPA_FORMATS (SNDRV_PCM_FMTBIT_S8 | \
SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \ SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE) SNDRV_PCM_FMTBIT_S32_LE)
static const struct snd_soc_dai_ops mmp_sspa_dai_ops = { static const struct snd_soc_dai_ops mmp_sspa_dai_ops = {
......
...@@ -93,6 +93,15 @@ ...@@ -93,6 +93,15 @@
* [mod]->fn() -> [mod]->fn() -> [mod]->fn()... * [mod]->fn() -> [mod]->fn() -> [mod]->fn()...
* *
*/ */
/*
* you can enable below define if you don't need
* DAI status debug message when debugging
* see rsnd_dbg_dai_call()
*
* #define RSND_DEBUG_NO_DAI_CALL 1
*/
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include "rsnd.h" #include "rsnd.h"
...@@ -468,7 +477,7 @@ static int rsnd_status_update(u32 *status, ...@@ -468,7 +477,7 @@ static int rsnd_status_update(u32 *status,
__rsnd_mod_shift_##fn, \ __rsnd_mod_shift_##fn, \
__rsnd_mod_add_##fn, \ __rsnd_mod_add_##fn, \
__rsnd_mod_call_##fn); \ __rsnd_mod_call_##fn); \
dev_dbg(dev, "%s[%d]\t0x%08x %s\n", \ rsnd_dbg_dai_call(dev, "%s[%d]\t0x%08x %s\n", \
rsnd_mod_name(mod), rsnd_mod_id(mod), *status, \ rsnd_mod_name(mod), rsnd_mod_id(mod), *status, \
(func_call && (mod)->ops->fn) ? #fn : ""); \ (func_call && (mod)->ops->fn) ? #fn : ""); \
if (func_call && (mod)->ops->fn) \ if (func_call && (mod)->ops->fn) \
...@@ -1546,8 +1555,7 @@ static int rsnd_resume(struct device *dev) ...@@ -1546,8 +1555,7 @@ static int rsnd_resume(struct device *dev)
} }
static const struct dev_pm_ops rsnd_pm_ops = { static const struct dev_pm_ops rsnd_pm_ops = {
.suspend = rsnd_suspend, SET_SYSTEM_SLEEP_PM_OPS(rsnd_suspend, rsnd_resume)
.resume = rsnd_resume,
}; };
static struct platform_driver rsnd_driver = { static struct platform_driver rsnd_driver = {
......
...@@ -788,4 +788,24 @@ void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type); ...@@ -788,4 +788,24 @@ void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type);
#define rsnd_mod_confirm_dvc(mdvc) #define rsnd_mod_confirm_dvc(mdvc)
#endif #endif
/*
* If you don't need interrupt status debug message,
* define RSND_DEBUG_NO_IRQ_STATUS as 1 on top of src.c/ssi.c
*
* #define RSND_DEBUG_NO_IRQ_STATUS 1
*/
#define rsnd_dbg_irq_status(dev, param...) \
if (!IS_BUILTIN(RSND_DEBUG_NO_IRQ_STATUS)) \
dev_dbg(dev, param)
/*
* If you don't need rsnd_dai_call debug message,
* define RSND_DEBUG_NO_DAI_CALL as 1 on top of core.c
*
* #define RSND_DEBUG_NO_DAI_CALL 1
*/
#define rsnd_dbg_dai_call(dev, param...) \
if (!IS_BUILTIN(RSND_DEBUG_NO_DAI_CALL)) \
dev_dbg(dev, param)
#endif #endif
...@@ -8,6 +8,15 @@ ...@@ -8,6 +8,15 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
/*
* you can enable below define if you don't need
* SSI interrupt status debug message when debugging
* see rsnd_dbg_irq_status()
*
* #define RSND_DEBUG_NO_IRQ_STATUS 1
*/
#include "rsnd.h" #include "rsnd.h"
#define SRC_NAME "src" #define SRC_NAME "src"
...@@ -325,7 +334,10 @@ static void rsnd_src_status_clear(struct rsnd_mod *mod) ...@@ -325,7 +334,10 @@ static void rsnd_src_status_clear(struct rsnd_mod *mod)
static bool rsnd_src_error_occurred(struct rsnd_mod *mod) static bool rsnd_src_error_occurred(struct rsnd_mod *mod)
{ {
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct device *dev = rsnd_priv_to_dev(priv);
u32 val0, val1; u32 val0, val1;
u32 status0, status1;
bool ret = false; bool ret = false;
val0 = val1 = OUF_SRC(rsnd_mod_id(mod)); val0 = val1 = OUF_SRC(rsnd_mod_id(mod));
...@@ -338,9 +350,15 @@ static bool rsnd_src_error_occurred(struct rsnd_mod *mod) ...@@ -338,9 +350,15 @@ static bool rsnd_src_error_occurred(struct rsnd_mod *mod)
if (rsnd_src_sync_is_enabled(mod)) if (rsnd_src_sync_is_enabled(mod))
val0 = val0 & 0xffff; val0 = val0 & 0xffff;
if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val0) || status0 = rsnd_mod_read(mod, SCU_SYS_STATUS0);
(rsnd_mod_read(mod, SCU_SYS_STATUS1) & val1)) status1 = rsnd_mod_read(mod, SCU_SYS_STATUS1);
if ((status0 & val0) || (status1 & val1)) {
rsnd_dbg_irq_status(dev, "%s[%d] err status : 0x%08x, 0x%08x\n",
rsnd_mod_name(mod), rsnd_mod_id(mod),
status0, status1);
ret = true; ret = true;
}
return ret; return ret;
} }
......
...@@ -11,6 +11,15 @@ ...@@ -11,6 +11,15 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
/*
* you can enable below define if you don't need
* SSI interrupt status debug message when debugging
* see rsnd_dbg_irq_status()
*
* #define RSND_DEBUG_NO_IRQ_STATUS 1
*/
#include <sound/simple_card_utils.h> #include <sound/simple_card_utils.h>
#include <linux/delay.h> #include <linux/delay.h>
#include "rsnd.h" #include "rsnd.h"
...@@ -603,6 +612,7 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, ...@@ -603,6 +612,7 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
struct rsnd_dai_stream *io) struct rsnd_dai_stream *io)
{ {
struct rsnd_priv *priv = rsnd_mod_to_priv(mod); struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct device *dev = rsnd_priv_to_dev(priv);
int is_dma = rsnd_ssi_is_dma_mode(mod); int is_dma = rsnd_ssi_is_dma_mode(mod);
u32 status; u32 status;
bool elapsed = false; bool elapsed = false;
...@@ -621,8 +631,12 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, ...@@ -621,8 +631,12 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
elapsed = rsnd_ssi_pio_interrupt(mod, io); elapsed = rsnd_ssi_pio_interrupt(mod, io);
/* DMA only */ /* DMA only */
if (is_dma && (status & (UIRQ | OIRQ))) if (is_dma && (status & (UIRQ | OIRQ))) {
rsnd_dbg_irq_status(dev, "%s[%d] err status : 0x%08x\n",
rsnd_mod_name(mod), rsnd_mod_id(mod), status);
stop = true; stop = true;
}
rsnd_ssi_status_clear(mod); rsnd_ssi_status_clear(mod);
rsnd_ssi_interrupt_out: rsnd_ssi_interrupt_out:
......
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