/*mute default clk */
if (p_tdm->start_clk_enable == 1 && p_tdm->pin_ctl) {
- struct pinctrl_state *state = NULL;
+ struct pinctrl_state *ps = NULL;
- state = pinctrl_lookup_state(p_tdm->pin_ctl, "tdmout_a_gpio");
- if (!IS_ERR_OR_NULL(state)) {
- pinctrl_select_state(p_tdm->pin_ctl, state);
+ ps = pinctrl_lookup_state(p_tdm->pin_ctl, "tdmout_a_gpio");
+ if (!IS_ERR_OR_NULL(ps)) {
+ pinctrl_select_state(p_tdm->pin_ctl, ps);
pr_info("%s tdm pins disable!\n", __func__);
}
}
prtd->timer_period = 1;
prtd->timer.data = (unsigned long)substream;
prtd->timer.function = aml_pcm_timer_callback;
+ spin_lock(&prtd->lock);
prtd->running = 0;
+ spin_unlock(&prtd->lock);
return 0;
}
{
struct aml_pcm *pcm_p = dev_get_drvdata(dai->dev);
+ if (!pcm_p) {
+ pr_err("%s(), null ptr\n", __func__);
+ return -EINVAL;
+ }
+
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
/* TODO */
- if (pcm_p && pcm_p->pcm_mode) {
+ if (pcm_p->pcm_mode) {
pr_info("aiu pcm master stream %d enable\n\n",
substream->stream);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- if (pcm_p && pcm_p->pcm_mode) {
+ if (pcm_p->pcm_mode) {
pr_info("aiu master pcm stream %d disable\n\n",
substream->stream);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
int ret;
struct tas5805m_priv *tas5805m = snd_soc_codec_get_drvdata(codec);
-// ret =
-// regmap_register_patch(tas5805m->regmap, tas5805m_init_sequence,
-// ARRAY_SIZE(tas5805m_init_sequence));
usleep_range(20 * 1000, 21 * 1000);
ret = tas5805m_reg_init(codec);
if (ret != 0)
goto err;
- if (tas5805m)
- tas5805m_set_volume(codec, tas5805m->vol);
-
+ tas5805m_set_volume(codec, tas5805m->vol);
snd_soc_add_codec_controls(codec, tas5805m_vol_control,
ARRAY_SIZE(tas5805m_vol_control));
tas5805m->codec = codec;