Re: [PATCH] SPI: DUAL and QUAD support

2013-08-09 Thread yuhang wang
Hi, Pekon 2013/8/9 Gupta, Pekon : >> 2. I don't think that SPI_NBITS_SINGLE_HALF_DUPLEX is necessary. >> tx_nbits and rx_nbits in @spi_transfer should be passed to spi master >> driver and the master driver will set the certain mode depend on the >> info in @spi_transfer. So there is no need to l

RE: [PATCH] SPI: DUAL and QUAD support

2013-08-08 Thread Gupta, Pekon
> > [Pekon] you need separate DT binding for controller and child devices. > > And then separate for Tx and Rx in each of them. > > Also, I suggest you add devicetree-discuss maillist when you update the > > Device-tree documentation for same. > > > Just as you said above, master node describe the

Re: [PATCH] SPI: DUAL and QUAD support

2013-08-08 Thread yuhang wang
Hi, Pekon 2013/8/8 Gupta, Pekon : >> >> Hi,Trent >> >> Thanks for so many details. >> 2013/7/30 Trent Piepho : >> > On Mon, Jul 29, 2013 at 7:21 AM, Gupta, Pekon wrote: >> >>> >> spi->mode |= SPI_CS_HIGH; >> >>> >> if (of_find_property(nc, "spi-3wire", NULL)) >

RE: [PATCH] SPI: DUAL and QUAD support

2013-08-08 Thread Gupta, Pekon
> 2. I don't think that SPI_NBITS_SINGLE_HALF_DUPLEX is necessary. > tx_nbits and rx_nbits in @spi_transfer should be passed to spi master > driver and the master driver will set the certain mode depend on the > info in @spi_transfer. So there is no need to let the master driver > know SPI_NBITS_S

Re: [PATCH] SPI: DUAL and QUAD support

2013-08-08 Thread yuhang wang
Hi, Pekon 2013/8/7 Gupta, Pekon : >> >> Hello, >> > diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h >> > index 38c2b92..222e49e 100644 >> > --- a/include/linux/spi/spi.h >> > +++ b/include/linux/spi/spi.h >> > @@ -437,6 +441,8 @@ extern struct spi_master >> > *spi_busnum_to_master(u

RE: [PATCH] SPI: DUAL and QUAD support

2013-08-08 Thread Gupta, Pekon
> > Hi,Trent > > Thanks for so many details. > 2013/7/30 Trent Piepho : > > On Mon, Jul 29, 2013 at 7:21 AM, Gupta, Pekon wrote: > >>> >> spi->mode |= SPI_CS_HIGH; > >>> >> if (of_find_property(nc, "spi-3wire", NULL)) > >>> >> spi->mode |

RE: [PATCH] SPI: DUAL and QUAD support

2013-08-07 Thread Gupta, Pekon
> > Hello, > > diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h > > index 38c2b92..222e49e 100644 > > --- a/include/linux/spi/spi.h > > +++ b/include/linux/spi/spi.h > > @@ -437,6 +441,8 @@ extern struct spi_master > > *spi_busnum_to_master(u16 busnum); > > * @rx_buf: data to be re

Re: [PATCH] SPI: DUAL and QUAD support

2013-07-30 Thread yuhang wang
Hi,Trent Thanks for so many details. 2013/7/30 Trent Piepho : > On Mon, Jul 29, 2013 at 7:21 AM, Gupta, Pekon wrote: >>> >> spi->mode |= SPI_CS_HIGH; >>> >> if (of_find_property(nc, "spi-3wire", NULL)) >>> >> spi->mode |= SPI_3WIRE; >>> >>

Re: [PATCH] SPI: DUAL and QUAD support

2013-07-29 Thread yuhang wang
Hi, Yes, you are right. I will correct it. Thanks 2013/7/29 Matthieu CASTET : > Le Mon, 29 Jul 2013 15:25:51 +0100, > yuhang wang a écrit : > >> Hi, >> >> 2013/7/29 Matthieu CASTET : >> > Le Mon, 29 Jul 2013 11:53:14 +0100, >> > wangyuhang a écrit : >> > >> >> Hi, >> >> >> >> modify two things

Re: [PATCH] SPI: DUAL and QUAD support

2013-07-29 Thread Trent Piepho
On Mon, Jul 29, 2013 at 7:21 AM, Gupta, Pekon wrote: >> >> spi->mode |= SPI_CS_HIGH; >> >> if (of_find_property(nc, "spi-3wire", NULL)) >> >> spi->mode |= SPI_3WIRE; >> >> + if (of_find_property(nc, "spi-tx-dual", NULL)) >> >> +

Re: [PATCH] SPI: DUAL and QUAD support

2013-07-29 Thread Matthieu CASTET
Le Mon, 29 Jul 2013 15:25:51 +0100, yuhang wang a écrit : > Hi, > > 2013/7/29 Matthieu CASTET : > > Le Mon, 29 Jul 2013 11:53:14 +0100, > > wangyuhang a écrit : > > > >> Hi, > >> > >> modify two things. > >> 1: > >> >> @@ -1316,6 +1324,12 @@ int spi_setup(struct spi_device *spi) > >> >>

Re: [PATCH] SPI: DUAL and QUAD support

2013-07-29 Thread yuhang wang
Hi, Pekon 2013/7/29 Gupta, Pekon : > Hi Yuhang, > >> >> >> >> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c >> >> index 004b10f..3f6dc93 100644 >> >> --- a/drivers/spi/spi.c >> >> +++ b/drivers/spi/spi.c >> >> @@ -868,6 +868,14 @@ static void of_register_spi_devices(struct >> spi_master >> >>

Re: [PATCH] SPI: DUAL and QUAD support

2013-07-29 Thread yuhang wang
Hi, 2013/7/29 Matthieu CASTET : > Le Mon, 29 Jul 2013 11:53:14 +0100, > wangyuhang a écrit : > >> Hi, >> >> modify two things. >> 1: >> >> @@ -1316,6 +1324,12 @@ int spi_setup(struct spi_device *spi) >> >> /* help drivers fail *cleanly* when they need options >> >> * that aren't

RE: [PATCH] SPI: DUAL and QUAD support

2013-07-29 Thread Gupta, Pekon
Hi Yuhang, > >> > >> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c > >> index 004b10f..3f6dc93 100644 > >> --- a/drivers/spi/spi.c > >> +++ b/drivers/spi/spi.c > >> @@ -868,6 +868,14 @@ static void of_register_spi_devices(struct > spi_master > >> *master) > >> spi->mode

Re: [PATCH] SPI: DUAL and QUAD support

2013-07-29 Thread yuhang wang
Hi, Pekon 2013/7/29 Gupta, Pekon : > Hello, > >> >> Hi, >> >> modify two things. > Hope you are tracking the Patch versions ? Good to include it in > mail-subject. > Ok, got it. >> 1: >> >> @@ -1316,6 +1324,12 @@ int spi_setup(struct spi_device *spi) >> >> /* help drivers fail *cleanly*

Re: [PATCH] SPI: DUAL and QUAD support

2013-07-29 Thread Matthieu CASTET
Le Mon, 29 Jul 2013 11:53:14 +0100, wangyuhang a écrit : > Hi, > > modify two things. > 1: > >> @@ -1316,6 +1324,12 @@ int spi_setup(struct spi_device *spi) > >> /* help drivers fail *cleanly* when they need options > >> * that aren't supported with their current master > >>

RE: [PATCH] SPI: DUAL and QUAD support

2013-07-29 Thread Gupta, Pekon
Hello, > > Hi, > > modify two things. Hope you are tracking the Patch versions ? Good to include it in mail-subject. > 1: > >> @@ -1316,6 +1324,12 @@ int spi_setup(struct spi_device *spi) > >> /* help drivers fail *cleanly* when they need options > >> * that aren't supported w

[PATCH] SPI: DUAL and QUAD support

2013-07-29 Thread wangyuhang
Hi, modify two things. 1: >> @@ -1316,6 +1324,12 @@ int spi_setup(struct spi_device *spi) >> /* help drivers fail *cleanly* when they need options >> * that aren't supported with their current master >> */ >> + if (((spi->mode >> 8) & 0x03) == 0x03 || >> +