From patchwork Wed Aug 11 10:08:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vishwanath.K" X-Patchwork-Id: 118801 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7BAYqRc006607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 11 Aug 2010 10:35:28 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o7BAWk72019367 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Aug 2010 05:32:46 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o7BAWjci029066; Wed, 11 Aug 2010 05:32:46 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 63D9B80627; Wed, 11 Aug 2010 05:32:45 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id B6BA780626 for ; Wed, 11 Aug 2010 05:32:43 -0500 (CDT) Received: from tidmzi-ftp.india.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with SMTP id o7BAWfv4011302; Wed, 11 Aug 2010 05:32:42 -0500 (CDT) Received: from symphonyindia.ti.com (symphony-ftp [192.168.247.11]) by tidmzi-ftp.india.ext.ti.com (Postfix) with SMTP id 315273887C; Wed, 11 Aug 2010 16:02:41 +0530 (IST) Received: from localhost.localdomain ([192.168.247.76]) by symphonyindia.ti.com (8.13.1/8.12.10) with ESMTP id o7BANqRV025119; Wed, 11 Aug 2010 15:53:52 +0530 From: vishwa To: linux-i2c@vger.kernel.org Subject: [PATCH v2] davinci: I2C: Adding bus frequency as module parameter Date: Wed, 11 Aug 2010 15:38:33 +0530 Message-Id: <1281521313-4556-1-git-send-email-vishwanath.k@ti.com> X-Mailer: git-send-email 1.5.6 Cc: davinci-linux-open-source@linux.davincidsp.com X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 11 Aug 2010 10:35:28 +0000 (UTC) diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 2222c87..8fbfaa2 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -98,6 +98,10 @@ #define DAVINCI_I2C_IMR_NACK BIT(1) #define DAVINCI_I2C_IMR_AL BIT(0) +static int i2c_davinci_busfreq; +module_param(i2c_davinci_busfreq, int, 0); +MODULE_PARM_DESC(i2c_davinci_busfreq, "bus frequency"); + struct davinci_i2c_dev { struct device *dev; void __iomem *base; @@ -243,6 +247,9 @@ static int i2c_davinci_init(struct davinci_i2c_dev *dev) /* put I2C into reset */ davinci_i2c_reset_ctrl(dev, 0); + if (i2c_davinci_busfreq != 0) + pdata->bus_freq = i2c_davinci_busfreq; + /* compute clock dividers */ i2c_davinci_calc_clk_dividers(dev);