|
1 | 1 | /* |
2 | 2 | * Driver for Cadence QSPI Controller |
3 | 3 | * |
4 | | - * Copyright (C) 2012 Altera Corporation |
| 4 | + * Copyright Altera Corporation (C) 2012-2014. All rights reserved. |
5 | 5 | * |
6 | 6 | * This program is free software; you can redistribute it and/or modify |
7 | | - * it under the terms of the GNU General Public License as published by |
8 | | - * the Free Software Foundation; either version 2 of the License, or |
9 | | - * (at your option) any later version. |
| 7 | + * it under the terms and conditions of the GNU General Public License, |
| 8 | + * version 2, as published by the Free Software Foundation. |
10 | 9 | * |
11 | | - * This program is distributed in the hope that it will be useful, |
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | | - * GNU General Public License for more details. |
| 10 | + * This program is distributed in the hope it will be useful, but WITHOUT |
| 11 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 13 | + * more details. |
15 | 14 | * |
16 | | - * You should have received a copy of the GNU General Public License |
17 | | - * along with this program; if not, write to the Free Software |
18 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 15 | + * You should have received a copy of the GNU General Public License along with |
| 16 | + * this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 17 | */ |
20 | | - |
| 18 | +#include <linux/clk.h> |
21 | 19 | #include <linux/kernel.h> |
22 | 20 | #include <linux/module.h> |
23 | 21 | #include <linux/interrupt.h> |
@@ -244,12 +242,6 @@ static int cadence_qspi_of_get_pdata(struct platform_device *pdev) |
244 | 242 | } |
245 | 243 | pdata->num_chipselect = prop; |
246 | 244 |
|
247 | | - if (of_property_read_u32(np, "master-ref-clk", &prop)) { |
248 | | - dev_err(&pdev->dev, "couldn't determine master-ref-clk\n"); |
249 | | - return -ENXIO; |
250 | | - } |
251 | | - pdata->master_ref_clk_hz = prop; |
252 | | - |
253 | 245 | if (of_property_read_u32(np, "ext-decoder", &prop)) { |
254 | 246 | dev_err(&pdev->dev, "couldn't determine ext-decoder\n"); |
255 | 247 | return -ENXIO; |
@@ -505,6 +497,13 @@ static int cadence_qspi_probe(struct platform_device *pdev) |
505 | 497 | pdev->dev.platform_data = pdata; |
506 | 498 | pdata->qspi_ahb_phy = res_ahb->start; |
507 | 499 |
|
| 500 | + cadence_qspi->clk = devm_clk_get(&pdev->dev, NULL); |
| 501 | + if (IS_ERR(cadence_qspi->clk)) { |
| 502 | + dev_err(&pdev->dev, "cannot get qspi clk\n"); |
| 503 | + return PTR_ERR(cadence_qspi->clk); |
| 504 | + } |
| 505 | + pdata->master_ref_clk_hz = clk_get_rate(cadence_qspi->clk); |
| 506 | + |
508 | 507 | status = cadence_qspi_of_get_pdata(pdev); |
509 | 508 | if (status) { |
510 | 509 | dev_err(&pdev->dev, "Get platform data failed.\n"); |
|
0 commit comments