8e7d4b189d51b96bd2c5b1eb3dfb46e3e91a86bb
[openwrt-10.03/.git] / package / mmc_over_gpio / src / linux / spi / spi_gpio.h
1 /*
2  * spi_gpio interface to platform code
3  *
4  * Copyright (c) 2008 Piotr Skamruk
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10 #ifndef _LINUX_SPI_SPI_GPIO
11 #define _LINUX_SPI_SPI_GPIO
12
13 #include <linux/types.h>
14 #include <linux/spi/spi.h>
15
16
17 /** struct spi_gpio_platform_data - Data definitions for a SPI-GPIO device.
18  * This structure holds information about a GPIO-based SPI device.
19  *
20  * @pin_clk: The GPIO pin number of the CLOCK pin.
21  *
22  * @pin_miso: The GPIO pin number of the MISO pin.
23  *
24  * @pin_mosi: The GPIO pin number of the MOSI pin.
25  *
26  * @pin_cs: The GPIO pin number of the CHIPSELECT pin.
27  *
28  * @cs_activelow: If true, the chip is selected when the CS line is low.
29  *
30  * @no_spi_delay: If true, no delay is done in the lowlevel bitbanging.
31  *                Note that doing no delay is not standards compliant,
32  *                but it might be needed to speed up transfers on some
33  *                slow embedded machines.
34  *
35  * @boardinfo_setup: This callback is called after the
36  *                   SPI master device was registered, but before the
37  *                   device is registered.
38  * @boardinfo_setup_data: Data argument passed to boardinfo_setup().
39  */
40 struct spi_gpio_platform_data {
41         unsigned int pin_clk;
42         unsigned int pin_miso;
43         unsigned int pin_mosi;
44         unsigned int pin_cs;
45         bool cs_activelow;
46         bool no_spi_delay;
47         int (*boardinfo_setup)(struct spi_board_info *bi,
48                                struct spi_master *master,
49                                void *data);
50         void *boardinfo_setup_data;
51 };
52
53 #endif /* _LINUX_SPI_SPI_GPIO */