Re: [PATCH] regmap: Allow read_reg_mask to be 0

2014-10-01 Thread Lars-Peter Clausen
On 10/01/2014 01:39 PM, Dan Murphy wrote: Lars On 09/30/2014 04:29 PM, Lars-Peter Clausen wrote: On 09/30/2014 11:18 PM, Dan Murphy wrote: Lars On 09/30/2014 04:03 PM, Lars-Peter Clausen wrote: On 09/30/2014 06:07 PM, Dan Murphy wrote: There may be spi devices that do not require a register

Re: [PATCH] regmap: Allow read_reg_mask to be 0

2014-10-01 Thread Dan Murphy
Lars On 09/30/2014 04:29 PM, Lars-Peter Clausen wrote: > On 09/30/2014 11:18 PM, Dan Murphy wrote: >> Lars >> >> On 09/30/2014 04:03 PM, Lars-Peter Clausen wrote: >>> On 09/30/2014 06:07 PM, Dan Murphy wrote: There may be spi devices that do not require a register read mask to read the r

Re: [PATCH] regmap: Allow read_reg_mask to be 0

2014-10-01 Thread Mark Brown
On Tue, Sep 30, 2014 at 11:29:34PM +0200, Lars-Peter Clausen wrote: > On 09/30/2014 11:18 PM, Dan Murphy wrote: Dan, please fix your mail client to word wrap within paragraphs. > >The device, which is already in production, has a specific control register > >that sets either the reading or writi

Re: [PATCH] regmap: Allow read_reg_mask to be 0

2014-09-30 Thread Lars-Peter Clausen
On 09/30/2014 11:18 PM, Dan Murphy wrote: Lars On 09/30/2014 04:03 PM, Lars-Peter Clausen wrote: On 09/30/2014 06:07 PM, Dan Murphy wrote: There may be spi devices that do not require a register read mask to read the registers. Currently the code sets the read mask based on a non-zero value p

Re: [PATCH] regmap: Allow read_reg_mask to be 0

2014-09-30 Thread Dan Murphy
Lars On 09/30/2014 04:03 PM, Lars-Peter Clausen wrote: > On 09/30/2014 06:07 PM, Dan Murphy wrote: >> There may be spi devices that do not require a >> register read mask to read the registers. >> >> Currently the code sets the read mask based on >> a non-zero value passed in from the driver or if

Re: [PATCH] regmap: Allow read_reg_mask to be 0

2014-09-30 Thread Lars-Peter Clausen
On 09/30/2014 06:07 PM, Dan Murphy wrote: There may be spi devices that do not require a register read mask to read the registers. Currently the code sets the read mask based on a non-zero value passed in from the driver or if that value is 0 sets the read mask to 0x80. It only sets it to the

Re: [PATCH] regmap: Allow read_reg_mask to be 0

2014-09-30 Thread Dan Murphy
Mark Thanks for the quick review On 09/30/2014 12:25 PM, Mark Brown wrote: > On Tue, Sep 30, 2014 at 11:07:00AM -0500, Dan Murphy wrote: > >> -if (config->read_flag_mask || config->write_flag_mask) { >> +if (config->read_flag_mask == REGMAP_NO_READ_MASK) >> +map->read_flag_mas

Re: [PATCH] regmap: Allow read_reg_mask to be 0

2014-09-30 Thread Dan Murphy
On 09/30/2014 12:25 PM, Mark Brown wrote: > On Tue, Sep 30, 2014 at 11:07:00AM -0500, Dan Murphy wrote: > >> -if (config->read_flag_mask || config->write_flag_mask) { >> +if (config->read_flag_mask == REGMAP_NO_READ_MASK) >> +map->read_flag_mask = 0x00; >> +else if (config->

Re: [PATCH] regmap: Allow read_reg_mask to be 0

2014-09-30 Thread Dan Murphy
Mark Thanks for the review On 09/30/2014 12:25 PM, Mark Brown wrote: > On Tue, Sep 30, 2014 at 11:07:00AM -0500, Dan Murphy wrote: > >> -if (config->read_flag_mask || config->write_flag_mask) { >> +if (config->read_flag_mask == REGMAP_NO_READ_MASK) >> +map->read_flag_mask = 0x

Re: [PATCH] regmap: Allow read_reg_mask to be 0

2014-09-30 Thread Mark Brown
On Tue, Sep 30, 2014 at 11:07:00AM -0500, Dan Murphy wrote: > - if (config->read_flag_mask || config->write_flag_mask) { > + if (config->read_flag_mask == REGMAP_NO_READ_MASK) > + map->read_flag_mask = 0x00; > + else if (config->read_flag_mask) This breaks the symmetry in

[PATCH] regmap: Allow read_reg_mask to be 0

2014-09-30 Thread Dan Murphy
There may be spi devices that do not require a register read mask to read the registers. Currently the code sets the read mask based on a non-zero value passed in from the driver or if that value is 0 sets the read mask to 0x80. A mask of 0 is a valid mask as well. Create a define to indicate th