[PATCH 5/6] i2c-davinci: if device has pfunc register, dump that group also

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the platform has indicated that this I2c controller has the ICPFUNC
regsiters then also dump their contents when producing a debug register dump.

Signed-off-by: Ben Gardiner <bengardiner@xxxxxxxxxxxxxx>
Cc: Bastian Ruppert <Bastian.Ruppert@xxxxxxxxxx>
Cc: Brad Griffis <bgriffis@xxxxxx>
Cc: Sekhar Nori <nsekhar@xxxxxx>
Cc: Ben Dooks <ben-linux@xxxxxxxxx>

---
 drivers/i2c/busses/i2c-davinci.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 5bdc98c..a084e50 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -164,6 +164,8 @@ static inline u16 davinci_i2c_read_reg(struct davinci_i2c_dev *i2c_dev, int reg)
 
 static void i2c_davinci_dump_regs(struct davinci_i2c_dev *dev)
 {
+	struct davinci_i2c_platform_data *pdata = dev->dev->platform_data;
+
 	dev_dbg(dev->dev, "PSC  = %08x\n",
 		davinci_i2c_read_reg(dev, DAVINCI_I2C_PSC_REG));
 	dev_dbg(dev->dev, "CLKL = %08x\n",
@@ -191,6 +193,19 @@ static void i2c_davinci_dump_regs(struct davinci_i2c_dev *dev)
 		davinci_i2c_read_reg(dev, DAVINCI_I2C_IVR_REG));
 	dev_dbg(dev->dev, "EMDR = %08x\n",
 		davinci_i2c_read_reg(dev, DAVINCI_I2C_EMDR_REG));
+
+	if (pdata->has_pfunc) {
+		dev_dbg(dev->dev, "PFUNC = %08x\n",
+			davinci_i2c_read_reg(dev, DAVINCI_I2C_PFUNC_REG));
+		dev_dbg(dev->dev, "PDIR = %08x\n",
+			davinci_i2c_read_reg(dev, DAVINCI_I2C_PDIR_REG));
+		dev_dbg(dev->dev, "PDIN = %08x\n",
+			davinci_i2c_read_reg(dev, DAVINCI_I2C_PDIN_REG));
+		dev_dbg(dev->dev, "DSET = %08x\n",
+			davinci_i2c_read_reg(dev, DAVINCI_I2C_DSET_REG));
+		dev_dbg(dev->dev, "DCLR = %08x\n",
+			davinci_i2c_read_reg(dev, DAVINCI_I2C_DCLR_REG));
+	}
 }
 
 /* Generate a pulse on the i2c clock pin. */
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux