linux/drivers/misc/lattice-ecp3-config.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2012 Stefan Roese <[email protected]>
 */

#include <linux/device.h>
#include <linux/firmware.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <asm/unaligned.h>

#define FIRMWARE_NAME

/*
 * The JTAG ID's of the supported FPGA's. The ID is 32bit wide
 * reversed as noted in the manual.
 */
#define ID_ECP3_17
#define ID_ECP3_35

/* FPGA commands */
#define FPGA_CMD_READ_ID
#define FPGA_CMD_READ_STATUS
#define FPGA_CMD_CLEAR
#define FPGA_CMD_REFRESH
#define FPGA_CMD_WRITE_EN
#define FPGA_CMD_WRITE_DIS
#define FPGA_CMD_WRITE_INC

/*
 * The status register is 32bit revered, DONE is bit 17 from the TN1222.pdf
 * (LatticeECP3 Slave SPI Port User's Guide)
 */
#define FPGA_STATUS_DONE
#define FPGA_STATUS_CLEARED

#define FPGA_CLEAR_TIMEOUT
#define FPGA_CLEAR_MSLEEP
#define FPGA_CLEAR_LOOP_COUNT

struct fpga_data {};

struct ecp3_dev {};

static const struct ecp3_dev ecp3_dev[] =;

static void firmware_load(const struct firmware *fw, void *context)
{}

static int lattice_ecp3_probe(struct spi_device *spi)
{}

static void lattice_ecp3_remove(struct spi_device *spi)
{}

static const struct spi_device_id lattice_ecp3_id[] =;
MODULE_DEVICE_TABLE(spi, lattice_ecp3_id);

static struct spi_driver lattice_ecp3_driver =;

module_spi_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_FIRMWARE();