From: Florian Fainelli <florian@openwrt.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org,
spi-devel-general@lists.sourceforge.net,
Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com>
Subject: Re: [PATCH 9/9 v3] spi: add Broadcom BCM63xx SPI controller driver
Date: Tue, 31 Jan 2012 22:20:41 +0100 [thread overview]
Message-ID: <201201312220.41561.florian@openwrt.org> (raw)
In-Reply-To: <20120131201922.GE22611@ponder.secretlab.ca>
Hello Grant,
On Tuesday 31 January 2012 21:19:22 Grant Likely wrote:
> On Tue, Jan 31, 2012 at 03:10:48PM +0100, Florian Fainelli wrote:
> > This patch adds support for the SPI controller found on the Broadcom
> > BCM63xx SoCs.
> >
> > Signed-off-by: Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com>
> > Signed-off-by: Florian Fainelli <florian@openwrt.org>
> > ---
> > Changes since v2:
> > - reworked bcm63xx_spi_setup_transfer to choose closest spi transfer
> >
> > frequency
> >
> > - removed invalid 25Mhz frequency
> > - fixed some minor checkpatch issues
> >
> > Changes since v1:
> > - switched to the devm_* API which frees resources automatically
> > - switched to dev_pm_ops
> > - use module_platform_driver
> > - remove MODULE_VERSION()
> > - fixed return value when clock is not present using PTR_ERR()
> > - fixed probe() error path to disable clock in case of failure
> >
> > drivers/spi/Kconfig | 6 +
> > drivers/spi/Makefile | 1 +
> > drivers/spi/spi-bcm63xx.c | 486
> > +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 493
> > insertions(+), 0 deletions(-)
> > create mode 100644 drivers/spi/spi-bcm63xx.c
>
> Looks okay. There are a couple of problems that needs to be fixed
> below, but otherwise:
>
> Acked-by: Grant Likely <grant.likely@secretlab.ca>
>
> Merge this through the same tree as patches 1-8
>
> g.
>
> > +static int __init bcm63xx_spi_probe(struct platform_device *pdev)
>
> __devinit
>
> > +static int __exit bcm63xx_spi_remove(struct platform_device *pdev)
>
> __devexit
>
> > +static const struct dev_pm_ops bcm63xx_spi_pm_ops = {
> > + .suspend = bcm63xx_spi_suspend,
> > + .resume = bcm63xx_spi_resume,
> > +};
> > +
> > +#define BCM63XX_SPI_PM_OPS (&bcm63xx_spi_pm_ops)
> > +#else
> > +#define BCM63XX_SPI_PM_OPS NULL
>
> A bit ugly. Do this instead in the else clause and drop the
> BCM63XX_SPI_PM_OPS:
>
> #define bcm63xx_spi_pm_ops NULL
This won't work, because driver.pm must be set to a pointer to a struct
dev_pm_ops, that's why I used this trick to make it build fine in both cases.
If I follow your advice, with driver.pm = &bcm63xx_spi_pm_ops, it won't build
for CONFIG_PM=n.
>
> > +#endif
> > +
> > +static struct platform_driver bcm63xx_spi_driver = {
> > + .driver = {
> > + .name = "bcm63xx-spi",
> > + .owner = THIS_MODULE,
> > + .pm = BCM63XX_SPI_PM_OPS,
> > + },
> > + .probe = bcm63xx_spi_probe,
> > + .remove = __exit_p(bcm63xx_spi_remove),
>
> __devexit_p
>
> > +};
> > +
> > +module_platform_driver(bcm63xx_spi_driver);
> > +
> > +MODULE_ALIAS("platform:bcm63xx_spi");
> > +MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
> > +MODULE_AUTHOR("Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com>");
> > +MODULE_DESCRIPTION("Broadcom BCM63xx SPI Controller driver");
> > +MODULE_LICENSE("GPL");
--
Florian
next prev parent reply other threads:[~2012-01-31 21:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 14:10 [PATCH 0/9 v3] MIPS: BCM63XX: add support for SPI Florian Fainelli
2012-01-31 14:10 ` [PATCH 1/9 v3] MIPS: BCM63XX: add IRQ_SPI and CPU specific SPI IRQ values Florian Fainelli
2012-01-31 14:10 ` [PATCH 2/9 v3] MIPS: BCM63XX: define BCM6358 SPI base address Florian Fainelli
2012-01-31 14:10 ` [PATCH 3/9 v3] MIPS: BCM63XX: add BCM6368 SPI clock mask Florian Fainelli
2012-01-31 14:10 ` [PATCH 4/9 v3] MIPS: BCM63XX: define SPI register sizes Florian Fainelli
2012-01-31 14:10 ` [PATCH 5/9 v3] MIPS: BCM63XX: remove SPI2 register Florian Fainelli
2012-01-31 14:10 ` [PATCH 6/9 v3] MIPS: BCM63XX: define internal registers offsets of the SPI controller Florian Fainelli
2012-01-31 14:10 ` [PATCH 7/9 v3] MIPS: BCM63XX: add stub to register the SPI platform driver Florian Fainelli
2012-01-31 14:10 ` [PATCH 8/9 v3] MIPS: BCM63XX: make board setup code register the spi platform device Florian Fainelli
2012-01-31 14:10 ` [PATCH 9/9 v3] spi: add Broadcom BCM63xx SPI controller driver Florian Fainelli
2012-01-31 17:52 ` Shubhrajyoti Datta
2012-01-31 20:19 ` Grant Likely
2012-01-31 21:20 ` Florian Fainelli [this message]
2012-01-31 21:59 ` Grant Likely
2012-02-01 10:14 ` [PATCH v4] " Florian Fainelli
2012-02-01 11:22 ` Maxime Bizon
2012-03-09 22:04 ` Grant Likely
2012-03-09 22:04 ` Grant Likely
2012-03-12 8:25 ` Florian Fainelli
2012-05-30 10:04 ` [PATCH 0/9 v3] MIPS: BCM63XX: add support for SPI Florian Fainelli
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=201201312220.41561.florian@openwrt.org \
--to=florian@openwrt.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=spi-devel-general@lists.sourceforge.net \
--cc=tanguy.bouzeloc@efixo.com \
/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