#define pr_fmt(fmt) …
#include <linux/crc-ccitt.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/acpi.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/nfc.h>
#include <linux/firmware.h>
#include <linux/gpio/consumer.h>
#include <linux/unaligned.h>
#include <net/nfc/hci.h>
#include <net/nfc/llc.h>
#include <net/nfc/nfc.h>
#include "pn544.h"
#define PN544_I2C_FRAME_HEADROOM …
#define PN544_I2C_FRAME_TAILROOM …
#define PN544_GPIO_NAME_IRQ …
#define PN544_GPIO_NAME_FW …
#define PN544_GPIO_NAME_EN …
#define PN544_HCI_I2C_LLC_LEN …
#define PN544_HCI_I2C_LLC_CRC …
#define PN544_HCI_I2C_LLC_LEN_CRC …
#define PN544_HCI_I2C_LLC_MIN_SIZE …
#define PN544_HCI_I2C_LLC_MAX_PAYLOAD …
#define PN544_HCI_I2C_LLC_MAX_SIZE …
static const struct i2c_device_id pn544_hci_i2c_id_table[] = …;
MODULE_DEVICE_TABLE(i2c, pn544_hci_i2c_id_table);
static const struct acpi_device_id pn544_hci_i2c_acpi_match[] __maybe_unused = …;
MODULE_DEVICE_TABLE(acpi, pn544_hci_i2c_acpi_match);
#define PN544_HCI_I2C_DRIVER_NAME …
#define PN544_HW_VARIANT_C2 …
#define PN544_HW_VARIANT_C3 …
#define PN544_FW_CMD_RESET …
#define PN544_FW_CMD_WRITE …
#define PN544_FW_CMD_CHECK …
#define PN544_FW_CMD_SECURE_WRITE …
#define PN544_FW_CMD_SECURE_CHUNK_WRITE …
struct pn544_i2c_fw_frame_write { … } __packed;
struct pn544_i2c_fw_frame_check { … } __packed;
struct pn544_i2c_fw_frame_response { … } __packed;
struct pn544_i2c_fw_blob { … };
struct pn544_i2c_fw_secure_frame { … } __packed;
struct pn544_i2c_fw_secure_blob { … };
#define PN544_FW_CMD_RESULT_TIMEOUT …
#define PN544_FW_CMD_RESULT_BAD_CRC …
#define PN544_FW_CMD_RESULT_ACCESS_DENIED …
#define PN544_FW_CMD_RESULT_PROTOCOL_ERROR …
#define PN544_FW_CMD_RESULT_INVALID_PARAMETER …
#define PN544_FW_CMD_RESULT_UNSUPPORTED_COMMAND …
#define PN544_FW_CMD_RESULT_INVALID_LENGTH …
#define PN544_FW_CMD_RESULT_CRYPTOGRAPHIC_ERROR …
#define PN544_FW_CMD_RESULT_VERSION_CONDITIONS_ERROR …
#define PN544_FW_CMD_RESULT_MEMORY_ERROR …
#define PN544_FW_CMD_RESULT_CHUNK_OK …
#define PN544_FW_CMD_RESULT_WRITE_FAILED …
#define PN544_FW_CMD_RESULT_COMMAND_REJECTED …
#define PN544_FW_CMD_RESULT_CHUNK_ERROR …
#define PN544_FW_WRITE_BUFFER_MAX_LEN …
#define PN544_FW_I2C_MAX_PAYLOAD …
#define PN544_FW_I2C_WRITE_FRAME_HEADER_LEN …
#define PN544_FW_I2C_WRITE_DATA_MAX_LEN …
#define PN544_FW_SECURE_CHUNK_WRITE_HEADER_LEN …
#define PN544_FW_SECURE_CHUNK_WRITE_DATA_MAX_LEN …
#define PN544_FW_SECURE_FRAME_HEADER_LEN …
#define PN544_FW_SECURE_BLOB_HEADER_LEN …
#define FW_WORK_STATE_IDLE …
#define FW_WORK_STATE_START …
#define FW_WORK_STATE_WAIT_WRITE_ANSWER …
#define FW_WORK_STATE_WAIT_CHECK_ANSWER …
#define FW_WORK_STATE_WAIT_SECURE_WRITE_ANSWER …
struct pn544_i2c_phy { … };
#define I2C_DUMP_SKB(info, skb) …
static void pn544_hci_i2c_platform_init(struct pn544_i2c_phy *phy)
{ … }
static void pn544_hci_i2c_enable_mode(struct pn544_i2c_phy *phy, int run_mode)
{ … }
static int pn544_hci_i2c_enable(void *phy_id)
{ … }
static void pn544_hci_i2c_disable(void *phy_id)
{ … }
static void pn544_hci_i2c_add_len_crc(struct sk_buff *skb)
{ … }
static void pn544_hci_i2c_remove_len_crc(struct sk_buff *skb)
{ … }
static int pn544_hci_i2c_write(void *phy_id, struct sk_buff *skb)
{ … }
static int check_crc(u8 *buf, int buflen)
{ … }
static int pn544_hci_i2c_read(struct pn544_i2c_phy *phy, struct sk_buff **skb)
{ … }
static int pn544_hci_i2c_fw_read_status(struct pn544_i2c_phy *phy)
{ … }
static irqreturn_t pn544_hci_i2c_irq_thread_fn(int irq, void *phy_id)
{ … }
static const struct nfc_phy_ops i2c_phy_ops = …;
static int pn544_hci_i2c_fw_download(void *phy_id, const char *firmware_name,
u8 hw_variant)
{ … }
static void pn544_hci_i2c_fw_work_complete(struct pn544_i2c_phy *phy,
int result)
{ … }
static int pn544_hci_i2c_fw_write_cmd(struct i2c_client *client, u32 dest_addr,
const u8 *data, u16 datalen)
{ … }
static int pn544_hci_i2c_fw_check_cmd(struct i2c_client *client, u32 start_addr,
const u8 *data, u16 datalen)
{ … }
static int pn544_hci_i2c_fw_write_chunk(struct pn544_i2c_phy *phy)
{ … }
static int pn544_hci_i2c_fw_secure_write_frame_cmd(struct pn544_i2c_phy *phy,
const u8 *data, u16 datalen)
{ … }
static int pn544_hci_i2c_fw_secure_write_frame(struct pn544_i2c_phy *phy)
{ … }
static void pn544_hci_i2c_fw_work(struct work_struct *work)
{ … }
static const struct acpi_gpio_params enable_gpios = …;
static const struct acpi_gpio_params firmware_gpios = …;
static const struct acpi_gpio_mapping acpi_pn544_gpios[] = …;
static int pn544_hci_i2c_probe(struct i2c_client *client)
{ … }
static void pn544_hci_i2c_remove(struct i2c_client *client)
{ … }
static const struct of_device_id of_pn544_i2c_match[] __maybe_unused = …;
MODULE_DEVICE_TABLE(of, of_pn544_i2c_match);
static struct i2c_driver pn544_hci_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…);