All of lore.kernel.org
 help / color / mirror / Atom feed
From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: SPI trouble on Colibri 270 (PXA)...
Date: Wed, 21 Apr 2010 11:44:41 +0200	[thread overview]
Message-ID: <201004211144.41781.marek.vasut@gmail.com> (raw)
In-Reply-To: <4BCDC645.5090001@viketoft.se>

Dne ?t 20. dubna 2010 17:20:37 Jakob Viketoft napsal(a):
> Eric Miao wrote:
> > On Tue, Apr 20, 2010 at 7:58 PM, Jakob Viketoft <jakob@viketoft.se> wrote:
> <...>
> 
> >> I haven't seen any other board using the same combination (the m25p80
> >> and the pxa2xx), but I'm still opting for an error on my part
> >> somewhere. I've attached my SPI configuration (board setup) in the end
> >> of the mail.
> > 
> > Not looked into m25p80 code, but CS is normally asserted before a
> > transfer begins and deasserted after a transfer is done. I doubt there
> > are some cases where the transfer is not set up correctly.
> 
> Well, in this case when doing a read you must set up a write transfer to
> write the read command + address and then a read transfer to actually
> read back the data. In this case the cs musn't be deasserted between
> transfers because this means the operation is terminated.
> 
> > Actually, cs_assert() and cs_deassert() are there in pxa2xx_spi.c as two
> > very good debugging point to print out the transfer information to see
> > if they are setup correctly.
> 
> When I look at how these two are used I get a an serie of assert,
> assert, deassert for each read operation (which should be correct
> behaviour). This suggests that something else is deasserting the cs or
> that the CPU is doing something on it's own accord. Hmmm...
> 
> Regards,
> 
> 	/Jakob
> 

You can try using gpio-spi driver as used in palmz72.c ... I had issues with 
pxa2xx-spi interfacing the OV96xx camera, but it worked well for me with gpio-
spi.

Looking at it now, it seems the patch was never merged, here's a shortened 
version, try something similar:

>From 777212ce6d3bacea76281aa3d74839a3c38b32a4 Mon Sep 17 00:00:00 2001
From: Marek Vasut <marek.vasut@gmail.com>
Date: Sat, 22 Aug 2009 05:15:10 +0200
Subject: [PATCH 3/3] PalmZ72: Add support for OV9640 camera sensor

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/include/mach/palmz72.h |    5 +
 arch/arm/mach-pxa/palmz72.c              |  126 
+++++++++++++++++++++++++++++-
 2 files changed, 130 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index c3645aa..e4449ad 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -30,6 +30,7 @@
 #include <linux/wm97xx_batt.h>
 #include <linux/power_supply.h>
 #include <linux/usb/gpio_vbus.h>
+#include <linux/i2c-gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -120,6 +123,28 @@ static unsigned long palmz72_pin_config[] __initdata = {
        GPIO22_GPIO,    /* LCD border color */
        GPIO96_GPIO,    /* lcd power */

+       /* I2C */
+       GPIO117_GPIO,   /* I2C_SCL */
+       GPIO118_GPIO,   /* I2C_SDA */

+static struct i2c_gpio_platform_data palmz72_i2c_bus_data = {
+       .sda_pin = 118,
+       .scl_pin = 117,
+       .udelay  = 10,
+       .timeout = 100,
+};
+
+static struct platform_device palmz72_i2c_bus_device = {
+       .name           = "i2c-gpio",
+       .id             = 0, /* we use this as a replacement for i2c-pxa */
+       .dev = {
+               .platform_data = &palmz72_i2c_bus_data,
+       }
+};

 #ifdef CONFIG_PM
 
 /* We have some black magic here
@@ -576,6 +665,8 @@ static struct platform_device *devices[] __initdata = {
        &palmz72_asoc,
        &power_supply,
        &palmz72_gpio_vbus,
+       &palmz72_i2c_bus_device,
 };
 

  reply	other threads:[~2010-04-21  9:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20 11:58 SPI trouble on Colibri 270 (PXA) Jakob Viketoft
2010-04-20 13:14 ` Eric Miao
2010-04-20 15:20   ` Jakob Viketoft
2010-04-21  9:44     ` Marek Vasut [this message]
2010-04-21 10:47       ` Eric Miao
2010-04-21 11:11         ` Martin Guy
2010-04-21 11:42           ` Eric Miao
2010-04-21 11:49             ` Martin Guy
2010-04-21 12:47           ` Jakob Viketoft
2010-04-21 14:53             ` Martin Guy
     [not found]             ` <g2xf17812d71004210607n4f3d82f2m4712d3bb97ef4924@mail.gmail.com>
2010-04-22 14:36               ` Jakob Viketoft
2010-04-23 16:55                 ` Vernon Sauder
2010-04-23 19:57                   ` Jakob Viketoft
2010-04-23 23:40                     ` Eric Miao
2010-04-21 12:12         ` Marek Vasut

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=201004211144.41781.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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 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.