#include <linux/device.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/i2c-mux.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <dt-bindings/mux/mux.h>
#define PCA954X_MAX_NCHANS …
#define PCA954X_IRQ_OFFSET …
#define MAX7357_CONF_INT_ENABLE …
#define MAX7357_CONF_FLUSH_OUT …
#define MAX7357_CONF_RELEASE_INT …
#define MAX7357_CONF_DISCON_SINGLE_CHAN …
#define MAX7357_CONF_PRECONNECT_TEST …
#define MAX7357_POR_DEFAULT_CONF …
enum pca_type { … };
struct chip_desc { … };
struct pca954x { … };
static const struct chip_desc chips[] = …;
static const struct i2c_device_id pca954x_id[] = …;
MODULE_DEVICE_TABLE(i2c, pca954x_id);
static const struct of_device_id pca954x_of_match[] = …;
MODULE_DEVICE_TABLE(of, pca954x_of_match);
static int pca954x_reg_write(struct i2c_adapter *adap,
struct i2c_client *client, u8 val)
{ … }
static u8 pca954x_regval(struct pca954x *data, u8 chan)
{ … }
static int pca954x_select_chan(struct i2c_mux_core *muxc, u32 chan)
{ … }
static int pca954x_deselect_mux(struct i2c_mux_core *muxc, u32 chan)
{ … }
static ssize_t idle_state_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t idle_state_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(idle_state);
static irqreturn_t pca954x_irq_handler(int irq, void *dev_id)
{ … }
static int pca954x_irq_set_type(struct irq_data *idata, unsigned int type)
{ … }
static struct irq_chip pca954x_irq_chip = …;
static int pca954x_irq_setup(struct i2c_mux_core *muxc)
{ … }
static void pca954x_cleanup(struct i2c_mux_core *muxc)
{ … }
static int pca954x_init(struct i2c_client *client, struct pca954x *data)
{ … }
static int pca954x_get_reset(struct device *dev, struct pca954x *data)
{ … }
static void pca954x_reset_deassert(struct pca954x *data)
{ … }
static int pca954x_probe(struct i2c_client *client)
{ … }
static void pca954x_remove(struct i2c_client *client)
{ … }
static int pca954x_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(pca954x_pm, NULL, pca954x_resume);
static struct i2c_driver pca954x_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;