linux/drivers/nfc/trf7970a.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * TI TRF7970a RFID/NFC Transceiver Driver
 *
 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
 *
 * Author: Erick Macias <[email protected]>
 * Author: Felipe Balbi <[email protected]>
 * Author: Mark A. Greer <[email protected]>
 */

#include <linux/module.h>
#include <linux/device.h>
#include <linux/netdevice.h>
#include <linux/interrupt.h>
#include <linux/pm_runtime.h>
#include <linux/nfc.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
#include <linux/spi/spi.h>
#include <linux/regulator/consumer.h>

#include <net/nfc/nfc.h>
#include <net/nfc/digital.h>

/* There are 3 ways the host can communicate with the trf7970a:
 * parallel mode, SPI with Slave Select (SS) mode, and SPI without
 * SS mode.  The driver only supports the two SPI modes.
 *
 * The trf7970a is very timing sensitive and the VIN, EN2, and EN
 * pins must asserted in that order and with specific delays in between.
 * The delays used in the driver were provided by TI and have been
 * confirmed to work with this driver.  There is a bug with the current
 * version of the trf7970a that requires that EN2 remain low no matter
 * what.  If it goes high, it will generate an RF field even when in
 * passive target mode.  TI has indicated that the chip will work okay
 * when EN2 is left low.  The 'en2-rf-quirk' device tree property
 * indicates that trf7970a currently being used has the erratum and
 * that EN2 must be kept low.
 *
 * Timeouts are implemented using the delayed workqueue kernel facility.
 * Timeouts are required so things don't hang when there is no response
 * from the trf7970a (or tag).  Using this mechanism creates a race with
 * interrupts, however.  That is, an interrupt and a timeout could occur
 * closely enough together that one is blocked by the mutex while the other
 * executes.  When the timeout handler executes first and blocks the
 * interrupt handler, it will eventually set the state to IDLE so the
 * interrupt handler will check the state and exit with no harm done.
 * When the interrupt handler executes first and blocks the timeout handler,
 * the cancel_delayed_work() call will know that it didn't cancel the
 * work item (i.e., timeout) and will return zero.  That return code is
 * used by the timer handler to indicate that it should ignore the timeout
 * once its unblocked.
 *
 * Aborting an active command isn't as simple as it seems because the only
 * way to abort a command that's already been sent to the tag is so turn
 * off power to the tag.  If we do that, though, we'd have to go through
 * the entire anticollision procedure again but the digital layer doesn't
 * support that.  So, if an abort is received before trf7970a_send_cmd()
 * has sent the command to the tag, it simply returns -ECANCELED.  If the
 * command has already been sent to the tag, then the driver continues
 * normally and recieves the response data (or error) but just before
 * sending the data upstream, it frees the rx_skb and sends -ECANCELED
 * upstream instead.  If the command failed, that error will be sent
 * upstream.
 *
 * When recieving data from a tag and the interrupt status register has
 * only the SRX bit set, it means that all of the data has been received
 * (once what's in the fifo has been read).  However, depending on timing
 * an interrupt status with only the SRX bit set may not be recived.  In
 * those cases, the timeout mechanism is used to wait 20 ms in case more
 * data arrives.  After 20 ms, it is assumed that all of the data has been
 * received and the accumulated rx data is sent upstream.  The
 * 'TRF7970A_ST_WAIT_FOR_RX_DATA_CONT' state is used for this purpose
 * (i.e., it indicates that some data has been received but we're not sure
 * if there is more coming so a timeout in this state means all data has
 * been received and there isn't an error).  The delay is 20 ms since delays
 * of ~16 ms have been observed during testing.
 *
 * When transmitting a frame larger than the FIFO size (127 bytes), the
 * driver will wait 20 ms for the FIFO to drain past the low-watermark
 * and generate an interrupt.  The low-watermark set to 32 bytes so the
 * interrupt should fire after 127 - 32 = 95 bytes have been sent.  At
 * the lowest possible bit rate (6.62 kbps for 15693), it will take up
 * to ~14.35 ms so 20 ms is used for the timeout.
 *
 * Type 2 write and sector select commands respond with a 4-bit ACK or NACK.
 * Having only 4 bits in the FIFO won't normally generate an interrupt so
 * driver enables the '4_bit_RX' bit of the Special Functions register 1
 * to cause an interrupt in that case.  Leaving that bit for a read command
 * messes up the data returned so it is only enabled when the framing is
 * 'NFC_DIGITAL_FRAMING_NFCA_T2T' and the command is not a read command.
 * Unfortunately, that means that the driver has to peek into tx frames
 * when the framing is 'NFC_DIGITAL_FRAMING_NFCA_T2T'.  This is done by
 * the trf7970a_per_cmd_config() routine.
 *
 * ISO/IEC 15693 frames specify whether to use single or double sub-carrier
 * frequencies and whether to use low or high data rates in the flags byte
 * of the frame.  This means that the driver has to peek at all 15693 frames
 * to determine what speed to set the communication to.  In addition, write
 * and lock commands use the OPTION flag to indicate that an EOF must be
 * sent to the tag before it will send its response.  So the driver has to
 * examine all frames for that reason too.
 *
 * It is unclear how long to wait before sending the EOF.  According to the
 * Note under Table 1-1 in section 1.6 of
 * http://www.ti.com/lit/ug/scbu011/scbu011.pdf, that wait should be at least
 * 10 ms for TI Tag-it HF-I tags; however testing has shown that is not long
 * enough so 20 ms is used.  So the timer is set to 40 ms - 20 ms to drain
 * up to 127 bytes in the FIFO at the lowest bit rate plus another 20 ms to
 * ensure the wait is long enough before sending the EOF.  This seems to work
 * reliably.
 */

#define TRF7970A_SUPPORTED_PROTOCOLS

#define TRF7970A_AUTOSUSPEND_DELAY
#define TRF7970A_13MHZ_CLOCK_FREQUENCY
#define TRF7970A_27MHZ_CLOCK_FREQUENCY

#define TRF7970A_RX_SKB_ALLOC_SIZE

#define TRF7970A_FIFO_SIZE

/* TX length is 3 nibbles long ==> 4KB - 1 bytes max */
#define TRF7970A_TX_MAX

#define TRF7970A_WAIT_FOR_TX_IRQ
#define TRF7970A_WAIT_FOR_RX_DATA_TIMEOUT
#define TRF7970A_WAIT_FOR_FIFO_DRAIN_TIMEOUT
#define TRF7970A_WAIT_TO_ISSUE_ISO15693_EOF

/* Guard times for various RF technologies (in us) */
#define TRF7970A_GUARD_TIME_NFCA
#define TRF7970A_GUARD_TIME_NFCB
#define TRF7970A_GUARD_TIME_NFCF
#define TRF7970A_GUARD_TIME_15693

/* Quirks */
/* Erratum: When reading IRQ Status register on trf7970a, we must issue a
 * read continuous command for IRQ Status and Collision Position registers.
 */
#define TRF7970A_QUIRK_IRQ_STATUS_READ
#define TRF7970A_QUIRK_EN2_MUST_STAY_LOW

/* Direct commands */
#define TRF7970A_CMD_IDLE
#define TRF7970A_CMD_SOFT_INIT
#define TRF7970A_CMD_RF_COLLISION
#define TRF7970A_CMD_RF_COLLISION_RESPONSE_N
#define TRF7970A_CMD_RF_COLLISION_RESPONSE_0
#define TRF7970A_CMD_FIFO_RESET
#define TRF7970A_CMD_TRANSMIT_NO_CRC
#define TRF7970A_CMD_TRANSMIT
#define TRF7970A_CMD_DELAY_TRANSMIT_NO_CRC
#define TRF7970A_CMD_DELAY_TRANSMIT
#define TRF7970A_CMD_EOF
#define TRF7970A_CMD_CLOSE_SLOT
#define TRF7970A_CMD_BLOCK_RX
#define TRF7970A_CMD_ENABLE_RX
#define TRF7970A_CMD_TEST_INT_RF
#define TRF7970A_CMD_TEST_EXT_RF
#define TRF7970A_CMD_RX_GAIN_ADJUST

/* Bits determining whether its a direct command or register R/W,
 * whether to use a continuous SPI transaction or not, and the actual
 * direct cmd opcode or register address.
 */
#define TRF7970A_CMD_BIT_CTRL
#define TRF7970A_CMD_BIT_RW
#define TRF7970A_CMD_BIT_CONTINUOUS
#define TRF7970A_CMD_BIT_OPCODE(opcode)

/* Registers addresses */
#define TRF7970A_CHIP_STATUS_CTRL
#define TRF7970A_ISO_CTRL
#define TRF7970A_ISO14443B_TX_OPTIONS
#define TRF7970A_ISO14443A_HIGH_BITRATE_OPTIONS
#define TRF7970A_TX_TIMER_SETTING_H_BYTE
#define TRF7970A_TX_TIMER_SETTING_L_BYTE
#define TRF7970A_TX_PULSE_LENGTH_CTRL
#define TRF7970A_RX_NO_RESPONSE_WAIT
#define TRF7970A_RX_WAIT_TIME
#define TRF7970A_MODULATOR_SYS_CLK_CTRL
#define TRF7970A_RX_SPECIAL_SETTINGS
#define TRF7970A_REG_IO_CTRL
#define TRF7970A_IRQ_STATUS
#define TRF7970A_COLLISION_IRQ_MASK
#define TRF7970A_COLLISION_POSITION
#define TRF7970A_RSSI_OSC_STATUS
#define TRF7970A_SPECIAL_FCN_REG1
#define TRF7970A_SPECIAL_FCN_REG2
#define TRF7970A_RAM1
#define TRF7970A_RAM2
#define TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS
#define TRF7970A_NFC_LOW_FIELD_LEVEL
#define TRF7970A_NFCID1
#define TRF7970A_NFC_TARGET_LEVEL
#define TRF79070A_NFC_TARGET_PROTOCOL
#define TRF7970A_TEST_REGISTER1
#define TRF7970A_TEST_REGISTER2
#define TRF7970A_FIFO_STATUS
#define TRF7970A_TX_LENGTH_BYTE1
#define TRF7970A_TX_LENGTH_BYTE2
#define TRF7970A_FIFO_IO_REGISTER

/* Chip Status Control Register Bits */
#define TRF7970A_CHIP_STATUS_VRS5_3
#define TRF7970A_CHIP_STATUS_REC_ON
#define TRF7970A_CHIP_STATUS_AGC_ON
#define TRF7970A_CHIP_STATUS_PM_ON
#define TRF7970A_CHIP_STATUS_RF_PWR
#define TRF7970A_CHIP_STATUS_RF_ON
#define TRF7970A_CHIP_STATUS_DIRECT
#define TRF7970A_CHIP_STATUS_STBY

/* ISO Control Register Bits */
#define TRF7970A_ISO_CTRL_15693_SGL_1OF4_662
#define TRF7970A_ISO_CTRL_15693_SGL_1OF256_662
#define TRF7970A_ISO_CTRL_15693_SGL_1OF4_2648
#define TRF7970A_ISO_CTRL_15693_SGL_1OF256_2648
#define TRF7970A_ISO_CTRL_15693_DBL_1OF4_667a
#define TRF7970A_ISO_CTRL_15693_DBL_1OF256_667
#define TRF7970A_ISO_CTRL_15693_DBL_1OF4_2669
#define TRF7970A_ISO_CTRL_15693_DBL_1OF256_2669
#define TRF7970A_ISO_CTRL_14443A_106
#define TRF7970A_ISO_CTRL_14443A_212
#define TRF7970A_ISO_CTRL_14443A_424
#define TRF7970A_ISO_CTRL_14443A_848
#define TRF7970A_ISO_CTRL_14443B_106
#define TRF7970A_ISO_CTRL_14443B_212
#define TRF7970A_ISO_CTRL_14443B_424
#define TRF7970A_ISO_CTRL_14443B_848
#define TRF7970A_ISO_CTRL_FELICA_212
#define TRF7970A_ISO_CTRL_FELICA_424
#define TRF7970A_ISO_CTRL_NFC_NFCA_106
#define TRF7970A_ISO_CTRL_NFC_NFCF_212
#define TRF7970A_ISO_CTRL_NFC_NFCF_424
#define TRF7970A_ISO_CTRL_NFC_CE_14443A
#define TRF7970A_ISO_CTRL_NFC_CE_14443B
#define TRF7970A_ISO_CTRL_NFC_CE
#define TRF7970A_ISO_CTRL_NFC_ACTIVE
#define TRF7970A_ISO_CTRL_NFC_INITIATOR
#define TRF7970A_ISO_CTRL_NFC_NFC_CE_MODE
#define TRF7970A_ISO_CTRL_RFID
#define TRF7970A_ISO_CTRL_DIR_MODE
#define TRF7970A_ISO_CTRL_RX_CRC_N

#define TRF7970A_ISO_CTRL_RFID_SPEED_MASK

/* Modulator and SYS_CLK Control Register Bits */
#define TRF7970A_MODULATOR_DEPTH(n)
#define TRF7970A_MODULATOR_DEPTH_ASK10
#define TRF7970A_MODULATOR_DEPTH_OOK
#define TRF7970A_MODULATOR_DEPTH_ASK7
#define TRF7970A_MODULATOR_DEPTH_ASK8_5
#define TRF7970A_MODULATOR_DEPTH_ASK13
#define TRF7970A_MODULATOR_DEPTH_ASK16
#define TRF7970A_MODULATOR_DEPTH_ASK22
#define TRF7970A_MODULATOR_DEPTH_ASK30
#define TRF7970A_MODULATOR_EN_ANA
#define TRF7970A_MODULATOR_CLK(n)
#define TRF7970A_MODULATOR_CLK_DISABLED
#define TRF7970A_MODULATOR_CLK_3_6
#define TRF7970A_MODULATOR_CLK_6_13
#define TRF7970A_MODULATOR_CLK_13_27
#define TRF7970A_MODULATOR_EN_OOK
#define TRF7970A_MODULATOR_27MHZ

#define TRF7970A_RX_SPECIAL_SETTINGS_NO_LIM
#define TRF7970A_RX_SPECIAL_SETTINGS_AGCR
#define TRF7970A_RX_SPECIAL_SETTINGS_GD_0DB
#define TRF7970A_RX_SPECIAL_SETTINGS_GD_5DB
#define TRF7970A_RX_SPECIAL_SETTINGS_GD_10DB
#define TRF7970A_RX_SPECIAL_SETTINGS_GD_15DB
#define TRF7970A_RX_SPECIAL_SETTINGS_HBT
#define TRF7970A_RX_SPECIAL_SETTINGS_M848
#define TRF7970A_RX_SPECIAL_SETTINGS_C424
#define TRF7970A_RX_SPECIAL_SETTINGS_C212

#define TRF7970A_REG_IO_CTRL_VRS(v)
#define TRF7970A_REG_IO_CTRL_IO_LOW
#define TRF7970A_REG_IO_CTRL_EN_EXT_PA
#define TRF7970A_REG_IO_CTRL_AUTO_REG

/* IRQ Status Register Bits */
#define TRF7970A_IRQ_STATUS_NORESP
#define TRF7970A_IRQ_STATUS_NFC_COL_ERROR
#define TRF7970A_IRQ_STATUS_COL
#define TRF7970A_IRQ_STATUS_FRAMING_EOF_ERROR
#define TRF7970A_IRQ_STATUS_NFC_RF
#define TRF7970A_IRQ_STATUS_PARITY_ERROR
#define TRF7970A_IRQ_STATUS_NFC_SDD
#define TRF7970A_IRQ_STATUS_CRC_ERROR
#define TRF7970A_IRQ_STATUS_NFC_PROTO_ERROR
#define TRF7970A_IRQ_STATUS_FIFO
#define TRF7970A_IRQ_STATUS_SRX
#define TRF7970A_IRQ_STATUS_TX

#define TRF7970A_IRQ_STATUS_ERROR

#define TRF7970A_RSSI_OSC_STATUS_RSSI_MASK
#define TRF7970A_RSSI_OSC_STATUS_RSSI_X_MASK
#define TRF7970A_RSSI_OSC_STATUS_RSSI_OSC_OK

#define TRF7970A_SPECIAL_FCN_REG1_COL_7_6
#define TRF7970A_SPECIAL_FCN_REG1_14_ANTICOLL
#define TRF7970A_SPECIAL_FCN_REG1_4_BIT_RX
#define TRF7970A_SPECIAL_FCN_REG1_SP_DIR_MODE
#define TRF7970A_SPECIAL_FCN_REG1_NEXT_SLOT_37US
#define TRF7970A_SPECIAL_FCN_REG1_PAR43

#define TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_124
#define TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_120
#define TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_112
#define TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96
#define TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_4
#define TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_8
#define TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_16
#define TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32

#define TRF7970A_NFC_LOW_FIELD_LEVEL_RFDET(v)
#define TRF7970A_NFC_LOW_FIELD_LEVEL_CLEX_DIS

#define TRF7970A_NFC_TARGET_LEVEL_RFDET(v)
#define TRF7970A_NFC_TARGET_LEVEL_HI_RF
#define TRF7970A_NFC_TARGET_LEVEL_SDD_EN
#define TRF7970A_NFC_TARGET_LEVEL_LD_S_4BYTES
#define TRF7970A_NFC_TARGET_LEVEL_LD_S_7BYTES
#define TRF7970A_NFC_TARGET_LEVEL_LD_S_10BYTES

#define TRF79070A_NFC_TARGET_PROTOCOL_NFCBR_106
#define TRF79070A_NFC_TARGET_PROTOCOL_NFCBR_212
#define TRF79070A_NFC_TARGET_PROTOCOL_NFCBR_424
#define TRF79070A_NFC_TARGET_PROTOCOL_PAS_14443B
#define TRF79070A_NFC_TARGET_PROTOCOL_PAS_106
#define TRF79070A_NFC_TARGET_PROTOCOL_FELICA
#define TRF79070A_NFC_TARGET_PROTOCOL_RF_L
#define TRF79070A_NFC_TARGET_PROTOCOL_RF_H

#define TRF79070A_NFC_TARGET_PROTOCOL_106A

#define TRF79070A_NFC_TARGET_PROTOCOL_106B

#define TRF79070A_NFC_TARGET_PROTOCOL_212F

#define TRF79070A_NFC_TARGET_PROTOCOL_424F

#define TRF7970A_FIFO_STATUS_OVERFLOW

/* NFC (ISO/IEC 14443A) Type 2 Tag commands */
#define NFC_T2T_CMD_READ

/* ISO 15693 commands codes */
#define ISO15693_CMD_INVENTORY
#define ISO15693_CMD_READ_SINGLE_BLOCK
#define ISO15693_CMD_WRITE_SINGLE_BLOCK
#define ISO15693_CMD_LOCK_BLOCK
#define ISO15693_CMD_READ_MULTIPLE_BLOCK
#define ISO15693_CMD_WRITE_MULTIPLE_BLOCK
#define ISO15693_CMD_SELECT
#define ISO15693_CMD_RESET_TO_READY
#define ISO15693_CMD_WRITE_AFI
#define ISO15693_CMD_LOCK_AFI
#define ISO15693_CMD_WRITE_DSFID
#define ISO15693_CMD_LOCK_DSFID
#define ISO15693_CMD_GET_SYSTEM_INFO
#define ISO15693_CMD_GET_MULTIPLE_BLOCK_SECURITY_STATUS

/* ISO 15693 request and response flags */
#define ISO15693_REQ_FLAG_SUB_CARRIER
#define ISO15693_REQ_FLAG_DATA_RATE
#define ISO15693_REQ_FLAG_INVENTORY
#define ISO15693_REQ_FLAG_PROTOCOL_EXT
#define ISO15693_REQ_FLAG_SELECT
#define ISO15693_REQ_FLAG_AFI
#define ISO15693_REQ_FLAG_ADDRESS
#define ISO15693_REQ_FLAG_NB_SLOTS
#define ISO15693_REQ_FLAG_OPTION

#define ISO15693_REQ_FLAG_SPEED_MASK

enum trf7970a_state {};

struct trf7970a {};

static int trf7970a_cmd(struct trf7970a *trf, u8 opcode)
{}

static int trf7970a_read(struct trf7970a *trf, u8 reg, u8 *val)
{}

static int trf7970a_read_cont(struct trf7970a *trf, u8 reg, u8 *buf,
			      size_t len)
{}

static int trf7970a_write(struct trf7970a *trf, u8 reg, u8 val)
{}

static int trf7970a_read_irqstatus(struct trf7970a *trf, u8 *status)
{}

static int trf7970a_read_target_proto(struct trf7970a *trf, u8 *target_proto)
{}

static int trf7970a_mode_detect(struct trf7970a *trf, u8 *rf_tech)
{}

static void trf7970a_send_upstream(struct trf7970a *trf)
{}

static void trf7970a_send_err_upstream(struct trf7970a *trf, int errno)
{}

static int trf7970a_transmit(struct trf7970a *trf, struct sk_buff *skb,
			     unsigned int len, const u8 *prefix,
			     unsigned int prefix_len)
{}

static void trf7970a_fill_fifo(struct trf7970a *trf)
{}

static void trf7970a_drain_fifo(struct trf7970a *trf, u8 status)
{}

static irqreturn_t trf7970a_irq(int irq, void *dev_id)
{}

static void trf7970a_issue_eof(struct trf7970a *trf)
{}

static void trf7970a_timeout_work_handler(struct work_struct *work)
{}

static int trf7970a_init(struct trf7970a *trf)
{}

static void trf7970a_switch_rf_off(struct trf7970a *trf)
{}

static int trf7970a_switch_rf_on(struct trf7970a *trf)
{}

static int trf7970a_switch_rf(struct nfc_digital_dev *ddev, bool on)
{}

static int trf7970a_in_config_rf_tech(struct trf7970a *trf, int tech)
{}

static int trf7970a_is_rf_field(struct trf7970a *trf, bool *is_rf_field)
{}

static int trf7970a_in_config_framing(struct trf7970a *trf, int framing)
{}

static int trf7970a_in_configure_hw(struct nfc_digital_dev *ddev, int type,
				    int param)
{}

static int trf7970a_is_iso15693_write_or_lock(u8 cmd)
{}

static int trf7970a_per_cmd_config(struct trf7970a *trf,
				   const struct sk_buff *skb)
{}

static int trf7970a_send_cmd(struct nfc_digital_dev *ddev,
			     struct sk_buff *skb, u16 timeout,
			     nfc_digital_cmd_complete_t cb, void *arg)
{}

static int trf7970a_tg_config_rf_tech(struct trf7970a *trf, int tech)
{}

/* Since this is a target routine, several of the framing calls are
 * made between receiving the request and sending the response so they
 * should take effect until after the response is sent.  This is accomplished
 * by skipping the ISO_CTRL register write here and doing it in the interrupt
 * handler.
 */
static int trf7970a_tg_config_framing(struct trf7970a *trf, int framing)
{}

static int trf7970a_tg_configure_hw(struct nfc_digital_dev *ddev, int type,
				    int param)
{}

static int _trf7970a_tg_listen(struct nfc_digital_dev *ddev, u16 timeout,
			       nfc_digital_cmd_complete_t cb, void *arg,
			       bool mode_detect)
{}

static int trf7970a_tg_listen(struct nfc_digital_dev *ddev, u16 timeout,
			      nfc_digital_cmd_complete_t cb, void *arg)
{}

static int trf7970a_tg_listen_md(struct nfc_digital_dev *ddev,
				 u16 timeout, nfc_digital_cmd_complete_t cb,
				 void *arg)
{}

static int trf7970a_tg_get_rf_tech(struct nfc_digital_dev *ddev, u8 *rf_tech)
{}

static void trf7970a_abort_cmd(struct nfc_digital_dev *ddev)
{}

static const struct nfc_digital_ops trf7970a_nfc_ops =;

static int trf7970a_power_up(struct trf7970a *trf)
{}

static int trf7970a_power_down(struct trf7970a *trf)
{}

static int trf7970a_startup(struct trf7970a *trf)
{}

static void trf7970a_shutdown(struct trf7970a *trf)
{}

static int trf7970a_get_autosuspend_delay(const struct device_node *np)
{}

static int trf7970a_probe(struct spi_device *spi)
{}

static void trf7970a_remove(struct spi_device *spi)
{}

#ifdef CONFIG_PM_SLEEP
static int trf7970a_suspend(struct device *dev)
{}

static int trf7970a_resume(struct device *dev)
{}
#endif

#ifdef CONFIG_PM
static int trf7970a_pm_runtime_suspend(struct device *dev)
{}

static int trf7970a_pm_runtime_resume(struct device *dev)
{}
#endif

static const struct dev_pm_ops trf7970a_pm_ops =;

static const struct of_device_id trf7970a_of_match[] __maybe_unused =;

MODULE_DEVICE_TABLE(of, trf7970a_of_match);

static const struct spi_device_id trf7970a_id_table[] =;

MODULE_DEVICE_TABLE(spi, trf7970a_id_table);

static struct spi_driver trf7970a_spi_driver =;

module_spi_driver();

MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_DESCRIPTION();