summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/pwm-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-16 19:43:32 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-17 00:29:24 +0200
commit84fc327aeb7be91e611520bb058a6c8d318401c3 (patch)
treee2ceb3c4e2dd193cb379a999f1c6131de9025845 /firmware/target/arm/imx233/pwm-imx233.c
parent8f351d6e212e3b726a9d9020ed8a4119bb68e77e (diff)
downloadrockbox-84fc327aeb7be91e611520bb058a6c8d318401c3.tar.gz
rockbox-84fc327aeb7be91e611520bb058a6c8d318401c3.tar.bz2
rockbox-84fc327aeb7be91e611520bb058a6c8d318401c3.zip
imx233: introduce virtual pins to simplify pin setup
A number of pins on the imx233 are standard and manually calling functions to acquire, set function/drive/output is painful. This will become unmanageable when we will add support for the other stmp chips. Introduce the concept of virtual pin which is a way to completely describe a virtual pin (virtual because pins are muxed). Change-Id: I01b6e040945648e58e1d1abab06529c9571c5f10
Diffstat (limited to 'firmware/target/arm/imx233/pwm-imx233.c')
-rw-r--r--firmware/target/arm/imx233/pwm-imx233.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/firmware/target/arm/imx233/pwm-imx233.c b/firmware/target/arm/imx233/pwm-imx233.c
index 86460e0140..00aba9320e 100644
--- a/firmware/target/arm/imx233/pwm-imx233.c
+++ b/firmware/target/arm/imx233/pwm-imx233.c
@@ -49,12 +49,7 @@ void imx233_pwm_setup_channel(int channel, int period, int cdiv, int active,
if(enable)
imx233_pwm_enable_channel(channel, false);
/* setup pin */
- imx233_pinctrl_acquire(IMX233_PWM_PIN_BANK(channel),
- IMX233_PWM_PIN(channel), "pwm");
- imx233_pinctrl_set_function(IMX233_PWM_PIN_BANK(channel), IMX233_PWM_PIN(channel),
- PINCTRL_FUNCTION_MAIN);
- imx233_pinctrl_set_drive(IMX233_PWM_PIN_BANK(channel), IMX233_PWM_PIN(channel),
- PINCTRL_DRIVE_4mA);
+ imx233_pinctrl_setup_vpin(VPIN_PWM(channel), "pwm", PINCTRL_DRIVE_4mA, false);
/* watch the order ! active THEN period */
HW_PWM_ACTIVEn(channel) = BF_OR2(PWM_ACTIVEn, ACTIVE(active), INACTIVE(inactive));
HW_PWM_PERIODn(channel) = BF_OR4(PWM_PERIODn, PERIOD(period - 1),