Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
pinctrl-mvebu.h File Reference

Go to the source code of this file.

Data Structures

struct  mvebu_mpp_ctrl
 
struct  mvebu_mpp_ctrl_setting
 
struct  mvebu_mpp_mode
 
struct  mvebu_pinctrl_soc_info
 

Macros

#define MVEBU_SETTING_GPO   (1 << 0)
 
#define MVEBU_SETTING_GPI   (1 << 1)
 

: ctrl setting name, e.g. uart2, spi0 - unique per mpp_mode

struct mvebu_mpp_ctrl_setting - describe a mpp ctrl setting : ctrl setting value

: (optional) additional ctrl setting name, e.g. rts, cts : (optional) variant identifier mask : (private) flags to store gpi/gpo/gpio capabilities

A ctrl_setting describes a specific internal mux function that a mpp pin can be switched to. The value (val) will be written in the corresponding register for common mpp pin configuration registers on MVEBU. SoC specific mpp_get/_set function may use val to distinguish between different settings.

The name will be used to switch to this setting in DT description, e.g. marvell,function = "uart2". subname is only for debugging purposes.

If name is one of "gpi", "gpo", "gpio" gpio capabilities are parsed during initialization and stored in flags.

The variant can be used to combine different revisions of one SoC to a common pinctrl driver. It is matched (AND) with variant of soc_info to determine if a setting is available on the current SoC revision.

#define MPP_REG_CTRL(_idl, _idh)
 
#define MPP_FUNC_CTRL(_idl, _idh, _name, _func)
 
#define MPP_FUNC_GPIO_CTRL(_idl, _idh, _name, _func)
 
#define _MPP_VAR_FUNCTION(_val, _name, _subname, _mask)
 
#define MPP_VAR_FUNCTION(_val, _name, _subname, _mask)   _MPP_VAR_FUNCTION(_val, _name, NULL, _mask)
 
#define MPP_FUNCTION(_val, _name, _subname)   MPP_VAR_FUNCTION(_val, _name, _subname, (u8)-1)
 
#define MPP_MODE(_id,...)
 
#define MPP_GPIO_RANGE(_id, _pinbase, _gpiobase, _npins)
 
int mvebu_pinctrl_probe (struct platform_device *pdev)
 
int mvebu_pinctrl_remove (struct platform_device *pdev)
 

Macro Definition Documentation

#define _MPP_VAR_FUNCTION (   _val,
  _name,
  _subname,
  _mask 
)
Value:
{ \
.val = _val, \
.name = _name, \
.subname = _subname, \
.variant = _mask, \
.flags = 0, \
}

Definition at line 153 of file pinctrl-mvebu.h.

#define MPP_FUNC_CTRL (   _idl,
  _idh,
  _name,
  _func 
)
Value:
{ \
.name = _name, \
.pid = _idl, \
.npins = _idh - _idl + 1, \
.pins = (unsigned[_idh - _idl + 1]) { }, \
.mpp_get = _func ## _get, \
.mpp_set = _func ## _set, \
.mpp_gpio_req = NULL, \
.mpp_gpio_dir = NULL, \
}

Definition at line 129 of file pinctrl-mvebu.h.

#define MPP_FUNC_GPIO_CTRL (   _idl,
  _idh,
  _name,
  _func 
)
Value:
{ \
.name = _name, \
.pid = _idl, \
.npins = _idh - _idl + 1, \
.pins = (unsigned[_idh - _idl + 1]) { }, \
.mpp_get = _func ## _get, \
.mpp_set = _func ## _set, \
.mpp_gpio_req = _func ## _gpio_req, \
.mpp_gpio_dir = _func ## _gpio_dir, \
}

Definition at line 141 of file pinctrl-mvebu.h.

#define MPP_FUNCTION (   _val,
  _name,
  _subname 
)    MPP_VAR_FUNCTION(_val, _name, _subname, (u8)-1)

Definition at line 170 of file pinctrl-mvebu.h.

#define MPP_GPIO_RANGE (   _id,
  _pinbase,
  _gpiobase,
  _npins 
)
Value:
{ \
.name = "mvebu-gpio", \
.id = _id, \
.pin_base = _pinbase, \
.base = _gpiobase, \
.npins = _npins, \
}

Definition at line 180 of file pinctrl-mvebu.h.

#define MPP_MODE (   _id,
  ... 
)
Value:
{ \
.pid = _id, \
.settings = (struct mvebu_mpp_ctrl_setting[]){ \
__VA_ARGS__, { } }, \
}

Definition at line 173 of file pinctrl-mvebu.h.

#define MPP_REG_CTRL (   _idl,
  _idh 
)
Value:
{ \
.name = NULL, \
.pid = _idl, \
.npins = _idh - _idl + 1, \
.pins = (unsigned[_idh - _idl + 1]) { }, \
.mpp_get = NULL, \
.mpp_set = NULL, \
.mpp_gpio_req = NULL, \
.mpp_gpio_dir = NULL, \
}

Definition at line 117 of file pinctrl-mvebu.h.

#define MPP_VAR_FUNCTION (   _val,
  _name,
  _subname,
  _mask 
)    _MPP_VAR_FUNCTION(_val, _name, NULL, _mask)

Definition at line 166 of file pinctrl-mvebu.h.

#define MVEBU_SETTING_GPI   (1 << 1)

Definition at line 77 of file pinctrl-mvebu.h.

#define MVEBU_SETTING_GPO   (1 << 0)

Definition at line 76 of file pinctrl-mvebu.h.

Function Documentation

int mvebu_pinctrl_probe ( struct platform_device pdev)

Definition at line 572 of file pinctrl-mvebu.c.

int mvebu_pinctrl_remove ( struct platform_device pdev)

Definition at line 749 of file pinctrl-mvebu.c.