Commit 64a7b0e0 authored by Mark Brown's avatar Mark Brown

spi: Header and core clean up and refactoring

Merge series from Andy Shevchenko <andriy.shevchenko@linux.intel.com>:

Various cleanups and refactorings of the SPI header and core parts
united in a single series. It also touches drivers under SPI subsystem
folder on the pure renaming purposes of some constants.

No functional change intended.
parents 0f516226 702ca026
...@@ -404,7 +404,7 @@ static int amd_spi_probe(struct platform_device *pdev) ...@@ -404,7 +404,7 @@ static int amd_spi_probe(struct platform_device *pdev)
master->bus_num = 0; master->bus_num = 0;
master->num_chipselect = 4; master->num_chipselect = 4;
master->mode_bits = 0; master->mode_bits = 0;
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->max_speed_hz = AMD_SPI_MAX_HZ; master->max_speed_hz = AMD_SPI_MAX_HZ;
master->min_speed_hz = AMD_SPI_MIN_HZ; master->min_speed_hz = AMD_SPI_MIN_HZ;
master->setup = amd_spi_master_setup; master->setup = amd_spi_master_setup;
......
...@@ -527,7 +527,7 @@ static int at91_usart_spi_probe(struct platform_device *pdev) ...@@ -527,7 +527,7 @@ static int at91_usart_spi_probe(struct platform_device *pdev)
controller->dev.of_node = pdev->dev.parent->of_node; controller->dev.of_node = pdev->dev.parent->of_node;
controller->bits_per_word_mask = SPI_BPW_MASK(8); controller->bits_per_word_mask = SPI_BPW_MASK(8);
controller->setup = at91_usart_spi_setup; controller->setup = at91_usart_spi_setup;
controller->flags = SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX; controller->flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX;
controller->transfer_one = at91_usart_spi_transfer_one; controller->transfer_one = at91_usart_spi_transfer_one;
controller->prepare_message = at91_usart_spi_prepare_message; controller->prepare_message = at91_usart_spi_prepare_message;
controller->unprepare_message = at91_usart_spi_unprepare_message; controller->unprepare_message = at91_usart_spi_unprepare_message;
......
...@@ -185,7 +185,7 @@ static int ath79_spi_probe(struct platform_device *pdev) ...@@ -185,7 +185,7 @@ static int ath79_spi_probe(struct platform_device *pdev)
host->use_gpio_descriptors = true; host->use_gpio_descriptors = true;
host->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32); host->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32);
host->flags = SPI_MASTER_GPIO_SS; host->flags = SPI_CONTROLLER_GPIO_SS;
host->num_chipselect = 3; host->num_chipselect = 3;
host->mem_ops = &ath79_mem_ops; host->mem_ops = &ath79_mem_ops;
......
...@@ -1471,8 +1471,8 @@ static int atmel_spi_probe(struct platform_device *pdev) ...@@ -1471,8 +1471,8 @@ static int atmel_spi_probe(struct platform_device *pdev)
host->bus_num = pdev->id; host->bus_num = pdev->id;
host->num_chipselect = 4; host->num_chipselect = 4;
host->setup = atmel_spi_setup; host->setup = atmel_spi_setup;
host->flags = (SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX | host->flags = (SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX |
SPI_MASTER_GPIO_SS); SPI_CONTROLLER_GPIO_SS);
host->transfer_one = atmel_spi_one_transfer; host->transfer_one = atmel_spi_one_transfer;
host->set_cs = atmel_spi_set_cs; host->set_cs = atmel_spi_set_cs;
host->cleanup = atmel_spi_cleanup; host->cleanup = atmel_spi_cleanup;
......
...@@ -57,7 +57,7 @@ bitbang_txrx_be_cpha0(struct spi_device *spi, ...@@ -57,7 +57,7 @@ bitbang_txrx_be_cpha0(struct spi_device *spi,
for (word <<= (32 - bits); likely(bits); bits--) { for (word <<= (32 - bits); likely(bits); bits--) {
/* setup MSB (to slave) on trailing edge */ /* setup MSB (to slave) on trailing edge */
if ((flags & SPI_MASTER_NO_TX) == 0) { if ((flags & SPI_CONTROLLER_NO_TX) == 0) {
if ((word & (1 << 31)) != oldbit) { if ((word & (1 << 31)) != oldbit) {
setmosi(spi, word & (1 << 31)); setmosi(spi, word & (1 << 31));
oldbit = word & (1 << 31); oldbit = word & (1 << 31);
...@@ -70,7 +70,7 @@ bitbang_txrx_be_cpha0(struct spi_device *spi, ...@@ -70,7 +70,7 @@ bitbang_txrx_be_cpha0(struct spi_device *spi,
/* sample MSB (from slave) on leading edge */ /* sample MSB (from slave) on leading edge */
word <<= 1; word <<= 1;
if ((flags & SPI_MASTER_NO_RX) == 0) if ((flags & SPI_CONTROLLER_NO_RX) == 0)
word |= getmiso(spi); word |= getmiso(spi);
setsck(spi, cpol); setsck(spi, cpol);
} }
...@@ -90,7 +90,7 @@ bitbang_txrx_be_cpha1(struct spi_device *spi, ...@@ -90,7 +90,7 @@ bitbang_txrx_be_cpha1(struct spi_device *spi,
/* setup MSB (to slave) on leading edge */ /* setup MSB (to slave) on leading edge */
setsck(spi, !cpol); setsck(spi, !cpol);
if ((flags & SPI_MASTER_NO_TX) == 0) { if ((flags & SPI_CONTROLLER_NO_TX) == 0) {
if ((word & (1 << 31)) != oldbit) { if ((word & (1 << 31)) != oldbit) {
setmosi(spi, word & (1 << 31)); setmosi(spi, word & (1 << 31));
oldbit = word & (1 << 31); oldbit = word & (1 << 31);
...@@ -103,7 +103,7 @@ bitbang_txrx_be_cpha1(struct spi_device *spi, ...@@ -103,7 +103,7 @@ bitbang_txrx_be_cpha1(struct spi_device *spi,
/* sample MSB (from slave) on trailing edge */ /* sample MSB (from slave) on trailing edge */
word <<= 1; word <<= 1;
if ((flags & SPI_MASTER_NO_RX) == 0) if ((flags & SPI_CONTROLLER_NO_RX) == 0)
word |= getmiso(spi); word |= getmiso(spi);
} }
return word; return word;
...@@ -122,7 +122,7 @@ bitbang_txrx_le_cpha0(struct spi_device *spi, ...@@ -122,7 +122,7 @@ bitbang_txrx_le_cpha0(struct spi_device *spi,
for (; likely(bits); bits--) { for (; likely(bits); bits--) {
/* setup LSB (to slave) on trailing edge */ /* setup LSB (to slave) on trailing edge */
if ((flags & SPI_MASTER_NO_TX) == 0) { if ((flags & SPI_CONTROLLER_NO_TX) == 0) {
if ((word & 1) != oldbit) { if ((word & 1) != oldbit) {
setmosi(spi, word & 1); setmosi(spi, word & 1);
oldbit = word & 1; oldbit = word & 1;
...@@ -135,7 +135,7 @@ bitbang_txrx_le_cpha0(struct spi_device *spi, ...@@ -135,7 +135,7 @@ bitbang_txrx_le_cpha0(struct spi_device *spi,
/* sample LSB (from slave) on leading edge */ /* sample LSB (from slave) on leading edge */
word >>= 1; word >>= 1;
if ((flags & SPI_MASTER_NO_RX) == 0) if ((flags & SPI_CONTROLLER_NO_RX) == 0)
word |= getmiso(spi) << rxbit; word |= getmiso(spi) << rxbit;
setsck(spi, cpol); setsck(spi, cpol);
} }
...@@ -156,7 +156,7 @@ bitbang_txrx_le_cpha1(struct spi_device *spi, ...@@ -156,7 +156,7 @@ bitbang_txrx_le_cpha1(struct spi_device *spi,
/* setup LSB (to slave) on leading edge */ /* setup LSB (to slave) on leading edge */
setsck(spi, !cpol); setsck(spi, !cpol);
if ((flags & SPI_MASTER_NO_TX) == 0) { if ((flags & SPI_CONTROLLER_NO_TX) == 0) {
if ((word & 1) != oldbit) { if ((word & 1) != oldbit) {
setmosi(spi, word & 1); setmosi(spi, word & 1);
oldbit = word & 1; oldbit = word & 1;
...@@ -169,7 +169,7 @@ bitbang_txrx_le_cpha1(struct spi_device *spi, ...@@ -169,7 +169,7 @@ bitbang_txrx_le_cpha1(struct spi_device *spi,
/* sample LSB (from slave) on trailing edge */ /* sample LSB (from slave) on trailing edge */
word >>= 1; word >>= 1;
if ((flags & SPI_MASTER_NO_RX) == 0) if ((flags & SPI_CONTROLLER_NO_RX) == 0)
word |= getmiso(spi) << rxbit; word |= getmiso(spi) << rxbit;
} }
return word; return word;
......
...@@ -248,7 +248,7 @@ static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t) ...@@ -248,7 +248,7 @@ static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t)
if (spi->mode & SPI_3WIRE) { if (spi->mode & SPI_3WIRE) {
unsigned flags; unsigned flags;
flags = t->tx_buf ? SPI_MASTER_NO_RX : SPI_MASTER_NO_TX; flags = t->tx_buf ? SPI_CONTROLLER_NO_RX : SPI_CONTROLLER_NO_TX;
return cs->txrx_bufs(spi, cs->txrx_word, nsecs, t, flags); return cs->txrx_bufs(spi, cs->txrx_word, nsecs, t, flags);
} }
return cs->txrx_bufs(spi, cs->txrx_word, nsecs, t, 0); return cs->txrx_bufs(spi, cs->txrx_word, nsecs, t, 0);
...@@ -349,11 +349,11 @@ int spi_bitbang_init(struct spi_bitbang *bitbang) ...@@ -349,11 +349,11 @@ int spi_bitbang_init(struct spi_bitbang *bitbang)
/* /*
* We only need the chipselect callback if we are actually using it. * We only need the chipselect callback if we are actually using it.
* If we just use GPIO descriptors, it is surplus. If the * If we just use GPIO descriptors, it is surplus. If the
* SPI_MASTER_GPIO_SS flag is set, we always need to call the * SPI_CONTROLLER_GPIO_SS flag is set, we always need to call the
* driver-specific chipselect routine. * driver-specific chipselect routine.
*/ */
custom_cs = (!master->use_gpio_descriptors || custom_cs = (!master->use_gpio_descriptors ||
(master->flags & SPI_MASTER_GPIO_SS)); (master->flags & SPI_CONTROLLER_GPIO_SS));
if (custom_cs && !bitbang->chipselect) if (custom_cs && !bitbang->chipselect)
return -EINVAL; return -EINVAL;
...@@ -371,7 +371,7 @@ int spi_bitbang_init(struct spi_bitbang *bitbang) ...@@ -371,7 +371,7 @@ int spi_bitbang_init(struct spi_bitbang *bitbang)
master->transfer_one = spi_bitbang_transfer_one; master->transfer_one = spi_bitbang_transfer_one;
/* /*
* When using GPIO descriptors, the ->set_cs() callback doesn't even * When using GPIO descriptors, the ->set_cs() callback doesn't even
* get called unless SPI_MASTER_GPIO_SS is set. * get called unless SPI_CONTROLLER_GPIO_SS is set.
*/ */
if (custom_cs) if (custom_cs)
master->set_cs = spi_bitbang_set_cs; master->set_cs = spi_bitbang_set_cs;
......
...@@ -64,7 +64,7 @@ static int thunderx_spi_probe(struct pci_dev *pdev, ...@@ -64,7 +64,7 @@ static int thunderx_spi_probe(struct pci_dev *pdev,
p->sys_freq = SYS_FREQ_DEFAULT; p->sys_freq = SYS_FREQ_DEFAULT;
dev_info(dev, "Set system clock to %u\n", p->sys_freq); dev_info(dev, "Set system clock to %u\n", p->sys_freq);
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->num_chipselect = 4; master->num_chipselect = 4;
master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH | master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH |
SPI_LSB_FIRST | SPI_3WIRE; SPI_LSB_FIRST | SPI_3WIRE;
......
...@@ -930,7 +930,7 @@ static int davinci_spi_probe(struct platform_device *pdev) ...@@ -930,7 +930,7 @@ static int davinci_spi_probe(struct platform_device *pdev)
master->bus_num = pdev->id; master->bus_num = pdev->id;
master->num_chipselect = pdata->num_chipselect; master->num_chipselect = pdata->num_chipselect;
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16); master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16);
master->flags = SPI_MASTER_MUST_RX | SPI_MASTER_GPIO_SS; master->flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_GPIO_SS;
master->setup = davinci_spi_setup; master->setup = davinci_spi_setup;
master->cleanup = davinci_spi_cleanup; master->cleanup = davinci_spi_cleanup;
master->can_dma = davinci_spi_can_dma; master->can_dma = davinci_spi_can_dma;
......
...@@ -932,7 +932,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) ...@@ -932,7 +932,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
if (dws->mem_ops.exec_op) if (dws->mem_ops.exec_op)
master->mem_ops = &dws->mem_ops; master->mem_ops = &dws->mem_ops;
master->max_speed_hz = dws->max_freq; master->max_speed_hz = dws->max_freq;
master->flags = SPI_MASTER_GPIO_SS; master->flags = SPI_CONTROLLER_GPIO_SS;
master->auto_runtime_pm = true; master->auto_runtime_pm = true;
/* Get default rx sample delay */ /* Get default rx sample delay */
......
...@@ -401,7 +401,7 @@ static int falcon_sflash_probe(struct platform_device *pdev) ...@@ -401,7 +401,7 @@ static int falcon_sflash_probe(struct platform_device *pdev)
priv->master = master; priv->master = master;
master->mode_bits = SPI_MODE_3; master->mode_bits = SPI_MODE_3;
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->setup = falcon_sflash_setup; master->setup = falcon_sflash_setup;
master->transfer_one_message = falcon_sflash_xfer_one; master->transfer_one_message = falcon_sflash_xfer_one;
master->dev.of_node = pdev->dev.of_node; master->dev.of_node = pdev->dev.of_node;
......
...@@ -856,7 +856,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev) ...@@ -856,7 +856,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
controller->prepare_transfer_hardware = lpspi_prepare_xfer_hardware; controller->prepare_transfer_hardware = lpspi_prepare_xfer_hardware;
controller->unprepare_transfer_hardware = lpspi_unprepare_xfer_hardware; controller->unprepare_transfer_hardware = lpspi_unprepare_xfer_hardware;
controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
controller->flags = SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX; controller->flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX;
controller->dev.of_node = pdev->dev.of_node; controller->dev.of_node = pdev->dev.of_node;
controller->bus_num = pdev->id; controller->bus_num = pdev->id;
controller->num_chipselect = fsl_lpspi->num_cs; controller->num_chipselect = fsl_lpspi->num_cs;
......
...@@ -170,7 +170,7 @@ static u32 spi_gpio_txrx_word_mode3(struct spi_device *spi, ...@@ -170,7 +170,7 @@ static u32 spi_gpio_txrx_word_mode3(struct spi_device *spi,
/* /*
* These functions do not call setmosi or getmiso if respective flag * These functions do not call setmosi or getmiso if respective flag
* (SPI_MASTER_NO_RX or SPI_MASTER_NO_TX) is set, so they are safe to * (SPI_CONTROLLER_NO_RX or SPI_CONTROLLER_NO_TX) is set, so they are safe to
* call when such pin is not present or defined in the controller. * call when such pin is not present or defined in the controller.
* A separate set of callbacks is defined to get highest possible * A separate set of callbacks is defined to get highest possible
* speed in the generic case (when both MISO and MOSI lines are * speed in the generic case (when both MISO and MOSI lines are
...@@ -416,11 +416,11 @@ static int spi_gpio_probe(struct platform_device *pdev) ...@@ -416,11 +416,11 @@ static int spi_gpio_probe(struct platform_device *pdev)
if (!spi_gpio->mosi) { if (!spi_gpio->mosi) {
/* HW configuration without MOSI pin /* HW configuration without MOSI pin
* *
* No setting SPI_MASTER_NO_RX here - if there is only * No setting SPI_CONTROLLER_NO_RX here - if there is only
* a MOSI pin connected the host can still do RX by * a MOSI pin connected the host can still do RX by
* changing the direction of the line. * changing the direction of the line.
*/ */
master->flags = SPI_MASTER_NO_TX; master->flags = SPI_CONTROLLER_NO_TX;
} }
master->bus_num = pdev->id; master->bus_num = pdev->id;
...@@ -434,11 +434,11 @@ static int spi_gpio_probe(struct platform_device *pdev) ...@@ -434,11 +434,11 @@ static int spi_gpio_probe(struct platform_device *pdev)
* line, that we need to do on selection. This makes the local * line, that we need to do on selection. This makes the local
* callback for chipselect always get called. * callback for chipselect always get called.
*/ */
master->flags |= SPI_MASTER_GPIO_SS; master->flags |= SPI_CONTROLLER_GPIO_SS;
bb->chipselect = spi_gpio_chipselect; bb->chipselect = spi_gpio_chipselect;
bb->set_line_direction = spi_gpio_set_direction; bb->set_line_direction = spi_gpio_set_direction;
if (master->flags & SPI_MASTER_NO_TX) { if (master->flags & SPI_CONTROLLER_NO_TX) {
bb->txrx_word[SPI_MODE_0] = spi_gpio_spec_txrx_word_mode0; bb->txrx_word[SPI_MODE_0] = spi_gpio_spec_txrx_word_mode0;
bb->txrx_word[SPI_MODE_1] = spi_gpio_spec_txrx_word_mode1; bb->txrx_word[SPI_MODE_1] = spi_gpio_spec_txrx_word_mode1;
bb->txrx_word[SPI_MODE_2] = spi_gpio_spec_txrx_word_mode2; bb->txrx_word[SPI_MODE_2] = spi_gpio_spec_txrx_word_mode2;
......
...@@ -1784,7 +1784,7 @@ static int spi_imx_probe(struct platform_device *pdev) ...@@ -1784,7 +1784,7 @@ static int spi_imx_probe(struct platform_device *pdev)
if (is_imx51_ecspi(spi_imx) || is_imx53_ecspi(spi_imx)) { if (is_imx51_ecspi(spi_imx) || is_imx53_ecspi(spi_imx)) {
controller->max_native_cs = 4; controller->max_native_cs = 4;
controller->flags |= SPI_MASTER_GPIO_SS; controller->flags |= SPI_CONTROLLER_GPIO_SS;
} }
spi_imx->spi_drctl = spi_drctl; spi_imx->spi_drctl = spi_drctl;
......
...@@ -75,14 +75,14 @@ bitbang_txrx_be_cpha0_lsb(struct spi_lp8841_rtc *data, ...@@ -75,14 +75,14 @@ bitbang_txrx_be_cpha0_lsb(struct spi_lp8841_rtc *data,
for (; likely(bits); bits--) { for (; likely(bits); bits--) {
/* setup LSB (to slave) on leading edge */ /* setup LSB (to slave) on leading edge */
if ((flags & SPI_MASTER_NO_TX) == 0) if ((flags & SPI_CONTROLLER_NO_TX) == 0)
setmosi(data, (word & 1)); setmosi(data, (word & 1));
usleep_range(usecs, usecs + 1); /* T(setup) */ usleep_range(usecs, usecs + 1); /* T(setup) */
/* sample LSB (from slave) on trailing edge */ /* sample LSB (from slave) on trailing edge */
word >>= 1; word >>= 1;
if ((flags & SPI_MASTER_NO_RX) == 0) if ((flags & SPI_CONTROLLER_NO_RX) == 0)
word |= (getmiso(data) << 31); word |= (getmiso(data) << 31);
setsck(data, !cpol); setsck(data, !cpol);
...@@ -113,7 +113,7 @@ spi_lp8841_rtc_transfer_one(struct spi_master *master, ...@@ -113,7 +113,7 @@ spi_lp8841_rtc_transfer_one(struct spi_master *master,
while (likely(count > 0)) { while (likely(count > 0)) {
word = *tx++; word = *tx++;
bitbang_txrx_be_cpha0_lsb(data, 1, 0, bitbang_txrx_be_cpha0_lsb(data, 1, 0,
SPI_MASTER_NO_RX, word, 8); SPI_CONTROLLER_NO_RX, word, 8);
count--; count--;
} }
} else if (rx) { } else if (rx) {
...@@ -121,7 +121,7 @@ spi_lp8841_rtc_transfer_one(struct spi_master *master, ...@@ -121,7 +121,7 @@ spi_lp8841_rtc_transfer_one(struct spi_master *master,
writeb(data->state, data->iomem); writeb(data->state, data->iomem);
while (likely(count > 0)) { while (likely(count > 0)) {
word = bitbang_txrx_be_cpha0_lsb(data, 1, 0, word = bitbang_txrx_be_cpha0_lsb(data, 1, 0,
SPI_MASTER_NO_TX, word, 8); SPI_CONTROLLER_NO_TX, word, 8);
*rx++ = word; *rx++ = word;
count--; count--;
} }
...@@ -191,7 +191,7 @@ spi_lp8841_rtc_probe(struct platform_device *pdev) ...@@ -191,7 +191,7 @@ spi_lp8841_rtc_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
platform_set_drvdata(pdev, master); platform_set_drvdata(pdev, master);
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->mode_bits = SPI_CS_HIGH | SPI_3WIRE | SPI_LSB_FIRST; master->mode_bits = SPI_CS_HIGH | SPI_3WIRE | SPI_LSB_FIRST;
master->bus_num = pdev->id; master->bus_num = pdev->id;
......
...@@ -864,7 +864,7 @@ static int meson_spicc_probe(struct platform_device *pdev) ...@@ -864,7 +864,7 @@ static int meson_spicc_probe(struct platform_device *pdev)
SPI_BPW_MASK(24) | SPI_BPW_MASK(24) |
SPI_BPW_MASK(16) | SPI_BPW_MASK(16) |
SPI_BPW_MASK(8); SPI_BPW_MASK(8);
master->flags = (SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX); master->flags = (SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX);
master->min_speed_hz = spicc->data->min_speed_hz; master->min_speed_hz = spicc->data->min_speed_hz;
master->max_speed_hz = spicc->data->max_speed_hz; master->max_speed_hz = spicc->data->max_speed_hz;
master->setup = meson_spicc_setup; master->setup = meson_spicc_setup;
......
...@@ -1142,7 +1142,7 @@ static int mtk_spi_probe(struct platform_device *pdev) ...@@ -1142,7 +1142,7 @@ static int mtk_spi_probe(struct platform_device *pdev)
master->mode_bits |= SPI_CS_HIGH; master->mode_bits |= SPI_CS_HIGH;
if (mdata->dev_comp->must_tx) if (mdata->dev_comp->must_tx)
master->flags = SPI_MASTER_MUST_TX; master->flags = SPI_CONTROLLER_MUST_TX;
if (mdata->dev_comp->ipm_design) if (mdata->dev_comp->ipm_design)
master->mode_bits |= SPI_LOOP | SPI_RX_DUAL | SPI_TX_DUAL | master->mode_bits |= SPI_LOOP | SPI_RX_DUAL | SPI_TX_DUAL |
SPI_RX_QUAD | SPI_TX_QUAD; SPI_RX_QUAD | SPI_TX_QUAD;
......
...@@ -572,7 +572,7 @@ static int mxs_spi_probe(struct platform_device *pdev) ...@@ -572,7 +572,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
master->mode_bits = SPI_CPOL | SPI_CPHA; master->mode_bits = SPI_CPOL | SPI_CPHA;
master->num_chipselect = 3; master->num_chipselect = 3;
master->dev.of_node = np; master->dev.of_node = np;
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->auto_runtime_pm = true; master->auto_runtime_pm = true;
spi = spi_master_get_devdata(master); spi = spi_master_get_devdata(master);
......
...@@ -486,7 +486,7 @@ static int uwire_probe(struct platform_device *pdev) ...@@ -486,7 +486,7 @@ static int uwire_probe(struct platform_device *pdev)
/* the spi->mode bits understood by this driver: */ /* the spi->mode bits understood by this driver: */
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 16); master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 16);
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->bus_num = 2; /* "official" */ master->bus_num = 2; /* "official" */
master->num_chipselect = 4; master->num_chipselect = 4;
......
...@@ -677,7 +677,7 @@ static int orion_spi_probe(struct platform_device *pdev) ...@@ -677,7 +677,7 @@ static int orion_spi_probe(struct platform_device *pdev)
master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16); master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16);
master->auto_runtime_pm = true; master->auto_runtime_pm = true;
master->use_gpio_descriptors = true; master->use_gpio_descriptors = true;
master->flags = SPI_MASTER_GPIO_SS; master->flags = SPI_CONTROLLER_GPIO_SS;
platform_set_drvdata(pdev, master); platform_set_drvdata(pdev, master);
......
...@@ -365,7 +365,7 @@ static int pci1xxxx_spi_probe(struct pci_dev *pdev, const struct pci_device_id * ...@@ -365,7 +365,7 @@ static int pci1xxxx_spi_probe(struct pci_dev *pdev, const struct pci_device_id *
spi_host->bits_per_word_mask = SPI_BPW_MASK(8); spi_host->bits_per_word_mask = SPI_BPW_MASK(8);
spi_host->max_speed_hz = PCI1XXXX_SPI_MAX_CLOCK_HZ; spi_host->max_speed_hz = PCI1XXXX_SPI_MAX_CLOCK_HZ;
spi_host->min_speed_hz = PCI1XXXX_SPI_MIN_CLOCK_HZ; spi_host->min_speed_hz = PCI1XXXX_SPI_MIN_CLOCK_HZ;
spi_host->flags = SPI_MASTER_MUST_TX; spi_host->flags = SPI_CONTROLLER_MUST_TX;
spi_master_set_devdata(spi_host, spi_sub_ptr); spi_master_set_devdata(spi_host, spi_sub_ptr);
ret = devm_spi_register_master(dev, spi_host); ret = devm_spi_register_master(dev, spi_host);
if (ret) if (ret)
......
...@@ -648,7 +648,7 @@ static int pic32_sqi_probe(struct platform_device *pdev) ...@@ -648,7 +648,7 @@ static int pic32_sqi_probe(struct platform_device *pdev)
master->dev.of_node = pdev->dev.of_node; master->dev.of_node = pdev->dev.of_node;
master->mode_bits = SPI_MODE_3 | SPI_MODE_0 | SPI_TX_DUAL | master->mode_bits = SPI_MODE_3 | SPI_MODE_0 | SPI_TX_DUAL |
SPI_RX_DUAL | SPI_TX_QUAD | SPI_RX_QUAD; SPI_RX_DUAL | SPI_TX_QUAD | SPI_RX_QUAD;
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->can_dma = pic32_sqi_can_dma; master->can_dma = pic32_sqi_can_dma;
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 32); master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 32);
master->transfer_one_message = pic32_sqi_one_message; master->transfer_one_message = pic32_sqi_one_message;
......
...@@ -773,7 +773,7 @@ static int pic32_spi_probe(struct platform_device *pdev) ...@@ -773,7 +773,7 @@ static int pic32_spi_probe(struct platform_device *pdev)
master->max_speed_hz = clk_get_rate(pic32s->clk); master->max_speed_hz = clk_get_rate(pic32s->clk);
master->setup = pic32_spi_setup; master->setup = pic32_spi_setup;
master->cleanup = pic32_spi_cleanup; master->cleanup = pic32_spi_cleanup;
master->flags = SPI_MASTER_MUST_TX | SPI_MASTER_MUST_RX; master->flags = SPI_CONTROLLER_MUST_TX | SPI_CONTROLLER_MUST_RX;
master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16) | master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16) |
SPI_BPW_MASK(32); SPI_BPW_MASK(32);
master->transfer_one = pic32_spi_one_transfer; master->transfer_one = pic32_spi_one_transfer;
......
...@@ -724,7 +724,7 @@ static int qcom_qspi_probe(struct platform_device *pdev) ...@@ -724,7 +724,7 @@ static int qcom_qspi_probe(struct platform_device *pdev)
master->mode_bits = SPI_MODE_0 | master->mode_bits = SPI_MODE_0 |
SPI_TX_DUAL | SPI_RX_DUAL | SPI_TX_DUAL | SPI_RX_DUAL |
SPI_TX_QUAD | SPI_RX_QUAD; SPI_TX_QUAD | SPI_RX_QUAD;
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->prepare_message = qcom_qspi_prepare_message; master->prepare_message = qcom_qspi_prepare_message;
master->transfer_one = qcom_qspi_transfer_one; master->transfer_one = qcom_qspi_transfer_one;
master->handle_err = qcom_qspi_handle_err; master->handle_err = qcom_qspi_handle_err;
......
...@@ -156,7 +156,7 @@ static int rb4xx_spi_probe(struct platform_device *pdev) ...@@ -156,7 +156,7 @@ static int rb4xx_spi_probe(struct platform_device *pdev)
master->num_chipselect = 3; master->num_chipselect = 3;
master->mode_bits = SPI_TX_DUAL; master->mode_bits = SPI_TX_DUAL;
master->bits_per_word_mask = SPI_BPW_MASK(8); master->bits_per_word_mask = SPI_BPW_MASK(8);
master->flags = SPI_MASTER_MUST_TX; master->flags = SPI_CONTROLLER_MUST_TX;
master->transfer_one = rb4xx_transfer_one; master->transfer_one = rb4xx_transfer_one;
master->set_cs = rb4xx_set_cs; master->set_cs = rb4xx_set_cs;
......
...@@ -565,7 +565,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev) ...@@ -565,7 +565,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
if (!master) if (!master)
return -ENOMEM; return -ENOMEM;
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->mem_ops = &rockchip_sfc_mem_ops; master->mem_ops = &rockchip_sfc_mem_ops;
master->dev.of_node = pdev->dev.of_node; master->dev.of_node = pdev->dev.of_node;
master->mode_bits = SPI_TX_QUAD | SPI_TX_DUAL | SPI_RX_QUAD | SPI_RX_DUAL; master->mode_bits = SPI_TX_QUAD | SPI_TX_DUAL | SPI_RX_QUAD | SPI_RX_DUAL;
......
...@@ -858,7 +858,7 @@ static int rockchip_spi_probe(struct platform_device *pdev) ...@@ -858,7 +858,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
ctlr->mode_bits |= SPI_NO_CS; ctlr->mode_bits |= SPI_NO_CS;
ctlr->slave_abort = rockchip_spi_slave_abort; ctlr->slave_abort = rockchip_spi_slave_abort;
} else { } else {
ctlr->flags = SPI_MASTER_GPIO_SS; ctlr->flags = SPI_CONTROLLER_GPIO_SS;
ctlr->max_native_cs = ROCKCHIP_SPI_MAX_CS_NUM; ctlr->max_native_cs = ROCKCHIP_SPI_MAX_CS_NUM;
/* /*
* rk spi0 has two native cs, spi1..5 one cs only * rk spi0 has two native cs, spi1..5 one cs only
......
...@@ -379,7 +379,7 @@ static int sifive_spi_probe(struct platform_device *pdev) ...@@ -379,7 +379,7 @@ static int sifive_spi_probe(struct platform_device *pdev)
* we need to "left-align" the bits (unless SPI_LSB_FIRST) * we need to "left-align" the bits (unless SPI_LSB_FIRST)
*/ */
master->bits_per_word_mask = SPI_BPW_MASK(8); master->bits_per_word_mask = SPI_BPW_MASK(8);
master->flags = SPI_CONTROLLER_MUST_TX | SPI_MASTER_GPIO_SS; master->flags = SPI_CONTROLLER_MUST_TX | SPI_CONTROLLER_GPIO_SS;
master->prepare_message = sifive_spi_prepare_message; master->prepare_message = sifive_spi_prepare_message;
master->set_cs = sifive_spi_set_cs; master->set_cs = sifive_spi_set_cs;
master->transfer_one = sifive_spi_transfer_one; master->transfer_one = sifive_spi_transfer_one;
......
...@@ -414,7 +414,7 @@ static int mtk_spi_slave_probe(struct platform_device *pdev) ...@@ -414,7 +414,7 @@ static int mtk_spi_slave_probe(struct platform_device *pdev)
mdata->dev_comp = of_id->data; mdata->dev_comp = of_id->data;
if (mdata->dev_comp->must_rx) if (mdata->dev_comp->must_rx)
ctlr->flags = SPI_MASTER_MUST_RX; ctlr->flags = SPI_CONTROLLER_MUST_RX;
platform_set_drvdata(pdev, ctlr); platform_set_drvdata(pdev, ctlr);
......
...@@ -580,7 +580,7 @@ static int sprd_adi_probe(struct platform_device *pdev) ...@@ -580,7 +580,7 @@ static int sprd_adi_probe(struct platform_device *pdev)
ctlr->dev.of_node = pdev->dev.of_node; ctlr->dev.of_node = pdev->dev.of_node;
ctlr->bus_num = pdev->id; ctlr->bus_num = pdev->id;
ctlr->num_chipselect = num_chipselect; ctlr->num_chipselect = num_chipselect;
ctlr->flags = SPI_MASTER_HALF_DUPLEX; ctlr->flags = SPI_CONTROLLER_HALF_DUPLEX;
ctlr->bits_per_word_mask = 0; ctlr->bits_per_word_mask = 0;
ctlr->transfer_one = sprd_adi_transfer_one; ctlr->transfer_one = sprd_adi_transfer_one;
......
...@@ -1753,7 +1753,7 @@ static const struct stm32_spi_cfg stm32f4_spi_cfg = { ...@@ -1753,7 +1753,7 @@ static const struct stm32_spi_cfg stm32f4_spi_cfg = {
.baud_rate_div_max = STM32F4_SPI_BR_DIV_MAX, .baud_rate_div_max = STM32F4_SPI_BR_DIV_MAX,
.has_fifo = false, .has_fifo = false,
.has_device_mode = false, .has_device_mode = false,
.flags = SPI_MASTER_MUST_TX, .flags = SPI_CONTROLLER_MUST_TX,
}; };
static const struct stm32_spi_cfg stm32h7_spi_cfg = { static const struct stm32_spi_cfg stm32h7_spi_cfg = {
......
...@@ -770,7 +770,7 @@ static int ti_qspi_probe(struct platform_device *pdev) ...@@ -770,7 +770,7 @@ static int ti_qspi_probe(struct platform_device *pdev)
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_RX_DUAL | SPI_RX_QUAD; master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_RX_DUAL | SPI_RX_QUAD;
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->setup = ti_qspi_setup; master->setup = ti_qspi_setup;
master->auto_runtime_pm = true; master->auto_runtime_pm = true;
master->transfer_one_message = ti_qspi_start_transfer_one; master->transfer_one_message = ti_qspi_start_transfer_one;
......
...@@ -218,7 +218,7 @@ static int spi_xcomm_probe(struct i2c_client *i2c) ...@@ -218,7 +218,7 @@ static int spi_xcomm_probe(struct i2c_client *i2c)
master->num_chipselect = 16; master->num_chipselect = 16;
master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_3WIRE; master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_3WIRE;
master->bits_per_word_mask = SPI_BPW_MASK(8); master->bits_per_word_mask = SPI_BPW_MASK(8);
master->flags = SPI_MASTER_HALF_DUPLEX; master->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->transfer_one_message = spi_xcomm_transfer_one; master->transfer_one_message = spi_xcomm_transfer_one;
master->dev.of_node = i2c->dev.of_node; master->dev.of_node = i2c->dev.of_node;
i2c_set_clientdata(i2c, master); i2c_set_clientdata(i2c, master);
......
...@@ -87,7 +87,7 @@ static int xtfpga_spi_probe(struct platform_device *pdev) ...@@ -87,7 +87,7 @@ static int xtfpga_spi_probe(struct platform_device *pdev)
if (!master) if (!master)
return -ENOMEM; return -ENOMEM;
master->flags = SPI_MASTER_NO_RX; master->flags = SPI_CONTROLLER_NO_RX;
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 16); master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 16);
master->bus_num = pdev->dev.id; master->bus_num = pdev->dev.id;
master->dev.of_node = pdev->dev.of_node; master->dev.of_node = pdev->dev.of_node;
......
This diff is collapsed.
This diff is collapsed.
...@@ -167,7 +167,7 @@ TRACE_EVENT(spi_message_done, ...@@ -167,7 +167,7 @@ TRACE_EVENT(spi_message_done,
); );
/* /*
* consider a buffer valid if non-NULL and if it doesn't match the dummy buffer * Consider a buffer valid if non-NULL and if it doesn't match the dummy buffer
* that only exist to work with controllers that have SPI_CONTROLLER_MUST_TX or * that only exist to work with controllers that have SPI_CONTROLLER_MUST_TX or
* SPI_CONTROLLER_MUST_RX. * SPI_CONTROLLER_MUST_RX.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment