* PGP Signed by an unknown key
On Sat, Aug 18, 2012 at 12:32:34AM +0530, Laxman Dewangan wrote:+ bool has_continue_xfer_support;I wonder if it makes sense to carry a pointer here to the
tegra_i2c_hw_feature in use instead of copying all entries by hand,
since they might get more and more.
};Drivers are requested to explicitly check for features of the I2C bus
static void dvc_writel(struct tegra_i2c_dev *i2c_dev, u32 val, unsigned long reg)
@@ -563,7 +574,17 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
if (i2c_dev->is_suspended)
return -EBUSY;
- clk_prepare_enable(i2c_dev->div_clk);
+ /* Support I2C_M_NOSTART only if HW support continue xfer. */
+ for (i = 0; i< num - 1; i++) {
+ if ((msgs[i + 1].flags& I2C_M_NOSTART)&&
+ !i2c_dev->has_continue_xfer_support) {
+ dev_err(i2c_dev->dev,
+ "mesg %d have illegal flag\n", i + 1);
+ return -EINVAL;
+ }
+ }
(like M_NOSTART) before using them, so I'd skip this extra check.
+From a glimpse, this change looks unrelated at least. Even wrong, no?
+ clk_prepare_enable(i2c_dev->clk);