PCI: imx: set the according disable signal

Set the according disable signal to high when enable the pcie port if
there is the disable signal in the hardware design.(e.x the second
port of imx8mq evk board).

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
This commit is contained in:
Richard Zhu 2019-01-21 14:49:12 +08:00 committed by Dong Aisheng
parent 219d54332a
commit efa6fd8e6d
1 changed files with 13 additions and 0 deletions

View File

@ -62,6 +62,7 @@ struct imx6_pcie_drvdata {
struct imx6_pcie {
struct dw_pcie *pci;
int dis_gpio;
int reset_gpio;
bool gpio_active_high;
struct clk *pcie_bus;
@ -1056,6 +1057,18 @@ static int imx6_pcie_probe(struct platform_device *pdev)
return PTR_ERR(pci->dbi_base);
/* Fetch GPIOs */
imx6_pcie->dis_gpio = of_get_named_gpio(node, "disable-gpio", 0);
if (gpio_is_valid(imx6_pcie->dis_gpio)) {
ret = devm_gpio_request_one(&pdev->dev, imx6_pcie->dis_gpio,
GPIOF_OUT_INIT_HIGH, "PCIe DIS");
if (ret) {
dev_err(&pdev->dev, "unable to get disable gpio\n");
return ret;
}
} else if (imx6_pcie->dis_gpio == -EPROBE_DEFER) {
return imx6_pcie->dis_gpio;
}
imx6_pcie->reset_gpio = of_get_named_gpio(node, "reset-gpio", 0);
imx6_pcie->gpio_active_high = of_property_read_bool(node,
"reset-gpio-active-high");