From patchwork Tue Jan 19 20:24:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 43215 X-Patchwork-Delegate: grant.likely@secretlab.ca Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 56B68B8E49 for ; Wed, 20 Jan 2010 07:25:27 +1100 (EST) Received: by ozlabs.org (Postfix) id C0797B7DC8; Wed, 20 Jan 2010 07:24:23 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by ozlabs.org (Postfix) with ESMTP id 69E3CB7D43 for ; Wed, 20 Jan 2010 07:24:23 +1100 (EST) Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 3997F1C1531B; Tue, 19 Jan 2010 21:24:22 +0100 (CET) X-Auth-Info: 4UiphVdxPhoUojgTZGt7eF7PGp8P9cBJpUkWU+8ozUI= Received: from localhost (pD953D0E8.dip.t-dialin.net [217.83.208.232]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTP id F20F290136; Tue, 19 Jan 2010 21:24:21 +0100 (CET) From: Anatolij Gustschin To: linuxppc-dev@ozlabs.org Subject: [PATCH 04/11] i2c-mpc: Add MPC5121 I2C bus support Date: Tue, 19 Jan 2010 21:24:06 +0100 Message-Id: <1263932653-3634-5-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1263932653-3634-1-git-send-email-agust@denx.de> References: <1263932653-3634-1-git-send-email-agust@denx.de> Cc: wd@denx.de, dzu@denx.de, linux-i2c@vger.kernel.org, Anatolij Gustschin , Piotr Ziecik X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org From: Piotr Ziecik - Update Kconfig for i2c-mpc driver. - Enable I2C interrupts on MPC5121. Signed-off-by: Piotr Ziecik Signed-off-by: Wolfgang Denk Signed-off-by: Anatolij Gustschin Cc: Cc: Grant Likely Cc: John Rigby --- drivers/i2c/busses/Kconfig | 9 +++++---- drivers/i2c/busses/i2c-mpc.c | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 5f318ce..f481f30 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -418,13 +418,14 @@ config I2C_IXP2000 instead. config I2C_MPC - tristate "MPC107/824x/85xx/52xx/86xx" + tristate "MPC107/824x/85xx/512x/52xx/86xx" depends on PPC32 help If you say yes to this option, support will be included for the - built-in I2C interface on the MPC107/Tsi107/MPC8240/MPC8245 and - MPC85xx/MPC8641 family processors. The driver may also work on 52xx - family processors, though interrupts are known not to work. + built-in I2C interface on the MPC107/Tsi107/MPC8240/MPC8245, + MPC85xx/MPC8641 and MPC512x family processors. The driver may + also work on 52xx family processors, though interrupts are known + not to work. This driver can also be built as a module. If so, the module will be called i2c-mpc. diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index f627001..84eeb25 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -540,6 +540,29 @@ static int __devinit fsl_i2c_probe(struct of_device *op, } } + if (of_device_is_compatible(op->node, "fsl,mpc5121-i2c")) { + struct device_node *np; + void __iomem *i2cctl; + + /* Enable I2C interrupts */ + np = of_find_compatible_node(NULL, NULL, + "fsl,mpc5121-i2c-ctrl"); + if (np) { + i2cctl = of_iomap(np, 0); + if (i2cctl) { + /* + * Set interrupt enable bits: + * - I2C-0: bit 24, + * - I2C-1: bit 26, + * - I2C-2: bit 28. + */ + out_be32(i2cctl, 0x15000000); + iounmap(i2cctl); + } + of_node_put(np); + } + } + dev_set_drvdata(&op->dev, i2c); i2c->adap = mpc_ops;