summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/i2c-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/i2c-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/i2c-imx233.c')
-rw-r--r--firmware/target/arm/imx233/i2c-imx233.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/firmware/target/arm/imx233/i2c-imx233.c b/firmware/target/arm/imx233/i2c-imx233.c
index d087c94793..5641d6fc62 100644
--- a/firmware/target/arm/imx233/i2c-imx233.c
+++ b/firmware/target/arm/imx233/i2c-imx233.c
@@ -84,10 +84,8 @@ void imx233_i2c_init(void)
{
BF_SET(I2C_CTRL0, SFTRST);
/* setup pins (must be done when shutdown) */
- imx233_pinctrl_acquire(0, 30, "i2c");
- imx233_pinctrl_acquire(0, 31, "i2c");
- imx233_pinctrl_set_function(0, 30, PINCTRL_FUNCTION_MAIN);
- imx233_pinctrl_set_function(0, 31, PINCTRL_FUNCTION_MAIN);
+ imx233_pinctrl_setup_vpin(VPIN_I2C_SCL, "i2c scl", PINCTRL_DRIVE_4mA, true);
+ imx233_pinctrl_setup_vpin(VPIN_I2C_SDA, "i2c sda", PINCTRL_DRIVE_4mA, true);
/* clear softreset */
imx233_reset_block(&HW_I2C_CTRL0);
/* Errata: