lkml.org 
[lkml]   [2011]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/8] regmap: Add I2C bus support
    On 06/20/2011 02:54 PM, Mark Brown wrote:
    > [...]
    > +
    > +#include <linux/regmap.h>
    > +#include <linux/i2c.h>

    #include <linux/init.h>

    > [...]
    > +
    > +static int regmap_i2c_read(struct device *dev,
    > + const void *reg, size_t reg_size,
    > + void *val, size_t val_size)
    > +{
    > + struct i2c_client *i2c = to_i2c_client(dev);
    > + struct i2c_msg xfer[2];
    > + int ret;
    > +
    > + if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_PROTOCOL_MANGLING))
    > + return -ENOTSUPP;

    You shouldn't need I2C_FUNC_PROTOCOL_MANGLING for reading.

    > [...]
    > diff --git a/drivers/regmap/regmap.c b/drivers/regmap/regmap.c
    > index a8610c7..896b710 100644
    > --- a/drivers/regmap/regmap.c
    > +++ b/drivers/regmap/regmap.c
    > @@ -461,7 +461,7 @@ out:
    > [...]

    I guess this should be part of the first patch.




    \
     
     \ /
      Last update: 2011-06-21 01:27    [W:0.050 / U:0.132 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site