Skip to content

Commit

Permalink
ASoC: arizona: Support clearing clocks
Browse files Browse the repository at this point in the history
Some systems may wish to support switching between telephony and CD audio
clock rates but this is restricted by enforcement of constraints on the
current DAI clock. Support setting clocks to zero and don't enforce any
constraints in that case in order to facilitate this use case.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Jan 21, 2013
1 parent e5ddd30 commit f2c26d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sound/soc/codecs/arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ int arizona_set_sysclk(struct snd_soc_codec *codec, int clk_id,
case 147456000:
val |= 6 << ARIZONA_SYSCLK_FREQ_SHIFT;
break;
case 0:
dev_dbg(arizona->dev, "%s cleared\n", name);
*clk = freq;
return 0;
default:
return -EINVAL;
}
Expand Down Expand Up @@ -692,6 +696,9 @@ static int arizona_startup(struct snd_pcm_substream *substream,
return 0;
}

if (base_rate == 0)
return 0;

if (base_rate % 8000)
constraint = &arizona_44k1_constraint;
else
Expand Down

0 comments on commit f2c26d4

Please sign in to comment.