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

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

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/i2c.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 "st-nci.h"

#define DRIVER_DESC

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

#define ST_NCI_I2C_MIN_SIZE
#define ST_NCI_I2C_MAX_SIZE

#define ST_NCI_DRIVER_NAME
#define ST_NCI_I2C_DRIVER_NAME

struct st_nci_i2c_phy {};

static int st_nci_i2c_enable(void *phy_id)
{}

static void st_nci_i2c_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_i2c_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_i2c_read(struct st_nci_i2c_phy *phy,
				 struct sk_buff **skb)
{}

/*
 * Reads an ndlc frame from the chip.
 *
 * On ST_NCI, 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 i2c_phy_ops =;

static const struct acpi_gpio_params reset_gpios =;

static const struct acpi_gpio_mapping acpi_st_nci_gpios[] =;

static int st_nci_i2c_probe(struct i2c_client *client)
{}

static void st_nci_i2c_remove(struct i2c_client *client)
{}

static const struct i2c_device_id st_nci_i2c_id_table[] =;
MODULE_DEVICE_TABLE(i2c, st_nci_i2c_id_table);

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

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

static struct i2c_driver st_nci_i2c_driver =;
module_i2c_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();