diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-03-02 13:05:48 -0700 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-03-05 11:25:11 +0100 |
commit | 1e2082b520721734c358f776d34a069867214c8e (patch) | |
tree | 4d11e15a4127ad69faf7555864480a6fafe5422c /drivers/pinctrl/core.h | |
parent | 6e5e959dde0d92d177f035652aeaa77f9330c9c6 (diff) |
pinctrl: enhance mapping table to support pin config operations
The pinctrl mapping table can now contain entries to:
* Set the mux function of a pin group
* Apply a set of pin config options to a pin or a group
This allows pinctrl_select_state() to apply pin configs settings as well
as mux settings.
v3: Fix find_pinctrl() to iterate over the correct list.
s/_MUX_CONFIGS_/_CONFIGS_/ in mapping table macros.
Fix documentation to use correct mapping table macro.
v2: Added numerous extra PIN_MAP_*() special-case macros.
Fixed kerneldoc typo. Delete pinctrl_get_pin_id() and
replace it with pin_get_from_name(). Various minor fixes.
Updates due to rebase.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/core.h')
-rw-r--r-- | drivers/pinctrl/core.h | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index 5691d312e15a..1cae3723bbed 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -72,17 +72,44 @@ struct pinctrl_state { }; /** + * struct pinctrl_setting_mux - setting data for MAP_TYPE_MUX_GROUP + * @group: the group selector to program + * @func: the function selector to program + */ +struct pinctrl_setting_mux { + unsigned group; + unsigned func; +}; + +/** + * struct pinctrl_setting_configs - setting data for MAP_TYPE_CONFIGS_* + * @group_or_pin: the group selector or pin ID to program + * @configs: a pointer to an array of config parameters/values to program into + * hardware. Each individual pin controller defines the format and meaning + * of config parameters. + * @num_configs: the number of entries in array @configs + */ +struct pinctrl_setting_configs { + unsigned group_or_pin; + unsigned long *configs; + unsigned num_configs; +}; + +/** * struct pinctrl_setting - an individual mux setting * @node: list node for struct pinctrl_settings's @settings field + * @type: the type of setting * @pctldev: pin control device handling to be programmed - * @group_selector: the group selector to program - * @func_selector: the function selector to program + * @data: Data specific to the setting type */ struct pinctrl_setting { struct list_head node; + enum pinctrl_map_type type; struct pinctrl_dev *pctldev; - unsigned group_selector; - unsigned func_selector; + union { + struct pinctrl_setting_mux mux; + struct pinctrl_setting_configs configs; + } data; }; /** |