Fabio Estevam | 6126fd8 | 2018-05-02 16:18:29 -0300 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | // |
| 3 | // Freescale i.MX7ULP LPSPI driver |
| 4 | // |
| 5 | // Copyright 2016 Freescale Semiconductor, Inc. |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 6 | // Copyright 2018 NXP Semiconductors |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 7 | |
| 8 | #include <linux/clk.h> |
| 9 | #include <linux/completion.h> |
| 10 | #include <linux/delay.h> |
| 11 | #include <linux/err.h> |
| 12 | #include <linux/interrupt.h> |
| 13 | #include <linux/io.h> |
| 14 | #include <linux/irq.h> |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/module.h> |
| 17 | #include <linux/of.h> |
| 18 | #include <linux/of_device.h> |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 19 | #include <linux/pinctrl/consumer.h> |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 20 | #include <linux/platform_device.h> |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 21 | #include <linux/pm_runtime.h> |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 22 | #include <linux/slab.h> |
| 23 | #include <linux/spi/spi.h> |
| 24 | #include <linux/spi/spi_bitbang.h> |
| 25 | #include <linux/types.h> |
| 26 | |
| 27 | #define DRIVER_NAME "fsl_lpspi" |
| 28 | |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 29 | #define FSL_LPSPI_RPM_TIMEOUT 50 /* 50ms */ |
| 30 | |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 31 | /* i.MX7ULP LPSPI registers */ |
| 32 | #define IMX7ULP_VERID 0x0 |
| 33 | #define IMX7ULP_PARAM 0x4 |
| 34 | #define IMX7ULP_CR 0x10 |
| 35 | #define IMX7ULP_SR 0x14 |
| 36 | #define IMX7ULP_IER 0x18 |
| 37 | #define IMX7ULP_DER 0x1c |
| 38 | #define IMX7ULP_CFGR0 0x20 |
| 39 | #define IMX7ULP_CFGR1 0x24 |
| 40 | #define IMX7ULP_DMR0 0x30 |
| 41 | #define IMX7ULP_DMR1 0x34 |
| 42 | #define IMX7ULP_CCR 0x40 |
| 43 | #define IMX7ULP_FCR 0x58 |
| 44 | #define IMX7ULP_FSR 0x5c |
| 45 | #define IMX7ULP_TCR 0x60 |
| 46 | #define IMX7ULP_TDR 0x64 |
| 47 | #define IMX7ULP_RSR 0x70 |
| 48 | #define IMX7ULP_RDR 0x74 |
| 49 | |
| 50 | /* General control register field define */ |
| 51 | #define CR_RRF BIT(9) |
| 52 | #define CR_RTF BIT(8) |
| 53 | #define CR_RST BIT(1) |
| 54 | #define CR_MEN BIT(0) |
Clark Wang | 6a13044 | 2019-01-07 07:47:41 +0000 | [diff] [blame] | 55 | #define SR_MBF BIT(24) |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 56 | #define SR_TCF BIT(10) |
Clark Wang | c23fdef | 2019-01-07 07:47:38 +0000 | [diff] [blame] | 57 | #define SR_FCF BIT(9) |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 58 | #define SR_RDF BIT(1) |
| 59 | #define SR_TDF BIT(0) |
| 60 | #define IER_TCIE BIT(10) |
Clark Wang | c23fdef | 2019-01-07 07:47:38 +0000 | [diff] [blame] | 61 | #define IER_FCIE BIT(9) |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 62 | #define IER_RDIE BIT(1) |
| 63 | #define IER_TDIE BIT(0) |
| 64 | #define CFGR1_PCSCFG BIT(27) |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 65 | #define CFGR1_PINCFG (BIT(24)|BIT(25)) |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 66 | #define CFGR1_PCSPOL BIT(8) |
| 67 | #define CFGR1_NOSTALL BIT(3) |
| 68 | #define CFGR1_MASTER BIT(0) |
Clark Wang | 6a13044 | 2019-01-07 07:47:41 +0000 | [diff] [blame] | 69 | #define FSR_RXCOUNT (BIT(16)|BIT(17)|BIT(18)) |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 70 | #define RSR_RXEMPTY BIT(1) |
| 71 | #define TCR_CPOL BIT(31) |
| 72 | #define TCR_CPHA BIT(30) |
| 73 | #define TCR_CONT BIT(21) |
| 74 | #define TCR_CONTC BIT(20) |
| 75 | #define TCR_RXMSK BIT(19) |
| 76 | #define TCR_TXMSK BIT(18) |
| 77 | |
| 78 | static int clkdivs[] = {1, 2, 4, 8, 16, 32, 64, 128}; |
| 79 | |
| 80 | struct lpspi_config { |
| 81 | u8 bpw; |
| 82 | u8 chip_select; |
| 83 | u8 prescale; |
| 84 | u16 mode; |
| 85 | u32 speed_hz; |
| 86 | }; |
| 87 | |
| 88 | struct fsl_lpspi_data { |
| 89 | struct device *dev; |
| 90 | void __iomem *base; |
Clark Wang | f5e5afd | 2019-03-06 06:30:34 +0000 | [diff] [blame] | 91 | struct clk *clk_ipg; |
| 92 | struct clk *clk_per; |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 93 | bool is_slave; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 94 | |
| 95 | void *rx_buf; |
| 96 | const void *tx_buf; |
| 97 | void (*tx)(struct fsl_lpspi_data *); |
| 98 | void (*rx)(struct fsl_lpspi_data *); |
| 99 | |
| 100 | u32 remain; |
Clark Wang | cf86874 | 2018-12-07 02:50:38 +0000 | [diff] [blame] | 101 | u8 watermark; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 102 | u8 txfifosize; |
| 103 | u8 rxfifosize; |
| 104 | |
| 105 | struct lpspi_config config; |
| 106 | struct completion xfer_done; |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 107 | |
| 108 | bool slave_aborted; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 109 | }; |
| 110 | |
| 111 | static const struct of_device_id fsl_lpspi_dt_ids[] = { |
| 112 | { .compatible = "fsl,imx7ulp-spi", }, |
| 113 | { /* sentinel */ } |
| 114 | }; |
| 115 | MODULE_DEVICE_TABLE(of, fsl_lpspi_dt_ids); |
| 116 | |
| 117 | #define LPSPI_BUF_RX(type) \ |
| 118 | static void fsl_lpspi_buf_rx_##type(struct fsl_lpspi_data *fsl_lpspi) \ |
| 119 | { \ |
| 120 | unsigned int val = readl(fsl_lpspi->base + IMX7ULP_RDR); \ |
| 121 | \ |
| 122 | if (fsl_lpspi->rx_buf) { \ |
| 123 | *(type *)fsl_lpspi->rx_buf = val; \ |
| 124 | fsl_lpspi->rx_buf += sizeof(type); \ |
| 125 | } \ |
| 126 | } |
| 127 | |
| 128 | #define LPSPI_BUF_TX(type) \ |
| 129 | static void fsl_lpspi_buf_tx_##type(struct fsl_lpspi_data *fsl_lpspi) \ |
| 130 | { \ |
| 131 | type val = 0; \ |
| 132 | \ |
| 133 | if (fsl_lpspi->tx_buf) { \ |
| 134 | val = *(type *)fsl_lpspi->tx_buf; \ |
| 135 | fsl_lpspi->tx_buf += sizeof(type); \ |
| 136 | } \ |
| 137 | \ |
| 138 | fsl_lpspi->remain -= sizeof(type); \ |
| 139 | writel(val, fsl_lpspi->base + IMX7ULP_TDR); \ |
| 140 | } |
| 141 | |
| 142 | LPSPI_BUF_RX(u8) |
| 143 | LPSPI_BUF_TX(u8) |
| 144 | LPSPI_BUF_RX(u16) |
| 145 | LPSPI_BUF_TX(u16) |
| 146 | LPSPI_BUF_RX(u32) |
| 147 | LPSPI_BUF_TX(u32) |
| 148 | |
| 149 | static void fsl_lpspi_intctrl(struct fsl_lpspi_data *fsl_lpspi, |
| 150 | unsigned int enable) |
| 151 | { |
| 152 | writel(enable, fsl_lpspi->base + IMX7ULP_IER); |
| 153 | } |
| 154 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 155 | static int lpspi_prepare_xfer_hardware(struct spi_controller *controller) |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 156 | { |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 157 | struct fsl_lpspi_data *fsl_lpspi = |
| 158 | spi_controller_get_devdata(controller); |
Clark Wang | f5e5afd | 2019-03-06 06:30:34 +0000 | [diff] [blame] | 159 | int ret; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 160 | |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 161 | ret = pm_runtime_get_sync(fsl_lpspi->dev); |
| 162 | if (ret < 0) { |
| 163 | dev_err(fsl_lpspi->dev, "failed to enable clock\n"); |
Clark Wang | f5e5afd | 2019-03-06 06:30:34 +0000 | [diff] [blame] | 164 | return ret; |
| 165 | } |
| 166 | |
| 167 | return 0; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 168 | } |
| 169 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 170 | static int lpspi_unprepare_xfer_hardware(struct spi_controller *controller) |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 171 | { |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 172 | struct fsl_lpspi_data *fsl_lpspi = |
| 173 | spi_controller_get_devdata(controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 174 | |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 175 | pm_runtime_mark_last_busy(fsl_lpspi->dev); |
| 176 | pm_runtime_put_autosuspend(fsl_lpspi->dev); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 177 | |
| 178 | return 0; |
| 179 | } |
| 180 | |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 181 | static void fsl_lpspi_write_tx_fifo(struct fsl_lpspi_data *fsl_lpspi) |
| 182 | { |
| 183 | u8 txfifo_cnt; |
Clark Wang | c23fdef | 2019-01-07 07:47:38 +0000 | [diff] [blame] | 184 | u32 temp; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 185 | |
| 186 | txfifo_cnt = readl(fsl_lpspi->base + IMX7ULP_FSR) & 0xff; |
| 187 | |
| 188 | while (txfifo_cnt < fsl_lpspi->txfifosize) { |
| 189 | if (!fsl_lpspi->remain) |
| 190 | break; |
| 191 | fsl_lpspi->tx(fsl_lpspi); |
| 192 | txfifo_cnt++; |
| 193 | } |
| 194 | |
Clark Wang | c23fdef | 2019-01-07 07:47:38 +0000 | [diff] [blame] | 195 | if (txfifo_cnt < fsl_lpspi->txfifosize) { |
| 196 | if (!fsl_lpspi->is_slave) { |
| 197 | temp = readl(fsl_lpspi->base + IMX7ULP_TCR); |
| 198 | temp &= ~TCR_CONTC; |
| 199 | writel(temp, fsl_lpspi->base + IMX7ULP_TCR); |
| 200 | } |
| 201 | |
| 202 | fsl_lpspi_intctrl(fsl_lpspi, IER_FCIE); |
| 203 | } else |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 204 | fsl_lpspi_intctrl(fsl_lpspi, IER_TDIE); |
| 205 | } |
| 206 | |
| 207 | static void fsl_lpspi_read_rx_fifo(struct fsl_lpspi_data *fsl_lpspi) |
| 208 | { |
| 209 | while (!(readl(fsl_lpspi->base + IMX7ULP_RSR) & RSR_RXEMPTY)) |
| 210 | fsl_lpspi->rx(fsl_lpspi); |
| 211 | } |
| 212 | |
| 213 | static void fsl_lpspi_set_cmd(struct fsl_lpspi_data *fsl_lpspi, |
| 214 | bool is_first_xfer) |
| 215 | { |
| 216 | u32 temp = 0; |
| 217 | |
| 218 | temp |= fsl_lpspi->config.bpw - 1; |
Gao Pan | e3a4939 | 2016-11-24 19:04:43 +0800 | [diff] [blame] | 219 | temp |= (fsl_lpspi->config.mode & 0x3) << 30; |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 220 | if (!fsl_lpspi->is_slave) { |
| 221 | temp |= fsl_lpspi->config.prescale << 27; |
| 222 | temp |= (fsl_lpspi->config.chip_select & 0x3) << 24; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 223 | |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 224 | /* |
| 225 | * Set TCR_CONT will keep SS asserted after current transfer. |
| 226 | * For the first transfer, clear TCR_CONTC to assert SS. |
| 227 | * For subsequent transfer, set TCR_CONTC to keep SS asserted. |
| 228 | */ |
| 229 | temp |= TCR_CONT; |
| 230 | if (is_first_xfer) |
| 231 | temp &= ~TCR_CONTC; |
| 232 | else |
| 233 | temp |= TCR_CONTC; |
| 234 | } |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 235 | writel(temp, fsl_lpspi->base + IMX7ULP_TCR); |
| 236 | |
| 237 | dev_dbg(fsl_lpspi->dev, "TCR=0x%x\n", temp); |
| 238 | } |
| 239 | |
| 240 | static void fsl_lpspi_set_watermark(struct fsl_lpspi_data *fsl_lpspi) |
| 241 | { |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 242 | u32 temp; |
| 243 | |
Clark Wang | cf86874 | 2018-12-07 02:50:38 +0000 | [diff] [blame] | 244 | temp = fsl_lpspi->watermark >> 1 | (fsl_lpspi->watermark >> 1) << 16; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 245 | |
| 246 | writel(temp, fsl_lpspi->base + IMX7ULP_FCR); |
| 247 | |
| 248 | dev_dbg(fsl_lpspi->dev, "FCR=0x%x\n", temp); |
| 249 | } |
| 250 | |
| 251 | static int fsl_lpspi_set_bitrate(struct fsl_lpspi_data *fsl_lpspi) |
| 252 | { |
| 253 | struct lpspi_config config = fsl_lpspi->config; |
| 254 | unsigned int perclk_rate, scldiv; |
| 255 | u8 prescale; |
| 256 | |
Clark Wang | f5e5afd | 2019-03-06 06:30:34 +0000 | [diff] [blame] | 257 | perclk_rate = clk_get_rate(fsl_lpspi->clk_per); |
Clark Wang | 77736a9 | 2019-03-06 06:30:41 +0000 | [diff] [blame^] | 258 | |
| 259 | if (config.speed_hz > perclk_rate / 2) { |
| 260 | dev_err(fsl_lpspi->dev, |
| 261 | "per-clk should be at least two times of transfer speed"); |
| 262 | return -EINVAL; |
| 263 | } |
| 264 | |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 265 | for (prescale = 0; prescale < 8; prescale++) { |
| 266 | scldiv = perclk_rate / |
| 267 | (clkdivs[prescale] * config.speed_hz) - 2; |
| 268 | if (scldiv < 256) { |
| 269 | fsl_lpspi->config.prescale = prescale; |
| 270 | break; |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | if (prescale == 8 && scldiv >= 256) |
| 275 | return -EINVAL; |
| 276 | |
Clark Wang | cf86874 | 2018-12-07 02:50:38 +0000 | [diff] [blame] | 277 | writel(scldiv | (scldiv << 8) | ((scldiv >> 1) << 16), |
| 278 | fsl_lpspi->base + IMX7ULP_CCR); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 279 | |
| 280 | dev_dbg(fsl_lpspi->dev, "perclk=%d, speed=%d, prescale =%d, scldiv=%d\n", |
| 281 | perclk_rate, config.speed_hz, prescale, scldiv); |
| 282 | |
| 283 | return 0; |
| 284 | } |
| 285 | |
| 286 | static int fsl_lpspi_config(struct fsl_lpspi_data *fsl_lpspi) |
| 287 | { |
| 288 | u32 temp; |
| 289 | int ret; |
| 290 | |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 291 | if (!fsl_lpspi->is_slave) { |
| 292 | ret = fsl_lpspi_set_bitrate(fsl_lpspi); |
| 293 | if (ret) |
| 294 | return ret; |
| 295 | } |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 296 | |
| 297 | fsl_lpspi_set_watermark(fsl_lpspi); |
| 298 | |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 299 | if (!fsl_lpspi->is_slave) |
| 300 | temp = CFGR1_MASTER; |
| 301 | else |
| 302 | temp = CFGR1_PINCFG; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 303 | if (fsl_lpspi->config.mode & SPI_CS_HIGH) |
| 304 | temp |= CFGR1_PCSPOL; |
| 305 | writel(temp, fsl_lpspi->base + IMX7ULP_CFGR1); |
| 306 | |
| 307 | temp = readl(fsl_lpspi->base + IMX7ULP_CR); |
| 308 | temp |= CR_RRF | CR_RTF | CR_MEN; |
| 309 | writel(temp, fsl_lpspi->base + IMX7ULP_CR); |
| 310 | |
| 311 | return 0; |
| 312 | } |
| 313 | |
Clark Wang | 77736a9 | 2019-03-06 06:30:41 +0000 | [diff] [blame^] | 314 | static int fsl_lpspi_setup_transfer(struct spi_device *spi, |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 315 | struct spi_transfer *t) |
| 316 | { |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 317 | struct fsl_lpspi_data *fsl_lpspi = |
| 318 | spi_controller_get_devdata(spi->controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 319 | |
| 320 | fsl_lpspi->config.mode = spi->mode; |
| 321 | fsl_lpspi->config.bpw = t ? t->bits_per_word : spi->bits_per_word; |
| 322 | fsl_lpspi->config.speed_hz = t ? t->speed_hz : spi->max_speed_hz; |
| 323 | fsl_lpspi->config.chip_select = spi->chip_select; |
| 324 | |
| 325 | if (!fsl_lpspi->config.speed_hz) |
| 326 | fsl_lpspi->config.speed_hz = spi->max_speed_hz; |
| 327 | if (!fsl_lpspi->config.bpw) |
| 328 | fsl_lpspi->config.bpw = spi->bits_per_word; |
| 329 | |
| 330 | /* Initialize the functions for transfer */ |
| 331 | if (fsl_lpspi->config.bpw <= 8) { |
| 332 | fsl_lpspi->rx = fsl_lpspi_buf_rx_u8; |
| 333 | fsl_lpspi->tx = fsl_lpspi_buf_tx_u8; |
| 334 | } else if (fsl_lpspi->config.bpw <= 16) { |
| 335 | fsl_lpspi->rx = fsl_lpspi_buf_rx_u16; |
| 336 | fsl_lpspi->tx = fsl_lpspi_buf_tx_u16; |
| 337 | } else { |
| 338 | fsl_lpspi->rx = fsl_lpspi_buf_rx_u32; |
| 339 | fsl_lpspi->tx = fsl_lpspi_buf_tx_u32; |
| 340 | } |
| 341 | |
Clark Wang | cf86874 | 2018-12-07 02:50:38 +0000 | [diff] [blame] | 342 | if (t->len <= fsl_lpspi->txfifosize) |
| 343 | fsl_lpspi->watermark = t->len; |
| 344 | else |
| 345 | fsl_lpspi->watermark = fsl_lpspi->txfifosize; |
| 346 | |
Clark Wang | 77736a9 | 2019-03-06 06:30:41 +0000 | [diff] [blame^] | 347 | return fsl_lpspi_config(fsl_lpspi); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 348 | } |
| 349 | |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 350 | static int fsl_lpspi_slave_abort(struct spi_controller *controller) |
| 351 | { |
| 352 | struct fsl_lpspi_data *fsl_lpspi = |
| 353 | spi_controller_get_devdata(controller); |
| 354 | |
| 355 | fsl_lpspi->slave_aborted = true; |
| 356 | complete(&fsl_lpspi->xfer_done); |
| 357 | return 0; |
| 358 | } |
| 359 | |
| 360 | static int fsl_lpspi_wait_for_completion(struct spi_controller *controller) |
| 361 | { |
| 362 | struct fsl_lpspi_data *fsl_lpspi = |
| 363 | spi_controller_get_devdata(controller); |
| 364 | |
| 365 | if (fsl_lpspi->is_slave) { |
| 366 | if (wait_for_completion_interruptible(&fsl_lpspi->xfer_done) || |
| 367 | fsl_lpspi->slave_aborted) { |
| 368 | dev_dbg(fsl_lpspi->dev, "interrupted\n"); |
| 369 | return -EINTR; |
| 370 | } |
| 371 | } else { |
| 372 | if (!wait_for_completion_timeout(&fsl_lpspi->xfer_done, HZ)) { |
| 373 | dev_dbg(fsl_lpspi->dev, "wait for completion timeout\n"); |
| 374 | return -ETIMEDOUT; |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | return 0; |
| 379 | } |
| 380 | |
Clark Wang | a15dc3d | 2019-01-07 07:47:43 +0000 | [diff] [blame] | 381 | static int fsl_lpspi_reset(struct fsl_lpspi_data *fsl_lpspi) |
| 382 | { |
| 383 | u32 temp; |
| 384 | |
| 385 | /* Disable all interrupt */ |
| 386 | fsl_lpspi_intctrl(fsl_lpspi, 0); |
| 387 | |
| 388 | /* W1C for all flags in SR */ |
| 389 | temp = 0x3F << 8; |
| 390 | writel(temp, fsl_lpspi->base + IMX7ULP_SR); |
| 391 | |
| 392 | /* Clear FIFO and disable module */ |
| 393 | temp = CR_RRF | CR_RTF; |
| 394 | writel(temp, fsl_lpspi->base + IMX7ULP_CR); |
| 395 | |
| 396 | return 0; |
| 397 | } |
| 398 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 399 | static int fsl_lpspi_transfer_one(struct spi_controller *controller, |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 400 | struct spi_device *spi, |
| 401 | struct spi_transfer *t) |
| 402 | { |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 403 | struct fsl_lpspi_data *fsl_lpspi = |
| 404 | spi_controller_get_devdata(controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 405 | int ret; |
| 406 | |
| 407 | fsl_lpspi->tx_buf = t->tx_buf; |
| 408 | fsl_lpspi->rx_buf = t->rx_buf; |
| 409 | fsl_lpspi->remain = t->len; |
| 410 | |
| 411 | reinit_completion(&fsl_lpspi->xfer_done); |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 412 | fsl_lpspi->slave_aborted = false; |
| 413 | |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 414 | fsl_lpspi_write_tx_fifo(fsl_lpspi); |
Gao Pan | d2ad0a62 | 2016-11-28 11:02:59 +0800 | [diff] [blame] | 415 | |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 416 | ret = fsl_lpspi_wait_for_completion(controller); |
| 417 | if (ret) |
| 418 | return ret; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 419 | |
Clark Wang | a15dc3d | 2019-01-07 07:47:43 +0000 | [diff] [blame] | 420 | fsl_lpspi_reset(fsl_lpspi); |
| 421 | |
Gao Pan | d989eed | 2016-12-02 11:50:01 +0800 | [diff] [blame] | 422 | return 0; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 423 | } |
| 424 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 425 | static int fsl_lpspi_transfer_one_msg(struct spi_controller *controller, |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 426 | struct spi_message *msg) |
| 427 | { |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 428 | struct fsl_lpspi_data *fsl_lpspi = |
| 429 | spi_controller_get_devdata(controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 430 | struct spi_device *spi = msg->spi; |
| 431 | struct spi_transfer *xfer; |
| 432 | bool is_first_xfer = true; |
Geert Uytterhoeven | cc4a7ff | 2016-12-14 12:20:55 +0100 | [diff] [blame] | 433 | int ret = 0; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 434 | |
| 435 | msg->status = 0; |
| 436 | msg->actual_length = 0; |
| 437 | |
| 438 | list_for_each_entry(xfer, &msg->transfers, transfer_list) { |
Clark Wang | 77736a9 | 2019-03-06 06:30:41 +0000 | [diff] [blame^] | 439 | ret = fsl_lpspi_setup_transfer(spi, xfer); |
| 440 | if (ret < 0) |
| 441 | goto complete; |
| 442 | |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 443 | fsl_lpspi_set_cmd(fsl_lpspi, is_first_xfer); |
| 444 | |
| 445 | is_first_xfer = false; |
| 446 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 447 | ret = fsl_lpspi_transfer_one(controller, spi, xfer); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 448 | if (ret < 0) |
| 449 | goto complete; |
| 450 | |
| 451 | msg->actual_length += xfer->len; |
| 452 | } |
| 453 | |
| 454 | complete: |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 455 | msg->status = ret; |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 456 | spi_finalize_current_message(controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 457 | |
| 458 | return ret; |
| 459 | } |
| 460 | |
| 461 | static irqreturn_t fsl_lpspi_isr(int irq, void *dev_id) |
| 462 | { |
Clark Wang | c23fdef | 2019-01-07 07:47:38 +0000 | [diff] [blame] | 463 | u32 temp_SR, temp_IER; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 464 | struct fsl_lpspi_data *fsl_lpspi = dev_id; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 465 | |
Clark Wang | c23fdef | 2019-01-07 07:47:38 +0000 | [diff] [blame] | 466 | temp_IER = readl(fsl_lpspi->base + IMX7ULP_IER); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 467 | fsl_lpspi_intctrl(fsl_lpspi, 0); |
Clark Wang | c23fdef | 2019-01-07 07:47:38 +0000 | [diff] [blame] | 468 | temp_SR = readl(fsl_lpspi->base + IMX7ULP_SR); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 469 | |
| 470 | fsl_lpspi_read_rx_fifo(fsl_lpspi); |
| 471 | |
Clark Wang | c23fdef | 2019-01-07 07:47:38 +0000 | [diff] [blame] | 472 | if ((temp_SR & SR_TDF) && (temp_IER & IER_TDIE)) { |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 473 | fsl_lpspi_write_tx_fifo(fsl_lpspi); |
Clark Wang | c23fdef | 2019-01-07 07:47:38 +0000 | [diff] [blame] | 474 | return IRQ_HANDLED; |
| 475 | } |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 476 | |
Clark Wang | 6a13044 | 2019-01-07 07:47:41 +0000 | [diff] [blame] | 477 | if (temp_SR & SR_MBF || |
| 478 | readl(fsl_lpspi->base + IMX7ULP_FSR) & FSR_RXCOUNT) { |
| 479 | writel(SR_FCF, fsl_lpspi->base + IMX7ULP_SR); |
| 480 | fsl_lpspi_intctrl(fsl_lpspi, IER_FCIE); |
| 481 | return IRQ_HANDLED; |
| 482 | } |
| 483 | |
Clark Wang | c23fdef | 2019-01-07 07:47:38 +0000 | [diff] [blame] | 484 | if (temp_SR & SR_FCF && (temp_IER & IER_FCIE)) { |
| 485 | writel(SR_FCF, fsl_lpspi->base + IMX7ULP_SR); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 486 | complete(&fsl_lpspi->xfer_done); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 487 | return IRQ_HANDLED; |
| 488 | } |
| 489 | |
| 490 | return IRQ_NONE; |
| 491 | } |
| 492 | |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 493 | int fsl_lpspi_runtime_resume(struct device *dev) |
| 494 | { |
| 495 | struct fsl_lpspi_data *fsl_lpspi = dev_get_drvdata(dev); |
| 496 | int ret; |
| 497 | |
| 498 | ret = clk_prepare_enable(fsl_lpspi->clk_per); |
| 499 | if (ret) |
| 500 | return ret; |
| 501 | |
| 502 | ret = clk_prepare_enable(fsl_lpspi->clk_ipg); |
| 503 | if (ret) { |
| 504 | clk_disable_unprepare(fsl_lpspi->clk_per); |
| 505 | return ret; |
| 506 | } |
| 507 | |
| 508 | return 0; |
| 509 | } |
| 510 | |
| 511 | int fsl_lpspi_runtime_suspend(struct device *dev) |
| 512 | { |
| 513 | struct fsl_lpspi_data *fsl_lpspi = dev_get_drvdata(dev); |
| 514 | |
| 515 | clk_disable_unprepare(fsl_lpspi->clk_per); |
| 516 | clk_disable_unprepare(fsl_lpspi->clk_ipg); |
| 517 | |
| 518 | return 0; |
| 519 | } |
| 520 | |
| 521 | static int fsl_lpspi_init_rpm(struct fsl_lpspi_data *fsl_lpspi) |
| 522 | { |
| 523 | struct device *dev = fsl_lpspi->dev; |
| 524 | |
| 525 | pm_runtime_enable(dev); |
| 526 | pm_runtime_set_autosuspend_delay(dev, FSL_LPSPI_RPM_TIMEOUT); |
| 527 | pm_runtime_use_autosuspend(dev); |
| 528 | |
| 529 | return 0; |
| 530 | } |
| 531 | |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 532 | static int fsl_lpspi_probe(struct platform_device *pdev) |
| 533 | { |
| 534 | struct fsl_lpspi_data *fsl_lpspi; |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 535 | struct spi_controller *controller; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 536 | struct resource *res; |
| 537 | int ret, irq; |
Gao Pan | b88a0de | 2016-11-28 11:03:00 +0800 | [diff] [blame] | 538 | u32 temp; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 539 | |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 540 | if (of_property_read_bool((&pdev->dev)->of_node, "spi-slave")) |
| 541 | controller = spi_alloc_slave(&pdev->dev, |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 542 | sizeof(struct fsl_lpspi_data)); |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 543 | else |
| 544 | controller = spi_alloc_master(&pdev->dev, |
| 545 | sizeof(struct fsl_lpspi_data)); |
| 546 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 547 | if (!controller) |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 548 | return -ENOMEM; |
| 549 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 550 | platform_set_drvdata(pdev, controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 551 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 552 | controller->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 32); |
| 553 | controller->bus_num = pdev->id; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 554 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 555 | fsl_lpspi = spi_controller_get_devdata(controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 556 | fsl_lpspi->dev = &pdev->dev; |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 557 | dev_set_drvdata(&pdev->dev, fsl_lpspi); |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 558 | fsl_lpspi->is_slave = of_property_read_bool((&pdev->dev)->of_node, |
| 559 | "spi-slave"); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 560 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 561 | controller->transfer_one_message = fsl_lpspi_transfer_one_msg; |
| 562 | controller->prepare_transfer_hardware = lpspi_prepare_xfer_hardware; |
| 563 | controller->unprepare_transfer_hardware = lpspi_unprepare_xfer_hardware; |
| 564 | controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; |
| 565 | controller->flags = SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX; |
| 566 | controller->dev.of_node = pdev->dev.of_node; |
| 567 | controller->bus_num = pdev->id; |
Clark Wang | bcd8731 | 2018-12-07 02:50:36 +0000 | [diff] [blame] | 568 | controller->slave_abort = fsl_lpspi_slave_abort; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 569 | |
| 570 | init_completion(&fsl_lpspi->xfer_done); |
| 571 | |
| 572 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 573 | fsl_lpspi->base = devm_ioremap_resource(&pdev->dev, res); |
| 574 | if (IS_ERR(fsl_lpspi->base)) { |
| 575 | ret = PTR_ERR(fsl_lpspi->base); |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 576 | goto out_controller_put; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 577 | } |
| 578 | |
| 579 | irq = platform_get_irq(pdev, 0); |
| 580 | if (irq < 0) { |
| 581 | ret = irq; |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 582 | goto out_controller_put; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 583 | } |
| 584 | |
| 585 | ret = devm_request_irq(&pdev->dev, irq, fsl_lpspi_isr, 0, |
| 586 | dev_name(&pdev->dev), fsl_lpspi); |
| 587 | if (ret) { |
| 588 | dev_err(&pdev->dev, "can't get irq%d: %d\n", irq, ret); |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 589 | goto out_controller_put; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 590 | } |
| 591 | |
Clark Wang | f5e5afd | 2019-03-06 06:30:34 +0000 | [diff] [blame] | 592 | fsl_lpspi->clk_per = devm_clk_get(&pdev->dev, "per"); |
| 593 | if (IS_ERR(fsl_lpspi->clk_per)) { |
| 594 | ret = PTR_ERR(fsl_lpspi->clk_per); |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 595 | goto out_controller_put; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 596 | } |
| 597 | |
Clark Wang | f5e5afd | 2019-03-06 06:30:34 +0000 | [diff] [blame] | 598 | fsl_lpspi->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); |
| 599 | if (IS_ERR(fsl_lpspi->clk_ipg)) { |
| 600 | ret = PTR_ERR(fsl_lpspi->clk_ipg); |
| 601 | goto out_controller_put; |
| 602 | } |
| 603 | |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 604 | /* enable the clock */ |
| 605 | ret = fsl_lpspi_init_rpm(fsl_lpspi); |
| 606 | if (ret) |
Clark Wang | f5e5afd | 2019-03-06 06:30:34 +0000 | [diff] [blame] | 607 | goto out_controller_put; |
Clark Wang | f5e5afd | 2019-03-06 06:30:34 +0000 | [diff] [blame] | 608 | |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 609 | ret = pm_runtime_get_sync(fsl_lpspi->dev); |
| 610 | if (ret < 0) { |
| 611 | dev_err(fsl_lpspi->dev, "failed to enable clock\n"); |
| 612 | return ret; |
Gao Pan | b88a0de | 2016-11-28 11:03:00 +0800 | [diff] [blame] | 613 | } |
| 614 | |
| 615 | temp = readl(fsl_lpspi->base + IMX7ULP_PARAM); |
| 616 | fsl_lpspi->txfifosize = 1 << (temp & 0x0f); |
| 617 | fsl_lpspi->rxfifosize = 1 << ((temp >> 8) & 0x0f); |
| 618 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 619 | ret = devm_spi_register_controller(&pdev->dev, controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 620 | if (ret < 0) { |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 621 | dev_err(&pdev->dev, "spi_register_controller error.\n"); |
| 622 | goto out_controller_put; |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 623 | } |
| 624 | |
| 625 | return 0; |
| 626 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 627 | out_controller_put: |
| 628 | spi_controller_put(controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 629 | |
| 630 | return ret; |
| 631 | } |
| 632 | |
| 633 | static int fsl_lpspi_remove(struct platform_device *pdev) |
| 634 | { |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 635 | struct spi_controller *controller = platform_get_drvdata(pdev); |
| 636 | struct fsl_lpspi_data *fsl_lpspi = |
| 637 | spi_controller_get_devdata(controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 638 | |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 639 | pm_runtime_disable(fsl_lpspi->dev); |
| 640 | |
| 641 | spi_master_put(controller); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 642 | |
| 643 | return 0; |
| 644 | } |
| 645 | |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 646 | #ifdef CONFIG_PM_SLEEP |
| 647 | static int fsl_lpspi_suspend(struct device *dev) |
| 648 | { |
| 649 | int ret; |
| 650 | |
| 651 | pinctrl_pm_select_sleep_state(dev); |
| 652 | ret = pm_runtime_force_suspend(dev); |
| 653 | return ret; |
| 654 | } |
| 655 | |
| 656 | static int fsl_lpspi_resume(struct device *dev) |
| 657 | { |
| 658 | int ret; |
| 659 | |
| 660 | ret = pm_runtime_force_resume(dev); |
| 661 | if (ret) { |
| 662 | dev_err(dev, "Error in resume: %d\n", ret); |
| 663 | return ret; |
| 664 | } |
| 665 | |
| 666 | pinctrl_pm_select_default_state(dev); |
| 667 | |
| 668 | return 0; |
| 669 | } |
| 670 | #endif /* CONFIG_PM_SLEEP */ |
| 671 | |
| 672 | static const struct dev_pm_ops fsl_lpspi_pm_ops = { |
| 673 | SET_RUNTIME_PM_OPS(fsl_lpspi_runtime_suspend, |
| 674 | fsl_lpspi_runtime_resume, NULL) |
| 675 | SET_SYSTEM_SLEEP_PM_OPS(fsl_lpspi_suspend, fsl_lpspi_resume) |
| 676 | }; |
| 677 | |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 678 | static struct platform_driver fsl_lpspi_driver = { |
| 679 | .driver = { |
Gao Pan | 102ecc47 | 2017-01-04 17:38:16 +0800 | [diff] [blame] | 680 | .name = DRIVER_NAME, |
| 681 | .of_match_table = fsl_lpspi_dt_ids, |
Han Xu | 944c01a | 2019-03-06 06:30:39 +0000 | [diff] [blame] | 682 | .pm = &fsl_lpspi_pm_ops, |
Gao Pan | 102ecc47 | 2017-01-04 17:38:16 +0800 | [diff] [blame] | 683 | }, |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 684 | .probe = fsl_lpspi_probe, |
| 685 | .remove = fsl_lpspi_remove, |
| 686 | }; |
| 687 | module_platform_driver(fsl_lpspi_driver); |
| 688 | |
Clark Wang | 07d7155 | 2018-12-07 02:50:34 +0000 | [diff] [blame] | 689 | MODULE_DESCRIPTION("LPSPI Controller driver"); |
Gao Pan | 5314987 | 2016-11-22 21:52:17 +0800 | [diff] [blame] | 690 | MODULE_AUTHOR("Gao Pan <pandy.gao@nxp.com>"); |
Gao Pan | b6787b6 | 2016-12-02 11:50:00 +0800 | [diff] [blame] | 691 | MODULE_LICENSE("GPL"); |