aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-05-17 20:34:16 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-19 14:41:08 -0400
commit284c6f6547dd08d8f26e12f4014ec298faa7da03 (patch)
treec5e774e1cee69906c73b0ab6a8629d617c4fe284 /sound/soc/sh
parent4d62ec125be98f5a446444e4ce53f4f4e2e1baff (diff)
ASoC: sh: fsi: add fsi_version() and removed meaningless version check
This patch adds fsi_version() function for accessing version. And there were some meaningless version check which never hit. This patch removed it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/fsi.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 976a57ecc5be..6efe6c9a41f6 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -321,6 +321,10 @@ static void _fsi_master_mask_set(struct fsi_master *master,
321/* 321/*
322 * basic function 322 * basic function
323 */ 323 */
324static int fsi_version(struct fsi_master *master)
325{
326 return master->core->ver;
327}
324 328
325static struct fsi_master *fsi_get_master(struct fsi_priv *fsi) 329static struct fsi_master *fsi_get_master(struct fsi_priv *fsi)
326{ 330{
@@ -629,11 +633,6 @@ static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable)
629 struct fsi_master *master = fsi_get_master(fsi); 633 struct fsi_master *master = fsi_get_master(fsi);
630 u32 mask, val; 634 u32 mask, val;
631 635
632 if (master->core->ver < 2) {
633 pr_err("fsi: register access err (%s)\n", __func__);
634 return;
635 }
636
637 mask = BP | SE; 636 mask = BP | SE;
638 val = enable ? mask : 0; 637 val = enable ? mask : 0;
639 638
@@ -648,9 +647,7 @@ static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable)
648static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi, 647static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
649 long rate, int enable) 648 long rate, int enable)
650{ 649{
651 struct fsi_master *master = fsi_get_master(fsi);
652 set_rate_func set_rate = fsi_get_info_set_rate(fsi); 650 set_rate_func set_rate = fsi_get_info_set_rate(fsi);
653 int fsi_ver = master->core->ver;
654 int ret; 651 int ret;
655 652
656 if (!set_rate) 653 if (!set_rate)
@@ -682,10 +679,7 @@ static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
682 data |= (0x3 << 12); 679 data |= (0x3 << 12);
683 break; 680 break;
684 case SH_FSI_ACKMD_32: 681 case SH_FSI_ACKMD_32:
685 if (fsi_ver < 2) 682 data |= (0x4 << 12);
686 dev_err(dev, "unsupported ACKMD\n");
687 else
688 data |= (0x4 << 12);
689 break; 683 break;
690 } 684 }
691 685
@@ -708,10 +702,7 @@ static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
708 data |= (0x4 << 8); 702 data |= (0x4 << 8);
709 break; 703 break;
710 case SH_FSI_BPFMD_16: 704 case SH_FSI_BPFMD_16:
711 if (fsi_ver < 2) 705 data |= (0x7 << 8);
712 dev_err(dev, "unsupported ACKMD\n");
713 else
714 data |= (0x7 << 8);
715 break; 706 break;
716 } 707 }
717 708
@@ -1177,7 +1168,6 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
1177 struct device *dev) 1168 struct device *dev)
1178{ 1169{
1179 struct fsi_master *master = fsi_get_master(fsi); 1170 struct fsi_master *master = fsi_get_master(fsi);
1180 int fsi_ver = master->core->ver;
1181 u32 flags = fsi_get_info_flags(fsi); 1171 u32 flags = fsi_get_info_flags(fsi);
1182 u32 data = 0; 1172 u32 data = 0;
1183 1173
@@ -1216,7 +1206,7 @@ static int fsi_hw_startup(struct fsi_priv *fsi,
1216 * FSI driver assumed that data package is in-back. 1206 * FSI driver assumed that data package is in-back.
1217 * FSI2 chip can select it. 1207 * FSI2 chip can select it.
1218 */ 1208 */
1219 if (fsi_ver >= 2) { 1209 if (fsi_version(master) >= 2) {
1220 fsi_reg_write(fsi, OUT_DMAC, VDMD_BACK); 1210 fsi_reg_write(fsi, OUT_DMAC, VDMD_BACK);
1221 fsi_reg_write(fsi, IN_DMAC, VDMD_BACK); 1211 fsi_reg_write(fsi, IN_DMAC, VDMD_BACK);
1222 } 1212 }
@@ -1306,7 +1296,7 @@ static int fsi_set_fmt_spdif(struct fsi_priv *fsi)
1306 struct fsi_master *master = fsi_get_master(fsi); 1296 struct fsi_master *master = fsi_get_master(fsi);
1307 u32 data = 0; 1297 u32 data = 0;
1308 1298
1309 if (master->core->ver < 2) 1299 if (fsi_version(master) < 2)
1310 return -EINVAL; 1300 return -EINVAL;
1311 1301
1312 data = CR_BWS_16 | CR_DTMD_SPDIF_PCM | CR_PCM; 1302 data = CR_BWS_16 | CR_DTMD_SPDIF_PCM | CR_PCM;