Source
x
/*
* Copyright (C) 2014-2017 Broadcom
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/*
* Broadcom Cygnus IOMUX driver
*
* This file contains the Cygnus IOMUX driver that supports group based PINMUX
* configuration. Although PINMUX configuration is mainly group based, the
* Cygnus IOMUX controller allows certain pins to be individually muxed to GPIO
* function, and therefore be controlled by the Cygnus ASIU GPIO controller
*/
/*
* Cygnus IOMUX register description
*
* @offset: register offset for mux configuration of a group
* @shift: bit shift for mux configuration of a group
* @alt: alternate function to set to
*/
struct cygnus_mux {
unsigned int offset;
unsigned int shift;
unsigned int alt;
};
/*
* Keep track of Cygnus IOMUX configuration and prevent double configuration
*
* @cygnus_mux: Cygnus IOMUX register description
* @is_configured: flag to indicate whether a mux setting has already been
* configured
*/
struct cygnus_mux_log {
struct cygnus_mux mux;
bool is_configured;
};
/*
* 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: Cygnus group based IOMUX configuration
*/
struct cygnus_pin_group {
const char *name;
const unsigned *pins;
unsigned num_pins;
struct cygnus_mux mux;
};
/*
* Cygnus 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 cygnus_pin_function {
const char *name;
const char * const *groups;
unsigned num_groups;
};