linux/drivers/pinctrl/bcm/pinctrl-nsp-mux.c

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (C) 2015 Broadcom Corporation
 *
 * This file contains the Northstar plus (NSP) IOMUX driver that supports
 * group based PINMUX configuration. The Northstar plus IOMUX controller
 * allows pins to be individually muxed to GPIO function. The NAND and MMC is
 * a group based selection. The gpio_a 8 - 11 are muxed with gpio_b and pwm.
 * To select PWM, one need to enable the corresponding gpio_b as well.
 *
 *				gpio_a (8 - 11)
 *				+----------
 *				|
 *		gpio_a (8-11)	|	gpio_b (0 - 3)
 *	------------------------+-------+----------
 *					|
 *					|	pwm (0 - 3)
 *					+----------
 */

#include <linux/err.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/platform_device.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 "../core.h"
#include "../pinctrl-utils.h"

#define NSP_MUX_BASE0
#define NSP_MUX_BASE1
#define NSP_MUX_BASE2
/*
 * nsp IOMUX register description
 *
 * @base: base 0 or base 1
 * @shift: bit shift for mux configuration of a group
 * @mask: bit mask of the function
 * @alt: alternate function to set to
 */
struct nsp_mux {};

/*
 * Keep track of nsp IOMUX configuration and prevent double configuration
 *
 * @nsp_mux: nsp IOMUX register description
 * @is_configured: flag to indicate whether a mux setting has already been
 * configured
 */
struct nsp_mux_log {};

/*
 * Group based IOMUX configuration
 *
 * @name: name of the group
 * @pins: array of pins used by this group
 * @num_pins: total number of pins used by this group
 * @mux: nsp group based IOMUX configuration
 */
struct nsp_pin_group {};

/*
 * nsp mux function and supported pin groups
 *
 * @name: name of the function
 * @groups: array of groups that can be supported by this function
 * @num_groups: total number of groups that can be supported by this function
 */
struct nsp_pin_function {};

/*
 * nsp IOMUX pinctrl core
 *
 * @pctl: pointer to pinctrl_dev
 * @dev: pointer to device
 * @base0: first mux register
 * @base1: second mux register
 * @base2: third mux register
 * @groups: pointer to array of groups
 * @num_groups: total number of groups
 * @functions: pointer to array of functions
 * @num_functions: total number of functions
 * @mux_log: pointer to the array of mux logs
 * @lock: lock to protect register access
 */
struct nsp_pinctrl {};

/*
 * Description of a pin in nsp
 *
 * @pin: pin number
 * @name: pin name
 * @gpio_select: reg data to select GPIO
 */
struct nsp_pin {};

#define NSP_PIN_DESC(p, n, g)

/*
 * List of muxable pins in nsp
 */
static struct nsp_pin nsp_pins[] =;

/*
 * List of groups of pins
 */

static const unsigned int spi_pins[] =;
static const unsigned int i2c_pins[] =;
static const unsigned int mdio_pins[] =;
static const unsigned int pwm0_pins[] =;
static const unsigned int gpio_b_0_pins[] =;
static const unsigned int pwm1_pins[] =;
static const unsigned int gpio_b_1_pins[] =;
static const unsigned int pwm2_pins[] =;
static const unsigned int gpio_b_2_pins[] =;
static const unsigned int pwm3_pins[] =;
static const unsigned int gpio_b_3_pins[] =;
static const unsigned int uart1_pins[] =;
static const unsigned int uart2_pins[] =;
static const unsigned int synce_pins[] =;
static const unsigned int sata0_led_pins[] =;
static const unsigned int sata1_led_pins[] =;
static const unsigned int xtal_out_pins[] =;
static const unsigned int sdio_pwr_pins[] =;
static const unsigned int sdio_1p8v_pins[] =;
static const unsigned int switch_p05_led0_pins[] =;
static const unsigned int switch_p05_led1_pins[] =;
static const unsigned int nand_pins[] =;
static const unsigned int emmc_pins[] =;

#define NSP_PIN_GROUP(group_name, ba, sh, ma, al)

/*
 * List of nsp pin groups
 */
static const struct nsp_pin_group nsp_pin_groups[] =;

/*
 * List of groups supported by functions
 */

static const char * const spi_grps[] =;
static const char * const i2c_grps[] =;
static const char * const mdio_grps[] =;
static const char * const pwm_grps[] =;
static const char * const gpio_b_grps[] =;
static const char * const uart1_grps[] =;
static const char * const uart2_grps[] =;
static const char * const synce_grps[] =;
static const char * const sata_led_grps[] =;
static const char * const xtal_out_grps[] =;
static const char * const sdio_grps[] =;
static const char * const switch_led_grps[] =;
static const char * const nand_grps[] =;
static const char * const emmc_grps[] =;

#define NSP_PIN_FUNCTION(func)

/*
 * List of supported functions in nsp
 */
static const struct nsp_pin_function nsp_pin_functions[] =;

static int nsp_get_groups_count(struct pinctrl_dev *pctrl_dev)
{}

static const char *nsp_get_group_name(struct pinctrl_dev *pctrl_dev,
				      unsigned int selector)
{}

static int nsp_get_group_pins(struct pinctrl_dev *pctrl_dev,
			      unsigned int selector, const unsigned int **pins,
			      unsigned int *num_pins)
{}

static void nsp_pin_dbg_show(struct pinctrl_dev *pctrl_dev,
			     struct seq_file *s, unsigned int offset)
{}

static const struct pinctrl_ops nsp_pinctrl_ops =;

static int nsp_get_functions_count(struct pinctrl_dev *pctrl_dev)
{}

static const char *nsp_get_function_name(struct pinctrl_dev *pctrl_dev,
					 unsigned int selector)
{}

static int nsp_get_function_groups(struct pinctrl_dev *pctrl_dev,
				   unsigned int selector,
				   const char * const **groups,
				   unsigned * const num_groups)
{}

static int nsp_pinmux_set(struct nsp_pinctrl *pinctrl,
			  const struct nsp_pin_function *func,
			  const struct nsp_pin_group *grp,
			  struct nsp_mux_log *mux_log)
{}

static int nsp_pinmux_enable(struct pinctrl_dev *pctrl_dev,
			     unsigned int func_select, unsigned int grp_select)
{}


static int nsp_gpio_request_enable(struct pinctrl_dev *pctrl_dev,
				   struct pinctrl_gpio_range *range,
				   unsigned int pin)
{}

static void nsp_gpio_disable_free(struct pinctrl_dev *pctrl_dev,
				  struct pinctrl_gpio_range *range,
				  unsigned int pin)
{}

static const struct pinmux_ops nsp_pinmux_ops =;

static struct pinctrl_desc nsp_pinctrl_desc =;

static int nsp_mux_log_init(struct nsp_pinctrl *pinctrl)
{}

static int nsp_pinmux_probe(struct platform_device *pdev)
{}

static const struct of_device_id nsp_pinmux_of_match[] =;

static struct platform_driver nsp_pinmux_driver =;

static int __init nsp_pinmux_init(void)
{}
arch_initcall(nsp_pinmux_init);