Skip to content

Commit

Permalink
spi/spi-fsl-spi: Make driver usable in CPU mode outside of an FSL_SOC…
Browse files Browse the repository at this point in the history
… environment

This makes the spi-fsl-spi driver usable in CPU mode outside of an FSL_SOC and
even an powerpc environment by moving CPM mode functionality to a separate file
that is only compiled and linked in an FSL_SOC environment and adding some
ifdefs to hide types and functions or provide alternatives.

For devicetree probing a "clock-frequency" property is used for clock frequency
instead of calls to FSL_SOC-specific functions.

Acked-by: Anton Vorontsov <anton@enomsg.org>
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Andreas Larsson authored and Grant Likely committed Apr 7, 2013
1 parent 58ad60b commit e8beacb
Show file tree
Hide file tree
Showing 9 changed files with 520 additions and 405 deletions.
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/spi/fsl-spi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Required properties:
controller you have.
- interrupt-parent : the phandle for the interrupt controller that
services interrupts for this device.
- clock-frequency : input clock frequency to non FSL_SOC cores

Optional properties:
- gpios : specifies the gpio pins to be used for chipselects.
Expand Down
7 changes: 6 additions & 1 deletion drivers/spi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,18 @@ config SPI_MPC512x_PSC
Controller in SPI master mode.

config SPI_FSL_LIB
tristate
depends on OF

config SPI_FSL_CPM
tristate
depends on FSL_SOC

config SPI_FSL_SPI
bool "Freescale SPI controller"
depends on FSL_SOC
depends on OF
select SPI_FSL_LIB
select SPI_FSL_CPM if FSL_SOC
help
This enables using the Freescale SPI controllers in master mode.
MPC83xx platform uses the controller in cpu mode or CPM/QE mode.
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ obj-$(CONFIG_SPI_DW_PCI) += spi-dw-midpci.o
spi-dw-midpci-objs := spi-dw-pci.o spi-dw-mid.o
obj-$(CONFIG_SPI_EP93XX) += spi-ep93xx.o
obj-$(CONFIG_SPI_FALCON) += spi-falcon.o
obj-$(CONFIG_SPI_FSL_CPM) += spi-fsl-cpm.o
obj-$(CONFIG_SPI_FSL_LIB) += spi-fsl-lib.o
obj-$(CONFIG_SPI_FSL_ESPI) += spi-fsl-espi.o
obj-$(CONFIG_SPI_FSL_SPI) += spi-fsl-spi.o
Expand Down
Loading

0 comments on commit e8beacb

Please sign in to comment.