hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/spi/spi-omap-100k.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * OMAP7xx SPI 100k controller driver
34 * Author: Fabrice Crohas <fcrohas@gmail.com>
....@@ -6,16 +7,6 @@
67 * Copyright (C) 2005, 2006 Nokia Corporation
78 * Author: Samuel Ortiz <samuel.ortiz@nokia.com> and
89 * 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.
1910 */
2011 #include <linux/kernel.h>
2112 #include <linux/init.h>
....@@ -28,7 +19,6 @@
2819 #include <linux/err.h>
2920 #include <linux/clk.h>
3021 #include <linux/io.h>
31
-#include <linux/gpio.h>
3222 #include <linux/slab.h>
3323
3424 #include <linux/spi/spi.h>
....@@ -137,7 +127,7 @@
137127
138128 static int spi100k_read_data(struct spi_master *master, int len)
139129 {
140
- int dataH, dataL;
130
+ int dataL;
141131 struct omap1_spi100k *spi100k = spi_master_get_devdata(master);
142132
143133 /* Always do at least 16 bits */
....@@ -155,7 +145,7 @@
155145 udelay(1000);
156146
157147 dataL = readw(spi100k->base + SPI_RX_LSB);
158
- dataH = readw(spi100k->base + SPI_RX_MSB);
148
+ readw(spi100k->base + SPI_RX_MSB);
159149 spi100k_disable_clock(master);
160150
161151 return dataL;
....@@ -330,8 +320,7 @@
330320 }
331321 }
332322
333
- if (t->delay_usecs)
334
- udelay(t->delay_usecs);
323
+ spi_transfer_delay_exec(t);
335324
336325 /* ignore the "leave it on after last xfer" hint */
337326
....@@ -425,6 +414,7 @@
425414 return status;
426415
427416 err_fck:
417
+ pm_runtime_disable(&pdev->dev);
428418 clk_disable_unprepare(spi100k->fck);
429419 err_ick:
430420 clk_disable_unprepare(spi100k->ick);