PCI: rockchip: dw: Remove rockchip,prsnt-active-high

gpiod_get_value would take gpio active state into count. So
the default pattern should be like prsnt-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>
to indicate that 1 means no devices. If we need 0 to indicate no devices,
we should use GPIO_ACTIVE_HIGH instead.

Fixes: cca1a93b9e ("PCI: rockchip: dw: Add present IO detect")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: Ic34debabfccdac357c52df427573decc65eea83f
This commit is contained in:
Shawn Lin
2022-01-28 09:58:17 +08:00
committed by Tao Huang
parent 1a23826f51
commit 20d9a60a89

View File

@@ -149,7 +149,6 @@ struct rk_pcie {
struct reset_bulk_data *rsts;
struct gpio_desc *rst_gpio;
struct gpio_desc *prsnt_gpio;
int prsnt_active_stat;
phys_addr_t mem_start;
size_t mem_size;
struct pcie_port pp;
@@ -1209,9 +1208,6 @@ static int rk_pcie_resource_get(struct platform_device *pdev,
if (IS_ERR_OR_NULL(rk_pcie->prsnt_gpio))
dev_info(&pdev->dev, "invalid prsnt-gpios property in node\n");
if (device_property_read_bool(&pdev->dev, "rockchip,prsnt-active-high"))
rk_pcie->prsnt_active_stat = 1;
return 0;
}
@@ -1786,7 +1782,7 @@ static int rk_pcie_really_probe(void *p)
}
if (!IS_ERR_OR_NULL(rk_pcie->prsnt_gpio)) {
if (gpiod_get_value(rk_pcie->prsnt_gpio) != rk_pcie->prsnt_active_stat) {
if (!gpiod_get_value(rk_pcie->prsnt_gpio)) {
ret = -ENODEV;
goto release_driver;
}