#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
struct i2c_demux_pinctrl_chan { … };
struct i2c_demux_pinctrl_priv { … };
static int i2c_demux_master_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
{ … }
static u32 i2c_demux_functionality(struct i2c_adapter *adap)
{ … }
static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 new_chan)
{ … }
static int i2c_demux_deactivate_master(struct i2c_demux_pinctrl_priv *priv)
{ … }
static int i2c_demux_change_master(struct i2c_demux_pinctrl_priv *priv, u32 new_chan)
{ … }
static ssize_t available_masters_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(available_masters);
static ssize_t current_master_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t current_master_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(current_master);
static int i2c_demux_pinctrl_probe(struct platform_device *pdev)
{ … }
static void i2c_demux_pinctrl_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id i2c_demux_pinctrl_of_match[] = …;
MODULE_DEVICE_TABLE(of, i2c_demux_pinctrl_of_match);
static struct platform_driver i2c_demux_pinctrl_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;