linux/drivers/gpio/gpio-fxl6408.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * FXL6408 GPIO driver
 *
 * Copyright 2023 Toradex
 *
 * Author: Emanuele Ghidoli <[email protected]>
 */

#include <linux/err.h>
#include <linux/gpio/regmap.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regmap.h>

#define FXL6408_REG_DEVICE_ID
#define FXL6408_MF_FAIRCHILD
#define FXL6408_MF_SHIFT

/* Bits set here indicate that the GPIO is an output. */
#define FXL6408_REG_IO_DIR

/*
 * Bits set here, when the corresponding bit of IO_DIR is set, drive
 * the output high instead of low.
 */
#define FXL6408_REG_OUTPUT

/* Bits here make the output High-Z, instead of the OUTPUT value. */
#define FXL6408_REG_OUTPUT_HIGH_Z

/* Returns the current status (1 = HIGH) of the input pins. */
#define FXL6408_REG_INPUT_STATUS

/*
 * Return the current interrupt status
 * This bit is HIGH if input GPIO != default state (register 09h).
 * The flag is cleared after being read (bit returns to 0).
 * The input must go back to default state and change again before this flag is raised again.
 */
#define FXL6408_REG_INT_STS

#define FXL6408_NGPIO

static const struct regmap_range rd_range[] =;

static const struct regmap_range wr_range[] =;

static const struct regmap_range volatile_range[] =;

static const struct regmap_access_table rd_table =;

static const struct regmap_access_table wr_table =;

static const struct regmap_access_table volatile_table =;

static const struct regmap_config regmap =;

static int fxl6408_identify(struct device *dev, struct regmap *regmap)
{}

static int fxl6408_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver fxl6408_driver =;
module_i2c_driver();

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