linux/drivers/mfd/kempld-core.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Kontron PLD MFD core driver
 *
 * Copyright (c) 2010-2013 Kontron Europe GmbH
 * Author: Michael Brunner <[email protected]>
 */

#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/mfd/core.h>
#include <linux/mfd/kempld.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/dmi.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/sysfs.h>

#define MAX_ID_LEN
static char force_device_id[MAX_ID_LEN + 1] =;
module_param_string();
MODULE_PARM_DESC();

/*
 * Get hardware mutex to block firmware from accessing the pld.
 * It is possible for the firmware may hold the mutex for an extended length of
 * time. This function will block until access has been granted.
 */
static void kempld_get_hardware_mutex(struct kempld_device_data *pld)
{}

static void kempld_release_hardware_mutex(struct kempld_device_data *pld)
{}

static int kempld_get_info_generic(struct kempld_device_data *pld)
{}

enum kempld_cells {};

static const char *kempld_dev_names[] =;

#define KEMPLD_MAX_DEVS

static int kempld_register_cells_generic(struct kempld_device_data *pld)
{}

static struct resource kempld_ioresource =;

static const struct kempld_platform_data kempld_platform_data_generic =;

static struct platform_device *kempld_pdev;

static int kempld_create_platform_device(const struct kempld_platform_data *pdata)
{}

/**
 * kempld_read8 - read 8 bit register
 * @pld: kempld_device_data structure describing the PLD
 * @index: register index on the chip
 *
 * kempld_get_mutex must be called prior to calling this function.
 */
u8 kempld_read8(struct kempld_device_data *pld, u8 index)
{}
EXPORT_SYMBOL_GPL();

/**
 * kempld_write8 - write 8 bit register
 * @pld: kempld_device_data structure describing the PLD
 * @index: register index on the chip
 * @data: new register value
 *
 * kempld_get_mutex must be called prior to calling this function.
 */
void kempld_write8(struct kempld_device_data *pld, u8 index, u8 data)
{}
EXPORT_SYMBOL_GPL();

/**
 * kempld_read16 - read 16 bit register
 * @pld: kempld_device_data structure describing the PLD
 * @index: register index on the chip
 *
 * kempld_get_mutex must be called prior to calling this function.
 */
u16 kempld_read16(struct kempld_device_data *pld, u8 index)
{}
EXPORT_SYMBOL_GPL();

/**
 * kempld_write16 - write 16 bit register
 * @pld: kempld_device_data structure describing the PLD
 * @index: register index on the chip
 * @data: new register value
 *
 * kempld_get_mutex must be called prior to calling this function.
 */
void kempld_write16(struct kempld_device_data *pld, u8 index, u16 data)
{}
EXPORT_SYMBOL_GPL();

/**
 * kempld_read32 - read 32 bit register
 * @pld: kempld_device_data structure describing the PLD
 * @index: register index on the chip
 *
 * kempld_get_mutex must be called prior to calling this function.
 */
u32 kempld_read32(struct kempld_device_data *pld, u8 index)
{}
EXPORT_SYMBOL_GPL();

/**
 * kempld_write32 - write 32 bit register
 * @pld: kempld_device_data structure describing the PLD
 * @index: register index on the chip
 * @data: new register value
 *
 * kempld_get_mutex must be called prior to calling this function.
 */
void kempld_write32(struct kempld_device_data *pld, u8 index, u32 data)
{}
EXPORT_SYMBOL_GPL();

/**
 * kempld_get_mutex - acquire PLD mutex
 * @pld: kempld_device_data structure describing the PLD
 */
void kempld_get_mutex(struct kempld_device_data *pld)
{}
EXPORT_SYMBOL_GPL();

/**
 * kempld_release_mutex - release PLD mutex
 * @pld: kempld_device_data structure describing the PLD
 */
void kempld_release_mutex(struct kempld_device_data *pld)
{}
EXPORT_SYMBOL_GPL();

/**
 * kempld_get_info - update device specific information
 * @pld: kempld_device_data structure describing the PLD
 *
 * This function calls the configured board specific kempld_get_info_XXXX
 * function which is responsible for gathering information about the specific
 * hardware. The information is then stored within the pld structure.
 */
static int kempld_get_info(struct kempld_device_data *pld)
{}

/*
 * kempld_register_cells - register cell drivers
 *
 * This function registers cell drivers for the detected hardware by calling
 * the configured kempld_register_cells_XXXX function which is responsible
 * to detect and register the needed cell drivers.
 */
static int kempld_register_cells(struct kempld_device_data *pld)
{}

static const char *kempld_get_type_string(struct kempld_device_data *pld)
{}

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

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

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

static DEVICE_ATTR_RO(pld_version);
static DEVICE_ATTR_RO(pld_specification);
static DEVICE_ATTR_RO(pld_type);

static struct attribute *pld_attrs[] =;
ATTRIBUTE_GROUPS();

static int kempld_detect_device(struct kempld_device_data *pld)
{}

static int kempld_probe(struct platform_device *pdev)
{}

static void kempld_remove(struct platform_device *pdev)
{}

static const struct acpi_device_id kempld_acpi_table[] =;
MODULE_DEVICE_TABLE(acpi, kempld_acpi_table);

static struct platform_driver kempld_driver =;

static const struct dmi_system_id kempld_dmi_table[] __initconst =;
MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);

static int __init kempld_init(void)
{}

static void __exit kempld_exit(void)
{}

module_init();
module_exit(kempld_exit);

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