cregit-Linux how code gets into the kernel

Release 4.14 arch/x86/platform/intel-mid/device_libs/platform_mrfld_spidev.c

/*
 * 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/err.h>
#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; if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER) return ERR_PTR(-ENODEV); spi_info->mode = SPI_MODE_0; spi_info->controller_data = &spidev_spi_chip; return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Andy Shevchenko49100.00%2100.00%
Total49100.00%2100.00%

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);

Overall Contributors

PersonTokensPropCommitsCommitProp
Andy Shevchenko138100.00%2100.00%
Total138100.00%2100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.