From 84fc327aeb7be91e611520bb058a6c8d318401c3 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Sun, 16 Jun 2013 19:43:32 +0200 Subject: 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 --- firmware/target/arm/imx233/i2c-imx233.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'firmware/target/arm/imx233/i2c-imx233.c') 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: -- cgit