Commit e81e11bc authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Ingo Molnar

x86/platform/intel-mid: Enable spidev on Intel Edison boards

Intel Edison board provides one of the SPI bus for user's connected devices.

Append platform data to get spidev enumerated over it.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Dan O'Donovan <dan@emutex.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1467677690-90007-1-git-send-email-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent ca22312d
......@@ -10,6 +10,8 @@ obj-$(subst m,y,$(CONFIG_MFD_INTEL_MSIC)) += platform_msic_battery.o
obj-$(subst m,y,$(CONFIG_INTEL_MID_POWER_BUTTON)) += platform_msic_power_btn.o
obj-$(subst m,y,$(CONFIG_GPIO_INTEL_PMIC)) += platform_pmic_gpio.o
obj-$(subst m,y,$(CONFIG_INTEL_MFLD_THERMAL)) += platform_msic_thermal.o
# SPI Devices
obj-$(subst m,y,$(CONFIG_SPI_SPIDEV)) += platform_spidev.o
# I2C Devices
obj-$(subst m,y,$(CONFIG_SENSORS_EMC1403)) += platform_emc1403.o
obj-$(subst m,y,$(CONFIG_SENSORS_LIS3LV02D)) += platform_lis331.o
......
/*
* spidev platform data initilization file
*
* (C) Copyright 2014, 2016 Intel Corporation
* Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* Dan O'Donovan <dan@emutex.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* of the License.
*/
#include <linux/init.h>
#include <linux/sfi.h>
#include <linux/spi/pxa2xx_spi.h>
#include <linux/spi/spi.h>
#include <asm/intel-mid.h>
#define MRFLD_SPI_DEFAULT_DMA_BURST 8
#define MRFLD_SPI_DEFAULT_TIMEOUT 500
/* GPIO pin for spidev chipselect */
#define MRFLD_SPIDEV_GPIO_CS 111
static struct pxa2xx_spi_chip spidev_spi_chip = {
.dma_burst_size = MRFLD_SPI_DEFAULT_DMA_BURST,
.timeout = MRFLD_SPI_DEFAULT_TIMEOUT,
.gpio_cs = MRFLD_SPIDEV_GPIO_CS,
};
static void __init *spidev_platform_data(void *info)
{
struct spi_board_info *spi_info = info;
spi_info->mode = SPI_MODE_0;
spi_info->controller_data = &spidev_spi_chip;
return NULL;
}
static const struct devs_id spidev_dev_id __initconst = {
.name = "spidev",
.type = SFI_DEV_TYPE_SPI,
.delay = 0,
.get_platform_data = &spidev_platform_data,
};
sfi_device(spidev_dev_id);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment