Re: [PATCH 2/3] regmap: split up regmap_config.use_single_rw
Hi David, Thank you for the patch! Yet something to improve: [auto build test ERROR on asoc/for-next] [also build test ERROR on v4.19-rc1 next-20180831] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/David-Frey/regmap-split-regmap_config-use_single_rw/20180901-141401 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next config: x86_64-randconfig-x013-201834 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 Note: the linux-review/David-Frey/regmap-split-regmap_config-use_single_rw/20180901-141401 HEAD ccc00a1af2b149f8dd70fe9bd1a047361070be43 builds fine. It only hurts bisectibility. All error/warnings (new ones prefixed by >>): >> drivers//hwmon/lm95245.c:544:3: error: 'const struct regmap_config' has no >> member named 'use_single_rw'; did you mean 'use_single_read'? .use_single_rw = true, ^ use_single_read >> drivers//hwmon/lm95245.c:544:19: warning: initialization makes pointer from >> integer without a cast [-Wint-conversion] .use_single_rw = true, ^~~~ drivers//hwmon/lm95245.c:544:19: note: (near initialization for 'lm95245_regmap_config.reg_defaults_raw') -- >> drivers//hwmon/tmp108.c:348:3: error: 'const struct regmap_config' has no >> member named 'use_single_rw'; did you mean 'use_single_read'? .use_single_rw = true, ^ use_single_read >> drivers//hwmon/tmp108.c:348:19: warning: initialization makes pointer from >> integer without a cast [-Wint-conversion] .use_single_rw = true, ^~~~ drivers//hwmon/tmp108.c:348:19: note: (near initialization for 'tmp108_regmap_config.reg_defaults_raw') -- >> drivers//iio/light/apds9960.c:209:3: error: 'const struct regmap_config' has >> no member named 'use_single_rw'; did you mean 'use_single_read'? .use_single_rw = 1, ^ use_single_read >> drivers//iio/light/apds9960.c:209:19: warning: initialization makes pointer >> from integer without a cast [-Wint-conversion] .use_single_rw = 1, ^ drivers//iio/light/apds9960.c:209:19: note: (near initialization for 'apds9960_regmap_config.writeable_reg') vim +544 drivers//hwmon/lm95245.c fffd80cc Alexander Stein 2011-06-28 537 c0a4b9ec Guenter Roeck 2016-07-05 538 static const struct regmap_config lm95245_regmap_config = { c0a4b9ec Guenter Roeck 2016-07-05 539.reg_bits = 8, c0a4b9ec Guenter Roeck 2016-07-05 540.val_bits = 8, c0a4b9ec Guenter Roeck 2016-07-05 541.writeable_reg = lm95245_is_writeable_reg, c0a4b9ec Guenter Roeck 2016-07-05 542.volatile_reg = lm95245_is_volatile_reg, c0a4b9ec Guenter Roeck 2016-07-05 543.cache_type = REGCACHE_RBTREE, c0a4b9ec Guenter Roeck 2016-07-05 @544.use_single_rw = true, c0a4b9ec Guenter Roeck 2016-07-05 545 }; c0a4b9ec Guenter Roeck 2016-07-05 546 :: The code at line 544 was first introduced by commit :: c0a4b9ec1b43ebb9d5001e3bf86f58d4ca0ffe18 hwmon: (lm95245) Use new hwmon registration API :: TO: Guenter Roeck :: CC: Guenter Roeck --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH 2/3] regmap: split up regmap_config.use_single_rw
Hi David, Thank you for the patch! Yet something to improve: [auto build test ERROR on asoc/for-next] [also build test ERROR on v4.19-rc1 next-20180831] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/David-Frey/regmap-split-regmap_config-use_single_rw/20180901-141401 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next config: x86_64-randconfig-x013-201834 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 Note: the linux-review/David-Frey/regmap-split-regmap_config-use_single_rw/20180901-141401 HEAD ccc00a1af2b149f8dd70fe9bd1a047361070be43 builds fine. It only hurts bisectibility. All error/warnings (new ones prefixed by >>): >> drivers//hwmon/lm95245.c:544:3: error: 'const struct regmap_config' has no >> member named 'use_single_rw'; did you mean 'use_single_read'? .use_single_rw = true, ^ use_single_read >> drivers//hwmon/lm95245.c:544:19: warning: initialization makes pointer from >> integer without a cast [-Wint-conversion] .use_single_rw = true, ^~~~ drivers//hwmon/lm95245.c:544:19: note: (near initialization for 'lm95245_regmap_config.reg_defaults_raw') -- >> drivers//hwmon/tmp108.c:348:3: error: 'const struct regmap_config' has no >> member named 'use_single_rw'; did you mean 'use_single_read'? .use_single_rw = true, ^ use_single_read >> drivers//hwmon/tmp108.c:348:19: warning: initialization makes pointer from >> integer without a cast [-Wint-conversion] .use_single_rw = true, ^~~~ drivers//hwmon/tmp108.c:348:19: note: (near initialization for 'tmp108_regmap_config.reg_defaults_raw') -- >> drivers//iio/light/apds9960.c:209:3: error: 'const struct regmap_config' has >> no member named 'use_single_rw'; did you mean 'use_single_read'? .use_single_rw = 1, ^ use_single_read >> drivers//iio/light/apds9960.c:209:19: warning: initialization makes pointer >> from integer without a cast [-Wint-conversion] .use_single_rw = 1, ^ drivers//iio/light/apds9960.c:209:19: note: (near initialization for 'apds9960_regmap_config.writeable_reg') vim +544 drivers//hwmon/lm95245.c fffd80cc Alexander Stein 2011-06-28 537 c0a4b9ec Guenter Roeck 2016-07-05 538 static const struct regmap_config lm95245_regmap_config = { c0a4b9ec Guenter Roeck 2016-07-05 539.reg_bits = 8, c0a4b9ec Guenter Roeck 2016-07-05 540.val_bits = 8, c0a4b9ec Guenter Roeck 2016-07-05 541.writeable_reg = lm95245_is_writeable_reg, c0a4b9ec Guenter Roeck 2016-07-05 542.volatile_reg = lm95245_is_volatile_reg, c0a4b9ec Guenter Roeck 2016-07-05 543.cache_type = REGCACHE_RBTREE, c0a4b9ec Guenter Roeck 2016-07-05 @544.use_single_rw = true, c0a4b9ec Guenter Roeck 2016-07-05 545 }; c0a4b9ec Guenter Roeck 2016-07-05 546 :: The code at line 544 was first introduced by commit :: c0a4b9ec1b43ebb9d5001e3bf86f58d4ca0ffe18 hwmon: (lm95245) Use new hwmon registration API :: TO: Guenter Roeck :: CC: Guenter Roeck --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH 2/3] regmap: split up regmap_config.use_single_rw
Hi David, Thank you for the patch! Yet something to improve: [auto build test ERROR on asoc/for-next] [also build test ERROR on v4.19-rc1 next-20180831] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/David-Frey/regmap-split-regmap_config-use_single_rw/20180901-141401 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next config: x86_64-randconfig-x018-201834 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 Note: the linux-review/David-Frey/regmap-split-regmap_config-use_single_rw/20180901-141401 HEAD ccc00a1af2b149f8dd70fe9bd1a047361070be43 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): drivers//mfd/da9052-spi.c: In function 'da9052_spi_probe': >> drivers//mfd/da9052-spi.c:49:9: error: 'struct regmap_config' has no member >> named 'use_single_rw'; did you mean 'use_single_read'? config.use_single_rw = 1; ^ use_single_read vim +49 drivers//mfd/da9052-spi.c cfe04478 Ashish Jangam2011-12-12 23 f791be49 Bill Pemberton 2012-11-19 24 static int da9052_spi_probe(struct spi_device *spi) cfe04478 Ashish Jangam2011-12-12 25 { e9e9d397 Axel Lin 2014-08-16 26struct regmap_config config; cfe04478 Ashish Jangam2011-12-12 27int ret; cfe04478 Ashish Jangam2011-12-12 28const struct spi_device_id *id = spi_get_device_id(spi); 6608a5e2 Axel Lin 2012-05-11 29struct da9052 *da9052; cfe04478 Ashish Jangam2011-12-12 30 6608a5e2 Axel Lin 2012-05-11 31da9052 = devm_kzalloc(>dev, sizeof(struct da9052), GFP_KERNEL); cfe04478 Ashish Jangam2011-12-12 32if (!da9052) cfe04478 Ashish Jangam2011-12-12 33return -ENOMEM; cfe04478 Ashish Jangam2011-12-12 34 72e341c4 Adam Ward2015-03-04 35spi->mode = SPI_MODE_0; cfe04478 Ashish Jangam2011-12-12 36spi->bits_per_word = 8; cfe04478 Ashish Jangam2011-12-12 37spi_setup(spi); cfe04478 Ashish Jangam2011-12-12 38 cfe04478 Ashish Jangam2011-12-12 39da9052->dev = >dev; cfe04478 Ashish Jangam2011-12-12 40da9052->chip_irq = spi->irq; cfe04478 Ashish Jangam2011-12-12 41 1b1ba09c Jingoo Han 2013-04-06 42spi_set_drvdata(spi, da9052); cfe04478 Ashish Jangam2011-12-12 43 e9e9d397 Axel Lin 2014-08-16 44config = da9052_regmap_config; e9e9d397 Axel Lin 2014-08-16 45config.read_flag_mask = 1; 72e341c4 Adam Ward2015-03-04 46config.reg_bits = 7; 72e341c4 Adam Ward2015-03-04 47config.pad_bits = 1; 72e341c4 Adam Ward2015-03-04 48config.val_bits = 8; 72e341c4 Adam Ward2015-03-04 @49config.use_single_rw = 1; cfe04478 Ashish Jangam2011-12-12 50 e9e9d397 Axel Lin 2014-08-16 51da9052->regmap = devm_regmap_init_spi(spi, ); cfe04478 Ashish Jangam2011-12-12 52if (IS_ERR(da9052->regmap)) { cfe04478 Ashish Jangam2011-12-12 53ret = PTR_ERR(da9052->regmap); cfe04478 Ashish Jangam2011-12-12 54 dev_err(>dev, "Failed to allocate register map: %d\n", cfe04478 Ashish Jangam2011-12-12 55ret); 6608a5e2 Axel Lin 2012-05-11 56return ret; cfe04478 Ashish Jangam2011-12-12 57} cfe04478 Ashish Jangam2011-12-12 58 ad698ea4 Javier Martinez Canillas 2015-09-29 59return da9052_device_init(da9052, id->driver_data); cfe04478 Ashish Jangam2011-12-12 60 } cfe04478 Ashish Jangam2011-12-12 61 :: The code at line 49 was first introduced by commit :: 72e341c48fbca142d767e97746e33a4becf890ea mfd: da9052: Fix register access via SPI :: TO: Adam Ward :: CC: Lee Jones --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH 2/3] regmap: split up regmap_config.use_single_rw
Hi David, Thank you for the patch! Yet something to improve: [auto build test ERROR on asoc/for-next] [also build test ERROR on v4.19-rc1 next-20180831] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/David-Frey/regmap-split-regmap_config-use_single_rw/20180901-141401 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next config: x86_64-randconfig-x018-201834 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 Note: the linux-review/David-Frey/regmap-split-regmap_config-use_single_rw/20180901-141401 HEAD ccc00a1af2b149f8dd70fe9bd1a047361070be43 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): drivers//mfd/da9052-spi.c: In function 'da9052_spi_probe': >> drivers//mfd/da9052-spi.c:49:9: error: 'struct regmap_config' has no member >> named 'use_single_rw'; did you mean 'use_single_read'? config.use_single_rw = 1; ^ use_single_read vim +49 drivers//mfd/da9052-spi.c cfe04478 Ashish Jangam2011-12-12 23 f791be49 Bill Pemberton 2012-11-19 24 static int da9052_spi_probe(struct spi_device *spi) cfe04478 Ashish Jangam2011-12-12 25 { e9e9d397 Axel Lin 2014-08-16 26struct regmap_config config; cfe04478 Ashish Jangam2011-12-12 27int ret; cfe04478 Ashish Jangam2011-12-12 28const struct spi_device_id *id = spi_get_device_id(spi); 6608a5e2 Axel Lin 2012-05-11 29struct da9052 *da9052; cfe04478 Ashish Jangam2011-12-12 30 6608a5e2 Axel Lin 2012-05-11 31da9052 = devm_kzalloc(>dev, sizeof(struct da9052), GFP_KERNEL); cfe04478 Ashish Jangam2011-12-12 32if (!da9052) cfe04478 Ashish Jangam2011-12-12 33return -ENOMEM; cfe04478 Ashish Jangam2011-12-12 34 72e341c4 Adam Ward2015-03-04 35spi->mode = SPI_MODE_0; cfe04478 Ashish Jangam2011-12-12 36spi->bits_per_word = 8; cfe04478 Ashish Jangam2011-12-12 37spi_setup(spi); cfe04478 Ashish Jangam2011-12-12 38 cfe04478 Ashish Jangam2011-12-12 39da9052->dev = >dev; cfe04478 Ashish Jangam2011-12-12 40da9052->chip_irq = spi->irq; cfe04478 Ashish Jangam2011-12-12 41 1b1ba09c Jingoo Han 2013-04-06 42spi_set_drvdata(spi, da9052); cfe04478 Ashish Jangam2011-12-12 43 e9e9d397 Axel Lin 2014-08-16 44config = da9052_regmap_config; e9e9d397 Axel Lin 2014-08-16 45config.read_flag_mask = 1; 72e341c4 Adam Ward2015-03-04 46config.reg_bits = 7; 72e341c4 Adam Ward2015-03-04 47config.pad_bits = 1; 72e341c4 Adam Ward2015-03-04 48config.val_bits = 8; 72e341c4 Adam Ward2015-03-04 @49config.use_single_rw = 1; cfe04478 Ashish Jangam2011-12-12 50 e9e9d397 Axel Lin 2014-08-16 51da9052->regmap = devm_regmap_init_spi(spi, ); cfe04478 Ashish Jangam2011-12-12 52if (IS_ERR(da9052->regmap)) { cfe04478 Ashish Jangam2011-12-12 53ret = PTR_ERR(da9052->regmap); cfe04478 Ashish Jangam2011-12-12 54 dev_err(>dev, "Failed to allocate register map: %d\n", cfe04478 Ashish Jangam2011-12-12 55ret); 6608a5e2 Axel Lin 2012-05-11 56return ret; cfe04478 Ashish Jangam2011-12-12 57} cfe04478 Ashish Jangam2011-12-12 58 ad698ea4 Javier Martinez Canillas 2015-09-29 59return da9052_device_init(da9052, id->driver_data); cfe04478 Ashish Jangam2011-12-12 60 } cfe04478 Ashish Jangam2011-12-12 61 :: The code at line 49 was first introduced by commit :: 72e341c48fbca142d767e97746e33a4becf890ea mfd: da9052: Fix register access via SPI :: TO: Adam Ward :: CC: Lee Jones --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
[PATCH 2/3] regmap: split up regmap_config.use_single_rw
Split regmap_config.use_single_rw into use_single_read and use_single_write. This change enables drivers of devices which only support bulk operations in one direction to use the regmap_bulk_*() functions for both directions and have their bulk operation split into single operations only when necessary. Signed-off-by: David Frey --- drivers/base/regmap/regmap.c | 4 ++-- include/linux/regmap.h | 12 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 0360a90ad6b6..78a778c08f92 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -762,8 +762,8 @@ struct regmap *__regmap_init(struct device *dev, map->reg_stride_order = ilog2(map->reg_stride); else map->reg_stride_order = -1; - map->use_single_read = config->use_single_rw || !bus || !bus->read; - map->use_single_write = config->use_single_rw || !bus || !bus->write; + map->use_single_read = config->use_single_read || !bus || !bus->read; + map->use_single_write = config->use_single_write || !bus || !bus->write; map->can_multi_write = config->can_multi_write && bus && bus->write; if (bus) { map->max_raw_read = bus->max_raw_read; diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 379505a53722..6ea9bf9377cb 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -315,9 +315,12 @@ typedef void (*regmap_unlock)(void *); * masks are used. * @zero_flag_mask: If set, read_flag_mask and write_flag_mask are used even * if they are both empty. - * @use_single_rw: 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. + * @use_single_read: If set, converts the bulk read operation into a series of + * single read operations. This is useful for a device that + * does not support bulk read. + * @use_single_write: If set, converts the bulk write operation into a series of + *single write operations. This is useful for a device that + *does not support bulk write. * @can_multi_write: If set, the device supports the multi write mode of bulk * write operations, if clear multi write requests will be * split into individual write operations @@ -380,7 +383,8 @@ struct regmap_config { unsigned long write_flag_mask; bool zero_flag_mask; - bool use_single_rw; + bool use_single_read; + bool use_single_write; bool can_multi_write; enum regmap_endian reg_format_endian; -- 2.11.0
[PATCH 2/3] regmap: split up regmap_config.use_single_rw
Split regmap_config.use_single_rw into use_single_read and use_single_write. This change enables drivers of devices which only support bulk operations in one direction to use the regmap_bulk_*() functions for both directions and have their bulk operation split into single operations only when necessary. Signed-off-by: David Frey --- drivers/base/regmap/regmap.c | 4 ++-- include/linux/regmap.h | 12 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 0360a90ad6b6..78a778c08f92 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -762,8 +762,8 @@ struct regmap *__regmap_init(struct device *dev, map->reg_stride_order = ilog2(map->reg_stride); else map->reg_stride_order = -1; - map->use_single_read = config->use_single_rw || !bus || !bus->read; - map->use_single_write = config->use_single_rw || !bus || !bus->write; + map->use_single_read = config->use_single_read || !bus || !bus->read; + map->use_single_write = config->use_single_write || !bus || !bus->write; map->can_multi_write = config->can_multi_write && bus && bus->write; if (bus) { map->max_raw_read = bus->max_raw_read; diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 379505a53722..6ea9bf9377cb 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -315,9 +315,12 @@ typedef void (*regmap_unlock)(void *); * masks are used. * @zero_flag_mask: If set, read_flag_mask and write_flag_mask are used even * if they are both empty. - * @use_single_rw: 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. + * @use_single_read: If set, converts the bulk read operation into a series of + * single read operations. This is useful for a device that + * does not support bulk read. + * @use_single_write: If set, converts the bulk write operation into a series of + *single write operations. This is useful for a device that + *does not support bulk write. * @can_multi_write: If set, the device supports the multi write mode of bulk * write operations, if clear multi write requests will be * split into individual write operations @@ -380,7 +383,8 @@ struct regmap_config { unsigned long write_flag_mask; bool zero_flag_mask; - bool use_single_rw; + bool use_single_read; + bool use_single_write; bool can_multi_write; enum regmap_endian reg_format_endian; -- 2.11.0