Unverified Commit 64a7b0e0 authored by Mark Brown's avatar Mark Brown
Browse files

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ static int amd_spi_probe(struct platform_device *pdev)
	master->bus_num = 0;
	master->num_chipselect = 4;
	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->min_speed_hz = AMD_SPI_MIN_HZ;
	master->setup = amd_spi_master_setup;
+1 −1
Original line number Diff line number Diff line
@@ -527,7 +527,7 @@ static int at91_usart_spi_probe(struct platform_device *pdev)
	controller->dev.of_node = pdev->dev.parent->of_node;
	controller->bits_per_word_mask = SPI_BPW_MASK(8);
	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->prepare_message = at91_usart_spi_prepare_message;
	controller->unprepare_message = at91_usart_spi_unprepare_message;
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ static int ath79_spi_probe(struct platform_device *pdev)

	host->use_gpio_descriptors = true;
	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->mem_ops = &ath79_mem_ops;

+2 −2
Original line number Diff line number Diff line
@@ -1471,8 +1471,8 @@ static int atmel_spi_probe(struct platform_device *pdev)
	host->bus_num = pdev->id;
	host->num_chipselect = 4;
	host->setup = atmel_spi_setup;
	host->flags = (SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX |
			SPI_MASTER_GPIO_SS);
	host->flags = (SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX |
			SPI_CONTROLLER_GPIO_SS);
	host->transfer_one = atmel_spi_one_transfer;
	host->set_cs = atmel_spi_set_cs;
	host->cleanup = atmel_spi_cleanup;
+8 −8
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ bitbang_txrx_be_cpha0(struct spi_device *spi,
	for (word <<= (32 - bits); likely(bits); bits--) {

		/* 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) {
				setmosi(spi, word & (1 << 31));
				oldbit = word & (1 << 31);
@@ -70,7 +70,7 @@ bitbang_txrx_be_cpha0(struct spi_device *spi,

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

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

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

		/* 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) {
				setmosi(spi, word & 1);
				oldbit = word & 1;
@@ -135,7 +135,7 @@ bitbang_txrx_le_cpha0(struct spi_device *spi,

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

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

		/* sample LSB (from slave) on trailing edge */
		word >>= 1;
		if ((flags & SPI_MASTER_NO_RX) == 0)
		if ((flags & SPI_CONTROLLER_NO_RX) == 0)
			word |= getmiso(spi) << rxbit;
	}
	return word;
Loading