aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2015-01-07 06:24:10 -0500
committerWolfram Sang <wsa@the-dreams.de>2015-03-13 10:10:57 -0400
commitf2325c54f362ffa1e2e3254bcb70d6d4da49a17a (patch)
tree0967c8fcc3a1130a49fda32d3a388a76bbd588bb /drivers/i2c/busses
parent7ee405ea068602d1fd42bf14ddc04d45733cfd7d (diff)
i2c: viperboard: make use of the new infrastructure for quirks
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-viperboard.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-viperboard.c b/drivers/i2c/busses/i2c-viperboard.c
index 7533fa34d737..47e88adf2011 100644
--- a/drivers/i2c/busses/i2c-viperboard.c
+++ b/drivers/i2c/busses/i2c-viperboard.c
@@ -288,10 +288,6 @@ static int vprbrd_i2c_xfer(struct i2c_adapter *i2c, struct i2c_msg *msgs,
288 i, pmsg->flags & I2C_M_RD ? "read" : "write", 288 i, pmsg->flags & I2C_M_RD ? "read" : "write",
289 pmsg->flags, pmsg->len, pmsg->addr); 289 pmsg->flags, pmsg->len, pmsg->addr);
290 290
291 /* msgs longer than 2048 bytes are not supported by adapter */
292 if (pmsg->len > 2048)
293 return -EINVAL;
294
295 mutex_lock(&vb->lock); 291 mutex_lock(&vb->lock);
296 /* directly send the message */ 292 /* directly send the message */
297 if (pmsg->flags & I2C_M_RD) { 293 if (pmsg->flags & I2C_M_RD) {
@@ -358,6 +354,11 @@ static const struct i2c_algorithm vprbrd_algorithm = {
358 .functionality = vprbrd_i2c_func, 354 .functionality = vprbrd_i2c_func,
359}; 355};
360 356
357static struct i2c_adapter_quirks vprbrd_quirks = {
358 .max_read_len = 2048,
359 .max_write_len = 2048,
360};
361
361static int vprbrd_i2c_probe(struct platform_device *pdev) 362static int vprbrd_i2c_probe(struct platform_device *pdev)
362{ 363{
363 struct vprbrd *vb = dev_get_drvdata(pdev->dev.parent); 364 struct vprbrd *vb = dev_get_drvdata(pdev->dev.parent);
@@ -373,6 +374,7 @@ static int vprbrd_i2c_probe(struct platform_device *pdev)
373 vb_i2c->i2c.owner = THIS_MODULE; 374 vb_i2c->i2c.owner = THIS_MODULE;
374 vb_i2c->i2c.class = I2C_CLASS_HWMON; 375 vb_i2c->i2c.class = I2C_CLASS_HWMON;
375 vb_i2c->i2c.algo = &vprbrd_algorithm; 376 vb_i2c->i2c.algo = &vprbrd_algorithm;
377 vb_i2c->i2c.quirks = &vprbrd_quirks;
376 vb_i2c->i2c.algo_data = vb; 378 vb_i2c->i2c.algo_data = vb;
377 /* save the param in usb capabable memory */ 379 /* save the param in usb capabable memory */
378 vb_i2c->bus_freq_param = i2c_bus_param; 380 vb_i2c->bus_freq_param = i2c_bus_param;