aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_s3c64xx.c
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2010-01-20 15:49:44 -0500
committerGrant Likely <grant.likely@secretlab.ca>2010-01-20 15:49:44 -0500
commitee64a37732c23ab2bcef5fe7785fd237a7e38951 (patch)
treeca004dc2263b7633f934e2290c551857df9645fa /drivers/spi/spi_s3c64xx.c
parentad7de729c60380a48844f885f37451158169c50d (diff)
spi/s3c64xx: Differentiate ip and rate clock
The instance of SPI clock for controller and that used for generating signals ought to be independently handled. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi/spi_s3c64xx.c')
-rw-r--r--drivers/spi/spi_s3c64xx.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c
index ad93d5d8539c..6d03d8f2de6d 100644
--- a/drivers/spi/spi_s3c64xx.c
+++ b/drivers/spi/spi_s3c64xx.c
@@ -1000,10 +1000,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
1000 goto err4; 1000 goto err4;
1001 } 1001 }
1002 1002
1003 if (sci->src_clk_nr == S3C64XX_SPI_SRCCLK_PCLK) 1003 sci->src_clk = clk_get(&pdev->dev, sci->src_clk_name);
1004 sci->src_clk = sdd->clk;
1005 else
1006 sci->src_clk = clk_get(&pdev->dev, sci->src_clk_name);
1007 if (IS_ERR(sci->src_clk)) { 1004 if (IS_ERR(sci->src_clk)) {
1008 dev_err(&pdev->dev, 1005 dev_err(&pdev->dev,
1009 "Unable to acquire clock '%s'\n", sci->src_clk_name); 1006 "Unable to acquire clock '%s'\n", sci->src_clk_name);
@@ -1011,7 +1008,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
1011 goto err5; 1008 goto err5;
1012 } 1009 }
1013 1010
1014 if (sci->src_clk != sdd->clk && clk_enable(sci->src_clk)) { 1011 if (clk_enable(sci->src_clk)) {
1015 dev_err(&pdev->dev, "Couldn't enable clock '%s'\n", 1012 dev_err(&pdev->dev, "Couldn't enable clock '%s'\n",
1016 sci->src_clk_name); 1013 sci->src_clk_name);
1017 ret = -EBUSY; 1014 ret = -EBUSY;
@@ -1053,11 +1050,9 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
1053err8: 1050err8:
1054 destroy_workqueue(sdd->workqueue); 1051 destroy_workqueue(sdd->workqueue);
1055err7: 1052err7:
1056 if (sci->src_clk != sdd->clk) 1053 clk_disable(sci->src_clk);
1057 clk_disable(sci->src_clk);
1058err6: 1054err6:
1059 if (sci->src_clk != sdd->clk) 1055 clk_put(sci->src_clk);
1060 clk_put(sci->src_clk);
1061err5: 1056err5:
1062 clk_disable(sdd->clk); 1057 clk_disable(sdd->clk);
1063err4: 1058err4:
@@ -1093,11 +1088,8 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
1093 1088
1094 destroy_workqueue(sdd->workqueue); 1089 destroy_workqueue(sdd->workqueue);
1095 1090
1096 if (sci->src_clk != sdd->clk) 1091 clk_disable(sci->src_clk);
1097 clk_disable(sci->src_clk); 1092 clk_put(sci->src_clk);
1098
1099 if (sci->src_clk != sdd->clk)
1100 clk_put(sci->src_clk);
1101 1093
1102 clk_disable(sdd->clk); 1094 clk_disable(sdd->clk);
1103 clk_put(sdd->clk); 1095 clk_put(sdd->clk);
@@ -1130,9 +1122,7 @@ static int s3c64xx_spi_suspend(struct platform_device *pdev, pm_message_t state)
1130 msleep(10); 1122 msleep(10);
1131 1123
1132 /* Disable the clock */ 1124 /* Disable the clock */
1133 if (sci->src_clk != sdd->clk) 1125 clk_disable(sci->src_clk);
1134 clk_disable(sci->src_clk);
1135
1136 clk_disable(sdd->clk); 1126 clk_disable(sdd->clk);
1137 1127
1138 sdd->cur_speed = 0; /* Output Clock is stopped */ 1128 sdd->cur_speed = 0; /* Output Clock is stopped */
@@ -1150,9 +1140,7 @@ static int s3c64xx_spi_resume(struct platform_device *pdev)
1150 sci->cfg_gpio(pdev); 1140 sci->cfg_gpio(pdev);
1151 1141
1152 /* Enable the clock */ 1142 /* Enable the clock */
1153 if (sci->src_clk != sdd->clk) 1143 clk_enable(sci->src_clk);
1154 clk_enable(sci->src_clk);
1155
1156 clk_enable(sdd->clk); 1144 clk_enable(sdd->clk);
1157 1145
1158 s3c64xx_spi_hwinit(sdd, pdev->id); 1146 s3c64xx_spi_hwinit(sdd, pdev->id);