linux/drivers/mfd/janz-cmodio.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Janz CMOD-IO MODULbus Carrier Board PCI Driver
 *
 * Copyright (c) 2010 Ira W. Snyder <[email protected]>
 *
 * Lots of inspiration and code was copied from drivers/mfd/sm501.c
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/mfd/core.h>

#include <linux/mfd/janz.h>

#define DRV_NAME

/* Size of each MODULbus module in PCI BAR4 */
#define CMODIO_MODULBUS_SIZE

/* Maximum number of MODULbus modules on a CMOD-IO carrier board */
#define CMODIO_MAX_MODULES

/* Module Parameters */
static unsigned int num_modules =;
static char *modules[CMODIO_MAX_MODULES] =;

module_param_array();
MODULE_PARM_DESC();

/* Unique Device Id */
static unsigned int cmodio_id;

struct cmodio_device {};

/*
 * Subdevices using the mfd-core API
 */

static int cmodio_setup_subdevice(struct cmodio_device *priv,
					    char *name, unsigned int devno,
					    unsigned int modno)
{}

/* Probe each submodule using kernel parameters */
static int cmodio_probe_submodules(struct cmodio_device *priv)
{}

/*
 * SYSFS Attributes
 */

static ssize_t modulbus_number_show(struct device *dev,
				    struct device_attribute *attr, char *buf)
{}

static DEVICE_ATTR_RO(modulbus_number);

static struct attribute *cmodio_sysfs_attrs[] =;

static const struct attribute_group cmodio_sysfs_attr_group =;

/*
 * PCI Driver
 */

static int cmodio_pci_probe(struct pci_dev *dev,
				      const struct pci_device_id *id)
{}

static void cmodio_pci_remove(struct pci_dev *dev)
{}

#define PCI_VENDOR_ID_JANZ

/* The list of devices that this module will support */
static const struct pci_device_id cmodio_pci_ids[] =;
MODULE_DEVICE_TABLE(pci, cmodio_pci_ids);

static struct pci_driver cmodio_pci_driver =;

module_pci_driver();

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