mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
pci: imx: request gpio before use
Before use GPIO, we need to request gpio first. Free gpio after use. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Stefano Babic <ssbabic@denx.de>
This commit is contained in:
parent
d9523fdd11
commit
67b71df277
1 changed files with 4 additions and 0 deletions
|
@ -517,10 +517,12 @@ static int imx6_pcie_init_phy(void)
|
||||||
__weak int imx6_pcie_toggle_power(void)
|
__weak int imx6_pcie_toggle_power(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_PCIE_IMX_POWER_GPIO
|
#ifdef CONFIG_PCIE_IMX_POWER_GPIO
|
||||||
|
gpio_request(CONFIG_PCIE_IMX_POWER_GPIO, "pcie_power");
|
||||||
gpio_direction_output(CONFIG_PCIE_IMX_POWER_GPIO, 0);
|
gpio_direction_output(CONFIG_PCIE_IMX_POWER_GPIO, 0);
|
||||||
mdelay(20);
|
mdelay(20);
|
||||||
gpio_set_value(CONFIG_PCIE_IMX_POWER_GPIO, 1);
|
gpio_set_value(CONFIG_PCIE_IMX_POWER_GPIO, 1);
|
||||||
mdelay(20);
|
mdelay(20);
|
||||||
|
gpio_free(CONFIG_PCIE_IMX_POWER_GPIO);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -556,10 +558,12 @@ __weak int imx6_pcie_toggle_reset(void)
|
||||||
* state due to being previously used in U-Boot.
|
* state due to being previously used in U-Boot.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_PCIE_IMX_PERST_GPIO
|
#ifdef CONFIG_PCIE_IMX_PERST_GPIO
|
||||||
|
gpio_request(CONFIG_PCIE_IMX_PERST_GPIO, "pcie_reset");
|
||||||
gpio_direction_output(CONFIG_PCIE_IMX_PERST_GPIO, 0);
|
gpio_direction_output(CONFIG_PCIE_IMX_PERST_GPIO, 0);
|
||||||
mdelay(20);
|
mdelay(20);
|
||||||
gpio_set_value(CONFIG_PCIE_IMX_PERST_GPIO, 1);
|
gpio_set_value(CONFIG_PCIE_IMX_PERST_GPIO, 1);
|
||||||
mdelay(20);
|
mdelay(20);
|
||||||
|
gpio_free(CONFIG_PCIE_IMX_PERST_GPIO);
|
||||||
#else
|
#else
|
||||||
puts("WARNING: Make sure the PCIe #PERST line is connected!\n");
|
puts("WARNING: Make sure the PCIe #PERST line is connected!\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue