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:
parent
219d54332a
commit
efa6fd8e6d
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue