From: Lucas Stach <l.stach@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/4] spi: imx5: allow CSPI to work
Date: Fri, 07 Feb 2014 10:50:24 +0100 [thread overview]
Message-ID: <1391766624.5116.1.camel@weser.hi.pengutronix.de> (raw)
In-Reply-To: <20140207072356.GH16215@pengutronix.de>
Am Freitag, den 07.02.2014, 08:23 +0100 schrieb Sascha Hauer:
> On Thu, Feb 06, 2014 at 04:37:07PM +0100, Lucas Stach wrote:
> > i.MX5 SoCs still have one old i.MX35-style SPI
> > controller. Allow this one to work side by side
> > with the new ECSPI controllers.
> >
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > ---
> > drivers/spi/Kconfig | 2 +-
> > drivers/spi/imx_spi.c | 13 +++++++++++++
> > 2 files changed, 14 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> > index 422693ccd5fe..b9f28da7983b 100644
> > --- a/drivers/spi/Kconfig
> > +++ b/drivers/spi/Kconfig
> > @@ -25,7 +25,7 @@ config DRIVER_SPI_IMX_0_0
> >
> > config DRIVER_SPI_IMX_0_7
> > bool
> > - depends on ARCH_IMX25 || ARCH_IMX35
> > + depends on ARCH_IMX25 || ARCH_IMX35 || ARCH_IMX51 || ARCH_IMX53
> > default y
> >
> > config DRIVER_SPI_IMX_2_3
> > diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c
> > index c0c2ed7c49df..e43712e118b3 100644
> > --- a/drivers/spi/imx_spi.c
> > +++ b/drivers/spi/imx_spi.c
> > @@ -564,6 +564,10 @@ static int imx_spi_probe(struct device_d *dev)
> > if (cpu_is_mx51() || cpu_is_mx53() || cpu_is_mx6())
> > version = SPI_IMX_VER_2_3;
> > #endif
> > + /* oftree knows best, so use it if it's there */
> > + if (dev->of_id_entry)
> > + version = dev->of_id_entry->data;
> > +
> > imx->chipselect = spi_imx_devtype_data[version].chipselect;
> > imx->xchg_single = spi_imx_devtype_data[version].xchg_single;
> > imx->init = spi_imx_devtype_data[version].init;
> > @@ -584,10 +588,19 @@ err_free:
> > static __maybe_unused struct of_device_id imx_spi_dt_ids[] = {
> > {
> > .compatible = "fsl,imx27-cspi",
> > +#ifdef CONFIG_DRIVER_SPI_IMX_0_0
> > + .data = SPI_IMX_VER_0_0,
> > +#endif
> > }, {
> > .compatible = "fsl,imx35-cspi",
> > +#ifdef CONFIG_DRIVER_SPI_IMX_0_7
> > + .data = SPI_IMX_VER_0_7,
> > +#endif
> > }, {
> > .compatible = "fsl,imx51-ecspi",
> > +#ifdef CONFIG_DRIVER_SPI_IMX_2_3
> > + .data = SPI_IMX_VER_2_3,
> > +#endif
>
> Are the ifdefs needed?
As long as we want to keep them in the rest of the driver, yes. If we
are willing to trade a little code size we could just remove them from
the whole driver.
Regards,
Lucas
--
Pengutronix e.K. | Lucas Stach |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5076 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2014-02-07 9:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 15:37 Lucas Stach
2014-02-06 15:37 ` [PATCH 2/4] spi: imx: correctly set GPIO chip selects on CSPI Lucas Stach
2014-02-06 15:37 ` [PATCH 3/4] spi: m25p80: sync up device list with linux 3.13 Lucas Stach
2014-02-06 15:37 ` [PATCH 4/4] spi: m25p80: detect non-jedec chips by using DT compatible Lucas Stach
2014-02-07 7:23 ` [PATCH 1/4] spi: imx5: allow CSPI to work Sascha Hauer
2014-02-07 9:50 ` Lucas Stach [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=1391766624.5116.1.camel@weser.hi.pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.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