.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * OMAP7xx SPI 100k controller driver |
---|
3 | 4 | * Author: Fabrice Crohas <fcrohas@gmail.com> |
---|
.. | .. |
---|
6 | 7 | * Copyright (C) 2005, 2006 Nokia Corporation |
---|
7 | 8 | * Author: Samuel Ortiz <samuel.ortiz@nokia.com> and |
---|
8 | 9 | * Juha Yrj�l� <juha.yrjola@nokia.com> |
---|
9 | | - * |
---|
10 | | - * This program is free software; you can redistribute it and/or modify |
---|
11 | | - * it under the terms of the GNU General Public License as published by |
---|
12 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
13 | | - * (at your option) any later version. |
---|
14 | | - * |
---|
15 | | - * This program is distributed in the hope that it will be useful, |
---|
16 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 | | - * GNU General Public License for more details. |
---|
19 | 10 | */ |
---|
20 | 11 | #include <linux/kernel.h> |
---|
21 | 12 | #include <linux/init.h> |
---|
.. | .. |
---|
28 | 19 | #include <linux/err.h> |
---|
29 | 20 | #include <linux/clk.h> |
---|
30 | 21 | #include <linux/io.h> |
---|
31 | | -#include <linux/gpio.h> |
---|
32 | 22 | #include <linux/slab.h> |
---|
33 | 23 | |
---|
34 | 24 | #include <linux/spi/spi.h> |
---|
.. | .. |
---|
137 | 127 | |
---|
138 | 128 | static int spi100k_read_data(struct spi_master *master, int len) |
---|
139 | 129 | { |
---|
140 | | - int dataH, dataL; |
---|
| 130 | + int dataL; |
---|
141 | 131 | struct omap1_spi100k *spi100k = spi_master_get_devdata(master); |
---|
142 | 132 | |
---|
143 | 133 | /* Always do at least 16 bits */ |
---|
.. | .. |
---|
155 | 145 | udelay(1000); |
---|
156 | 146 | |
---|
157 | 147 | dataL = readw(spi100k->base + SPI_RX_LSB); |
---|
158 | | - dataH = readw(spi100k->base + SPI_RX_MSB); |
---|
| 148 | + readw(spi100k->base + SPI_RX_MSB); |
---|
159 | 149 | spi100k_disable_clock(master); |
---|
160 | 150 | |
---|
161 | 151 | return dataL; |
---|
.. | .. |
---|
330 | 320 | } |
---|
331 | 321 | } |
---|
332 | 322 | |
---|
333 | | - if (t->delay_usecs) |
---|
334 | | - udelay(t->delay_usecs); |
---|
| 323 | + spi_transfer_delay_exec(t); |
---|
335 | 324 | |
---|
336 | 325 | /* ignore the "leave it on after last xfer" hint */ |
---|
337 | 326 | |
---|
.. | .. |
---|
425 | 414 | return status; |
---|
426 | 415 | |
---|
427 | 416 | err_fck: |
---|
| 417 | + pm_runtime_disable(&pdev->dev); |
---|
428 | 418 | clk_disable_unprepare(spi100k->fck); |
---|
429 | 419 | err_ick: |
---|
430 | 420 | clk_disable_unprepare(spi100k->ick); |
---|