Re: [RFC 01/11] i2c: add quirk structure to describe adapter flaws

2015-02-24 Thread Wolfram Sang
On Mon, Jan 19, 2015 at 04:05:15PM +0100, Wolfram Sang wrote: > > > > + struct i2c_adapter_quirks *quirks; > > > }; > > > #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) > > > > > > > I suggest to add const. > > const struct i2c_adapter_quirks *quirks; > > > > also, in

Re: [RFC 01/11] i2c: add quirk structure to describe adapter flaws

2015-01-19 Thread Wolfram Sang
> > + struct i2c_adapter_quirks *quirks; > > }; > > #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) > > > > I suggest to add const. > const struct i2c_adapter_quirks *quirks; > > also, in i2c-core.c, should modify: > const struct i2c_adapter_quirks *q = adap-

Re: [RFC 01/11] i2c: add quirk structure to describe adapter flaws

2015-01-19 Thread Wolfram Sang
Hi, > This can describe the behavior of our current upstream driver[1], which > only support combine write-then-read. > > After checking with Xudong & HW guys, it seems our HW can do more. > On MT8135, it can support at most 2 messages, no matter read or write, > with the limitation that the len

Re: [RFC 01/11] i2c: add quirk structure to describe adapter flaws

2015-01-16 Thread Yingjoe Chen
On Fri, 2015-01-09 at 18:21 +0100, Wolfram Sang wrote: > The number of I2C adapters which are not fully I2C compatible is rising, > sadly. Drivers usually do handle the flaws, still the user receives only > some errno for a transfer which normally can be expected to work. This > patch introduces a

Re: [RFC 01/11] i2c: add quirk structure to describe adapter flaws

2015-01-15 Thread Eddie Huang
Hi Wolfram, On Fri, 2015-01-09 at 18:21 +0100, Wolfram Sang wrote: > > + */ > +struct i2c_adapter_quirks { > + u64 flags; > + int max_num_msgs; > + u16 max_write_len; > + u16 max_read_len; > + u16 max_comb_write_len; > + u16 max_comb_read_len; > +}; > + > +#define I2C_ADA