linux/drivers/mcb/mcb-core.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * MEN Chameleon Bus.
 *
 * Copyright (C) 2013 MEN Mikroelektronik GmbH (www.men.de)
 * Author: Johannes Thumshirn <[email protected]>
 */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/idr.h>
#include <linux/mcb.h>

static DEFINE_IDA(mcb_ida);

static const struct mcb_device_id *mcb_match_id(const struct mcb_device_id *ids,
						struct mcb_device *dev)
{}

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

static int mcb_uevent(const struct device *dev, struct kobj_uevent_env *env)
{}

static int mcb_probe(struct device *dev)
{}

static void mcb_remove(struct device *dev)
{}

static void mcb_shutdown(struct device *dev)
{}

static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{}
static DEVICE_ATTR_RO(revision);

static ssize_t model_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{}
static DEVICE_ATTR_RO(model);

static ssize_t minor_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{}
static DEVICE_ATTR_RO(minor);

static ssize_t name_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{}
static DEVICE_ATTR_RO(name);

static struct attribute *mcb_bus_attrs[] =;

static const struct attribute_group mcb_carrier_group =;

static const struct attribute_group *mcb_carrier_groups[] =;


static const struct bus_type mcb_bus_type =;

static const struct device_type mcb_carrier_device_type =;

/**
 * __mcb_register_driver() - Register a @mcb_driver at the system
 * @drv: The @mcb_driver
 * @owner: The @mcb_driver's module
 * @mod_name: The name of the @mcb_driver's module
 *
 * Register a @mcb_driver at the system. Perform some sanity checks, if
 * the .probe and .remove methods are provided by the driver.
 */
int __mcb_register_driver(struct mcb_driver *drv, struct module *owner,
			const char *mod_name)
{}
EXPORT_SYMBOL_NS_GPL();

/**
 * mcb_unregister_driver() - Unregister a @mcb_driver from the system
 * @drv: The @mcb_driver
 *
 * Unregister a @mcb_driver from the system.
 */
void mcb_unregister_driver(struct mcb_driver *drv)
{}
EXPORT_SYMBOL_NS_GPL();

static void mcb_release_dev(struct device *dev)
{}

/**
 * mcb_device_register() - Register a mcb_device
 * @bus: The @mcb_bus of the device
 * @dev: The @mcb_device
 *
 * Register a specific @mcb_device at a @mcb_bus and the system itself.
 */
int mcb_device_register(struct mcb_bus *bus, struct mcb_device *dev)
{}
EXPORT_SYMBOL_NS_GPL();

static void mcb_free_bus(struct device *dev)
{}

/**
 * mcb_alloc_bus() - Allocate a new @mcb_bus
 * @carrier: generic &struct device for the carrier device
 *
 * Allocate a new @mcb_bus.
 */
struct mcb_bus *mcb_alloc_bus(struct device *carrier)
{}
EXPORT_SYMBOL_NS_GPL();

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

static void mcb_devices_unregister(struct mcb_bus *bus)
{}
/**
 * mcb_release_bus() - Free a @mcb_bus
 * @bus: The @mcb_bus to release
 *
 * Release an allocated @mcb_bus from the system.
 */
void mcb_release_bus(struct mcb_bus *bus)
{}
EXPORT_SYMBOL_NS_GPL();

/**
 * mcb_bus_get() - Increment refcnt
 * @bus: The @mcb_bus
 *
 * Get a @mcb_bus' ref
 */
struct mcb_bus *mcb_bus_get(struct mcb_bus *bus)
{}
EXPORT_SYMBOL_NS_GPL();

/**
 * mcb_bus_put() - Decrement refcnt
 * @bus: The @mcb_bus
 *
 * Release a @mcb_bus' ref
 */
void mcb_bus_put(struct mcb_bus *bus)
{}
EXPORT_SYMBOL_NS_GPL();

/**
 * mcb_alloc_dev() - Allocate a device
 * @bus: The @mcb_bus the device is part of
 *
 * Allocate a @mcb_device and add bus.
 */
struct mcb_device *mcb_alloc_dev(struct mcb_bus *bus)
{}
EXPORT_SYMBOL_NS_GPL();

/**
 * mcb_free_dev() - Free @mcb_device
 * @dev: The device to free
 *
 * Free a @mcb_device
 */
void mcb_free_dev(struct mcb_device *dev)
{}
EXPORT_SYMBOL_NS_GPL();

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

/**
 * mcb_bus_add_devices() - Add devices in the bus' internal device list
 * @bus: The @mcb_bus we add the devices
 *
 * Add devices in the bus' internal device list to the system.
 */
void mcb_bus_add_devices(const struct mcb_bus *bus)
{}
EXPORT_SYMBOL_NS_GPL();

/**
 * mcb_get_resource() - get a resource for a mcb device
 * @dev: the mcb device
 * @type: the type of resource
 */
struct resource *mcb_get_resource(struct mcb_device *dev, unsigned int type)
{}
EXPORT_SYMBOL_NS_GPL();

/**
 * mcb_request_mem() - Request memory
 * @dev: The @mcb_device the memory is for
 * @name: The name for the memory reference.
 *
 * Request memory for a @mcb_device. If @name is NULL the driver name will
 * be used.
 */
struct resource *mcb_request_mem(struct mcb_device *dev, const char *name)
{}
EXPORT_SYMBOL_NS_GPL();

/**
 * mcb_release_mem() - Release memory requested by device
 * @mem: The memory resource to be released
 *
 * Release memory that was prior requested via @mcb_request_mem().
 */
void mcb_release_mem(struct resource *mem)
{}
EXPORT_SYMBOL_NS_GPL();

static int __mcb_get_irq(struct mcb_device *dev)
{}

/**
 * mcb_get_irq() - Get device's IRQ number
 * @dev: The @mcb_device the IRQ is for
 *
 * Get the IRQ number of a given @mcb_device.
 */
int mcb_get_irq(struct mcb_device *dev)
{}
EXPORT_SYMBOL_NS_GPL();

static int mcb_init(void)
{}

static void mcb_exit(void)
{}

/* mcb must be initialized after PCI but before the chameleon drivers.
 * That means we must use some initcall between subsys_initcall and
 * device_initcall.
 */
fs_initcall(mcb_init);
module_exit(mcb_exit);

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