All of lore.kernel.org
 help / color / mirror / Atom feed
* Change MODE, CS, BUS, and SPEED using SPI-DEV driver?
@ 2010-10-01 17:40 Charles Martel
       [not found] ` <20101001175135.147160-KK0ffGbhmjU@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Martel @ 2010-10-01 17:40 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

I have built a linux kernel using only the "S3C6410 High Speed SPI Driver." Debug messages were enabled.
In the ./drivers/spi directory, the following were built: built-in.o hspi-s3c64xx.o spi-dev.o spi.o
When I open the driver from a user space application, the debug statements come from the SPI-DEV driver.
However, I don't see the IOCTL calls in spi-dev.c to change the MODE, CS, BUS, or SPEED. I also need to use two speeds, high and low.
The question I have is how do I modify these settings?
Thanks in advance.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: Change MODE, CS, BUS, and SPEED using SPI-DEV driver?
@ 2010-10-04 21:02 Charles Martel
       [not found] ` <20101004210503.147160-KK0ffGbhmjU@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Martel @ 2010-10-04 21:02 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

----- Original Message -----
From: David Brownell
Sent: 10/01/10 08:02 PM
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Charles Martel
Subject: Re: Change MODE, CS, BUS, and SPEED using SPI-DEV driver?

--- On Fri, 10/1/10, Charles Martel <SingerIsland-KK0ffGbhmjU@public.gmane.org> wrote: >> >> The question I have is how do I modify these settings? > Evidently you haven't yet looked at the > documentation. Try that. There's a sample > program which will be informative.

Thank you for your reply.

1) I have read numerous documents but don't see where they
explain what I need considering that only the following SPI driver
files are built:
 built-in.o, hspi-s3c64xx.o, spi.o, and spi-dev.o.

I had built a kernel for the s3c6410 using linux-2.6.24.
I noticed that there are drivers for the s3c24xx but only the
"S3C6410 High Speed SPI Driver" is specific to the s3c6410.
I do not believe that the the s3c24xx series drivers are
compatible with the s3c6410. Am I wrong?
The problem I am having would go away if I could use the
s3c24xx drivers since they result in the spidev.c file being
built.

2) The following all return 0 (debug message: "Invalid ioctl option"):
 ret = ioctl(fd, SPI_IOC_WR_MODE, &spiMode);
 ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bitsPerWord);
 ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &spiSpeed);
 These ioctl functions are supported by the spidev_ioctl function in spidev.c.
 However, as mentioned above, the "S3C6410 High Speed SPI Driver"
 does not build spidev.c.

 The same result happens when I use the following ioctl call:
 ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
 where tr structure (spi_ioc_transfer) contains the following:
 tr.tx_buf = txBuf;
 tr.rx_buf = rxBuf;
 tr.delay_usecs = delay;
 tr.speed_hz = speed;
 tr.bits_per_word = 8;
 tr.pad = 0;
 tr.cs_change = 0;

 This is what I expect since spi-dev.c does not handle these ioctl requests.
 The spidev_ioctl function in spi-dev.c only handles the following:
 SET_SPI_FLAGS, SET_SPI_RETRIES, and SET_SPI_TIMEOUT.

3) The following always succeeds:
 ret = write(fd, txBuf, xLen);
------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d

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

end of thread, other threads:[~2010-10-05  0:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-01 17:40 Change MODE, CS, BUS, and SPEED using SPI-DEV driver? Charles Martel
     [not found] ` <20101001175135.147160-KK0ffGbhmjU@public.gmane.org>
2010-10-02  0:02   ` David Brownell
  -- strict thread matches above, loose matches on Subject: below --
2010-10-04 21:02 Charles Martel
     [not found] ` <20101004210503.147160-KK0ffGbhmjU@public.gmane.org>
2010-10-05  0:54   ` Jassi Brar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.