RE: [RFC PATCH] drivers: soc: xilinx: Add ZynqMP PM driver
From: Jolly Shah
Date: Wed Jan 10 2018 - 15:22:09 EST
Thanks Sean for review,
> -----Original Message-----
> From: Sean Wang [mailto:sean.wang@xxxxxxxxxxxx]
> Sent: Monday, January 08, 2018 7:10 PM
> To: Jolly Shah <JOLLYS@xxxxxxxxxx>
> Cc: matthias.bgg@xxxxxxxxx; andy.gross@xxxxxxxxxx; shawnguo@xxxxxxxxxx;
> geert+renesas@xxxxxxxxx; bjorn.andersson@xxxxxxxxxx;
> m.szyprowski@xxxxxxxxxxx; michal.simek@xxxxxxxxxx; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Jolly Shah
> <JOLLYS@xxxxxxxxxx>; Rajan Vaja <RAJANV@xxxxxxxxxx>
> Subject: Re: [RFC PATCH] drivers: soc: xilinx: Add ZynqMP PM driver
>
> On Mon, 2018-01-08 at 14:10 -0800, Jolly Shah wrote:
> > Add ZynqMP PM driver. PM driver provides power management support for
> > ZynqMP.
> >
> > Signed-off-by: Jolly Shah <jollys@xxxxxxxxxx>
> > Signed-off-by: Rajan Vaja <rajanv@xxxxxxxxxx>
> > ---
> > .../bindings/soc/xilinx/xlnx,zynqmp-pm.txt | 15 ++
>
>
> The patch should be split into two: one is for dt-bindings part and the other is for
> driver part. Where dt-binding part should require additionally to send to Rob and
> Cc. devicetree@xxxxxxxxxxxxxxxx
>
Sure. Will do it in next version.
> > diff --git a/drivers/soc/xilinx/zynqmp/Makefile
> > b/drivers/soc/xilinx/zynqmp/Makefile
> > new file mode 100644
> > index 0000000..98034f7
> > --- /dev/null
> > +++ b/drivers/soc/xilinx/zynqmp/Makefile
> > @@ -0,0 +1 @@
> > +obj-$(CONFIG_ZYNQMP_PM) += pm.o
> > diff --git a/drivers/soc/xilinx/zynqmp/pm.c
> > b/drivers/soc/xilinx/zynqmp/pm.c new file mode 100644 index
> > 0000000..7178fb5
> > --- /dev/null
> > +++ b/drivers/soc/xilinx/zynqmp/pm.c
> > @@ -0,0 +1,265 @@
> > +/*
> > + * Xilinx Zynq MPSoC Power Management
> > + *
> > + * Copyright (C) 2014-2017 Xilinx, Inc.
>
> should include 2018 ?
>
Will fix in next version
> > + if (!eemi_ops || !eemi_ops->get_api_version)
> > + return -ENXIO;
> > +
> > + eemi_ops->get_api_version(&pm_api_version);
> > +
> > + /* Check PM API version number */
> > + if (pm_api_version != ZYNQMP_PM_VERSION)
> > + return -ENODEV;
> > +
> > + irq = platform_get_irq(pdev, 0);
> > + if (irq <= 0)
> > + return -ENXIO;
> > +
> > + ret = request_irq(irq, zynqmp_pm_isr, IRQF_SHARED, DRIVER_NAME,
> pdev);
> > + if (ret) {
> > + dev_err(&pdev->dev, "request_irq '%d' failed with %d\n",
> > + irq, ret);
> > + return ret;
> > + }
>
>
> how about use devm_request_irq to simplify error path?
Will change in next version
Thanks,
Jolly Shah