diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-12-13 03:28:43 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-12-13 03:28:43 -0500 |
commit | 20aeeb356ba2e8daa99b5942c528ae2b3ea28433 (patch) | |
tree | d2cebc7039954851998d592123899f5627def7a9 /sound/soc/sh | |
parent | 07a9e2b2fbdda631eeff54e4b8ebcaaea71be538 (diff) | |
parent | 5b84ba26a9672e615897234fa5efd3eea2d6b295 (diff) |
Merge branch 'topic/workq-update' into topic/asoc
Conflicts:
sound/soc/codecs/wm8350.c
sound/soc/codecs/wm8753.c
sound/soc/sh/fsi.c
sound/soc/soc-core.c
Diffstat (limited to 'sound/soc/sh')
-rw-r--r-- | sound/soc/sh/fsi.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 19a2f99be60c..97c5394aa7d7 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c | |||
@@ -142,6 +142,8 @@ struct fsi_priv { | |||
142 | 142 | ||
143 | struct fsi_stream playback; | 143 | struct fsi_stream playback; |
144 | struct fsi_stream capture; | 144 | struct fsi_stream capture; |
145 | |||
146 | long rate; | ||
145 | }; | 147 | }; |
146 | 148 | ||
147 | struct fsi_core { | 149 | struct fsi_core { |
@@ -829,10 +831,17 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream, | |||
829 | { | 831 | { |
830 | struct fsi_priv *fsi = fsi_get_priv(substream); | 832 | struct fsi_priv *fsi = fsi_get_priv(substream); |
831 | int is_play = fsi_is_play(substream); | 833 | int is_play = fsi_is_play(substream); |
834 | struct fsi_master *master = fsi_get_master(fsi); | ||
835 | int (*set_rate)(struct device *dev, int is_porta, int rate, int enable); | ||
832 | 836 | ||
833 | fsi_irq_disable(fsi, is_play); | 837 | fsi_irq_disable(fsi, is_play); |
834 | fsi_clk_ctrl(fsi, 0); | 838 | fsi_clk_ctrl(fsi, 0); |
835 | 839 | ||
840 | set_rate = master->info->set_rate; | ||
841 | if (set_rate && fsi->rate) | ||
842 | set_rate(dai->dev, fsi_is_port_a(fsi), fsi->rate, 0); | ||
843 | fsi->rate = 0; | ||
844 | |||
836 | pm_runtime_put_sync(dai->dev); | 845 | pm_runtime_put_sync(dai->dev); |
837 | } | 846 | } |
838 | 847 | ||
@@ -866,20 +875,20 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream, | |||
866 | { | 875 | { |
867 | struct fsi_priv *fsi = fsi_get_priv(substream); | 876 | struct fsi_priv *fsi = fsi_get_priv(substream); |
868 | struct fsi_master *master = fsi_get_master(fsi); | 877 | struct fsi_master *master = fsi_get_master(fsi); |
869 | int (*set_rate)(int is_porta, int rate) = master->info->set_rate; | 878 | int (*set_rate)(struct device *dev, int is_porta, int rate, int enable); |
870 | int fsi_ver = master->core->ver; | 879 | int fsi_ver = master->core->ver; |
871 | int is_play = fsi_is_play(substream); | 880 | long rate = params_rate(params); |
872 | int ret; | 881 | int ret; |
873 | 882 | ||
874 | /* if slave mode, set_rate is not needed */ | 883 | set_rate = master->info->set_rate; |
875 | if (!fsi_is_master_mode(fsi, is_play)) | 884 | if (!set_rate) |
876 | return 0; | 885 | return 0; |
877 | 886 | ||
878 | /* it is error if no set_rate */ | 887 | ret = set_rate(dai->dev, fsi_is_port_a(fsi), rate, 1); |
879 | if (!set_rate) | 888 | if (ret < 0) /* error */ |
880 | return -EIO; | 889 | return ret; |
881 | 890 | ||
882 | ret = set_rate(fsi_is_port_a(fsi), params_rate(params)); | 891 | fsi->rate = rate; |
883 | if (ret > 0) { | 892 | if (ret > 0) { |
884 | u32 data = 0; | 893 | u32 data = 0; |
885 | 894 | ||