#include <linux/fs.h>
#include <linux/ioctl.h>
#include <linux/kernel.h>
#include <linux/kfifo.h>
#include <linux/kref.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/poll.h>
#include <linux/rwsem.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
#include <linux/surface_aggregator/cdev.h>
#include <linux/surface_aggregator/controller.h>
#include <linux/surface_aggregator/serial_hub.h>
#define SSAM_CDEV_DEVICE_NAME …
enum ssam_cdev_device_state { … };
struct ssam_cdev { … };
struct ssam_cdev_client;
struct ssam_cdev_notifier { … };
struct ssam_cdev_client { … };
static void __ssam_cdev_release(struct kref *kref)
{ … }
static struct ssam_cdev *ssam_cdev_get(struct ssam_cdev *cdev)
{ … }
static void ssam_cdev_put(struct ssam_cdev *cdev)
{ … }
static u32 ssam_cdev_notifier(struct ssam_event_notifier *nf, const struct ssam_event *in)
{ … }
static int ssam_cdev_notifier_register(struct ssam_cdev_client *client, u8 tc, int priority)
{ … }
static int ssam_cdev_notifier_unregister(struct ssam_cdev_client *client, u8 tc)
{ … }
static void ssam_cdev_notifier_unregister_all(struct ssam_cdev_client *client)
{ … }
static long ssam_cdev_request(struct ssam_cdev_client *client, struct ssam_cdev_request __user *r)
{ … }
static long ssam_cdev_notif_register(struct ssam_cdev_client *client,
const struct ssam_cdev_notifier_desc __user *d)
{ … }
static long ssam_cdev_notif_unregister(struct ssam_cdev_client *client,
const struct ssam_cdev_notifier_desc __user *d)
{ … }
static long ssam_cdev_event_enable(struct ssam_cdev_client *client,
const struct ssam_cdev_event_desc __user *d)
{ … }
static long ssam_cdev_event_disable(struct ssam_cdev_client *client,
const struct ssam_cdev_event_desc __user *d)
{ … }
static int ssam_cdev_device_open(struct inode *inode, struct file *filp)
{ … }
static int ssam_cdev_device_release(struct inode *inode, struct file *filp)
{ … }
static long __ssam_cdev_device_ioctl(struct ssam_cdev_client *client, unsigned int cmd,
unsigned long arg)
{ … }
static long ssam_cdev_device_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ … }
static ssize_t ssam_cdev_read(struct file *file, char __user *buf, size_t count, loff_t *offs)
{ … }
static __poll_t ssam_cdev_poll(struct file *file, struct poll_table_struct *pt)
{ … }
static int ssam_cdev_fasync(int fd, struct file *file, int on)
{ … }
static const struct file_operations ssam_controller_fops = …;
static int ssam_dbg_device_probe(struct platform_device *pdev)
{ … }
static void ssam_dbg_device_remove(struct platform_device *pdev)
{ … }
static struct platform_device *ssam_cdev_device;
static struct platform_driver ssam_cdev_driver = …;
static int __init ssam_debug_init(void)
{ … }
module_init(…) …;
static void __exit ssam_debug_exit(void)
{ … }
module_exit(ssam_debug_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;