#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/nfc.h>
#include <linux/of.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/wait.h>
#include <net/nfc/digital.h>
#include <net/nfc/nfc.h>
#include "spi.h"
#define ST95HF_SUPPORTED_PROT …
#define ST95HF_CAPABILITIES …
#define ECHO_CMD …
#define WRITE_REGISTER_CMD …
#define PROTOCOL_SELECT_CMD …
#define SEND_RECEIVE_CMD …
#define ISO15693_PROTOCOL_CODE …
#define ISO14443A_PROTOCOL_CODE …
#define ISO14443B_PROTOCOL_CODE …
#define ST95HF_HEADROOM_LEN …
#define ST95HF_TAILROOM_LEN …
#define MAX_RESPONSE_BUFFER_SIZE …
#define ECHORESPONSE …
#define ST95HF_ERR_MASK …
#define ST95HF_TIMEOUT_ERROR …
#define ST95HF_NFCA_CRC_ERR_MASK …
#define ST95HF_NFCB_CRC_ERR_MASK …
#define TRFLAG_NFCA_SHORT_FRAME …
#define TRFLAG_NFCA_STD_FRAME …
#define TRFLAG_NFCA_STD_FRAME_CRC …
#define HIGH …
#define LOW …
#define ISO14443A_RATS_REQ …
#define RATS_TB1_PRESENT_MASK …
#define RATS_TA1_PRESENT_MASK …
#define TB1_FWI_MASK …
#define WTX_REQ_FROM_TAG …
#define MAX_CMD_LEN …
#define MAX_CMD_PARAMS …
struct cmd { … };
struct param_list { … };
enum st95hf_cmd_list { … };
static const struct cmd cmd_array[] = …;
struct st95_digital_cmd_complete_arg { … };
struct st95hf_context { … };
static int st95hf_send_recv_cmd(struct st95hf_context *st95context,
enum st95hf_cmd_list cmd,
int no_modif,
struct param_list *list_array,
bool recv_res)
{ … }
static int st95hf_echo_command(struct st95hf_context *st95context)
{ … }
static int secondary_configuration_type4a(struct st95hf_context *stcontext)
{ … }
static int secondary_configuration_type4b(struct st95hf_context *stcontext)
{ … }
static int st95hf_select_protocol(struct st95hf_context *stcontext, int type)
{ … }
static void st95hf_send_st95enable_negativepulse(struct st95hf_context *st95con)
{ … }
static int st95hf_send_spi_reset_sequence(struct st95hf_context *st95context)
{ … }
static int st95hf_por_sequence(struct st95hf_context *st95context)
{ … }
static int iso14443_config_fdt(struct st95hf_context *st95context, int wtxm)
{ … }
static int st95hf_handle_wtx(struct st95hf_context *stcontext,
bool new_wtx,
int wtx_val)
{ … }
static int st95hf_error_handling(struct st95hf_context *stcontext,
struct sk_buff *skb_resp,
int res_len)
{ … }
static int st95hf_response_handler(struct st95hf_context *stcontext,
struct sk_buff *skb_resp,
int res_len)
{ … }
static irqreturn_t st95hf_irq_handler(int irq, void *st95hfcontext)
{ … }
static irqreturn_t st95hf_irq_thread_handler(int irq, void *st95hfcontext)
{ … }
static int st95hf_in_configure_hw(struct nfc_digital_dev *ddev,
int type,
int param)
{ … }
static int rf_off(struct st95hf_context *stcontext)
{ … }
static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev,
struct sk_buff *skb,
u16 timeout,
nfc_digital_cmd_complete_t cb,
void *arg)
{ … }
static int st95hf_tg_configure_hw(struct nfc_digital_dev *ddev,
int type,
int param)
{ … }
static int st95hf_tg_send_cmd(struct nfc_digital_dev *ddev,
struct sk_buff *skb,
u16 timeout,
nfc_digital_cmd_complete_t cb,
void *arg)
{ … }
static int st95hf_tg_listen(struct nfc_digital_dev *ddev,
u16 timeout,
nfc_digital_cmd_complete_t cb,
void *arg)
{ … }
static int st95hf_tg_get_rf_tech(struct nfc_digital_dev *ddev, u8 *rf_tech)
{ … }
static int st95hf_switch_rf(struct nfc_digital_dev *ddev, bool on)
{ … }
static void st95hf_abort_cmd(struct nfc_digital_dev *ddev)
{ … }
static const struct nfc_digital_ops st95hf_nfc_digital_ops = …;
static const struct spi_device_id st95hf_id[] = …;
MODULE_DEVICE_TABLE(spi, st95hf_id);
static const struct of_device_id st95hf_spi_of_match[] __maybe_unused = …;
MODULE_DEVICE_TABLE(of, st95hf_spi_of_match);
static int st95hf_probe(struct spi_device *nfc_spi_dev)
{ … }
static void st95hf_remove(struct spi_device *nfc_spi_dev)
{ … }
static struct spi_driver st95hf_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;