From 5f98dbbdc2cc4e01385ea3c705f1a8b45d4d1308 Mon Sep 17 00:00:00 2001 From: Harini Jayaraman Date: Tue, 20 Dec 2011 13:38:19 -0700 Subject: [PATCH] msm: Copper: Add board and device tree support for SPI driver This patch describes the basic attributes in the device tree for the MSM SPI driver. Support for specifying the GPIO pins associated with SPI is not yet present. Change-Id: Idcb5cc28d84a2fa59463e698628da48cb058c652 Signed-off-by: Harini Jayaraman --- .../devicetree/bindings/spi/spi_qsd.txt | 16 ++++++++++++++++ arch/arm/boot/dts/msmcopper.dts | 6 ++++++ arch/arm/mach-msm/board-copper.c | 4 ++++ 3 files changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/spi_qsd.txt diff --git a/Documentation/devicetree/bindings/spi/spi_qsd.txt b/Documentation/devicetree/bindings/spi/spi_qsd.txt new file mode 100644 index 00000000000..5839f63a83e --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi_qsd.txt @@ -0,0 +1,16 @@ +Qualcomm Serial Peripheral Interface (SPI) + +Required properties: +- compatible : should be "qcom,spi-qup-v2". +- reg : offset and length of the QUP register map. +- interrupts : should contain the QUP core interrupt. +- spi-max-frequency : specifies maximum SPI clock frequency, Units - Hz. + +Example: + spi@f9924000 { + compatible = "qcom,spi-qup-v2"; + reg = <0xf9924000 0x1000>; + interrupts = <96>; + spi-max-frequency = <24000000>; + }; + diff --git a/arch/arm/boot/dts/msmcopper.dts b/arch/arm/boot/dts/msmcopper.dts index 6561c71f3f4..b00237a9057 100644 --- a/arch/arm/boot/dts/msmcopper.dts +++ b/arch/arm/boot/dts/msmcopper.dts @@ -70,4 +70,10 @@ qcom,bam-dma-res-pipes = <6>; }; + spi@f9924000 { + compatible = "qcom,spi-qup-v2"; + reg = <0xf9924000 0x1000>; + interrupts = <96>; + spi-max-frequency = <24000000>; + }; }; diff --git a/arch/arm/mach-msm/board-copper.c b/arch/arm/mach-msm/board-copper.c index a372eb67ec4..f26187ed9f3 100644 --- a/arch/arm/mach-msm/board-copper.c +++ b/arch/arm/mach-msm/board-copper.c @@ -77,6 +77,8 @@ static struct clk_lookup msm_clocks_dummy[] = { CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0), CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0), CLK_DUMMY("mem_clk", NULL, NULL, 0), + CLK_DUMMY("core_clk", SPI_CLK, "spi_qsd.1", OFF), + CLK_DUMMY("iface_clk", SPI_P_CLK, "spi_qsd.1", OFF), }; struct clock_init_data msm_dummy_clock_init_data __initdata = { @@ -89,6 +91,8 @@ static struct of_dev_auxdata msm_copper_auxdata_lookup[] __initdata = { "msm_serial_hsl.0", NULL), OF_DEV_AUXDATA("qcom,hsusb-otg", 0xF9A55000, \ "msm_otg", NULL), + OF_DEV_AUXDATA("qcom,spi-qup-v2", 0xF9924000, \ + "spi_qsd.1", NULL), {} };