#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/unaligned.h>
#include "ucsi.h"
#define STM32G0_I2C_BL_ADDR …
#define STM32G0_I2C_BL_SZ …
#define STM32_CMD_GVR …
#define STM32_CMD_GVR_LEN …
#define STM32_CMD_RM …
#define STM32_CMD_WM …
#define STM32_CMD_ADDR_LEN …
#define STM32_CMD_ERASE …
#define STM32_CMD_ERASE_SPECIAL_LEN …
#define STM32_CMD_GLOBAL_MASS_ERASE …
#define STM32G0_I2C_BL_ACK …
#define STM32G0_I2C_BL_NACK …
#define STM32G0_I2C_BL_BUSY …
#define STM32G0_USER_OPTION_BYTES …
#define STM32G0_USER_OB_NBOOT0 …
#define STM32G0_USER_OB_NBOOT_SEL …
#define STM32G0_USER_OB_BOOT_MAIN …
#define STM32G0_MAIN_MEM_ADDR …
#define STM32G0_FW_GETVER …
#define STM32G0_FW_GETVER_LEN …
#define STM32G0_FW_RSTGOBL …
#define STM32G0_FW_KEYWORD …
struct ucsi_stm32g0_fw_info { … };
struct ucsi_stm32g0 { … };
static int ucsi_stm32g0_bl_check_ack(struct ucsi *ucsi)
{ … }
static int ucsi_stm32g0_bl_cmd_check_ack(struct ucsi *ucsi, unsigned int cmd, bool check_ack)
{ … }
static int ucsi_stm32g0_bl_cmd(struct ucsi *ucsi, unsigned int cmd)
{ … }
static int ucsi_stm32g0_bl_rcv_check_ack(struct ucsi *ucsi, void *data, size_t len, bool check_ack)
{ … }
static int ucsi_stm32g0_bl_rcv(struct ucsi *ucsi, void *data, size_t len)
{ … }
static int ucsi_stm32g0_bl_rcv_woack(struct ucsi *ucsi, void *data, size_t len)
{ … }
static int ucsi_stm32g0_bl_send(struct ucsi *ucsi, void *data, size_t len)
{ … }
static int ucsi_stm32g0_bl_get_version(struct ucsi *ucsi, u8 *bl_version)
{ … }
static int ucsi_stm32g0_bl_send_addr(struct ucsi *ucsi, u32 addr)
{ … }
static int ucsi_stm32g0_bl_global_mass_erase(struct ucsi *ucsi)
{ … }
static int ucsi_stm32g0_bl_write(struct ucsi *ucsi, u32 addr, const void *data, size_t len)
{ … }
static int ucsi_stm32g0_bl_read(struct ucsi *ucsi, u32 addr, void *data, size_t len)
{ … }
static int ucsi_stm32g0_fw_cmd(struct ucsi *ucsi, unsigned int cmd)
{ … }
static int ucsi_stm32g0_fw_rcv(struct ucsi *ucsi, void *data, size_t len)
{ … }
static int ucsi_stm32g0_read(struct ucsi *ucsi, unsigned int offset, void *val, size_t len)
{ … }
static int ucsi_stm32g0_read_version(struct ucsi *ucsi, u16 *version)
{ … }
static int ucsi_stm32g0_read_cci(struct ucsi *ucsi, u32 *cci)
{ … }
static int ucsi_stm32g0_read_message_in(struct ucsi *ucsi, void *val, size_t len)
{ … }
static int ucsi_stm32g0_async_control(struct ucsi *ucsi, u64 command)
{ … }
static irqreturn_t ucsi_stm32g0_irq_handler(int irq, void *data)
{ … }
static const struct ucsi_operations ucsi_stm32g0_ops = …;
static int ucsi_stm32g0_register(struct ucsi *ucsi)
{ … }
static void ucsi_stm32g0_unregister(struct ucsi *ucsi)
{ … }
static void ucsi_stm32g0_fw_cb(const struct firmware *fw, void *context)
{ … }
static int ucsi_stm32g0_probe_bootloader(struct ucsi *ucsi)
{ … }
static int ucsi_stm32g0_probe(struct i2c_client *client)
{ … }
static void ucsi_stm32g0_remove(struct i2c_client *client)
{ … }
static int ucsi_stm32g0_suspend(struct device *dev)
{ … }
static int ucsi_stm32g0_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(ucsi_stm32g0_pm_ops, ucsi_stm32g0_suspend, ucsi_stm32g0_resume);
static const struct of_device_id __maybe_unused ucsi_stm32g0_typec_of_match[] = …;
MODULE_DEVICE_TABLE(of, ucsi_stm32g0_typec_of_match);
static const struct i2c_device_id ucsi_stm32g0_typec_i2c_devid[] = …;
MODULE_DEVICE_TABLE(i2c, ucsi_stm32g0_typec_i2c_devid);
static struct i2c_driver ucsi_stm32g0_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;