linux/drivers/mfd/gateworks-gsc.c

// SPDX-License-Identifier: GPL-2.0
/*
 * The Gateworks System Controller (GSC) is a multi-function
 * device designed for use in Gateworks Single Board Computers.
 * The control interface is I2C, with an interrupt. The device supports
 * system functions such as push-button monitoring, multiple ADC's for
 * voltage and temperature monitoring, fan controller and watchdog monitor.
 *
 * Copyright (C) 2020 Gateworks Corporation
 */

#include <linux/device.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/mfd/gsc.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>

#include <asm/unaligned.h>

/*
 * The GSC suffers from an errata where occasionally during
 * ADC cycles the chip can NAK I2C transactions. To ensure we have reliable
 * register access we place retries around register access.
 */
#define I2C_RETRIES

int gsc_write(void *context, unsigned int reg, unsigned int val)
{}
EXPORT_SYMBOL_GPL();

int gsc_read(void *context, unsigned int reg, unsigned int *val)
{}
EXPORT_SYMBOL_GPL();

/*
 * gsc_powerdown - API to use GSC to power down board for a specific time
 *
 * secs - number of seconds to remain powered off
 */
static int gsc_powerdown(struct gsc_dev *gsc, unsigned long secs)
{}

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

static ssize_t gsc_store(struct device *dev, struct device_attribute *attr,
			 const char *buf, size_t count)
{}

static struct device_attribute attr_fwver =;
static struct device_attribute attr_fwcrc =;
static struct device_attribute attr_pwrdown =;

static struct attribute *gsc_attrs[] =;

static struct attribute_group attr_group =;

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

static struct regmap_bus gsc_regmap_bus =;

static const struct regmap_config gsc_regmap_config =;

static const struct regmap_irq gsc_irqs[] =;

static const struct regmap_irq_chip gsc_irq_chip =;

static int gsc_probe(struct i2c_client *client)
{}

static void gsc_remove(struct i2c_client *client)
{}

static struct i2c_driver gsc_driver =;
module_i2c_driver();

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