linux/drivers/mfd/ntxec.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * The Netronix embedded controller is a microcontroller found in some
 * e-book readers designed by the original design manufacturer Netronix, Inc.
 * It contains RTC, battery monitoring, system power management, and PWM
 * functionality.
 *
 * This driver implements register access, version detection, and system
 * power-off/reset.
 *
 * Copyright 2020 Jonathan Neuschäfer <[email protected]>
 */

#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/mfd/core.h>
#include <linux/mfd/ntxec.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/reboot.h>
#include <linux/regmap.h>
#include <linux/types.h>
#include <asm/unaligned.h>

#define NTXEC_REG_VERSION
#define NTXEC_REG_POWEROFF
#define NTXEC_REG_POWERKEEP
#define NTXEC_REG_RESET

#define NTXEC_POWEROFF_VALUE
#define NTXEC_POWERKEEP_VALUE
#define NTXEC_RESET_VALUE

static struct i2c_client *poweroff_restart_client;

static void ntxec_poweroff(void)
{}

static int ntxec_restart(struct notifier_block *nb,
			 unsigned long action, void *data)
{}

static struct notifier_block ntxec_restart_handler =;

static int regmap_ignore_write(void *context,
			       unsigned int reg, unsigned int val)

{}

static int regmap_wrap_read(void *context, unsigned int reg,
			    unsigned int *val)
{}

/*
 * Some firmware versions do not ack written data, add a wrapper. It
 * is used to stack another regmap on top.
 */
static const struct regmap_config regmap_config_noack =;

static const struct regmap_config regmap_config =;

static const struct mfd_cell ntxec_subdev[] =;

static const struct mfd_cell ntxec_subdev_pwm[] =;

static int ntxec_probe(struct i2c_client *client)
{}

static void ntxec_remove(struct i2c_client *client)
{}

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

static struct i2c_driver ntxec_driver =;
module_i2c_driver();

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