Logo Search packages:      
Sourcecode: linux version File versions

int mxc_request_iomux ( iomux_pin_name_t  pin,
iomux_pin_cfg_t  config 
)

Request ownership for an IO pin. This function has to be the first one being called before that pin is used. The caller has to check the return value to make sure it returns 0.

Parameters:
pin a name defined by iomux_pin_name_t
config a configuration as defined in iomux_pin_cfg_t
Returns:
0 if successful; Non-zero otherwise

Definition at line 156 of file iomux.c.

References IOMUX_CONFIG_GPIO, iomux_config_mux(), and mxc_request_gpio().

Referenced by mxc_board_init().

{
      int ret = iomux_config_mux(pin, config);
      int gpio_port = GPIO_TO_PORT(IOMUX_TO_GPIO(pin));

      if (!ret && (gpio_port != NON_GPIO_PORT)
          && ((config == IOMUX_CONFIG_GPIO)
            || (config == PIN_TO_ALT_GPIO(pin))))
            ret |= mxc_request_gpio(pin);

      return ret;
}


Generated by  Doxygen 1.6.0   Back to index