#include <linux/mfd/max77620.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinmux.h>
#include "core.h"
#include "pinconf.h"
#include "pinctrl-utils.h"
#define MAX77620_PIN_NUM …
enum max77620_pin_ppdrv { … };
#define MAX77620_ACTIVE_FPS_SOURCE …
#define MAX77620_ACTIVE_FPS_POWER_ON_SLOTS …
#define MAX77620_ACTIVE_FPS_POWER_DOWN_SLOTS …
#define MAX77620_SUSPEND_FPS_SOURCE …
#define MAX77620_SUSPEND_FPS_POWER_ON_SLOTS …
#define MAX77620_SUSPEND_FPS_POWER_DOWN_SLOTS …
struct max77620_pin_function { … };
static const struct pinconf_generic_params max77620_cfg_params[] = …;
enum max77620_alternate_pinmux_option { … };
struct max77620_pingroup { … };
struct max77620_pin_info { … };
struct max77620_fps_config { … };
struct max77620_pctrl_info { … };
static const struct pinctrl_pin_desc max77620_pins_desc[] = …;
static const char * const gpio_groups[] = …;
#define FUNCTION_GROUP(fname, mux) …
static const struct max77620_pin_function max77620_pin_function[] = …;
#define MAX77620_PINGROUP(pg_name, pin_id, option) …
static const struct max77620_pingroup max77620_pingroups[] = …;
static int max77620_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
{ … }
static const char *max77620_pinctrl_get_group_name(
struct pinctrl_dev *pctldev, unsigned int group)
{ … }
static int max77620_pinctrl_get_group_pins(
struct pinctrl_dev *pctldev, unsigned int group,
const unsigned int **pins, unsigned int *num_pins)
{ … }
static const struct pinctrl_ops max77620_pinctrl_ops = …;
static int max77620_pinctrl_get_funcs_count(struct pinctrl_dev *pctldev)
{ … }
static const char *max77620_pinctrl_get_func_name(struct pinctrl_dev *pctldev,
unsigned int function)
{ … }
static int max77620_pinctrl_get_func_groups(struct pinctrl_dev *pctldev,
unsigned int function,
const char * const **groups,
unsigned int * const num_groups)
{ … }
static int max77620_pinctrl_enable(struct pinctrl_dev *pctldev,
unsigned int function, unsigned int group)
{ … }
static const struct pinmux_ops max77620_pinmux_ops = …;
static int max77620_pinconf_get(struct pinctrl_dev *pctldev,
unsigned int pin, unsigned long *config)
{ … }
static int max77620_get_default_fps(struct max77620_pctrl_info *mpci,
int addr, int *fps)
{ … }
static int max77620_set_fps_param(struct max77620_pctrl_info *mpci,
int pin, int param)
{ … }
static int max77620_pinconf_set(struct pinctrl_dev *pctldev,
unsigned int pin, unsigned long *configs,
unsigned int num_configs)
{ … }
static const struct pinconf_ops max77620_pinconf_ops = …;
static struct pinctrl_desc max77620_pinctrl_desc = …;
static int max77620_pinctrl_probe(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int max77620_suspend_fps_param[] = …;
static int max77620_active_fps_param[] = …;
static int max77620_pinctrl_suspend(struct device *dev)
{
struct max77620_pctrl_info *mpci = dev_get_drvdata(dev);
int pin, p;
for (pin = 0; pin < MAX77620_PIN_NUM; ++pin) {
if ((pin < MAX77620_GPIO1) || (pin > MAX77620_GPIO3))
continue;
for (p = 0; p < 3; ++p)
max77620_set_fps_param(
mpci, pin, max77620_suspend_fps_param[p]);
}
return 0;
};
static int max77620_pinctrl_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops max77620_pinctrl_pm_ops = …;
static const struct platform_device_id max77620_pinctrl_devtype[] = …;
MODULE_DEVICE_TABLE(platform, max77620_pinctrl_devtype);
static struct platform_driver max77620_pinctrl_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;