Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

void gpio_i2c_inactive ( int  i2c_num  ) 

Inactivate an I2C device

Parameters:
i2c_num an I2C device
Setup GPIO for an I2C device to be inactive

Parameters:
i2c_num an I2C device

Definition at line 543 of file mx25_3stack_gpio.c.

References MUX_CONFIG_GPIO, and mxc_free_iomux().

{
      switch (i2c_num) {
      case 0:
            /*I2C1*/
            gpio_request(IOMUX_TO_GPIO(MX25_PIN_I2C1_CLK), NULL);
            gpio_request(IOMUX_TO_GPIO(MX25_PIN_I2C1_DAT), NULL);
            mxc_free_iomux(MX25_PIN_I2C1_CLK, MUX_CONFIG_GPIO);
            mxc_free_iomux(MX25_PIN_I2C1_DAT, MUX_CONFIG_GPIO);
            break;
      case 1:
            /*I2C2*/
            gpio_request(IOMUX_TO_GPIO(MX25_PIN_GPIO_C), NULL);
            gpio_request(IOMUX_TO_GPIO(MX25_PIN_GPIO_D), NULL);
            mxc_free_iomux(MX25_PIN_GPIO_C, MUX_CONFIG_GPIO);
            mxc_free_iomux(MX25_PIN_GPIO_D, MUX_CONFIG_GPIO);

#if 0
            /* Or use FEC pins if not in use */
            gpio_request(IOMUX_TO_GPIO(MX25_PIN_FEC_RDATA1, NULL); /*SCL*/
            gpio_request(IOMUX_TO_GPIO(MX25_PIN_FEC_RX_DV, NULL); /*SDA*/
            mxc_free_iomux(MX25_PIN_FEC_RDATA1, MUX_CONFIG_GPIO);
            mxc_free_iomux(MX25_PIN_FEC_RX_DV, MUX_CONFIG_GPIO);
#endif

            break;
      case 2:
            /*I2C3*/
            gpio_request(IOMUX_TO_GPIO(MX25_PIN_HSYNC), NULL);
            gpio_request(IOMUX_TO_GPIO(MX25_PIN_VSYNC), NULL);
            mxc_free_iomux(MX25_PIN_HSYNC, MUX_CONFIG_GPIO);
            mxc_free_iomux(MX25_PIN_VSYNC, MUX_CONFIG_GPIO);
            break;
      default:
            break;
      }
}


Generated by  Doxygen 1.6.0   Back to index