spi-ath79.c (5d2d4a9f603a47403395408f64b1261ca61f6d50) | spi-ath79.c (cff49d58f57e5667c10a0db85d7461790bb85cf8) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * SPI controller driver for the Atheros AR71XX/AR724X/AR913X SoCs 4 * 5 * Copyright (C) 2009-2011 Gabor Juhos <juhosg@openwrt.org> 6 * 7 * This driver has been based on the spi-gpio.c: 8 * Copyright (C) 2006,2008 David Brownell --- 132 unchanged lines hidden (view full) --- 141 142 /* Ensures that reading is performed on device connected to hardware cs0 */ 143 if (spi_get_chipselect(mem->spi, 0) || spi_get_csgpiod(mem->spi, 0)) 144 return -ENOTSUPP; 145 146 /* Only use for fast-read op. */ 147 if (op->cmd.opcode != 0x0b || op->data.dir != SPI_MEM_DATA_IN || 148 op->addr.nbytes != 3 || op->dummy.nbytes != 1) | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * SPI controller driver for the Atheros AR71XX/AR724X/AR913X SoCs 4 * 5 * Copyright (C) 2009-2011 Gabor Juhos <juhosg@openwrt.org> 6 * 7 * This driver has been based on the spi-gpio.c: 8 * Copyright (C) 2006,2008 David Brownell --- 132 unchanged lines hidden (view full) --- 141 142 /* Ensures that reading is performed on device connected to hardware cs0 */ 143 if (spi_get_chipselect(mem->spi, 0) || spi_get_csgpiod(mem->spi, 0)) 144 return -ENOTSUPP; 145 146 /* Only use for fast-read op. */ 147 if (op->cmd.opcode != 0x0b || op->data.dir != SPI_MEM_DATA_IN || 148 op->addr.nbytes != 3 || op->dummy.nbytes != 1) |
149 return -ENOTSUPP; | 149 return -EOPNOTSUPP; |
150 151 /* disable GPIO mode */ 152 ath79_spi_wr(sp, AR71XX_SPI_REG_FS, 0); 153 154 memcpy_fromio(op->data.buf.in, sp->base + op->addr.val, op->data.nbytes); 155 156 /* enable GPIO mode */ 157 ath79_spi_wr(sp, AR71XX_SPI_REG_FS, AR71XX_SPI_FS_GPIO); --- 111 unchanged lines hidden --- | 150 151 /* disable GPIO mode */ 152 ath79_spi_wr(sp, AR71XX_SPI_REG_FS, 0); 153 154 memcpy_fromio(op->data.buf.in, sp->base + op->addr.val, op->data.nbytes); 155 156 /* enable GPIO mode */ 157 ath79_spi_wr(sp, AR71XX_SPI_REG_FS, AR71XX_SPI_FS_GPIO); --- 111 unchanged lines hidden --- |