cip-dev.lists.cip-project.org archive mirror
 help / color / mirror / Atom feed
From: "Lad Prabhakar" <prabhakar.mahadev-lad.rj@bp.renesas.com>
To: Pavel Machek <pavel@denx.de>
Cc: "cip-dev@lists.cip-project.org" <cip-dev@lists.cip-project.org>,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Biju Das <biju.das.jz@bp.renesas.com>
Subject: Re: [cip-dev] [PATCH 4.19.y-cip 7/7] spi: add Renesas RPC-IF driver
Date: Mon, 23 Nov 2020 23:12:32 +0000	[thread overview]
Message-ID: <OSBPR01MB504880810908024D5D691832AAFC0@OSBPR01MB5048.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20201123195228.GE5619@amd>

[-- Attachment #1: Type: text/plain, Size: 3548 bytes --]

Hi Pavel,

Thank you for the review.

> -----Original Message-----
> From: Pavel Machek <pavel@denx.de>
> Sent: 23 November 2020 19:52
> To: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: cip-dev@lists.cip-project.org; Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>; Pavel Machek
> <pavel@denx.de>; Biju Das <biju.das.jz@bp.renesas.com>
> Subject: Re: [PATCH 4.19.y-cip 7/7] spi: add Renesas RPC-IF driver
> 
> Hi!
> 
> > commit eb8d6d464a27850498dced21a8450e85d4a02009 upstream.
> >
> > Add the SPI driver for the Renesas RPC-IF.  It's the "front end" driver
> > using the "back end" APIs in the main driver to talk to the real hardware.
> > We only implement the 'spi-mem' interface -- there's no need to implement
> > the usual SPI driver methods...
> >
> > Based on the original patch by Mason Yang <masonccyang@mxic.com.tw>.
> >
> > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > Link: https://lore.kernel.org/r/1ece0e6c-71af-f0f1-709e-571f4b0b4853@cogentembedded.com
> > Signed-off-by: Mark Brown <broonie@kernel.org>
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > ---
> >  drivers/spi/Kconfig      |   6 ++
> >  drivers/spi/Makefile     |   1 +
> >  drivers/spi/spi-rpc-if.c | 216 +++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 223 insertions(+)
> >  create mode 100644 drivers/spi/spi-rpc-if.c
> >
> > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> > index 0a7fd56c1ed9..461315967f96 100644
> > --- a/drivers/spi/Kconfig
> > +++ b/drivers/spi/Kconfig
> > @@ -514,6 +514,12 @@ config SPI_RB4XX
> >  	help
> >  	  SPI controller driver for the Mikrotik RB4xx series boards.
> >
> > +config SPI_RPCIF
> > +	tristate "Renesas RPC-IF SPI driver"
> > +	depends on RENESAS_RPCIF
> > +	help
> > +	  SPI driver for Renesas R-Car Gen3 RPC-IF.
> 
> Few lines here explaining the acronyms etc. would be nice.
> 
Will do.

> > +	error = spi_register_controller(ctlr);
> > +	if (error) {
> > +		dev_err(&pdev->dev, "spi_register_controller failed\n");
> > +		goto err_put_ctlr;
> > +	}
> > +	return 0;
> > +
> > +err_put_ctlr:
> > +	rpcif_disable_rpm(rpc);
> > +	spi_controller_put(ctlr);
> > +
> > +	return error;
> > +}
> 
> With just one user of the error exit, I'd avoid the goto.
> 
Agreed shall fix that.

> > +#ifdef CONFIG_PM_SLEEP
> > +static int rpcif_spi_suspend(struct device *dev)
> > +{
> > +	struct spi_controller *ctlr = dev_get_drvdata(dev);
> > +
> > +	return spi_controller_suspend(ctlr);
> > +}
> > +
> > +static int rpcif_spi_resume(struct device *dev)
> > +{
> > +	struct spi_controller *ctlr = dev_get_drvdata(dev);
> > +
> > +	return spi_controller_resume(ctlr);
> > +}
> > +
> > +static SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume);
> > +#define DEV_PM_OPS	(&rpcif_spi_pm_ops)
> > +#else
> > +#define DEV_PM_OPS	NULL
> > +#endif
> > +
> > +static struct platform_driver rpcif_spi_driver = {
> > +	.probe	= rpcif_spi_probe,
> > +	.remove	= rpcif_spi_remove,
> > +	.driver = {
> > +		.name	= "rpc-if-spi",
> > +		.pm	= DEV_PM_OPS,
> > +	},
> > +};
> 
> Can you just add "__maybe_unused" annotation and avoid the ifdefs,
> like atmel-quadspi.c does?
> 
Agreed will replace that.

Cheers,
Prabhakar

> Best regards,
> 								Pavel
> --
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: Type: text/plain, Size: 420 bytes --]


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5836): https://lists.cip-project.org/g/cip-dev/message/5836
Mute This Topic: https://lists.cip-project.org/mt/78451549/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-


      reply	other threads:[~2020-11-23 23:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 12:03 [cip-dev] [PATCH 4.19.y-cip 0/7] Add RPC-IF driver for RZ/G2x SoC's Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 1/7] dt-bindings: memory: document Renesas RPC-IF bindings Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 2/7] memory: add Renesas RPC-IF driver Lad Prabhakar
2020-11-23 19:37   ` Pavel Machek
2020-11-23 23:00     ` Lad Prabhakar
2020-11-24  9:27       ` Pavel Machek
2020-11-23 19:38   ` Pavel Machek
2020-11-23 23:02     ` Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 3/7] spi: spi-mem: Add SPI_MEM_NO_DATA to the spi_mem_data_dir enum Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 4/7] spi: spi-mem: export spi_mem_default_supports_op() Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 5/7] spi: spi-mem: Split spi_mem_exec_op() code Lad Prabhakar
2020-11-23 19:43   ` Pavel Machek
2020-11-23 23:05     ` Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 6/7] spi: spi-mem: Add a new API to support direct mapping Lad Prabhakar
2020-11-23 19:46   ` Pavel Machek
2020-11-23 23:08     ` Lad Prabhakar
2020-11-23 12:03 ` [cip-dev] [PATCH 4.19.y-cip 7/7] spi: add Renesas RPC-IF driver Lad Prabhakar
2020-11-23 19:52   ` Pavel Machek
2020-11-23 23:12     ` Lad Prabhakar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OSBPR01MB504880810908024D5D691832AAFC0@OSBPR01MB5048.jpnprd01.prod.outlook.com \
    --to=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).