linux/drivers/hwmon/pmbus/adm1266.c

// SPDX-License-Identifier: GPL-2.0
/*
 * ADM1266 - Cascadable Super Sequencer with Margin
 * Control and Fault Recording
 *
 * Copyright 2020 Analog Devices Inc.
 */

#include <linux/bitfield.h>
#include <linux/crc8.h>
#include <linux/debugfs.h>
#include <linux/gpio/driver.h>
#include <linux/i2c.h>
#include <linux/i2c-smbus.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/nvmem-consumer.h>
#include <linux/nvmem-provider.h>
#include "pmbus.h"
#include <linux/slab.h>
#include <linux/timekeeping.h>

#define ADM1266_BLACKBOX_CONFIG
#define ADM1266_PDIO_CONFIG
#define ADM1266_READ_STATE
#define ADM1266_READ_BLACKBOX
#define ADM1266_SET_RTC
#define ADM1266_GPIO_CONFIG
#define ADM1266_BLACKBOX_INFO
#define ADM1266_PDIO_STATUS
#define ADM1266_GPIO_STATUS

/* ADM1266 GPIO defines */
#define ADM1266_GPIO_NR
#define ADM1266_GPIO_FUNCTIONS(x)
#define ADM1266_GPIO_INPUT_EN(x)
#define ADM1266_GPIO_OUTPUT_EN(x)
#define ADM1266_GPIO_OPEN_DRAIN(x)

/* ADM1266 PDIO defines */
#define ADM1266_PDIO_NR
#define ADM1266_PDIO_PIN_CFG(x)
#define ADM1266_PDIO_GLITCH_FILT(x)
#define ADM1266_PDIO_OUT_CFG(x)

#define ADM1266_BLACKBOX_OFFSET
#define ADM1266_BLACKBOX_SIZE

#define ADM1266_PMBUS_BLOCK_MAX

struct adm1266_data {};

static const struct nvmem_cell_info adm1266_nvmem_cells[] =;

DECLARE_CRC8_TABLE(pmbus_crc_table);

/*
 * Different from Block Read as it sends data and waits for the slave to
 * return a value dependent on that data. The protocol is simply a Write Block
 * followed by a Read Block without the Read-Block command field and the
 * Write-Block STOP bit.
 */
static int adm1266_pmbus_block_xfer(struct adm1266_data *data, u8 cmd, u8 w_len, u8 *data_w,
				    u8 *data_r)
{}

static const unsigned int adm1266_gpio_mapping[ADM1266_GPIO_NR][2] =;

static const char *adm1266_names[ADM1266_GPIO_NR + ADM1266_PDIO_NR] =;

static int adm1266_gpio_get(struct gpio_chip *chip, unsigned int offset)
{}

static int adm1266_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask,
				     unsigned long *bits)
{}

static void adm1266_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
{}

static int adm1266_config_gpio(struct adm1266_data *data)
{}

static int adm1266_state_read(struct seq_file *s, void *pdata)
{}

static void adm1266_init_debugfs(struct adm1266_data *data)
{}

static int adm1266_nvmem_read_blackbox(struct adm1266_data *data, u8 *read_buff)
{}

static int adm1266_nvmem_read(void *priv, unsigned int offset, void *val, size_t bytes)
{}

static int adm1266_config_nvmem(struct adm1266_data *data)
{}

static int adm1266_set_rtc(struct adm1266_data *data)
{}

static int adm1266_probe(struct i2c_client *client)
{}

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

static const struct i2c_device_id adm1266_id[] =;
MODULE_DEVICE_TABLE(i2c, adm1266_id);

static struct i2c_driver adm1266_driver =;

module_i2c_driver();

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