#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include "siox.h"
#define SIOX_STATUS_WDG …
#define SIOX_STATUS_COUNTER …
#define SIOX_STATUS_TYPE …
#define CREATE_TRACE_POINTS
#include <trace/events/siox.h>
static bool siox_is_registered;
static void siox_master_lock(struct siox_master *smaster)
{ … }
static void siox_master_unlock(struct siox_master *smaster)
{ … }
static inline u8 siox_status_clean(u8 status_read, u8 status_written)
{ … }
static bool siox_device_counter_error(struct siox_device *sdevice,
u8 status_clean)
{ … }
static bool siox_device_type_error(struct siox_device *sdevice, u8 status_clean)
{ … }
static bool siox_device_wdg_error(struct siox_device *sdevice, u8 status_clean)
{ … }
bool siox_device_synced(struct siox_device *sdevice)
{ … }
EXPORT_SYMBOL_GPL(…);
bool siox_device_connected(struct siox_device *sdevice)
{ … }
EXPORT_SYMBOL_GPL(…);
static void siox_poll(struct siox_master *smaster)
{ … }
static int siox_poll_thread(void *data)
{ … }
static int __siox_start(struct siox_master *smaster)
{ … }
static int siox_start(struct siox_master *smaster)
{ … }
static int __siox_stop(struct siox_master *smaster)
{ … }
static int siox_stop(struct siox_master *smaster)
{ … }
static ssize_t type_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(type);
static ssize_t inbytes_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(inbytes);
static ssize_t outbytes_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(outbytes);
static ssize_t status_errors_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(status_errors);
static ssize_t connected_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(connected);
static ssize_t watchdog_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(watchdog);
static ssize_t watchdog_errors_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(watchdog_errors);
static struct attribute *siox_device_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void siox_device_release(struct device *dev)
{ … }
static const struct device_type siox_device_type = …;
static int siox_match(struct device *dev, const struct device_driver *drv)
{ … }
static int siox_probe(struct device *dev)
{ … }
static void siox_remove(struct device *dev)
{ … }
static void siox_shutdown(struct device *dev)
{ … }
static const struct bus_type siox_bus_type = …;
static ssize_t active_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t active_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(active);
static struct siox_device *siox_device_add(struct siox_master *smaster,
const char *type, size_t inbytes,
size_t outbytes, u8 statustype);
static ssize_t device_add_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(device_add);
static void siox_device_remove(struct siox_master *smaster);
static ssize_t device_remove_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(device_remove);
static ssize_t poll_interval_ns_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t poll_interval_ns_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(poll_interval_ns);
static struct attribute *siox_master_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void siox_master_release(struct device *dev)
{ … }
static const struct device_type siox_master_type = …;
struct siox_master *siox_master_alloc(struct device *dev,
size_t size)
{ … }
EXPORT_SYMBOL_GPL(…);
static void devm_siox_master_put(void *data)
{ … }
struct siox_master *devm_siox_master_alloc(struct device *dev,
size_t size)
{ … }
EXPORT_SYMBOL_GPL(…);
int siox_master_register(struct siox_master *smaster)
{ … }
EXPORT_SYMBOL_GPL(…);
void siox_master_unregister(struct siox_master *smaster)
{ … }
EXPORT_SYMBOL_GPL(…);
static void devm_siox_master_unregister(void *data)
{ … }
int devm_siox_master_register(struct device *dev, struct siox_master *smaster)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct siox_device *siox_device_add(struct siox_master *smaster,
const char *type, size_t inbytes,
size_t outbytes, u8 statustype)
{ … }
static void siox_device_remove(struct siox_master *smaster)
{ … }
int __siox_driver_register(struct siox_driver *sdriver, struct module *owner)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init siox_init(void)
{ … }
subsys_initcall(siox_init);
static void __exit siox_exit(void)
{ … }
module_exit(siox_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;