#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/gpio/consumer.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/delay.h>
#include <linux/idr.h>
#include <linux/mutex.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regmap.h>
#include "anybuss-controller.h"
#define CPLD_STATUS1 …
#define CPLD_CONTROL …
#define CPLD_CONTROL_CRST …
#define CPLD_CONTROL_RST1 …
#define CPLD_CONTROL_RST2 …
#define CPLD_STATUS1_AB …
#define CPLD_STATUS1_CAN_POWER …
#define CPLD_DESIGN_LO …
#define CPLD_DESIGN_HI …
#define CPLD_CAP …
#define CPLD_CAP_COMPAT …
#define CPLD_CAP_SEP_RESETS …
struct controller_priv { … };
static void do_reset(struct controller_priv *cd, u8 rst_bit, bool reset)
{ … }
static int anybuss_reset(struct controller_priv *cd,
unsigned long id, bool reset)
{ … }
static void export_reset_0(struct device *dev, bool assert)
{ … }
static void export_reset_1(struct device *dev, bool assert)
{ … }
static const struct regmap_config arcx_regmap_cfg = …;
static struct regmap *create_parallel_regmap(struct platform_device *pdev,
int idx)
{ … }
static struct anybuss_host *
create_anybus_host(struct platform_device *pdev, int idx)
{ … }
static ssize_t version_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(version);
static ssize_t design_number_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(design_number);
static struct attribute *controller_attributes[] = …;
static const struct attribute_group controller_attribute_group = …;
static const struct attribute_group *controller_attribute_groups[] = …;
static void controller_device_release(struct device *dev)
{ … }
static int can_power_is_enabled(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops can_power_ops = …;
static const struct regulator_desc can_power_desc = …;
static const struct class controller_class = …;
static DEFINE_IDA(controller_index_ida);
static int controller_probe(struct platform_device *pdev)
{ … }
static void controller_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id controller_of_match[] = …;
MODULE_DEVICE_TABLE(of, controller_of_match);
static struct platform_driver controller_driver = …;
static int __init controller_init(void)
{ … }
static void __exit controller_exit(void)
{ … }
module_init(…) …;
module_exit(controller_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;