From patchwork Mon Sep 30 09:08:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 278970 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 02C9C2C009F for ; Mon, 30 Sep 2013 19:09:37 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753955Ab3I3JJf (ORCPT ); Mon, 30 Sep 2013 05:09:35 -0400 Received: from mail-ee0-f54.google.com ([74.125.83.54]:53251 "EHLO mail-ee0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754448Ab3I3JJI (ORCPT ); Mon, 30 Sep 2013 05:09:08 -0400 Received: by mail-ee0-f54.google.com with SMTP id e53so2496563eek.41 for ; Mon, 30 Sep 2013 02:09:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:content-type; bh=PD/89uQsjk/SDn4dOE9v5Gx50LWFofB0eCZ9Q9hwV9I=; b=lH3ETF0KfCdj+N5TiBtRqJJt6agZJKHMkDlobNfRF9X+89BeqNPesqODLc0rURwuy0 3nmFzRaSa/XrbCFpejcdaDnzxv5ziD6DZ3DZD3imaODVyfARSlM3pfCoTcIj8S0CsSau kx3WmOmGL+cVeCARLPbmA0/xHiSV6UmSUZQbSi681H672Uxxc6QP0b7sl2OUV3O9X5w6 tapmWTu352uCjKswgeVuEwYhNT/5JjCHvhMWxWDicIGMOgihRSUcrVSC4FJmXC8KkrJJ MUDrUVa+9SZvKmb1JYJkA01EO5DwMgH/dKuPbj06xdXMWEIHDNRydh6RSEzcVUAbg3eD 9FvA== X-Gm-Message-State: ALoCoQkmEb5rfv+iZKu9d4xZ+oUYA8yUhZmo1AoZuIT96kOOgbBKp+tBvhvJQokkq78miorWi74d X-Received: by 10.15.51.74 with SMTP id m50mr2022331eew.58.1380532147154; Mon, 30 Sep 2013 02:09:07 -0700 (PDT) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id v8sm48772748eeo.12.1969.12.31.16.00.00 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 30 Sep 2013 02:09:06 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Cc: Kedareswara rao Appana , Wolfram Sang , Kedareswara rao Appana , Jean Delvare , Peter Korsgaard , linux-i2c@vger.kernel.org Subject: [PATCH 2/3] i2c: xilinx: Set tx direction in write operation Date: Mon, 30 Sep 2013 11:08:51 +0200 Message-Id: <5d234cfc8d23cfc7e8d750f103344cf4e8e398d4.1380532113.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Kedareswara rao Appana In write operation, after filling address byte to tx fifo, set the direction of transfer to tx using control register. Signed-off-by: Kedareswara rao Appana Signed-off-by: Michal Simek --- drivers/i2c/busses/i2c-xiic.c | 5 +++++ 1 file changed, 5 insertions(+) -- 1.8.2.3 diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 5eb0a8b..44e6ae7 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -536,6 +536,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c) static void xiic_start_send(struct xiic_i2c *i2c) { struct i2c_msg *msg = i2c->tx_msg; + u32 cr; xiic_irq_clr(i2c, XIIC_INTR_TX_ERROR_MASK); @@ -556,6 +557,10 @@ static void xiic_start_send(struct xiic_i2c *i2c) xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, data); } + cr = xiic_getreg32(i2c, XIIC_CR_REG_OFFSET); + cr |= XIIC_CR_DIR_IS_TX_MASK; + xiic_setreg32(i2c, XIIC_CR_REG_OFFSET, cr); + xiic_fill_tx_fifo(i2c); /* Clear any pending Tx empty, Tx Error and then enable them. */