diff mbox

[v2] davinci: I2C: Adding bus frequency as module parameter

Message ID 1281521313-4556-1-git-send-email-vishwanath.k@ti.com (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Vishwanath.K Aug. 11, 2010, 10:08 a.m. UTC
None
diff mbox

Patch

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);