summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/mvebu/pinctrl-mvebu.h
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2017-01-13 12:03:20 +0100
committerLinus Walleij <linus.walleij@linaro.org>2017-01-18 09:54:24 +0100
commit20955c5f5c423bb1f2ed03c564a6657738d61955 (patch)
tree222a781fcc3fabd659c89b011349775fa1d8c941 /drivers/pinctrl/mvebu/pinctrl-mvebu.h
parentpinctrl: mvebu: constify mvebu_mpp_ctrl structures (diff)
downloadlinux-20955c5f5c423bb1f2ed03c564a6657738d61955.tar.xz
linux-20955c5f5c423bb1f2ed03c564a6657738d61955.zip
pinctrl: mvebu: provide per-control private data
Provide per-control private data into each mvebu pinctrl method, which will allow us to provide some completely generic helpers without the global variable and per-instance function definitions that would be required when we have multiple pin controllers on a SoC. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mvebu/pinctrl-mvebu.h')
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-mvebu.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.h b/drivers/pinctrl/mvebu/pinctrl-mvebu.h
index 7f7c24ac49e3..37bfa3bb56f0 100644
--- a/drivers/pinctrl/mvebu/pinctrl-mvebu.h
+++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.h
@@ -14,6 +14,14 @@
#define __PINCTRL_MVEBU_H__
/**
+ * struct mvebu_mpp_ctrl_data - private data for the mpp ctrl operations
+ * @base: base address of pinctrl hardware
+ */
+struct mvebu_mpp_ctrl_data {
+ void __iomem *base;
+};
+
+/**
* struct mvebu_mpp_ctrl - describe a mpp control
* @name: name of the control group
* @pid: first pin id handled by this control
@@ -37,10 +45,13 @@ struct mvebu_mpp_ctrl {
u8 pid;
u8 npins;
unsigned *pins;
- int (*mpp_get)(unsigned pid, unsigned long *config);
- int (*mpp_set)(unsigned pid, unsigned long config);
- int (*mpp_gpio_req)(unsigned pid);
- int (*mpp_gpio_dir)(unsigned pid, bool input);
+ int (*mpp_get)(struct mvebu_mpp_ctrl_data *data, unsigned pid,
+ unsigned long *config);
+ int (*mpp_set)(struct mvebu_mpp_ctrl_data *data, unsigned pid,
+ unsigned long config);
+ int (*mpp_gpio_req)(struct mvebu_mpp_ctrl_data *data, unsigned pid);
+ int (*mpp_gpio_dir)(struct mvebu_mpp_ctrl_data *data, unsigned pid,
+ bool input);
};
/**
@@ -93,6 +104,7 @@ struct mvebu_mpp_mode {
* struct mvebu_pinctrl_soc_info - SoC specific info passed to pinctrl-mvebu
* @variant: variant mask of soc_info
* @controls: list of available mvebu_mpp_ctrls
+ * @control_data: optional array, one entry for each control
* @ncontrols: number of available mvebu_mpp_ctrls
* @modes: list of available mvebu_mpp_modes
* @nmodes: number of available mvebu_mpp_modes
@@ -106,6 +118,7 @@ struct mvebu_mpp_mode {
struct mvebu_pinctrl_soc_info {
u8 variant;
const struct mvebu_mpp_ctrl *controls;
+ struct mvebu_mpp_ctrl_data *control_data;
int ncontrols;
struct mvebu_mpp_mode *modes;
int nmodes;