From patchwork Thu Jan 21 09:26:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pietrek, Markus" X-Patchwork-Id: 74303 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0L9QdpI001753 for ; Thu, 21 Jan 2010 09:26:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754912Ab0AUJ0i (ORCPT ); Thu, 21 Jan 2010 04:26:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754932Ab0AUJ0i (ORCPT ); Thu, 21 Jan 2010 04:26:38 -0500 Received: from mail3.emtrion.de ([80.150.99.69]:40976 "EHLO mail3.emtrion.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754912Ab0AUJ0g convert rfc822-to-8bit (ORCPT ); Thu, 21 Jan 2010 04:26:36 -0500 Received: from BMK019S01.emtrion.local ([fe80::4a1:cedc:cab6:e9ce]) by BMK019S01.emtrion.local ([fe80::4a1:cedc:cab6:e9ce%10]) with mapi; Thu, 21 Jan 2010 10:26:30 +0100 From: "Pietrek, Markus" To: "linux-sh@vger.kernel.org" Date: Thu, 21 Jan 2010 10:26:27 +0100 Subject: [PATCH] spi_sh_msiof: Fixed data sampling on the correct edge Thread-Topic: [PATCH] spi_sh_msiof: Fixed data sampling on the correct edge Thread-Index: Acqae87qPrkZ8yMgTLamHa6PChyh4Q== Message-ID: <95F51F4B902CAC40AF459205F6322F0171E8D4959B@BMK019S01.emtrion.local> Accept-Language: de-DE Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE x-tm-as-product-ver: SMEX-8.0.0.1307-6.000.1038-17144.004 x-tm-as-result: No--34.579400-8.000000-31 x-tm-as-user-approved-sender: No x-tm-as-user-blocked-sender: No MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org diff --git a/drivers/spi/spi_sh_msiof.c b/drivers/spi/spi_sh_msiof.c index 51e5e1d..a9fec2f 100644 --- a/drivers/spi/spi_sh_msiof.c +++ b/drivers/spi/spi_sh_msiof.c @@ -173,13 +173,11 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p, int edge; /* - * CPOL CPHA TSCKIZ RSCKIZ TEDG REDG(!) - * 0 0 10 10 1 0 - * 0 1 10 10 0 1 - * 1 0 11 11 0 1 - * 1 1 11 11 1 0 - * - * (!) Note: REDG is inverted recommended data sheet setting + * CPOL CPHA TSCKIZ RSCKIZ TEDG REDG + * 0 0 10 10 1 1 + * 0 1 10 10 0 0 + * 1 0 11 11 0 0 + * 1 1 11 11 1 1 */ sh_msiof_write(p, FCTR, 0); @@ -193,7 +191,7 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p, edge = cpol ? cpha : !cpha; tmp |= edge << 27; /* TEDG */ - tmp |= !edge << 26; /* REDG */ + tmp |= edge << 26; /* REDG */ tmp |= (tx_hi_z ? 2 : 0) << 22; /* TXDIZ */ sh_msiof_write(p, CTR, tmp); } @@ -280,6 +278,9 @@ static void sh_msiof_spi_read_fifo_8(struct sh_msiof_spi_priv *p, for (k = 0; k < words; k++) buf_8[k] = sh_msiof_read(p, RFDR) >> fs; + + for (k = 0; k < words; k++) + pr_err(" %02x\n", buf_8[k]); } static void sh_msiof_spi_read_fifo_16(struct sh_msiof_spi_priv *p,