From: Heiko Stuebner <heiko.stuebner@...>
Date: Thu, 19 Jan 2012 10:25:20 +0100
This patch moves the platform data definition for the spi-s3c64xx driver
from an arch-header to a separate one under linux/spi.
As building drivers without references to architecture code is a goal,
only the mach/dma.h reference remains now to be sorted at some point.
Signed-off-by: Heiko Stuebner <heiko@...>
arch/arm/mach-exynos/setup-spi.c | 1 +
arch/arm/mach-s3c64xx/mach-crag6410.c | 1 +
arch/arm/mach-s3c64xx/setup-spi.c | 1 +
arch/arm/mach-s5p64x0/setup-spi.c | 1 +
arch/arm/mach-s5pc100/setup-spi.c | 1 +
arch/arm/mach-s5pv210/setup-spi.c | 1 +
arch/arm/plat-samsung/devs.c | 1 +
arch/arm/plat-samsung/include/plat/s3c64xx-spi.h | 44 ----------------
drivers/spi/spi-s3c64xx.c | 2 +-
include/linux/spi/s3c64xx.h | 59 ++++++++++++++++++++++
10 files changed, 67 insertions(+), 45 deletions(-)
create mode 100644 include/linux/spi/s3c64xx.h
@@ -10,6 +10,7 @@
#include <linux/gpio.h>
#include <linux/platform_device.h>
+#include <linux/spi/s3c64xx.h>
#include <plat/gpio-cfg.h>
#include <plat/s3c64xx-spi.h>
@@ -29,6 +29,7 @@
#include <linux/gpio_keys.h>
#include <linux/basic_mmio_gpio.h>
#include <linux/spi/spi.h>
+#include <linux/spi/s3c64xx.h>
#include <linux/i2c/pca953x.h>
@@ -10,6 +10,7 @@
#include <linux/gpio.h>
#include <linux/platform_device.h>
+#include <linux/spi/s3c64xx.h>
#include <plat/gpio-cfg.h>
#include <plat/s3c64xx-spi.h>
@@ -11,6 +11,7 @@
#include <linux/gpio.h>
#include <linux/platform_device.h>
#include <linux/io.h>
+#include <linux/spi/s3c64xx.h>
#include <plat/gpio-cfg.h>
#include <plat/cpu.h>
@@ -10,6 +10,7 @@
#include <linux/gpio.h>
#include <linux/platform_device.h>
+#include <linux/spi/s3c64xx.h>
#include <plat/gpio-cfg.h>
#include <plat/s3c64xx-spi.h>
@@ -10,6 +10,7 @@
#include <linux/gpio.h>
#include <linux/platform_device.h>
+#include <linux/spi/s3c64xx.h>
#include <plat/gpio-cfg.h>
#include <plat/s3c64xx-spi.h>
@@ -30,6 +30,7 @@
#include <linux/mmc/host.h>
#include <linux/ioport.h>
#include <linux/platform_data/s3c-hsudc.h>
+#include <linux/spi/s3c64xx.h>
#include <asm/irq.h>
#include <asm/pmu.h>
@@ -14,50 +14,6 @@
struct platform_device;
/**
- * struct s3c64xx_spi_csinfo - ChipSelect description
- * @fb_delay: Slave specific feedback delay.
- * Refer to FB_CLK_SEL register definition in SPI chapter.
- * @line: Custom 'identity' of the CS line.
- * @set_level: CS line control.
- *
- * This is per SPI-Slave Chipselect information.
- * Allocate and initialize one in machine init code and make the
- * spi_board_info.controller_data point to it.
- */
-struct s3c64xx_spi_csinfo {
- u8 fb_delay;
- unsigned line;
- void (*set_level)(unsigned line_id, int lvl);
-};
-
-/**
- * struct s3c64xx_spi_info - SPI Controller defining structure
- * @src_clk_nr: Clock source index for the CLK_CFG[SPI_CLKSEL] field.
- * @clk_from_cmu: If the SPI clock/prescalar control block is present
- * by the platform's clock-management-unit and not in SPI controller.
- * @num_cs: Number of CS this controller emulates.
- * @cfg_gpio: Configure pins for this SPI controller.
- * @fifo_lvl_mask: All tx fifo_lvl fields start at offset-6
- * @rx_lvl_offset: Depends on tx fifo_lvl field and bus number
- * @high_speed: If the controller supports HIGH_SPEED_EN bit
- * @tx_st_done: Depends on tx fifo_lvl field
- */
-struct s3c64xx_spi_info {
- int src_clk_nr;
- bool clk_from_cmu;
-
- int num_cs;
-
- int (*cfg_gpio)(struct platform_device *pdev);
-
- /* Following two fields are for future compatibility */
- int fifo_lvl_mask;
- int rx_lvl_offset;
- int high_speed;
- int tx_st_done;
-};
-
-/**
* s3c64xx_spi_set_platdata - SPI Controller configure callback by the board
* initialization code.
* @pd: SPI platform data to set.
@@ -27,7 +27,7 @@
#include <linux/spi/spi.h>
#include <mach/dma.h>
-#include <plat/s3c64xx-spi.h>
+#include <linux/spi/s3c64xx.h>
/* Registers and bit-fields */
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2009 Samsung Electronics Ltd.
+ * Jaswinder Singh <jassi.brar@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __SPI_S3C64XX_H
+#define __SPI_S3C64XX_H
+
+struct platform_device;
+
+/**
+ * struct s3c64xx_spi_csinfo - ChipSelect description
+ * @fb_delay: Slave specific feedback delay.
+ * Refer to FB_CLK_SEL register definition in SPI chapter.
+ * @line: Custom 'identity' of the CS line.
+ * @set_level: CS line control.
+ *
+ * This is per SPI-Slave Chipselect information.
+ * Allocate and initialize one in machine init code and make the
+ * spi_board_info.controller_data point to it.
+ */
+struct s3c64xx_spi_csinfo {
+ u8 fb_delay;
+ unsigned line;
+ void (*set_level)(unsigned line_id, int lvl);
+};
+
+/**
+ * struct s3c64xx_spi_info - SPI Controller defining structure
+ * @src_clk_nr: Clock source index for the CLK_CFG[SPI_CLKSEL] field.
+ * @clk_from_cmu: If the SPI clock/prescalar control block is present
+ * by the platform's clock-management-unit and not in SPI controller.
+ * @num_cs: Number of CS this controller emulates.
+ * @cfg_gpio: Configure pins for this SPI controller.
+ * @fifo_lvl_mask: All tx fifo_lvl fields start at offset-6
+ * @rx_lvl_offset: Depends on tx fifo_lvl field and bus number
+ * @high_speed: If the controller supports HIGH_SPEED_EN bit
+ * @tx_st_done: Depends on tx fifo_lvl field
+ */
+struct s3c64xx_spi_info {
+ int src_clk_nr;
+ bool clk_from_cmu;
+
+ int num_cs;
+
+ int (*cfg_gpio)(struct platform_device *pdev);
+
+ /* Following two fields are for future compatibility */
+ int fifo_lvl_mask;
+ int rx_lvl_offset;
+ int high_speed;
+ int tx_st_done;
+};
+
+#endif /* __SPI_S3C64XX_H */