]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: rockchip: Simplify reset control handling by using reset_control_bulk*() function
authorAnand Moon <linux.amoon@gmail.com>
Mon, 2 Dec 2024 15:11:43 +0000 (20:41 +0530)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Wed, 15 Jan 2025 18:23:28 +0000 (18:23 +0000)
commit18715931a5c08d199d14df116832d88dc4df48c5
tree3281420181f6370cf42d10cd932acf01c7f36f4b
parentabdd4c8ea7d75308315a15cfb97d2eabfb4d052b
PCI: rockchip: Simplify reset control handling by using reset_control_bulk*() function

Currently, the driver acquires and asserts/deasserts the resets
individually thereby making the driver complex to read.

This can be simplified by using the reset_control_bulk() APIs.

Use devm_reset_control_bulk_get_exclusive() API to acquire all the resets
and use reset_control_bulk_{assert/deassert}() APIs to assert/deassert them
in bulk.

Following the recommendations in 'Rockchip RK3399 TRM v1.3 Part2':

  1. Split the reset controls into two groups as per section '17.5.8.1.1
     PCIe as Root Complex'.

  2. Deassert the 'Pipe, MGMT Sticky, MGMT, Core' resets in groups as per
     section '17.5.8.1.1 PCIe as Root Complex'. This is accomplished using
     the reset_control_bulk APIs.

Link: https://lore.kernel.org/r/20241202151150.7393-3-linux.amoon@gmail.com
Co-developed-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
[kwilczynski: squash error handling fix from https://lore.kernel.org/r/7da6ac56-af55-4436-9597-6af24df8122c@stanley.mountain]
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/pci/controller/pcie-rockchip.c
drivers/pci/controller/pcie-rockchip.h