Skip to content

Commit c397f09

Browse files
andy-shevbroonie
authored andcommitted
spi: Get rid of old SPI_MASTER_NO_TX & SPI_MASTER_NO_RX
Convert the users from SPI_MASTER_NO_TX and/or SPI_MASTER_NO_RX to SPI_CONTROLLER_NO_TX and/or SPI_CONTROLLER_NO_RX respectively and kill the not used anymore definitions. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-12-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent edf6a86 commit c397f09

File tree

6 files changed

+18
-20
lines changed

6 files changed

+18
-20
lines changed

drivers/spi/spi-bitbang-txrx.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ bitbang_txrx_be_cpha0(struct spi_device *spi,
5757
for (word <<= (32 - bits); likely(bits); bits--) {
5858

5959
/* setup MSB (to slave) on trailing edge */
60-
if ((flags & SPI_MASTER_NO_TX) == 0) {
60+
if ((flags & SPI_CONTROLLER_NO_TX) == 0) {
6161
if ((word & (1 << 31)) != oldbit) {
6262
setmosi(spi, word & (1 << 31));
6363
oldbit = word & (1 << 31);
@@ -70,7 +70,7 @@ bitbang_txrx_be_cpha0(struct spi_device *spi,
7070

7171
/* sample MSB (from slave) on leading edge */
7272
word <<= 1;
73-
if ((flags & SPI_MASTER_NO_RX) == 0)
73+
if ((flags & SPI_CONTROLLER_NO_RX) == 0)
7474
word |= getmiso(spi);
7575
setsck(spi, cpol);
7676
}
@@ -90,7 +90,7 @@ bitbang_txrx_be_cpha1(struct spi_device *spi,
9090

9191
/* setup MSB (to slave) on leading edge */
9292
setsck(spi, !cpol);
93-
if ((flags & SPI_MASTER_NO_TX) == 0) {
93+
if ((flags & SPI_CONTROLLER_NO_TX) == 0) {
9494
if ((word & (1 << 31)) != oldbit) {
9595
setmosi(spi, word & (1 << 31));
9696
oldbit = word & (1 << 31);
@@ -103,7 +103,7 @@ bitbang_txrx_be_cpha1(struct spi_device *spi,
103103

104104
/* sample MSB (from slave) on trailing edge */
105105
word <<= 1;
106-
if ((flags & SPI_MASTER_NO_RX) == 0)
106+
if ((flags & SPI_CONTROLLER_NO_RX) == 0)
107107
word |= getmiso(spi);
108108
}
109109
return word;
@@ -122,7 +122,7 @@ bitbang_txrx_le_cpha0(struct spi_device *spi,
122122
for (; likely(bits); bits--) {
123123

124124
/* setup LSB (to slave) on trailing edge */
125-
if ((flags & SPI_MASTER_NO_TX) == 0) {
125+
if ((flags & SPI_CONTROLLER_NO_TX) == 0) {
126126
if ((word & 1) != oldbit) {
127127
setmosi(spi, word & 1);
128128
oldbit = word & 1;
@@ -135,7 +135,7 @@ bitbang_txrx_le_cpha0(struct spi_device *spi,
135135

136136
/* sample LSB (from slave) on leading edge */
137137
word >>= 1;
138-
if ((flags & SPI_MASTER_NO_RX) == 0)
138+
if ((flags & SPI_CONTROLLER_NO_RX) == 0)
139139
word |= getmiso(spi) << rxbit;
140140
setsck(spi, cpol);
141141
}
@@ -156,7 +156,7 @@ bitbang_txrx_le_cpha1(struct spi_device *spi,
156156

157157
/* setup LSB (to slave) on leading edge */
158158
setsck(spi, !cpol);
159-
if ((flags & SPI_MASTER_NO_TX) == 0) {
159+
if ((flags & SPI_CONTROLLER_NO_TX) == 0) {
160160
if ((word & 1) != oldbit) {
161161
setmosi(spi, word & 1);
162162
oldbit = word & 1;
@@ -169,7 +169,7 @@ bitbang_txrx_le_cpha1(struct spi_device *spi,
169169

170170
/* sample LSB (from slave) on trailing edge */
171171
word >>= 1;
172-
if ((flags & SPI_MASTER_NO_RX) == 0)
172+
if ((flags & SPI_CONTROLLER_NO_RX) == 0)
173173
word |= getmiso(spi) << rxbit;
174174
}
175175
return word;

drivers/spi/spi-bitbang.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t)
248248
if (spi->mode & SPI_3WIRE) {
249249
unsigned flags;
250250

251-
flags = t->tx_buf ? SPI_MASTER_NO_RX : SPI_MASTER_NO_TX;
251+
flags = t->tx_buf ? SPI_CONTROLLER_NO_RX : SPI_CONTROLLER_NO_TX;
252252
return cs->txrx_bufs(spi, cs->txrx_word, nsecs, t, flags);
253253
}
254254
return cs->txrx_bufs(spi, cs->txrx_word, nsecs, t, 0);

drivers/spi/spi-gpio.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static u32 spi_gpio_txrx_word_mode3(struct spi_device *spi,
170170

171171
/*
172172
* These functions do not call setmosi or getmiso if respective flag
173-
* (SPI_MASTER_NO_RX or SPI_MASTER_NO_TX) is set, so they are safe to
173+
* (SPI_CONTROLLER_NO_RX or SPI_CONTROLLER_NO_TX) is set, so they are safe to
174174
* call when such pin is not present or defined in the controller.
175175
* A separate set of callbacks is defined to get highest possible
176176
* 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)
416416
if (!spi_gpio->mosi) {
417417
/* HW configuration without MOSI pin
418418
*
419-
* No setting SPI_MASTER_NO_RX here - if there is only
419+
* No setting SPI_CONTROLLER_NO_RX here - if there is only
420420
* a MOSI pin connected the host can still do RX by
421421
* changing the direction of the line.
422422
*/
423-
master->flags = SPI_MASTER_NO_TX;
423+
master->flags = SPI_CONTROLLER_NO_TX;
424424
}
425425

426426
master->bus_num = pdev->id;
@@ -438,7 +438,7 @@ static int spi_gpio_probe(struct platform_device *pdev)
438438
bb->chipselect = spi_gpio_chipselect;
439439
bb->set_line_direction = spi_gpio_set_direction;
440440

441-
if (master->flags & SPI_MASTER_NO_TX) {
441+
if (master->flags & SPI_CONTROLLER_NO_TX) {
442442
bb->txrx_word[SPI_MODE_0] = spi_gpio_spec_txrx_word_mode0;
443443
bb->txrx_word[SPI_MODE_1] = spi_gpio_spec_txrx_word_mode1;
444444
bb->txrx_word[SPI_MODE_2] = spi_gpio_spec_txrx_word_mode2;

drivers/spi/spi-lp8841-rtc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ bitbang_txrx_be_cpha0_lsb(struct spi_lp8841_rtc *data,
7575
for (; likely(bits); bits--) {
7676

7777
/* setup LSB (to slave) on leading edge */
78-
if ((flags & SPI_MASTER_NO_TX) == 0)
78+
if ((flags & SPI_CONTROLLER_NO_TX) == 0)
7979
setmosi(data, (word & 1));
8080

8181
usleep_range(usecs, usecs + 1); /* T(setup) */
8282

8383
/* sample LSB (from slave) on trailing edge */
8484
word >>= 1;
85-
if ((flags & SPI_MASTER_NO_RX) == 0)
85+
if ((flags & SPI_CONTROLLER_NO_RX) == 0)
8686
word |= (getmiso(data) << 31);
8787

8888
setsck(data, !cpol);
@@ -113,15 +113,15 @@ spi_lp8841_rtc_transfer_one(struct spi_master *master,
113113
while (likely(count > 0)) {
114114
word = *tx++;
115115
bitbang_txrx_be_cpha0_lsb(data, 1, 0,
116-
SPI_MASTER_NO_RX, word, 8);
116+
SPI_CONTROLLER_NO_RX, word, 8);
117117
count--;
118118
}
119119
} else if (rx) {
120120
data->state |= SPI_LP8841_RTC_nWE;
121121
writeb(data->state, data->iomem);
122122
while (likely(count > 0)) {
123123
word = bitbang_txrx_be_cpha0_lsb(data, 1, 0,
124-
SPI_MASTER_NO_TX, word, 8);
124+
SPI_CONTROLLER_NO_TX, word, 8);
125125
*rx++ = word;
126126
count--;
127127
}

drivers/spi/spi-xtensa-xtfpga.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static int xtfpga_spi_probe(struct platform_device *pdev)
8787
if (!master)
8888
return -ENOMEM;
8989

90-
master->flags = SPI_MASTER_NO_RX;
90+
master->flags = SPI_CONTROLLER_NO_RX;
9191
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 16);
9292
master->bus_num = pdev->dev.id;
9393
master->dev.of_node = pdev->dev.of_node;

include/linux/spi/spi.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,8 +1623,6 @@ spi_transfer_is_last(struct spi_controller *ctlr, struct spi_transfer *xfer)
16231623
#define spi_master spi_controller
16241624

16251625
#define SPI_MASTER_HALF_DUPLEX SPI_CONTROLLER_HALF_DUPLEX
1626-
#define SPI_MASTER_NO_RX SPI_CONTROLLER_NO_RX
1627-
#define SPI_MASTER_NO_TX SPI_CONTROLLER_NO_TX
16281626
#define SPI_MASTER_MUST_RX SPI_CONTROLLER_MUST_RX
16291627
#define SPI_MASTER_MUST_TX SPI_CONTROLLER_MUST_TX
16301628

0 commit comments

Comments
 (0)