linux/drivers/bus/moxtet.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Turris Mox module configuration bus driver
 *
 * Copyright (C) 2019 Marek Behún <[email protected]>
 */

#include <dt-bindings/bus/moxtet.h>
#include <linux/bitops.h>
#include <linux/debugfs.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/moxtet.h>
#include <linux/mutex.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/spi/spi.h>

/*
 * @name:	module name for sysfs
 * @hwirq_base:	base index for IRQ for this module (-1 if no IRQs)
 * @nirqs:	how many interrupts does the shift register provide
 * @desc:	module description for kernel log
 */
static const struct {} mox_module_table[] =;

static inline bool mox_module_known(unsigned int id)
{}

static inline const char *mox_module_name(unsigned int id)
{}

#define DEF_MODULE_ATTR(name, fmt, ...)

DEF_MODULE_ATTR();
DEF_MODULE_ATTR();
DEF_MODULE_ATTR();

static struct attribute *moxtet_dev_attrs[] =;

static const struct attribute_group moxtet_dev_group =;

static const struct attribute_group *moxtet_dev_groups[] =;

static int moxtet_match(struct device *dev, const struct device_driver *drv)
{}

static const struct bus_type moxtet_bus_type =;

int __moxtet_register_driver(struct module *owner,
			     struct moxtet_driver *mdrv)
{}
EXPORT_SYMBOL_GPL();

static int moxtet_dev_check(struct device *dev, void *data)
{}

static void moxtet_dev_release(struct device *dev)
{}

static struct moxtet_device *
moxtet_alloc_device(struct moxtet *moxtet)
{}

static int moxtet_add_device(struct moxtet_device *dev)
{}

static int __unregister(struct device *dev, void *null)
{}

static struct moxtet_device *
of_register_moxtet_device(struct moxtet *moxtet, struct device_node *nc)
{}

static void of_register_moxtet_devices(struct moxtet *moxtet)
{}

static void
moxtet_register_devices_from_topology(struct moxtet *moxtet)
{}

/*
 * @nsame:	how many modules with same id are already in moxtet->modules
 */
static int moxtet_set_irq(struct moxtet *moxtet, int idx, int id, int nsame)
{}

static int moxtet_find_topology(struct moxtet *moxtet)
{}

static int moxtet_spi_read(struct moxtet *moxtet, u8 *buf)
{}

int moxtet_device_read(struct device *dev)
{}
EXPORT_SYMBOL_GPL();

int moxtet_device_write(struct device *dev, u8 val)
{}
EXPORT_SYMBOL_GPL();

int moxtet_device_written(struct device *dev)
{}
EXPORT_SYMBOL_GPL();

#ifdef CONFIG_DEBUG_FS
static int moxtet_debug_open(struct inode *inode, struct file *file)
{}

static ssize_t input_read(struct file *file, char __user *buf, size_t len,
			  loff_t *ppos)
{}

static const struct file_operations input_fops =;

static ssize_t output_read(struct file *file, char __user *buf, size_t len,
			   loff_t *ppos)
{}

static ssize_t output_write(struct file *file, const char __user *buf,
			    size_t len, loff_t *ppos)
{}

static const struct file_operations output_fops =;

static int moxtet_register_debugfs(struct moxtet *moxtet)
{}

static void moxtet_unregister_debugfs(struct moxtet *moxtet)
{}
#else
static inline int moxtet_register_debugfs(struct moxtet *moxtet)
{
	return 0;
}

static inline void moxtet_unregister_debugfs(struct moxtet *moxtet)
{
}
#endif

static int moxtet_irq_domain_map(struct irq_domain *d, unsigned int irq,
				 irq_hw_number_t hw)
{}

static int moxtet_irq_domain_xlate(struct irq_domain *d,
				   struct device_node *ctrlr,
				   const u32 *intspec, unsigned int intsize,
				   unsigned long *out_hwirq,
				   unsigned int *out_type)
{}

static const struct irq_domain_ops moxtet_irq_domain =;

static void moxtet_irq_mask(struct irq_data *d)
{}

static void moxtet_irq_unmask(struct irq_data *d)
{}

static void moxtet_irq_print_chip(struct irq_data *d, struct seq_file *p)
{}

static const struct irq_chip moxtet_irq_chip =;

static int moxtet_irq_read(struct moxtet *moxtet, unsigned long *map)
{}

static irqreturn_t moxtet_irq_thread_fn(int irq, void *data)
{}

static void moxtet_irq_free(struct moxtet *moxtet)
{}

static int moxtet_irq_setup(struct moxtet *moxtet)
{}

static int moxtet_probe(struct spi_device *spi)
{}

static void moxtet_remove(struct spi_device *spi)
{}

static const struct spi_device_id moxtet_spi_ids[] =;
MODULE_DEVICE_TABLE(spi, moxtet_spi_ids);

static const struct of_device_id moxtet_dt_ids[] =;
MODULE_DEVICE_TABLE(of, moxtet_dt_ids);

static struct spi_driver moxtet_spi_driver =;

static int __init moxtet_init(void)
{}
postcore_initcall_sync(moxtet_init);

static void __exit moxtet_exit(void)
{}
module_exit(moxtet_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();