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: Andy 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.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Andy Shevchenko 2016-07-05 03:14:50 +03:00 committed by Ingo Molnar
parent ca22312dc8
commit e81e11bc71
2 changed files with 52 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,50 @@
/*
* 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);