linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Tom <tom.spi.devel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org"
	<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	alan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
Subject: Re: MRST SPI
Date: Mon, 14 Feb 2011 09:05:43 +0800	[thread overview]
Message-ID: <20110214090543.63312e78@feng-i7> (raw)
In-Reply-To: <AANLkTin60qjesNcaPRiDftt8s83i7JTRkB7zbt1pW31--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Tom,

On Thu, 10 Feb 2011 18:48:00 +0800
Tom <tom.spi.devel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

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

The DW spi controller has a slave select register for that purpose, and
myself don't have experience of using an external GPIO lines for SS, so
no comment here.

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

Suggest you refer the arch/platform/mrst/mrst.c about setting up
the max3110 spi device's platform and controller data, you can 
find it in Alan Cox's MID reference tree:

git://git.kernel.org/pub/scm/linux/kernel/git/alan/linux-2.6-mid-ref.git 

Thanks,
Feng

> 
> Regards,
> Tom

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

      parent reply	other threads:[~2011-02-14  1:05 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   ` MRST SPI Tom
     [not found]     ` <AANLkTin60qjesNcaPRiDftt8s83i7JTRkB7zbt1pW31--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-10 10:50       ` Tom
2011-02-14  1:05       ` Feng Tang [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=20110214090543.63312e78@feng-i7 \
    --to=feng.tang-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=alan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=tom.spi.devel-Re5JQEeQqe8AvxtiuMwx3w@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).