summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/pinctrl-imx233.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/pinctrl-imx233.h')
-rw-r--r--firmware/target/arm/imx233/pinctrl-imx233.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/pinctrl-imx233.h b/firmware/target/arm/imx233/pinctrl-imx233.h
index 291b5c8ff7..4e3a9a035e 100644
--- a/firmware/target/arm/imx233/pinctrl-imx233.h
+++ b/firmware/target/arm/imx233/pinctrl-imx233.h
@@ -106,4 +106,20 @@ static inline void imx233_set_pin_function(unsigned bank, unsigned pin, unsigned
__REG_SET(HW_PINCTRL_MUXSEL(2 * bank + pin / 16)) = function << (2 * (pin % 16));
}
+static inline void imx233_enable_pin_pullup(unsigned bank, unsigned pin, bool enable)
+{
+ if(enable)
+ __REG_SET(HW_PINCTRL_PULL(bank)) = 1 << pin;
+ else
+ __REG_CLR(HW_PINCTRL_PULL(bank)) = 1 << pin;
+}
+
+static inline void imx233_enable_pin_pullup_mask(unsigned bank, uint32_t pin_msk, bool enable)
+{
+ if(enable)
+ __REG_SET(HW_PINCTRL_PULL(bank)) = pin_msk;
+ else
+ __REG_CLR(HW_PINCTRL_PULL(bank)) = pin_msk;
+}
+
#endif /* __PINCTRL_IMX233_H__ */