#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/log2.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/firmware/qcom/qcom_scm.h>
#include <linux/reboot.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/pinctrl/machine.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/soc/qcom/irq.h>
#include "../core.h"
#include "../pinconf.h"
#include "../pinctrl-utils.h"
#include "pinctrl-msm.h"
#define MAX_NR_GPIO …
#define MAX_NR_TILES …
#define PS_HOLD_OFFSET …
struct msm_pinctrl { … };
#define MSM_ACCESSOR(name) …
MSM_ACCESSOR(…)
MSM_ACCESSOR(…)
MSM_ACCESSOR(…)
MSM_ACCESSOR(…)
MSM_ACCESSOR(…)
static void msm_ack_intr_status(struct msm_pinctrl *pctrl,
const struct msm_pingroup *g)
{ … }
static int msm_get_groups_count(struct pinctrl_dev *pctldev)
{ … }
static const char *msm_get_group_name(struct pinctrl_dev *pctldev,
unsigned group)
{ … }
static int msm_get_group_pins(struct pinctrl_dev *pctldev,
unsigned group,
const unsigned **pins,
unsigned *num_pins)
{ … }
static const struct pinctrl_ops msm_pinctrl_ops = …;
static int msm_pinmux_request(struct pinctrl_dev *pctldev, unsigned offset)
{ … }
static int msm_get_functions_count(struct pinctrl_dev *pctldev)
{ … }
static const char *msm_get_function_name(struct pinctrl_dev *pctldev,
unsigned function)
{ … }
static int msm_get_function_groups(struct pinctrl_dev *pctldev,
unsigned function,
const char * const **groups,
unsigned * const num_groups)
{ … }
static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev,
unsigned function,
unsigned group)
{ … }
static int msm_pinmux_request_gpio(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned offset)
{ … }
static const struct pinmux_ops msm_pinmux_ops = …;
static int msm_config_reg(struct msm_pinctrl *pctrl,
const struct msm_pingroup *g,
unsigned param,
unsigned *mask,
unsigned *bit)
{ … }
#define MSM_NO_PULL …
#define MSM_PULL_DOWN …
#define MSM_KEEPER …
#define MSM_PULL_UP_NO_KEEPER …
#define MSM_PULL_UP …
#define MSM_I2C_STRONG_PULL_UP …
static unsigned msm_regval_to_drive(u32 val)
{ … }
static int msm_config_group_get(struct pinctrl_dev *pctldev,
unsigned int group,
unsigned long *config)
{ … }
static int msm_config_group_set(struct pinctrl_dev *pctldev,
unsigned group,
unsigned long *configs,
unsigned num_configs)
{ … }
static const struct pinconf_ops msm_pinconf_ops = …;
static int msm_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
{ … }
static int msm_gpio_direction_output(struct gpio_chip *chip, unsigned offset, int value)
{ … }
static int msm_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
{ … }
static int msm_gpio_get(struct gpio_chip *chip, unsigned offset)
{ … }
static void msm_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
{ … }
#ifdef CONFIG_DEBUG_FS
static void msm_gpio_dbg_show_one(struct seq_file *s,
struct pinctrl_dev *pctldev,
struct gpio_chip *chip,
unsigned offset,
unsigned gpio)
{ … }
static void msm_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
{ … }
#else
#define msm_gpio_dbg_show …
#endif
static int msm_gpio_init_valid_mask(struct gpio_chip *gc,
unsigned long *valid_mask,
unsigned int ngpios)
{ … }
static const struct gpio_chip msm_gpio_template = …;
static void msm_gpio_update_dual_edge_pos(struct msm_pinctrl *pctrl,
const struct msm_pingroup *g,
struct irq_data *d)
{ … }
static void msm_gpio_irq_mask(struct irq_data *d)
{ … }
static void msm_gpio_irq_unmask(struct irq_data *d)
{ … }
static void msm_gpio_irq_enable(struct irq_data *d)
{ … }
static void msm_gpio_irq_disable(struct irq_data *d)
{ … }
static void msm_gpio_update_dual_edge_parent(struct irq_data *d)
{ … }
static void msm_gpio_irq_ack(struct irq_data *d)
{ … }
static void msm_gpio_irq_eoi(struct irq_data *d)
{ … }
static bool msm_gpio_needs_dual_edge_parent_workaround(struct irq_data *d,
unsigned int type)
{ … }
static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
{ … }
static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
{ … }
static int msm_gpio_irq_reqres(struct irq_data *d)
{ … }
static void msm_gpio_irq_relres(struct irq_data *d)
{ … }
static int msm_gpio_irq_set_affinity(struct irq_data *d,
const struct cpumask *dest, bool force)
{ … }
static int msm_gpio_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu_info)
{ … }
static void msm_gpio_irq_handler(struct irq_desc *desc)
{ … }
static int msm_gpio_wakeirq(struct gpio_chip *gc,
unsigned int child,
unsigned int child_type,
unsigned int *parent,
unsigned int *parent_type)
{ … }
static bool msm_gpio_needs_valid_mask(struct msm_pinctrl *pctrl)
{ … }
static const struct irq_chip msm_gpio_irq_chip = …;
static int msm_gpio_init(struct msm_pinctrl *pctrl)
{ … }
static int msm_ps_hold_restart(struct notifier_block *nb, unsigned long action,
void *data)
{ … }
static struct msm_pinctrl *poweroff_pctrl;
static void msm_ps_hold_poweroff(void)
{ … }
static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl)
{ … }
static __maybe_unused int msm_pinctrl_suspend(struct device *dev)
{ … }
static __maybe_unused int msm_pinctrl_resume(struct device *dev)
{ … }
SIMPLE_DEV_PM_OPS(msm_pinctrl_dev_pm_ops, msm_pinctrl_suspend,
msm_pinctrl_resume);
EXPORT_SYMBOL(…);
int msm_pinctrl_probe(struct platform_device *pdev,
const struct msm_pinctrl_soc_data *soc_data)
{ … }
EXPORT_SYMBOL(…);
void msm_pinctrl_remove(struct platform_device *pdev)
{ … }
EXPORT_SYMBOL(…);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;