linux/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015, Sony Mobile Communications AB.
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 */

#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/seq_file.h>
#include <linux/slab.h>

#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>

#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>

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

/* MPP registers */
#define SSBI_REG_ADDR_MPP_BASE
#define SSBI_REG_ADDR_MPP(n)

/* MPP Type: type */
#define PM8XXX_MPP_TYPE_D_INPUT
#define PM8XXX_MPP_TYPE_D_OUTPUT
#define PM8XXX_MPP_TYPE_D_BI_DIR
#define PM8XXX_MPP_TYPE_A_INPUT
#define PM8XXX_MPP_TYPE_A_OUTPUT
#define PM8XXX_MPP_TYPE_SINK
#define PM8XXX_MPP_TYPE_DTEST_SINK
#define PM8XXX_MPP_TYPE_DTEST_OUTPUT

/* Digital Input: control */
#define PM8XXX_MPP_DIN_TO_INT
#define PM8XXX_MPP_DIN_TO_DBUS1
#define PM8XXX_MPP_DIN_TO_DBUS2
#define PM8XXX_MPP_DIN_TO_DBUS3

/* Digital Output: control */
#define PM8XXX_MPP_DOUT_CTRL_LOW
#define PM8XXX_MPP_DOUT_CTRL_HIGH
#define PM8XXX_MPP_DOUT_CTRL_MPP
#define PM8XXX_MPP_DOUT_CTRL_INV_MPP

/* Bidirectional: control */
#define PM8XXX_MPP_BI_PULLUP_1KOHM
#define PM8XXX_MPP_BI_PULLUP_OPEN
#define PM8XXX_MPP_BI_PULLUP_10KOHM
#define PM8XXX_MPP_BI_PULLUP_30KOHM

/* Analog Output: control */
#define PM8XXX_MPP_AOUT_CTRL_DISABLE
#define PM8XXX_MPP_AOUT_CTRL_ENABLE
#define PM8XXX_MPP_AOUT_CTRL_MPP_HIGH_EN
#define PM8XXX_MPP_AOUT_CTRL_MPP_LOW_EN

/* Current Sink: control */
#define PM8XXX_MPP_CS_CTRL_DISABLE
#define PM8XXX_MPP_CS_CTRL_ENABLE
#define PM8XXX_MPP_CS_CTRL_MPP_HIGH_EN
#define PM8XXX_MPP_CS_CTRL_MPP_LOW_EN

/* DTEST Current Sink: control */
#define PM8XXX_MPP_DTEST_CS_CTRL_EN1
#define PM8XXX_MPP_DTEST_CS_CTRL_EN2
#define PM8XXX_MPP_DTEST_CS_CTRL_EN3
#define PM8XXX_MPP_DTEST_CS_CTRL_EN4

/* DTEST Digital Output: control */
#define PM8XXX_MPP_DTEST_DBUS1
#define PM8XXX_MPP_DTEST_DBUS2
#define PM8XXX_MPP_DTEST_DBUS3
#define PM8XXX_MPP_DTEST_DBUS4

/* custom pinconf parameters */
#define PM8XXX_CONFIG_AMUX
#define PM8XXX_CONFIG_DTEST_SELECTOR
#define PM8XXX_CONFIG_ALEVEL
#define PM8XXX_CONFIG_PAIRED

/**
 * struct pm8xxx_pin_data - dynamic configuration for a pin
 * @reg:		address of the control register
 * @mode:		operating mode for the pin (digital, analog or current sink)
 * @input:		pin is input
 * @output:		pin is output
 * @high_z:		pin is floating
 * @paired:		mpp operates in paired mode
 * @output_value:	logical output value of the mpp
 * @power_source:	selected power source
 * @dtest:		DTEST route selector
 * @amux:		input muxing in analog mode
 * @aout_level:		selector of the output in analog mode
 * @drive_strength:	drive strength of the current sink
 * @pullup:		pull up value, when in digital bidirectional mode
 */
struct pm8xxx_pin_data {};

struct pm8xxx_mpp {};

static const struct pinconf_generic_params pm8xxx_mpp_bindings[] =;

#ifdef CONFIG_DEBUG_FS
static const struct pin_config_item pm8xxx_conf_items[] =;
#endif

#define PM8XXX_MAX_MPPS
#define PM8XXX_MPP_PHYSICAL_OFFSET

static const char * const pm8xxx_groups[PM8XXX_MAX_MPPS] =;

#define PM8XXX_MPP_DIGITAL
#define PM8XXX_MPP_ANALOG
#define PM8XXX_MPP_SINK

static const char * const pm8xxx_mpp_functions[] =;

static int pm8xxx_mpp_update(struct pm8xxx_mpp *pctrl,
			     struct pm8xxx_pin_data *pin)
{}

static int pm8xxx_get_groups_count(struct pinctrl_dev *pctldev)
{}

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


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

static const struct pinctrl_ops pm8xxx_pinctrl_ops =;

static int pm8xxx_get_functions_count(struct pinctrl_dev *pctldev)
{}

static const char *pm8xxx_get_function_name(struct pinctrl_dev *pctldev,
					    unsigned function)
{}

static int pm8xxx_get_function_groups(struct pinctrl_dev *pctldev,
				      unsigned function,
				      const char * const **groups,
				      unsigned * const num_groups)
{}

static int pm8xxx_pinmux_set_mux(struct pinctrl_dev *pctldev,
				 unsigned function,
				 unsigned group)
{}

static const struct pinmux_ops pm8xxx_pinmux_ops =;

static int pm8xxx_pin_config_get(struct pinctrl_dev *pctldev,
				 unsigned int offset,
				 unsigned long *config)
{}

static int pm8xxx_pin_config_set(struct pinctrl_dev *pctldev,
				 unsigned int offset,
				 unsigned long *configs,
				 unsigned num_configs)
{}

static const struct pinconf_ops pm8xxx_pinconf_ops =;

static const struct pinctrl_desc pm8xxx_pinctrl_desc =;

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

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

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

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

static int pm8xxx_mpp_of_xlate(struct gpio_chip *chip,
				const struct of_phandle_args *gpio_desc,
				u32 *flags)
{}


#ifdef CONFIG_DEBUG_FS

static void pm8xxx_mpp_dbg_show_one(struct seq_file *s,
				  struct pinctrl_dev *pctldev,
				  struct gpio_chip *chip,
				  unsigned offset,
				  unsigned gpio)
{}

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

#else
#define pm8xxx_mpp_dbg_show
#endif

static const struct gpio_chip pm8xxx_mpp_template =;

static int pm8xxx_pin_populate(struct pm8xxx_mpp *pctrl,
			       struct pm8xxx_pin_data *pin)
{}

static int pm8xxx_mpp_domain_translate(struct irq_domain *domain,
				   struct irq_fwspec *fwspec,
				   unsigned long *hwirq,
				   unsigned int *type)
{}

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

static int pm8821_mpp_child_to_parent_hwirq(struct gpio_chip *chip,
					    unsigned int child_hwirq,
					    unsigned int child_type,
					    unsigned int *parent_hwirq,
					    unsigned int *parent_type)
{}

static int pm8xxx_mpp_child_to_parent_hwirq(struct gpio_chip *chip,
					    unsigned int child_hwirq,
					    unsigned int child_type,
					    unsigned int *parent_hwirq,
					    unsigned int *parent_type)
{}

static void pm8xxx_mpp_irq_disable(struct irq_data *d)
{}

static void pm8xxx_mpp_irq_enable(struct irq_data *d)
{}

static const struct irq_chip pm8xxx_mpp_irq_chip =;

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

static int pm8xxx_mpp_probe(struct platform_device *pdev)
{}

static void pm8xxx_mpp_remove(struct platform_device *pdev)
{}

static struct platform_driver pm8xxx_mpp_driver =;

module_platform_driver();

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