linux/drivers/siox/siox-core.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2015-2017 Pengutronix, Uwe Kleine-König <[email protected]>
 */
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sysfs.h>

#include "siox.h"

/*
 * The lowest bit in the SIOX status word signals if the in-device watchdog is
 * ok. If the bit is set, the device is functional.
 *
 * On writing the watchdog timer is reset when this bit toggles.
 */
#define SIOX_STATUS_WDG

/*
 * Bits 1 to 3 of the status word read as the bitwise negation of what was
 * clocked in before. The value clocked in is changed in each cycle and so
 * allows to detect transmit/receive problems.
 */
#define SIOX_STATUS_COUNTER

/*
 * Each Siox-Device has a 4 bit type number that is neither 0 nor 15. This is
 * available in the upper nibble of the read status.
 *
 * On write these bits are DC.
 */
#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)
{}

/*
 * If there is a type or counter error the device is called "unsynced".
 */
bool siox_device_synced(struct siox_device *sdevice)
{}
EXPORT_SYMBOL_GPL();

/*
 * A device is called "connected" if it is synced and the watchdog is not
 * asserted.
 */
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();