linux/drivers/net/wireless/ti/wlcore/spi.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * This file is part of wl1271
 *
 * Copyright (C) 2008-2009 Nokia Corporation
 *
 * Contact: Luciano Coelho <[email protected]>
 */

#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/swab.h>
#include <linux/crc7.h>
#include <linux/spi/spi.h>
#include <linux/platform_device.h>
#include <linux/of_irq.h>
#include <linux/regulator/consumer.h>

#include "wlcore.h"
#include "wl12xx_80211.h"
#include "io.h"

#define WSPI_CMD_READ
#define WSPI_CMD_WRITE
#define WSPI_CMD_FIXED
#define WSPI_CMD_BYTE_LENGTH
#define WSPI_CMD_BYTE_LENGTH_OFFSET
#define WSPI_CMD_BYTE_ADDR

#define WSPI_INIT_CMD_CRC_LEN

#define WSPI_INIT_CMD_START
#define WSPI_INIT_CMD_TX
/* the extra bypass bit is sampled by the TNET as '1' */
#define WSPI_INIT_CMD_BYPASS_BIT
#define WSPI_INIT_CMD_FIXEDBUSY_LEN
#define WSPI_INIT_CMD_EN_FIXEDBUSY
#define WSPI_INIT_CMD_DIS_FIXEDBUSY
#define WSPI_INIT_CMD_IOD
#define WSPI_INIT_CMD_IP
#define WSPI_INIT_CMD_CS
#define WSPI_INIT_CMD_WS
#define WSPI_INIT_CMD_WSPI
#define WSPI_INIT_CMD_END

#define WSPI_INIT_CMD_LEN

#define HW_ACCESS_WSPI_FIXED_BUSY_LEN
#define HW_ACCESS_WSPI_INIT_CMD_MASK

/* HW limitation: maximum possible chunk size is 4095 bytes */
#define WSPI_MAX_CHUNK_SIZE

/*
 * wl18xx driver aggregation buffer size is (13 * 4K) compared to
 * (4 * 4K) for wl12xx, so use the larger buffer needed for wl18xx
 */
#define SPI_AGGR_BUFFER_SIZE

/* Maximum number of SPI write chunks */
#define WSPI_MAX_NUM_OF_CHUNKS

static const struct wilink_family_data wl127x_data =;

static const struct wilink_family_data wl128x_data =;

static const struct wilink_family_data wl18xx_data =;

struct wl12xx_spi_glue {};

static void wl12xx_spi_reset(struct device *child)
{}

static void wl12xx_spi_init(struct device *child)
{}

#define WL1271_BUSY_WORD_TIMEOUT

static int wl12xx_spi_read_busy(struct device *child)
{}

static int __must_check wl12xx_spi_raw_read(struct device *child, int addr,
					    void *buf, size_t len, bool fixed)
{}

static int __wl12xx_spi_raw_write(struct device *child, int addr,
				  void *buf, size_t len, bool fixed)
{}

static int __must_check wl12xx_spi_raw_write(struct device *child, int addr,
					     void *buf, size_t len, bool fixed)
{}

/**
 * wl12xx_spi_set_power - power on/off the wl12xx unit
 * @child: wl12xx device handle.
 * @enable: true/false to power on/off the unit.
 *
 * use the WiFi enable regulator to enable/disable the WiFi unit.
 */
static int wl12xx_spi_set_power(struct device *child, bool enable)
{}

/*
 * wl12xx_spi_set_block_size
 *
 * This function is not needed for spi mode, but need to be present.
 * Without it defined the wlcore fallback to use the wrong packet
 * allignment on tx.
 */
static void wl12xx_spi_set_block_size(struct device *child,
				      unsigned int blksz)
{}

static struct wl1271_if_operations spi_ops =;

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

/**
 * wlcore_probe_of - DT node parsing.
 * @spi: SPI slave device parameters.
 * @glue: wl12xx SPI bus to slave device glue parameters.
 * @pdev_data: wlcore device parameters
 */
static int wlcore_probe_of(struct spi_device *spi, struct wl12xx_spi_glue *glue,
			   struct wlcore_platdev_data *pdev_data)
{}

static int wl1271_probe(struct spi_device *spi)
{}

static void wl1271_remove(struct spi_device *spi)
{}

static struct spi_driver wl1271_spi_driver =;

module_spi_driver();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_ALIAS();