linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi/fsl-espi: Add missing cell-index OF property
@ 2012-05-25 13:49 Joakim Tjernlund
       [not found] ` <1337953769-28244-1-git-send-email-Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Joakim Tjernlund @ 2012-05-25 13:49 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Kenth Eriksson
  Cc: Joakim Tjernlund

espi does not look for a OF cell-index property which
makes the bus numbering dynamic only. This add an
optional cell-index.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
---
 drivers/spi/spi-fsl-espi.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index d770f03..c4bea1f 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -680,6 +680,10 @@ static int of_fsl_espi_get_chipselects(struct device *dev)
 	}
 
 	pdata->max_chipselect = *prop;
+	prop = of_get_property(np, "cell-index", &len);
+	if (prop && len == sizeof(*prop))
+		pdata->bus_num = *prop;
+
 	pdata->cs_control = NULL;
 
 	return 0;
-- 
1.7.3.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] spi/fsl-espi: Add missing cell-index OF property
       [not found] ` <1337953769-28244-1-git-send-email-Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
@ 2012-05-25 18:52   ` Grant Likely
  2012-05-26 16:23     ` Joakim Tjernlund
       [not found]     ` <OFB53233C6.0724FA94-ONC1257A0A.00593F62-C1257A0A.005A0C24@LocalDomain>
  0 siblings, 2 replies; 4+ messages in thread
From: Grant Likely @ 2012-05-25 18:52 UTC (permalink / raw)
  To: Joakim Tjernlund,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Kenth Eriksson
  Cc: Joakim Tjernlund

On Fri, 25 May 2012 15:49:29 +0200, Joakim Tjernlund <Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org> wrote:
> espi does not look for a OF cell-index property which
> makes the bus numbering dynamic only. This add an
> optional cell-index.
> 
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>

Nack.  Use /aliases instead.

g.

> ---
>  drivers/spi/spi-fsl-espi.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
> index d770f03..c4bea1f 100644
> --- a/drivers/spi/spi-fsl-espi.c
> +++ b/drivers/spi/spi-fsl-espi.c
> @@ -680,6 +680,10 @@ static int of_fsl_espi_get_chipselects(struct device *dev)
>  	}
>  
>  	pdata->max_chipselect = *prop;
> +	prop = of_get_property(np, "cell-index", &len);
> +	if (prop && len == sizeof(*prop))
> +		pdata->bus_num = *prop;
> +
>  	pdata->cs_control = NULL;
>  
>  	return 0;
> -- 
> 1.7.3.4
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> spi-devel-general mailing list
> spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] spi/fsl-espi: Add missing cell-index OF property
  2012-05-25 18:52   ` Grant Likely
@ 2012-05-26 16:23     ` Joakim Tjernlund
       [not found]     ` <OFB53233C6.0724FA94-ONC1257A0A.00593F62-C1257A0A.005A0C24@LocalDomain>
  1 sibling, 0 replies; 4+ messages in thread
From: Joakim Tjernlund @ 2012-05-26 16:23 UTC (permalink / raw)
  To: Grant Likely
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Kenth Eriksson

Grant Likely <glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote on 2012/05/25 20:52:26:
>
> On Fri, 25 May 2012 15:49:29 +0200, Joakim Tjernlund <Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org> wrote:
> > espi does not look for a OF cell-index property which
> > makes the bus numbering dynamic only. This add an
> > optional cell-index.
> >
> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
>
> Nack.  Use /aliases instead.

hmm, tried that but that didn't work:
      aliases {
               spi0 = &spi0;
      }
Maybe we need some other alias then(what)?

Anyhow, what is wrong with adding cell-index? Isn't that the standard ?

To be clear what we want to do is make spidev (in /dev) appear
as spidev0 instead of spidev<some random number>

>
> g.
>
> > ---
> >  drivers/spi/spi-fsl-espi.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
> > index d770f03..c4bea1f 100644
> > --- a/drivers/spi/spi-fsl-espi.c
> > +++ b/drivers/spi/spi-fsl-espi.c
> > @@ -680,6 +680,10 @@ static int of_fsl_espi_get_chipselects(struct device *dev)
> >     }
> >
> >     pdata->max_chipselect = *prop;
> > +   prop = of_get_property(np, "cell-index", &len);
> > +   if (prop && len == sizeof(*prop))
> > +      pdata->bus_num = *prop;
> > +
> >     pdata->cs_control = NULL;
> >
> >     return 0;
> > --


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] spi/fsl-espi: Add missing cell-index OF property
       [not found]     ` <OFB53233C6.0724FA94-ONC1257A0A.00593F62-C1257A0A.005A0C24@LocalDomain>
@ 2012-05-27  9:28       ` Joakim Tjernlund
  0 siblings, 0 replies; 4+ messages in thread
From: Joakim Tjernlund @ 2012-05-27  9:28 UTC (permalink / raw)
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Kenth Eriksson

Joakim Tjernlund/Transmode wrote on 2012/05/26 18:23:33:
>
> Grant Likely <glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote on 2012/05/25 20:52:26:
> >
> > On Fri, 25 May 2012 15:49:29 +0200, Joakim Tjernlund <Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org> wrote:
> > > espi does not look for a OF cell-index property which
> > > makes the bus numbering dynamic only. This add an
> > > optional cell-index.
> > >
> > > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
> >
> > Nack.  Use /aliases instead.
>
> hmm, tried that but that didn't work:
>       aliases {
>                spi0 = &spi0;
>       }
> Maybe we need some other alias then(what)?
>
> Anyhow, what is wrong with adding cell-index? Isn't that the standard ?
>
> To be clear what we want to do is make spidev (in /dev) appear
> as spidev0 instead of spidev<some random number>

I cannot make /alias work, nigher spi0 = &spi0 nor spidev0 = &spidev0 work.
However, if I stop spi-fsl-lib.c from forcing dynamic numbering:
	/* Allocate bus num dynamically. */
	//pdata->bus_num = -1;
spidev numbering works as expected.
Please advice what to do.

 Jocke


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-27  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-25 13:49 [PATCH] spi/fsl-espi: Add missing cell-index OF property Joakim Tjernlund
     [not found] ` <1337953769-28244-1-git-send-email-Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2012-05-25 18:52   ` Grant Likely
2012-05-26 16:23     ` Joakim Tjernlund
     [not found]     ` <OFB53233C6.0724FA94-ONC1257A0A.00593F62-C1257A0A.005A0C24@LocalDomain>
2012-05-27  9:28       ` Joakim Tjernlund

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).