[PATCH v2 2/2] PCI: mediatek-gen3: Add power and reset control feature for downstream component

Rob Herring robh at kernel.org
Tue Mar 21 09:57:55 PDT 2023


On Mon, Mar 06, 2023 at 02:40:59PM +0800, Jian Yang wrote:
> From: "jian.yang" <jian.yang at mediatek.com>
> 
> Make MediaTek's controller driver capable of controlling power
> supplies and reset pin of a downstream component in power-on and
> power-off flow.
> 
> Some downstream components (e.g., a WIFI chip) may need an extra
> reset other than PERST# and their power supplies, depending on
> the requirements of platform, may need to controlled by their
> parent's driver. To meet the requirements described above, I add this
> feature to MediaTek's PCIe controller driver as a optional feature.

If you have PCI devices with extra stuff that's not standard PCI stuff 
(i.e. what's on a standard connector), then you should be describing 
the PCI device in the DT.

The standard stuff should really be in the root port node rather than 
the host bridge node. That's often omitted too because many host bridges 
only have a single root port.

> 
> Signed-off-by: jian.yang <jian.yang at mediatek.com>
> ---
>  drivers/pci/controller/pcie-mediatek-gen3.c | 86 ++++++++++++++++++++-
>  1 file changed, 85 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
> index b8612ce5f4d0..45e368b03ed2 100644
> --- a/drivers/pci/controller/pcie-mediatek-gen3.c
> +++ b/drivers/pci/controller/pcie-mediatek-gen3.c
> @@ -8,6 +8,8 @@
>  
>  #include <linux/clk.h>
>  #include <linux/delay.h>
> +#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
>  #include <linux/iopoll.h>
>  #include <linux/irq.h>
>  #include <linux/irqchip/chained_irq.h>
> @@ -15,11 +17,14 @@
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/msi.h>
> +#include <linux/of_gpio.h>

This header is getting removed. You shouldn't depend on it.

Rob



More information about the linux-arm-kernel mailing list