#include <linux/acpi.h>
#include <linux/cleanup.h>
#include <linux/crc32.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/irq.h>
#include <linux/irqreturn.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/types.h>
#include "vsc-tp.h"
#define VSC_TP_RESET_PIN_TOGGLE_INTERVAL_MS …
#define VSC_TP_ROM_BOOTUP_DELAY_MS …
#define VSC_TP_ROM_XFER_POLL_TIMEOUT_US …
#define VSC_TP_ROM_XFER_POLL_DELAY_US …
#define VSC_TP_WAIT_FW_POLL_TIMEOUT …
#define VSC_TP_WAIT_FW_POLL_DELAY_US …
#define VSC_TP_MAX_XFER_COUNT …
#define VSC_TP_PACKET_SYNC …
#define VSC_TP_CRC_SIZE …
#define VSC_TP_MAX_MSG_SIZE …
#define VSC_TP_XFER_TIMEOUT_BYTES …
#define VSC_TP_PACKET_PADDING_SIZE …
#define VSC_TP_PACKET_SIZE(pkt) …
#define VSC_TP_MAX_PACKET_SIZE …
#define VSC_TP_MAX_XFER_SIZE …
#define VSC_TP_NEXT_XFER_LEN(len, offset) …
struct vsc_tp_packet { … };
struct vsc_tp { … };
static const struct acpi_gpio_params wakeuphost_gpio = …;
static const struct acpi_gpio_params wakeuphostint_gpio = …;
static const struct acpi_gpio_params resetfw_gpio = …;
static const struct acpi_gpio_params wakeupfw = …;
static const struct acpi_gpio_mapping vsc_tp_acpi_gpios[] = …;
static irqreturn_t vsc_tp_isr(int irq, void *data)
{ … }
static irqreturn_t vsc_tp_thread_isr(int irq, void *data)
{ … }
static int vsc_tp_wakeup_request(struct vsc_tp *tp)
{ … }
static void vsc_tp_wakeup_release(struct vsc_tp *tp)
{ … }
static int vsc_tp_dev_xfer(struct vsc_tp *tp, void *obuf, void *ibuf, size_t len)
{ … }
static int vsc_tp_xfer_helper(struct vsc_tp *tp, struct vsc_tp_packet *pkt,
void *ibuf, u16 ilen)
{ … }
int vsc_tp_xfer(struct vsc_tp *tp, u8 cmd, const void *obuf, size_t olen,
void *ibuf, size_t ilen)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int vsc_tp_rom_xfer(struct vsc_tp *tp, const void *obuf, void *ibuf, size_t len)
{ … }
void vsc_tp_reset(struct vsc_tp *tp)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
bool vsc_tp_need_read(struct vsc_tp *tp)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int vsc_tp_register_event_cb(struct vsc_tp *tp, vsc_tp_event_cb_t event_cb,
void *context)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int vsc_tp_request_irq(struct vsc_tp *tp)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
void vsc_tp_free_irq(struct vsc_tp *tp)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
void vsc_tp_intr_synchronize(struct vsc_tp *tp)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
void vsc_tp_intr_enable(struct vsc_tp *tp)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
void vsc_tp_intr_disable(struct vsc_tp *tp)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
static int vsc_tp_match_any(struct acpi_device *adev, void *data)
{ … }
static int vsc_tp_probe(struct spi_device *spi)
{ … }
static void vsc_tp_remove(struct spi_device *spi)
{ … }
static void vsc_tp_shutdown(struct spi_device *spi)
{ … }
static const struct acpi_device_id vsc_tp_acpi_ids[] = …;
MODULE_DEVICE_TABLE(acpi, vsc_tp_acpi_ids);
static struct spi_driver vsc_tp_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;