linux/drivers/spi/spi-ingenic.c

// SPDX-License-Identifier: GPL-2.0
/*
 * SPI bus driver for the Ingenic SoCs
 * Copyright (c) 2017-2021 Artur Rojek <[email protected]>
 * Copyright (c) 2017-2021 Paul Cercueil <[email protected]>
 * Copyright (c) 2022 周琰杰 (Zhou Yanjie) <[email protected]>
 */

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include "internals.h"

#define REG_SSIDR
#define REG_SSICR0
#define REG_SSICR1
#define REG_SSISR
#define REG_SSIGR

#define REG_SSICR0_TENDIAN_LSB
#define REG_SSICR0_RENDIAN_LSB
#define REG_SSICR0_SSIE
#define REG_SSICR0_LOOP
#define REG_SSICR0_EACLRUN
#define REG_SSICR0_FSEL
#define REG_SSICR0_TFLUSH
#define REG_SSICR0_RFLUSH

#define REG_SSICR1_FRMHL_MASK
#define REG_SSICR1_FRMHL
#define REG_SSICR1_LFST
#define REG_SSICR1_UNFIN
#define REG_SSICR1_PHA
#define REG_SSICR1_POL

#define REG_SSISR_END
#define REG_SSISR_BUSY
#define REG_SSISR_TFF
#define REG_SSISR_RFE
#define REG_SSISR_RFHF
#define REG_SSISR_UNDR
#define REG_SSISR_OVER

#define SPI_INGENIC_FIFO_SIZE

struct jz_soc_info {};

struct ingenic_spi {};

static int spi_ingenic_wait(struct ingenic_spi *priv,
			    unsigned long mask,
			    bool condition)
{}

static void spi_ingenic_set_cs(struct spi_device *spi, bool disable)
{}

static void spi_ingenic_prepare_transfer(struct ingenic_spi *priv,
					 struct spi_device *spi,
					 struct spi_transfer *xfer)
{}

static void spi_ingenic_finalize_transfer(void *controller)
{}

static struct dma_async_tx_descriptor *
spi_ingenic_prepare_dma(struct spi_controller *ctlr, struct dma_chan *chan,
			struct sg_table *sg, enum dma_transfer_direction dir,
			unsigned int bits)
{}

static int spi_ingenic_dma_tx(struct spi_controller *ctlr,
			      struct spi_transfer *xfer, unsigned int bits)
{}

#define SPI_INGENIC_TX
SPI_INGENIC_TX(8)
SPI_INGENIC_TX(16)
SPI_INGENIC_TX(32)
#undef SPI_INGENIC_TX

static int spi_ingenic_transfer_one(struct spi_controller *ctlr,
				    struct spi_device *spi,
				    struct spi_transfer *xfer)
{}

static int spi_ingenic_prepare_message(struct spi_controller *ctlr,
				       struct spi_message *message)
{}

static int spi_ingenic_prepare_hardware(struct spi_controller *ctlr)
{}

static int spi_ingenic_unprepare_hardware(struct spi_controller *ctlr)
{}

static bool spi_ingenic_can_dma(struct spi_controller *ctlr,
				struct spi_device *spi,
				struct spi_transfer *xfer)
{}

static int spi_ingenic_request_dma(struct spi_controller *ctlr,
				   struct device *dev)
{}

static void spi_ingenic_release_dma(void *data)
{}

static const struct regmap_config spi_ingenic_regmap_config =;

static int spi_ingenic_probe(struct platform_device *pdev)
{}

static const struct jz_soc_info jz4750_soc_info =;

static const struct jz_soc_info jz4780_soc_info =;

static const struct jz_soc_info x1000_soc_info =;

static const struct jz_soc_info x2000_soc_info =;

static const struct of_device_id spi_ingenic_of_match[] =;
MODULE_DEVICE_TABLE(of, spi_ingenic_of_match);

static struct platform_driver spi_ingenic_driver =;

module_platform_driver();
MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_LICENSE();