linux/drivers/net/wireless/silabs/wfx/bus_spi.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * SPI interface.
 *
 * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
 * Copyright (c) 2011, Sagrad Inc.
 * Copyright (c) 2010, ST-Ericsson
 */
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/spi/spi.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/of.h>

#include "bus.h"
#include "wfx.h"
#include "hwio.h"
#include "main.h"
#include "bh.h"

#define SET_WRITE
#define SET_READ

static const struct wfx_platform_data pdata_wf200 =;

static const struct wfx_platform_data pdata_brd4001a =;

static const struct wfx_platform_data pdata_brd8022a =;

static const struct wfx_platform_data pdata_brd8023a =;

struct wfx_spi_priv {};

/* The chip reads 16bits of data at time and place them directly into (little endian) CPU register.
 * So, the chip expects bytes order to be "B1 B0 B3 B2" (while LE is "B0 B1 B2 B3" and BE is
 * "B3 B2 B1 B0")
 *
 * A little endian host with bits_per_word == 16 should do the right job natively. The code below to
 * support big endian host and commonly used SPI 8bits.
 */
static int wfx_spi_copy_from_io(void *priv, unsigned int addr, void *dst, size_t count)
{}

static int wfx_spi_copy_to_io(void *priv, unsigned int addr, const void *src, size_t count)
{}

static void wfx_spi_lock(void *priv)
{}

static void wfx_spi_unlock(void *priv)
{}

static irqreturn_t wfx_spi_irq_handler(int irq, void *priv)
{}

static int wfx_spi_irq_subscribe(void *priv)
{}

static int wfx_spi_irq_unsubscribe(void *priv)
{}

static size_t wfx_spi_align_size(void *priv, size_t size)
{}

static const struct wfx_hwbus_ops wfx_spi_hwbus_ops =;

static int wfx_spi_probe(struct spi_device *func)
{}

static void wfx_spi_remove(struct spi_device *func)
{}

/* For dynamic driver binding, kernel does not use OF to match driver. It only
 * use modalias and modalias is a copy of 'compatible' DT node with vendor
 * stripped.
 */
static const struct spi_device_id wfx_spi_id[] =;
MODULE_DEVICE_TABLE(spi, wfx_spi_id);

#ifdef CONFIG_OF
static const struct of_device_id wfx_spi_of_match[] =;
MODULE_DEVICE_TABLE(of, wfx_spi_of_match);
#endif

struct spi_driver wfx_spi_driver =;