]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - arch/x86/platform/intel-mid/device_libs/platform_spidev.c
Merge branch 'for-4.8/core' of git://git.kernel.dk/linux-block
[karo-tx-linux.git] / arch / x86 / platform / intel-mid / device_libs / platform_spidev.c
1 /*
2  * spidev platform data initilization file
3  *
4  * (C) Copyright 2014, 2016 Intel Corporation
5  * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
6  *          Dan O'Donovan <dan@emutex.com>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; version 2
11  * of the License.
12  */
13
14 #include <linux/init.h>
15 #include <linux/sfi.h>
16 #include <linux/spi/pxa2xx_spi.h>
17 #include <linux/spi/spi.h>
18
19 #include <asm/intel-mid.h>
20
21 #define MRFLD_SPI_DEFAULT_DMA_BURST     8
22 #define MRFLD_SPI_DEFAULT_TIMEOUT       500
23
24 /* GPIO pin for spidev chipselect */
25 #define MRFLD_SPIDEV_GPIO_CS            111
26
27 static struct pxa2xx_spi_chip spidev_spi_chip = {
28         .dma_burst_size         = MRFLD_SPI_DEFAULT_DMA_BURST,
29         .timeout                = MRFLD_SPI_DEFAULT_TIMEOUT,
30         .gpio_cs                = MRFLD_SPIDEV_GPIO_CS,
31 };
32
33 static void __init *spidev_platform_data(void *info)
34 {
35         struct spi_board_info *spi_info = info;
36
37         spi_info->mode = SPI_MODE_0;
38         spi_info->controller_data = &spidev_spi_chip;
39
40         return NULL;
41 }
42
43 static const struct devs_id spidev_dev_id __initconst = {
44         .name                   = "spidev",
45         .type                   = SFI_DEV_TYPE_SPI,
46         .delay                  = 0,
47         .get_platform_data      = &spidev_platform_data,
48 };
49
50 sfi_device(spidev_dev_id);