Re: [RFC] regmap: Add regmap_field APIs

2013-06-10 Thread Srinivas KANDAGATLA
On 10/06/13 10:15, Mark Brown wrote: > On Sun, Jun 09, 2013 at 06:00:19PM +0200, Lars-Peter Clausen wrote: > >>> +int regmap_field_write(struct regmap_field *field, unsigned int val) >>> +{ >>> + int field_bits; >>> + unsigned int reg_mask; >>> + field_bits = field->msb - field->lsb + 1; >>>

Re: [RFC] regmap: Add regmap_field APIs

2013-06-10 Thread Mark Brown
On Sun, Jun 09, 2013 at 06:00:19PM +0200, Lars-Peter Clausen wrote: > > +int regmap_field_write(struct regmap_field *field, unsigned int val) > > +{ > > + int field_bits; > > + unsigned int reg_mask; > > + field_bits = field->msb - field->lsb + 1; > > + reg_mask = ((BIT(field_bits) - 1) <<

Re: [RFC] regmap: Add regmap_field APIs

2013-06-10 Thread Srinivas KANDAGATLA
On 09/06/13 17:00, Lars-Peter Clausen wrote: > [...] >> +int regmap_field_write(struct regmap_field *field, unsigned int val) >> +{ >> +int field_bits; >> +unsigned int reg_mask; >> +field_bits = field->msb - field->lsb + 1; >> +reg_mask = ((BIT(field_bits) - 1) << field->lsb); >> +

Re: [RFC] regmap: Add regmap_field APIs

2013-06-09 Thread Lars-Peter Clausen
[...] > +int regmap_field_write(struct regmap_field *field, unsigned int val) > +{ > + int field_bits; > + unsigned int reg_mask; > + field_bits = field->msb - field->lsb + 1; > + reg_mask = ((BIT(field_bits) - 1) << field->lsb); > + return regmap_update_bits(field->regmap, fiel

Re: [RFC] regmap: Add regmap_field APIs

2013-06-05 Thread Mark Brown
On Wed, Jun 05, 2013 at 03:41:29PM +0100, Srinivas KANDAGATLA wrote: > Is it Ok If I send this patch with my "STiH41x SOC support series", as > we can see the actual usage of this new apis in the follow on patches? Yes. signature.asc Description: Digital signature

Re: [RFC] regmap: Add regmap_field APIs

2013-06-05 Thread Srinivas KANDAGATLA
Thankyou for reviewing the patch. On 05/06/13 12:41, Mark Brown wrote: > On Wed, Jun 05, 2013 at 10:21:23AM +0100, Srinivas KANDAGATLA wrote: > I think I'd prefer to see a struct passed in here for the field > definition - this would make it easier to initialise from static data, > otherwise people

Re: [RFC] regmap: Add regmap_field APIs

2013-06-05 Thread Mark Brown
On Wed, Jun 05, 2013 at 10:21:23AM +0100, Srinivas KANDAGATLA wrote: > Is it ok if we rename the regmap_field_init function to > regmap_field_alloc, as it will make it obvious that its allocating > memory which should be freed? > I also thought we could add devm version of it as well. Yes, that's

Re: [RFC] regmap: Add regmap_field APIs

2013-06-05 Thread Srinivas KANDAGATLA
On 04/06/13 22:01, Mark Brown wrote: > On Tue, May 28, 2013 at 03:58:00PM +0100, Srinivas KANDAGATLA wrote: > >> +#define REGMAP_FIELD_INIT(regmap, reg, lsb, msb) { \ >> +.regmap = regmap, \ >> +.reg = reg, \ >> +

Re: [RFC] regmap: Add regmap_field APIs

2013-06-04 Thread Mark Brown
On Tue, May 28, 2013 at 03:58:00PM +0100, Srinivas KANDAGATLA wrote: > +#define REGMAP_FIELD_INIT(regmap, reg, lsb, msb) { \ > + .regmap = regmap, \ > + .reg = reg, \ > + .lsb = lsb,

Re: [RFC] regmap: Add regmap_field APIs

2013-06-01 Thread Mark Brown
On Fri, May 31, 2013 at 07:31:48AM +0100, Srinivas KANDAGATLA wrote: > We have pretty much completed reworking the patch-set we sent recently > for the STiH41x SOC support. We are waiting for your feedback on this patch. Don't top post and don't send contentless pings; you should generally allow

Re: [RFC] regmap: Add regmap_field APIs

2013-05-30 Thread Srinivas KANDAGATLA
Hi Mark, We have pretty much completed reworking the patch-set we sent recently for the STiH41x SOC support. We are waiting for your feedback on this patch. Thanks, srini On 28/05/13 15:58, Srinivas KANDAGATLA wrote: > From: Srinivas Kandagatla > > It is common to access regmap registers at bi

[RFC] regmap: Add regmap_field APIs

2013-05-28 Thread Srinivas KANDAGATLA
From: Srinivas Kandagatla It is common to access regmap registers at bit level, using regmap_update_bits or regmap_read functions, however the end user has to take care of a mask or shifting. This becomes overhead when such use cases are high. Having a common function to do this is much convient