linux/drivers/pinctrl/pinctrl-sx150x.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016, BayLibre, SAS. All rights reserved.
 * Author: Neil Armstrong <[email protected]>
 *
 * Copyright (c) 2010, Code Aurora Forum. All rights reserved.
 *
 * Driver for Semtech SX150X I2C GPIO Expanders
 * The handling of the 4-bit chips (SX1501/SX1504/SX1507) is untested.
 *
 * Author: Gregory Bean <[email protected]>
 */

#include <linux/regmap.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/gpio/driver.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/pinctrl/pinconf-generic.h>

#include "core.h"
#include "pinconf.h"
#include "pinctrl-utils.h"

/* The chip models of sx150x */
enum {};
enum {};

struct sx150x_123_pri {};

struct sx150x_456_pri {};

struct sx150x_789_pri {};

struct sx150x_device_data {};

struct sx150x_pinctrl {};

static const struct pinctrl_pin_desc sx150x_4_pins[] =;

static const struct pinctrl_pin_desc sx150x_8_pins[] =;

static const struct pinctrl_pin_desc sx150x_16_pins[] =;

static const struct sx150x_device_data sx1501q_device_data =;

static const struct sx150x_device_data sx1502q_device_data =;

static const struct sx150x_device_data sx1503q_device_data =;

static const struct sx150x_device_data sx1504q_device_data =;

static const struct sx150x_device_data sx1505q_device_data =;

static const struct sx150x_device_data sx1506q_device_data =;

static const struct sx150x_device_data sx1507q_device_data =;

static const struct sx150x_device_data sx1508q_device_data =;

static const struct sx150x_device_data sx1509q_device_data =;

static int sx150x_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
{}

static const char *sx150x_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
						unsigned int group)
{}

static int sx150x_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
					unsigned int group,
					const unsigned int **pins,
					unsigned int *num_pins)
{}

static const struct pinctrl_ops sx150x_pinctrl_ops =;

static bool sx150x_pin_is_oscio(struct sx150x_pinctrl *pctl, unsigned int pin)
{}

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

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

static int __sx150x_gpio_set(struct sx150x_pinctrl *pctl, unsigned int offset,
			     int value)
{}

static int sx150x_gpio_oscio_set(struct sx150x_pinctrl *pctl,
				 int value)
{}

static void sx150x_gpio_set(struct gpio_chip *chip, unsigned int offset,
			    int value)
{}

static void sx150x_gpio_set_multiple(struct gpio_chip *chip,
				     unsigned long *mask,
				     unsigned long *bits)
{}

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

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

static void sx150x_irq_mask(struct irq_data *d)
{}

static void sx150x_irq_unmask(struct irq_data *d)
{}

static void sx150x_irq_set_sense(struct sx150x_pinctrl *pctl,
				 unsigned int line, unsigned int sense)
{}

static int sx150x_irq_set_type(struct irq_data *d, unsigned int flow_type)
{}

static irqreturn_t sx150x_irq_thread_fn(int irq, void *dev_id)
{}

static void sx150x_irq_bus_lock(struct irq_data *d)
{}

static void sx150x_irq_bus_sync_unlock(struct irq_data *d)
{}


static void sx150x_irq_print_chip(struct irq_data *d, struct seq_file *p)
{}

static const struct irq_chip sx150x_irq_chip =;

static int sx150x_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
			      unsigned long *config)
{}

static int sx150x_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
			      unsigned long *configs, unsigned int num_configs)
{}

static const struct pinconf_ops sx150x_pinconf_ops =;

static const struct i2c_device_id sx150x_id[] =;

static const struct of_device_id sx150x_of_match[] =;

static int sx150x_reset(struct sx150x_pinctrl *pctl)
{}

static int sx150x_init_misc(struct sx150x_pinctrl *pctl)
{}

static int sx150x_init_hw(struct sx150x_pinctrl *pctl)
{}

static int sx150x_regmap_reg_width(struct sx150x_pinctrl *pctl,
				   unsigned int reg)
{}

static unsigned int sx150x_maybe_swizzle(struct sx150x_pinctrl *pctl,
					 unsigned int reg, unsigned int val)
{}

/*
 * In order to mask the differences between 16 and 8 bit expander
 * devices we set up a sligthly ficticious regmap that pretends to be
 * a set of 32-bit (to accommodate RegSenseLow/RegSenseHigh
 * pair/quartet) registers and transparently reconstructs those
 * registers via multiple I2C/SMBus reads
 *
 * This way the rest of the driver code, interfacing with the chip via
 * regmap API, can work assuming that each GPIO pin is represented by
 * a group of bits at an offset proportional to GPIO number within a
 * given register.
 */
static int sx150x_regmap_reg_read(void *context, unsigned int reg,
				  unsigned int *result)
{}

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

static bool sx150x_reg_volatile(struct device *dev, unsigned int reg)
{}

static const struct regmap_config sx150x_regmap_config =;

static int sx150x_probe(struct i2c_client *client)
{}

static struct i2c_driver sx150x_driver =;

static int __init sx150x_init(void)
{}
subsys_initcall(sx150x_init);