diff options
-rw-r--r-- | sound/soc/sh/fsi.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 1bd0df060afa..53d1a7c0a6bb 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c | |||
@@ -1333,12 +1333,17 @@ static int fsi_hw_startup(struct fsi_priv *fsi, | |||
1333 | /* fifo init */ | 1333 | /* fifo init */ |
1334 | fsi_fifo_init(fsi, io, dev); | 1334 | fsi_fifo_init(fsi, io, dev); |
1335 | 1335 | ||
1336 | /* start master clock */ | ||
1337 | if (fsi_is_clk_master(fsi)) | ||
1338 | fsi_set_master_clk(dev, fsi, fsi->rate, 1); | ||
1339 | |||
1336 | return 0; | 1340 | return 0; |
1337 | } | 1341 | } |
1338 | 1342 | ||
1339 | static void fsi_hw_shutdown(struct fsi_priv *fsi, | 1343 | static void fsi_hw_shutdown(struct fsi_priv *fsi, |
1340 | struct device *dev) | 1344 | struct device *dev) |
1341 | { | 1345 | { |
1346 | /* stop master clock */ | ||
1342 | if (fsi_is_clk_master(fsi)) | 1347 | if (fsi_is_clk_master(fsi)) |
1343 | fsi_set_master_clk(dev, fsi, fsi->rate, 0); | 1348 | fsi_set_master_clk(dev, fsi, fsi->rate, 0); |
1344 | } | 1349 | } |
@@ -1461,19 +1466,11 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream, | |||
1461 | struct snd_soc_dai *dai) | 1466 | struct snd_soc_dai *dai) |
1462 | { | 1467 | { |
1463 | struct fsi_priv *fsi = fsi_get_priv(substream); | 1468 | struct fsi_priv *fsi = fsi_get_priv(substream); |
1464 | long rate = params_rate(params); | ||
1465 | int ret; | ||
1466 | |||
1467 | if (!fsi_is_clk_master(fsi)) | ||
1468 | return 0; | ||
1469 | |||
1470 | ret = fsi_set_master_clk(dai->dev, fsi, rate, 1); | ||
1471 | if (ret < 0) | ||
1472 | return ret; | ||
1473 | 1469 | ||
1474 | fsi->rate = rate; | 1470 | if (fsi_is_clk_master(fsi)) |
1471 | fsi->rate = params_rate(params); | ||
1475 | 1472 | ||
1476 | return ret; | 1473 | return 0; |
1477 | } | 1474 | } |
1478 | 1475 | ||
1479 | static const struct snd_soc_dai_ops fsi_dai_ops = { | 1476 | static const struct snd_soc_dai_ops fsi_dai_ops = { |
@@ -1770,10 +1767,6 @@ static void __fsi_resume(struct fsi_priv *fsi, | |||
1770 | return; | 1767 | return; |
1771 | 1768 | ||
1772 | fsi_hw_startup(fsi, io, dev); | 1769 | fsi_hw_startup(fsi, io, dev); |
1773 | |||
1774 | if (fsi_is_clk_master(fsi) && fsi->rate) | ||
1775 | fsi_set_master_clk(dev, fsi, fsi->rate, 1); | ||
1776 | |||
1777 | fsi_stream_start(fsi, io); | 1770 | fsi_stream_start(fsi, io); |
1778 | } | 1771 | } |
1779 | 1772 | ||