linux/drivers/pinctrl/pinctrl-rk805.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Pinctrl driver for Rockchip RK805/RK806 PMIC
 *
 * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd
 * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
 *
 * Author: Joseph Chen <[email protected]>
 * Author: Xu Shengfei <[email protected]>
 *
 * Based on the pinctrl-as3722 driver
 */

#include <linux/gpio/driver.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mfd/rk808.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/property.h>
#include <linux/slab.h>

#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/machine.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"

struct rk805_pin_function {};

struct rk805_pin_group {};

/*
 * @reg: gpio setting register;
 * @fun_reg: functions select register;
 * @fun_mask: functions select mask value, when set is gpio;
 * @dir_mask: input or output mask value, when set is output, otherwise input;
 * @val_mask: gpio set value, when set is level high, otherwise low;
 *
 * Different PMIC has different pin features, belowing 3 mask members are not
 * all necessary for every PMIC. For example, RK805 has 2 pins that can be used
 * as output only GPIOs, so func_mask and dir_mask are not needed. RK816 has 1
 * pin that can be used as TS/GPIO, so fun_mask, dir_mask and val_mask are all
 * necessary.
 */
struct rk805_pin_config {};

struct rk805_pctrl_info {};

enum rk805_pinmux_option {};

enum rk806_pinmux_option {};

enum rk816_pinmux_option {};

enum {};

enum {};

enum {};

static const char *const rk805_gpio_groups[] =;

static const char *const rk806_gpio_groups[] =;

static const char *const rk816_gpio_groups[] =;

/* RK805: 2 output only GPIOs */
static const struct pinctrl_pin_desc rk805_pins_desc[] =;

/* RK806 */
static const struct pinctrl_pin_desc rk806_pins_desc[] =;

/* RK816 */
static const struct pinctrl_pin_desc rk816_pins_desc[] =;

static const struct rk805_pin_function rk805_pin_functions[] =;

static const struct rk805_pin_function rk806_pin_functions[] =;

static const struct rk805_pin_function rk816_pin_functions[] =;

static const struct rk805_pin_group rk805_pin_groups[] =;

static const struct rk805_pin_group rk806_pin_groups[] =;

static const struct rk805_pin_group rk816_pin_groups[] =;

#define RK805_GPIO0_VAL_MSK
#define RK805_GPIO1_VAL_MSK

static const struct rk805_pin_config rk805_gpio_cfgs[] =;

#define RK806_PWRCTRL1_DR
#define RK806_PWRCTRL2_DR
#define RK806_PWRCTRL3_DR
#define RK806_PWRCTRL1_DATA
#define RK806_PWRCTRL2_DATA
#define RK806_PWRCTRL3_DATA
#define RK806_PWRCTRL1_FUN
#define RK806_PWRCTRL2_FUN
#define RK806_PWRCTRL3_FUN

static struct rk805_pin_config rk806_gpio_cfgs[] =;

#define RK816_FUN_MASK
#define RK816_VAL_MASK
#define RK816_DIR_MASK

static struct rk805_pin_config rk816_gpio_cfgs[] =;

/* generic gpio chip */
static int rk805_gpio_get(struct gpio_chip *chip, unsigned int offset)
{}

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

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

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

static const struct gpio_chip rk805_gpio_chip =;

/* generic pinctrl */
static int rk805_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
{}

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

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

static const struct pinctrl_ops rk805_pinctrl_ops =;

static int rk805_pinctrl_get_funcs_count(struct pinctrl_dev *pctldev)
{}

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

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

static int _rk805_pinctrl_set_mux(struct pinctrl_dev *pctldev,
				  unsigned int offset,
				  int mux)
{}

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

static int rk805_pinctrl_gpio_request_enable(struct pinctrl_dev *pctldev,
					     struct pinctrl_gpio_range *range,
					     unsigned int offset)
{}

static int rk805_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
					struct pinctrl_gpio_range *range,
					unsigned int offset, bool input)
{}

static const struct pinmux_ops rk805_pinmux_ops =;

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

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

static const struct pinconf_ops rk805_pinconf_ops =;

static const struct pinctrl_desc rk805_pinctrl_desc =;

static int rk805_pinctrl_probe(struct platform_device *pdev)
{}

static struct platform_driver rk805_pinctrl_driver =;
module_platform_driver();

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