#include <linux/device.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/fsi-sbefifo.h>
#include <linux/gfp.h>
#include <linux/idr.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/miscdevice.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/fsi-occ.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <asm/unaligned.h>
#define OCC_SRAM_BYTES …
#define OCC_CMD_DATA_BYTES …
#define OCC_RESP_DATA_BYTES …
#define OCC_P9_SRAM_CMD_ADDR …
#define OCC_P9_SRAM_RSP_ADDR …
#define OCC_P10_SRAM_CMD_ADDR …
#define OCC_P10_SRAM_RSP_ADDR …
#define OCC_P10_SRAM_MODE …
#define OCC_TIMEOUT_MS …
#define OCC_CMD_IN_PRG_WAIT_MS …
enum versions { … };
struct occ { … };
#define to_occ(x) …
struct occ_response { … } __packed;
struct occ_client { … };
#define to_client(x) …
static DEFINE_IDA(occ_ida);
static int occ_open(struct inode *inode, struct file *file)
{ … }
static ssize_t occ_read(struct file *file, char __user *buf, size_t len,
loff_t *offset)
{ … }
static ssize_t occ_write(struct file *file, const char __user *buf,
size_t len, loff_t *offset)
{ … }
static int occ_release(struct inode *inode, struct file *file)
{ … }
static const struct file_operations occ_fops = …;
static void occ_save_ffdc(struct occ *occ, __be32 *resp, size_t parsed_len,
size_t resp_len)
{ … }
static int occ_verify_checksum(struct occ *occ, struct occ_response *resp,
u16 data_length)
{ … }
static int occ_getsram(struct occ *occ, u32 offset, void *data, ssize_t len)
{ … }
static int occ_putsram(struct occ *occ, const void *data, ssize_t len,
u8 seq_no, u16 checksum)
{ … }
static int occ_trigger_attn(struct occ *occ)
{ … }
static bool fsi_occ_response_not_ready(struct occ_response *resp, u8 seq_no,
u8 cmd_type)
{ … }
int fsi_occ_submit(struct device *dev, const void *request, size_t req_len,
void *response, size_t *resp_len)
{ … }
EXPORT_SYMBOL_GPL(…);
static int occ_unregister_platform_child(struct device *dev, void *data)
{ … }
static int occ_unregister_of_child(struct device *dev, void *data)
{ … }
static int occ_probe(struct platform_device *pdev)
{ … }
static void occ_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id occ_match[] = …;
MODULE_DEVICE_TABLE(of, occ_match);
static struct platform_driver occ_driver = …;
static int occ_init(void)
{ … }
static void occ_exit(void)
{ … }
module_init(…) …;
module_exit(occ_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;