* Idea: regmap_config.use_single_rw -> use_single_read, use_single_write @ 2018-08-29 17:35 David Frey 2018-08-31 14:55 ` David Frey 0 siblings, 1 reply; 5+ messages in thread From: David Frey @ 2018-08-29 17:35 UTC (permalink / raw) To: linux-iio Hi, I just want to float an idea and see if it gets any support. In struct regmap_config, there is a member "bool use_single_rw" which is documented as follows: "If set, converts the bulk read and write operations into a series of single read and write operations. This is useful for device that does not support bulk read and write." My idea is to split this into: bool use_single_read; bool use_single_write; I think this would be useful because at least one device that I'm using (Bosch bmi160 IMU) supports bulk reads, but not bulk writes. It would be convenient to be able to use regmap_bulk_read and regmap_bulk_write and have only regmap_bulk_write split the writes apart. This change would also support the case where a device supports bulk writes, but not bulk reads. I don't know of such a device, but I haven't made any attempt to find one. What do you think? David Frey ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Idea: regmap_config.use_single_rw -> use_single_read, use_single_write 2018-08-29 17:35 Idea: regmap_config.use_single_rw -> use_single_read, use_single_write David Frey @ 2018-08-31 14:55 ` David Frey 2018-08-31 17:09 ` Himanshu Jha 0 siblings, 1 reply; 5+ messages in thread From: David Frey @ 2018-08-31 14:55 UTC (permalink / raw) To: linux-iio On 8/29/2018 10:35 AM, David Frey wrote: > Hi, > > I just want to float an idea and see if it gets any support. > > In struct regmap_config, there is a member "bool use_single_rw" which is > documented as follows: > > "If set, converts the bulk read and write operations into a series of > single read and write operations. This is useful for device that does > not support bulk read and write." > > My idea is to split this into: > bool use_single_read; > bool use_single_write; > > I think this would be useful because at least one device that I'm using > (Bosch bmi160 IMU) supports bulk reads, but not bulk writes. It would > be convenient to be able to use regmap_bulk_read and regmap_bulk_write > and have only regmap_bulk_write split the writes apart. This change > would also support the case where a device supports bulk writes, but not > bulk reads. I don't know of such a device, but I haven't made any > attempt to find one. > > What do you think? > > David Frey I realized after I sent this that this is a regmap change and thus might be out of scope for discussion on the linux-iio mailing list. Is there somewhere more appropriate to post this to? Thanks, David ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Idea: regmap_config.use_single_rw -> use_single_read, use_single_write 2018-08-31 14:55 ` David Frey @ 2018-08-31 17:09 ` Himanshu Jha 2018-08-31 17:20 ` Himanshu Jha 0 siblings, 1 reply; 5+ messages in thread From: Himanshu Jha @ 2018-08-31 17:09 UTC (permalink / raw) To: David Frey; +Cc: linux-iio On Fri, Aug 31, 2018 at 07:55:36AM -0700, David Frey wrote: > On 8/29/2018 10:35 AM, David Frey wrote: > > Hi, > > > > I just want to float an idea and see if it gets any support. > > > > In struct regmap_config, there is a member "bool use_single_rw" which is > > documented as follows: > > > > "If set, converts the bulk read and write operations into a series of > > single read and write operations. This is useful for device that does > > not support bulk read and write." > > > > My idea is to split this into: > > bool use_single_read; > > bool use_single_write; > > > > I think this would be useful because at least one device that I'm using > > (Bosch bmi160 IMU) supports bulk reads, but not bulk writes. It would > > be convenient to be able to use regmap_bulk_read and regmap_bulk_write > > and have only regmap_bulk_write split the writes apart. This change > > would also support the case where a device supports bulk writes, but not > > bulk reads. I don't know of such a device, but I haven't made any > > attempt to find one. > > > > What do you think? > > > > David Frey > > I realized after I sent this that this is a regmap change and thus might > be out of scope for discussion on the linux-iio mailing list. Is there > somewhere more appropriate to post this to? himanshu@himanshu-Vostro-3559:~/linux-next$ ./scripts/get_maintainer.pl include/linux/regmap.h Mark Brown <broonie@kernel.org> (supporter:REGISTER MAP ABSTRACTION) linux-kernel@vger.kernel.org (open list:REGISTER MAP ABSTRACTION) Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Idea: regmap_config.use_single_rw -> use_single_read, use_single_write 2018-08-31 17:09 ` Himanshu Jha @ 2018-08-31 17:20 ` Himanshu Jha 2018-08-31 17:40 ` David Frey 0 siblings, 1 reply; 5+ messages in thread From: Himanshu Jha @ 2018-08-31 17:20 UTC (permalink / raw) To: David Frey; +Cc: linux-iio On Fri, Aug 31, 2018 at 10:39:07PM +0530, Himanshu Jha wrote: > On Fri, Aug 31, 2018 at 07:55:36AM -0700, David Frey wrote: > > On 8/29/2018 10:35 AM, David Frey wrote: > > > Hi, > > > > > > I just want to float an idea and see if it gets any support. > > > > > > In struct regmap_config, there is a member "bool use_single_rw" which is > > > documented as follows: > > > > > > "If set, converts the bulk read and write operations into a series of > > > single read and write operations. This is useful for device that does > > > not support bulk read and write." > > > > > > My idea is to split this into: > > > bool use_single_read; > > > bool use_single_write; > > > > > > I think this would be useful because at least one device that I'm using > > > (Bosch bmi160 IMU) supports bulk reads, but not bulk writes. It would > > > be convenient to be able to use regmap_bulk_read and regmap_bulk_write > > > and have only regmap_bulk_write split the writes apart. This change > > > would also support the case where a device supports bulk writes, but not > > > bulk reads. I don't know of such a device, but I haven't made any > > > attempt to find one. > > > > > > What do you think? Btw, if device doesn't support a bulk write and instead only supports a bulk read as we see in BMI160, wouldn't the following suffice the problem: .use_single_rw = true, .can_multi_write = false, // or probably not setting it up(clear) 313 * @can_multi_write: If set, the device supports the multi write mode of bulk 314 * write operations, if clear multi write requests will be 315 * split into individual write operations Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Idea: regmap_config.use_single_rw -> use_single_read, use_single_write 2018-08-31 17:20 ` Himanshu Jha @ 2018-08-31 17:40 ` David Frey 0 siblings, 0 replies; 5+ messages in thread From: David Frey @ 2018-08-31 17:40 UTC (permalink / raw) To: Himanshu Jha; +Cc: linux-iio On 8/31/2018 10:20 AM, Himanshu Jha wrote: > On Fri, Aug 31, 2018 at 10:39:07PM +0530, Himanshu Jha wrote: >> On Fri, Aug 31, 2018 at 07:55:36AM -0700, David Frey wrote: >>> On 8/29/2018 10:35 AM, David Frey wrote: >>>> Hi, >>>> >>>> I just want to float an idea and see if it gets any support. >>>> >>>> In struct regmap_config, there is a member "bool use_single_rw" which is >>>> documented as follows: >>>> >>>> "If set, converts the bulk read and write operations into a series of >>>> single read and write operations. This is useful for device that does >>>> not support bulk read and write." >>>> >>>> My idea is to split this into: >>>> bool use_single_read; >>>> bool use_single_write; >>>> >>>> I think this would be useful because at least one device that I'm using >>>> (Bosch bmi160 IMU) supports bulk reads, but not bulk writes. It would >>>> be convenient to be able to use regmap_bulk_read and regmap_bulk_write >>>> and have only regmap_bulk_write split the writes apart. This change >>>> would also support the case where a device supports bulk writes, but not >>>> bulk reads. I don't know of such a device, but I haven't made any >>>> attempt to find one. >>>> >>>> What do you think? > > Btw, if device doesn't support a bulk write and instead only supports a bulk > read as we see in BMI160, wouldn't the following suffice the problem: > > .use_single_rw = true, > .can_multi_write = false, // or probably not setting it up(clear) > > 313 * @can_multi_write: If set, the device supports the multi write mode of bulk > 314 * write operations, if clear multi write requests will be > 315 * split into individual write operations I don't think the can_multi_write flag is relevant here. Bulk writes have the form: {regN, dataN, dataN+1, dataN+2, ...}. Multi-write is used by regmap_multi_reg_write() and is this form: {regaA, dataA, regF, dataF, regC, dataC, ...}. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-08-31 21:48 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-08-29 17:35 Idea: regmap_config.use_single_rw -> use_single_read, use_single_write David Frey 2018-08-31 14:55 ` David Frey 2018-08-31 17:09 ` Himanshu Jha 2018-08-31 17:20 ` Himanshu Jha 2018-08-31 17:40 ` David Frey
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox