From patchwork Mon Sep 30 14:15:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 279166 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 C8F662C008C for ; Tue, 1 Oct 2013 00:16:06 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754813Ab3I3OP2 (ORCPT ); Mon, 30 Sep 2013 10:15:28 -0400 Received: from mail-ea0-f182.google.com ([209.85.215.182]:53012 "EHLO mail-ea0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754512Ab3I3OP2 (ORCPT ); Mon, 30 Sep 2013 10:15:28 -0400 Received: by mail-ea0-f182.google.com with SMTP id o10so2725942eaj.13 for ; Mon, 30 Sep 2013 07:15:27 -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=WNogGTIFma/kgQOP0raARuJoGLbRSIq0rERsiv0GWT4=; b=klyxl+FSp3/Fv4Sq439zVo/ELQzrE3VrtRRmpQAmL1hHbqqFXpJ8B4fVVuHXO8mtLA zpfnHgqoLbZvR7/ZF3tIjVklpvt7AqcDCjGMPbdsmeILk0bQYUK7rEfv+iq58mrWcveA yH1HGjoM+M7wyJeRFP+m9PenJ04aEfu7q6OHRNBBZAuIR6qyziDbn3YrYqmpxlq3GeXx 09bRcsXfgJiLArY69bincegWeXdn3Th1EU4RiGTdrVGJ5fl2gInsWxjTP7vV0o0fvGwv SRMpf0HYNMGcYYsy3GlrwsSA2KWPZ8D/sz8a5VEUXk7U1i6OtSPmH3SKa8GKfvaNpQ7H jyUg== X-Gm-Message-State: ALoCoQnn4NAjcmXXWSuM6IsZiMUsLnUeEEh1fs8hyZDKt5UOuqkxvJI5PsptUTJQ4Mc1TpIvxk91 X-Received: by 10.14.107.68 with SMTP id n44mr38111959eeg.26.1380550526943; Mon, 30 Sep 2013 07:15:26 -0700 (PDT) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id b45sm1670237eef.4.1969.12.31.16.00.00 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 30 Sep 2013 07:15:26 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, wsa@the-dreams.de Cc: Kedareswara rao Appana , Kedareswara rao Appana , Jean Delvare , Peter Korsgaard , linux-i2c@vger.kernel.org Subject: [PATCH v2 2/3] i2c: xilinx: Set tx direction in write operation Date: Mon, 30 Sep 2013 16:15:14 +0200 Message-Id: <57a4f5352ce6f03bde7aafe8b880f91b52994379.1380550490.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 The patch fixes the problem with i2c eeprom memories where controller is not properly setup to transmit mode. This problem is fixed 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 --- Changes in v2: - Extend patch description as Wolfram asked for. 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. */