aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sh-pfc/sh_pfc.h
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>2016-11-12 17:04:25 +0100
committerGeert Uytterhoeven <geert+renesas@glider.be>2016-11-15 11:01:09 +0100
commitc314c9f15aa5f43f0e5c0e2602cc65798dbd1598 (patch)
tree0434d8dd83087fbf43f288502ce0eca470d17374 /drivers/pinctrl/sh-pfc/sh_pfc.h
parentpinctrl: sh-pfc: Do not unconditionally support PIN_CONFIG_BIAS_DISABLE (diff)
downloadlinux-dev-c314c9f15aa5f43f0e5c0e2602cc65798dbd1598.tar.xz
linux-dev-c314c9f15aa5f43f0e5c0e2602cc65798dbd1598.zip
pinctrl: sh-pfc: Add helper to handle bias lookup table
On some SoC there are no simple mapping of pins to bias register bits and a lookup table is needed. This logic is already implemented in some SoC specific drivers that could benefit from a generic implementation. Add helpers to deal with the lookup which later can be used by the SoC specific drivers. The logic used to lookup are different from the one it aims to replace, this is intentional. This new method reduces the memory consumption at the cost of increased CPU usage and fix a bug where a WARN() would incorrectly be triggered if the register offset is 0. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Diffstat (limited to 'drivers/pinctrl/sh-pfc/sh_pfc.h')
-rw-r--r--drivers/pinctrl/sh-pfc/sh_pfc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index 2345421103db..9556c172e3d2 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -189,6 +189,12 @@ struct sh_pfc_window {
unsigned long size;
};
+struct sh_pfc_bias_info {
+ u16 pin;
+ u16 reg : 11;
+ u16 bit : 5;
+};
+
struct sh_pfc_pin_range;
struct sh_pfc {