linux/drivers/nfc/st-nci/spi.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * SPI Link Layer for ST NCI based Driver
 * Copyright (C) 2014-2015 STMicroelectronics SAS. All rights reserved.
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/spi/spi.h>
#include <linux/gpio/consumer.h>
#include <linux/acpi.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/nfc.h>
#include <linux/of.h>
#include <net/nfc/nci.h>

#include "st-nci.h"

#define DRIVER_DESC

/* ndlc header */
#define ST_NCI_FRAME_HEADROOM
#define ST_NCI_FRAME_TAILROOM

#define ST_NCI_SPI_MIN_SIZE
#define ST_NCI_SPI_MAX_SIZE

#define ST_NCI_DRIVER_NAME
#define ST_NCI_SPI_DRIVER_NAME

struct st_nci_spi_phy {};

static int st_nci_spi_enable(void *phy_id)
{}

static void st_nci_spi_disable(void *phy_id)
{}

/*
 * Writing a frame must not return the number of written bytes.
 * It must return either zero for success, or <0 for error.
 * In addition, it must not alter the skb
 */
static int st_nci_spi_write(void *phy_id, struct sk_buff *skb)
{}

/*
 * Reads an ndlc frame and returns it in a newly allocated sk_buff.
 * returns:
 * 0 : if received frame is complete
 * -EREMOTEIO : i2c read error (fatal)
 * -EBADMSG : frame was incorrect and discarded
 * -ENOMEM : cannot allocate skb, frame dropped
 */
static int st_nci_spi_read(struct st_nci_spi_phy *phy,
			struct sk_buff **skb)
{}

/*
 * Reads an ndlc frame from the chip.
 *
 * On ST21NFCB, IRQ goes in idle state when read starts.
 */
static irqreturn_t st_nci_irq_thread_fn(int irq, void *phy_id)
{}

static const struct nfc_phy_ops spi_phy_ops =;

static const struct acpi_gpio_params reset_gpios =;

static const struct acpi_gpio_mapping acpi_st_nci_gpios[] =;

static int st_nci_spi_probe(struct spi_device *dev)
{}

static void st_nci_spi_remove(struct spi_device *dev)
{}

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

static const struct acpi_device_id st_nci_spi_acpi_match[] __maybe_unused =;
MODULE_DEVICE_TABLE(acpi, st_nci_spi_acpi_match);

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

static struct spi_driver st_nci_spi_driver =;
module_spi_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();