Commit efa225254a4a57b871b279cc38fd4048a0fbfa76
Committed by
Greg Kroah-Hartman
1 parent
12dac5fcf5
Exists in
smarct4x-processor-sdk-04.01.00.06
and in
1 other branch
x86/platform/intel-mid: Rename 'spidev' to 'mrfld_spidev'
[ Upstream commit 159d3726db12b3476bc59ea0ab0a702103d466b5 ] The current implementation supports only Intel Merrifield platforms. Don't mess with the rest of the Intel MID family by not registering device with wrong properties. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.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/20170102092450.87229-1-andriy.shevchenko@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 3 changed files with 55 additions and 51 deletions Side-by-side Diff
arch/x86/platform/intel-mid/device_libs/Makefile
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 | obj-$(subst m,y,$(CONFIG_GPIO_INTEL_PMIC)) += platform_pmic_gpio.o |
16 | 16 | obj-$(subst m,y,$(CONFIG_INTEL_MFLD_THERMAL)) += platform_msic_thermal.o |
17 | 17 | # SPI Devices |
18 | -obj-$(subst m,y,$(CONFIG_SPI_SPIDEV)) += platform_spidev.o | |
18 | +obj-$(subst m,y,$(CONFIG_SPI_SPIDEV)) += platform_mrfld_spidev.o | |
19 | 19 | # I2C Devices |
20 | 20 | obj-$(subst m,y,$(CONFIG_SENSORS_EMC1403)) += platform_emc1403.o |
21 | 21 | obj-$(subst m,y,$(CONFIG_SENSORS_LIS3LV02D)) += platform_lis331.o |
arch/x86/platform/intel-mid/device_libs/platform_mrfld_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/err.h> | |
15 | +#include <linux/init.h> | |
16 | +#include <linux/sfi.h> | |
17 | +#include <linux/spi/pxa2xx_spi.h> | |
18 | +#include <linux/spi/spi.h> | |
19 | + | |
20 | +#include <asm/intel-mid.h> | |
21 | + | |
22 | +#define MRFLD_SPI_DEFAULT_DMA_BURST 8 | |
23 | +#define MRFLD_SPI_DEFAULT_TIMEOUT 500 | |
24 | + | |
25 | +/* GPIO pin for spidev chipselect */ | |
26 | +#define MRFLD_SPIDEV_GPIO_CS 111 | |
27 | + | |
28 | +static struct pxa2xx_spi_chip spidev_spi_chip = { | |
29 | + .dma_burst_size = MRFLD_SPI_DEFAULT_DMA_BURST, | |
30 | + .timeout = MRFLD_SPI_DEFAULT_TIMEOUT, | |
31 | + .gpio_cs = MRFLD_SPIDEV_GPIO_CS, | |
32 | +}; | |
33 | + | |
34 | +static void __init *spidev_platform_data(void *info) | |
35 | +{ | |
36 | + struct spi_board_info *spi_info = info; | |
37 | + | |
38 | + if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER) | |
39 | + return ERR_PTR(-ENODEV); | |
40 | + | |
41 | + spi_info->mode = SPI_MODE_0; | |
42 | + spi_info->controller_data = &spidev_spi_chip; | |
43 | + | |
44 | + return NULL; | |
45 | +} | |
46 | + | |
47 | +static const struct devs_id spidev_dev_id __initconst = { | |
48 | + .name = "spidev", | |
49 | + .type = SFI_DEV_TYPE_SPI, | |
50 | + .delay = 0, | |
51 | + .get_platform_data = &spidev_platform_data, | |
52 | +}; | |
53 | + | |
54 | +sfi_device(spidev_dev_id); |
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); |