linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom <tom.spi.devel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: MRST SPI
Date: Thu, 10 Feb 2011 16:18:00 +0530	[thread overview]
Message-ID: <AANLkTin60qjesNcaPRiDftt8s83i7JTRkB7zbt1pW31-@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimry3-NehWrundOuB_PWb420yOdrD1APaMXYkr6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1718 bytes --]

Hi All,

I have a SPI device problem on MRST CDK.

I use a GPIO as SS because my slave device expects the SS to be low between
byte transfers.
My probe function does a read as:

int read_val;
-------
---
read_val = spi_w8r8(&spi_dev,0x20);
 if ( read_val < 0 )
printk ( "spi_read err\n");
else
 printk ( "spi_read %d\n",read_val );
----
--

The MRST SFI interface passes the device board info. Because, my device is
not listed in the IA32 f/w I modified the MRST.c code sfi_handle_spi_dev
function as:

while(dev->name[0])
{
                if (dev->type == SFI_DEV_TYPE_SPI &&
                                !strncmp(dev->name, spi_info->modalias, 16))
{
                        if (!strncmp("spi_old_device", spi_info->modalias,
16)){
                                strncpy (spi_info->modalias,
"spi_my_dev",16);
                                pdata = dev->get_platform_data(spi_info);
                                pr_info ( "spi_old_device modalias to
spi_my_dev ");
                        }
                       else
                       {
                             pdata = dev->get_platform_data(spi_info);
                       }
                      break;
                }
          dev++;
}

i also modified the devs_id array to change the platform_data

 {"spi_old_dev", SFI_DEV_TYPE_SPI, 0, &no_platform_data}

The issue is  that for the spi_w8r8 call, i get multiple read (multiple * (8
clock cycles/SS toggle))on the SPI bus.

Also regarding the spi->irq, is it the responsibility of the protocol driver
to register for this irq and handle it or does the spi framework or master
driver take care of this ?

Any pointers would be really helpful. ( attached is the test code)

Regards,
Tom

[-- Attachment #2: Type: text/plain, Size: 387 bytes --]

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb

[-- Attachment #3: Type: text/plain, Size: 210 bytes --]

_______________________________________________
spi-devel-general mailing list
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

       reply	other threads:[~2011-02-10 10:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTimry3-NehWrundOuB_PWb420yOdrD1APaMXYkr6@mail.gmail.com>
     [not found] ` <AANLkTimry3-NehWrundOuB_PWb420yOdrD1APaMXYkr6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-10 10:48   ` Tom [this message]
     [not found]     ` <AANLkTin60qjesNcaPRiDftt8s83i7JTRkB7zbt1pW31--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-10 10:50       ` MRST SPI Tom
2011-02-14  1:05       ` Feng Tang

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=AANLkTin60qjesNcaPRiDftt8s83i7JTRkB7zbt1pW31-@mail.gmail.com \
    --to=tom.spi.devel-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).