diff options
author | Aisheng.Dong <b29396@freescale.com> | 2010-09-13 22:29:40 +0800 |
---|---|---|
committer | Alejandro Gonzalez <alex.gonzalez@digi.com> | 2011-01-17 14:56:43 +0100 |
commit | 32f42ee6b04c200c560b79362dfed609ed696734 (patch) | |
tree | bfcd7c788b1f2b4bacf6473f78968496a0499326 /drivers | |
parent | 41e3674d4aed6fd112b5de31f8334dc4505f3121 (diff) |
ENGR00131466-4 mxs spi: dynamically check which clock to use
The original spi host driver uses the fixed clock, spi.0,
which will cause the spi driver only support spi0.
Change it to dynamically check which clock to use to support
different spi hosts.
Signed-off-by: Aisheng.Dong <b29396@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi_mxs.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/spi/spi_mxs.c b/drivers/spi/spi_mxs.c index 106b81380bb4..149d24a9b833 100644 --- a/drivers/spi/spi_mxs.c +++ b/drivers/spi/spi_mxs.c @@ -67,9 +67,17 @@ static int debug; */ static int mxs_spi_init_hw(struct mxs_spi *ss) { + struct mxs_spi_platform_data *pdata; int err; - ss->clk = clk_get(NULL, "ssp.0"); + pdata = ss->master_dev->platform_data; + + if (!pdata->clk) { + dev_err(ss->master_dev, "unknown clock\n"); + err = -EINVAL; + goto out; + } + ss->clk = clk_get(ss->master_dev, pdata->clk); if (IS_ERR(ss->clk)) { err = PTR_ERR(ss->clk); goto out; |