diff options
Diffstat (limited to 'sound/soc/sh/fsi.c')
-rw-r--r-- | sound/soc/sh/fsi.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 507e709f2807..136414f163e9 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c | |||
@@ -132,6 +132,8 @@ struct fsi_priv { | |||
132 | struct fsi_stream playback; | 132 | struct fsi_stream playback; |
133 | struct fsi_stream capture; | 133 | struct fsi_stream capture; |
134 | 134 | ||
135 | long rate; | ||
136 | |||
135 | u32 mst_ctrl; | 137 | u32 mst_ctrl; |
136 | }; | 138 | }; |
137 | 139 | ||
@@ -854,10 +856,17 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream, | |||
854 | { | 856 | { |
855 | struct fsi_priv *fsi = fsi_get_priv(substream); | 857 | struct fsi_priv *fsi = fsi_get_priv(substream); |
856 | int is_play = fsi_is_play(substream); | 858 | int is_play = fsi_is_play(substream); |
859 | struct fsi_master *master = fsi_get_master(fsi); | ||
860 | int (*set_rate)(struct device *dev, int is_porta, int rate, int enable); | ||
857 | 861 | ||
858 | fsi_irq_disable(fsi, is_play); | 862 | fsi_irq_disable(fsi, is_play); |
859 | fsi_clk_ctrl(fsi, 0); | 863 | fsi_clk_ctrl(fsi, 0); |
860 | 864 | ||
865 | set_rate = master->info->set_rate; | ||
866 | if (set_rate && fsi->rate) | ||
867 | set_rate(dai->dev, fsi_is_port_a(fsi), fsi->rate, 0); | ||
868 | fsi->rate = 0; | ||
869 | |||
861 | pm_runtime_put_sync(dai->dev); | 870 | pm_runtime_put_sync(dai->dev); |
862 | } | 871 | } |
863 | 872 | ||
@@ -891,9 +900,10 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream, | |||
891 | { | 900 | { |
892 | struct fsi_priv *fsi = fsi_get_priv(substream); | 901 | struct fsi_priv *fsi = fsi_get_priv(substream); |
893 | struct fsi_master *master = fsi_get_master(fsi); | 902 | struct fsi_master *master = fsi_get_master(fsi); |
894 | int (*set_rate)(int is_porta, int rate) = master->info->set_rate; | 903 | int (*set_rate)(struct device *dev, int is_porta, int rate, int enable); |
895 | int fsi_ver = master->core->ver; | 904 | int fsi_ver = master->core->ver; |
896 | int is_play = fsi_is_play(substream); | 905 | int is_play = fsi_is_play(substream); |
906 | long rate = params_rate(params); | ||
897 | int ret; | 907 | int ret; |
898 | 908 | ||
899 | /* if slave mode, set_rate is not needed */ | 909 | /* if slave mode, set_rate is not needed */ |
@@ -901,10 +911,15 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream, | |||
901 | return 0; | 911 | return 0; |
902 | 912 | ||
903 | /* it is error if no set_rate */ | 913 | /* it is error if no set_rate */ |
914 | set_rate = master->info->set_rate; | ||
904 | if (!set_rate) | 915 | if (!set_rate) |
905 | return -EIO; | 916 | return -EIO; |
906 | 917 | ||
907 | ret = set_rate(fsi_is_port_a(fsi), params_rate(params)); | 918 | ret = set_rate(dai->dev, fsi_is_port_a(fsi), rate, 1); |
919 | if (ret < 0) /* error */ | ||
920 | return ret; | ||
921 | |||
922 | fsi->rate = rate; | ||
908 | if (ret > 0) { | 923 | if (ret > 0) { |
909 | u32 data = 0; | 924 | u32 data = 0; |
910 | 925 | ||