Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'regmap-5.2' into regmap-next

+118 -177
+1 -4
drivers/base/regmap/internal.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* 2 3 * Register map access API internal header 3 4 * 4 5 * Copyright 2011 Wolfson Microelectronics plc 5 6 * 6 7 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 8 */ 12 9 13 10 #ifndef _REGMAP_INTERNAL_H
+7 -11
drivers/base/regmap/regcache-flat.c
··· 1 - /* 2 - * Register cache access API - flat caching support 3 - * 4 - * Copyright 2012 Wolfson Microelectronics plc 5 - * 6 - * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register cache access API - flat caching support 4 + // 5 + // Copyright 2012 Wolfson Microelectronics plc 6 + // 7 + // Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 12 8 13 9 #include <linux/device.h> 14 10 #include <linux/seq_file.h>
+7 -11
drivers/base/regmap/regcache-lzo.c
··· 1 - /* 2 - * Register cache access API - LZO caching support 3 - * 4 - * Copyright 2011 Wolfson Microelectronics plc 5 - * 6 - * Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register cache access API - LZO caching support 4 + // 5 + // Copyright 2011 Wolfson Microelectronics plc 6 + // 7 + // Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> 12 8 13 9 #include <linux/device.h> 14 10 #include <linux/lzo.h>
+7 -11
drivers/base/regmap/regcache-rbtree.c
··· 1 - /* 2 - * Register cache access API - rbtree caching support 3 - * 4 - * Copyright 2011 Wolfson Microelectronics plc 5 - * 6 - * Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register cache access API - rbtree caching support 4 + // 5 + // Copyright 2011 Wolfson Microelectronics plc 6 + // 7 + // Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> 12 8 13 9 #include <linux/debugfs.h> 14 10 #include <linux/device.h>
+7 -11
drivers/base/regmap/regcache.c
··· 1 - /* 2 - * Register cache access API 3 - * 4 - * Copyright 2011 Wolfson Microelectronics plc 5 - * 6 - * Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register cache access API 4 + // 5 + // Copyright 2011 Wolfson Microelectronics plc 6 + // 7 + // Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> 12 8 13 9 #include <linux/bsearch.h> 14 10 #include <linux/device.h>
+5 -17
drivers/base/regmap/regmap-ac97.c
··· 1 - /* 2 - * Register map access API - AC'97 support 3 - * 4 - * Copyright 2013 Linaro Ltd. All rights reserved. 5 - * 6 - * This program is free software; you can redistribute it and/or modify it 7 - * under the terms and conditions of the GNU General Public License, 8 - * version 2, as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope it will be useful, but WITHOUT 11 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - * more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register map access API - AC'97 support 4 + // 5 + // Copyright 2013 Linaro Ltd. All rights reserved. 18 6 19 7 #include <linux/clk.h> 20 8 #include <linux/err.h>
+31 -17
drivers/base/regmap/regmap-debugfs.c
··· 1 - /* 2 - * Register map access API - debugfs 3 - * 4 - * Copyright 2011 Wolfson Microelectronics plc 5 - * 6 - * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register map access API - debugfs 4 + // 5 + // Copyright 2011 Wolfson Microelectronics plc 6 + // 7 + // Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 12 8 13 9 #include <linux/slab.h> 14 10 #include <linux/mutex.h> ··· 191 195 } 192 196 } 193 197 198 + static int regmap_next_readable_reg(struct regmap *map, int reg) 199 + { 200 + struct regmap_debugfs_off_cache *c; 201 + int ret = -EINVAL; 202 + 203 + if (regmap_printable(map, reg + map->reg_stride)) { 204 + ret = reg + map->reg_stride; 205 + } else { 206 + mutex_lock(&map->cache_lock); 207 + list_for_each_entry(c, &map->debugfs_off_cache, list) { 208 + if (reg > c->max_reg) 209 + continue; 210 + if (reg < c->base_reg) { 211 + ret = c->base_reg; 212 + break; 213 + } 214 + } 215 + mutex_unlock(&map->cache_lock); 216 + } 217 + return ret; 218 + } 219 + 194 220 static ssize_t regmap_read_debugfs(struct regmap *map, unsigned int from, 195 221 unsigned int to, char __user *user_buf, 196 222 size_t count, loff_t *ppos) ··· 236 218 /* Work out which register we're starting at */ 237 219 start_reg = regmap_debugfs_get_dump_start(map, from, *ppos, &p); 238 220 239 - for (i = start_reg; i <= to; i += map->reg_stride) { 240 - if (!regmap_readable(map, i) && !regmap_cached(map, i)) 241 - continue; 242 - 243 - if (regmap_precious(map, i)) 244 - continue; 221 + for (i = start_reg; i >= 0 && i <= to; 222 + i = regmap_next_readable_reg(map, i)) { 245 223 246 224 /* If we're in the region the user is trying to read */ 247 225 if (p >= *ppos) {
+7 -11
drivers/base/regmap/regmap-i2c.c
··· 1 - /* 2 - * Register map access API - I2C support 3 - * 4 - * Copyright 2011 Wolfson Microelectronics plc 5 - * 6 - * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register map access API - I2C support 4 + // 5 + // Copyright 2011 Wolfson Microelectronics plc 6 + // 7 + // Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 12 8 13 9 #include <linux/regmap.h> 14 10 #include <linux/i2c.h>
+7 -11
drivers/base/regmap/regmap-irq.c
··· 1 - /* 2 - * regmap based irq_chip 3 - * 4 - * Copyright 2011 Wolfson Microelectronics plc 5 - * 6 - * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // regmap based irq_chip 4 + // 5 + // Copyright 2011 Wolfson Microelectronics plc 6 + // 7 + // Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 12 8 13 9 #include <linux/device.h> 14 10 #include <linux/export.h>
+5 -17
drivers/base/regmap/regmap-mmio.c
··· 1 - /* 2 - * Register map access API - MMIO support 3 - * 4 - * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. 5 - * 6 - * This program is free software; you can redistribute it and/or modify it 7 - * under the terms and conditions of the GNU General Public License, 8 - * version 2, as published by the Free Software Foundation. 9 - * 10 - * This program is distributed in the hope it will be useful, but WITHOUT 11 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - * more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register map access API - MMIO support 4 + // 5 + // Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. 18 6 19 7 #include <linux/clk.h> 20 8 #include <linux/err.h>
+7 -11
drivers/base/regmap/regmap-spi.c
··· 1 - /* 2 - * Register map access API - SPI support 3 - * 4 - * Copyright 2011 Wolfson Microelectronics plc 5 - * 6 - * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register map access API - SPI support 4 + // 5 + // Copyright 2011 Wolfson Microelectronics plc 6 + // 7 + // Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 12 8 13 9 #include <linux/regmap.h> 14 10 #include <linux/spi/spi.h>
+10 -19
drivers/base/regmap/regmap-spmi.c
··· 1 - /* 2 - * Register map access API - SPMI support 3 - * 4 - * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. 5 - * 6 - * Based on regmap-i2c.c: 7 - * Copyright 2011 Wolfson Microelectronics plc 8 - * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 9 - * 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of the GNU General Public License version 2 and 12 - * only version 2 as published by the Free Software Foundation. 13 - * 14 - * This program is distributed in the hope that it will be useful, 15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 - * GNU General Public License for more details. 18 - * 19 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register map access API - SPMI support 4 + // 5 + // Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. 6 + // 7 + // Based on regmap-i2c.c: 8 + // Copyright 2011 Wolfson Microelectronics plc 9 + // Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 10 + 20 11 #include <linux/regmap.h> 21 12 #include <linux/spmi.h> 22 13 #include <linux/module.h>
+6 -10
drivers/base/regmap/regmap-w1.c
··· 1 - /* 2 - * Register map access API - W1 (1-Wire) support 3 - * 4 - * Copyright (c) 2017 Radioavionica Corporation 5 - * Author: Alex A. Mihaylov <minimumlaw@rambler.ru> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation 10 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register map access API - W1 (1-Wire) support 4 + // 5 + // Copyright (c) 2017 Radioavionica Corporation 6 + // Author: Alex A. Mihaylov <minimumlaw@rambler.ru> 11 7 12 8 #include <linux/regmap.h> 13 9 #include <linux/module.h>
+11 -16
drivers/base/regmap/regmap.c
··· 1 - /* 2 - * Register map access API 3 - * 4 - * Copyright 2011 Wolfson Microelectronics plc 5 - * 6 - * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // Register map access API 4 + // 5 + // Copyright 2011 Wolfson Microelectronics plc 6 + // 7 + // Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 12 8 13 9 #include <linux/device.h> 14 10 #include <linux/slab.h> ··· 1489 1493 WARN_ON(!map->bus); 1490 1494 1491 1495 /* Check for unwritable registers before we start */ 1492 - if (map->writeable_reg) 1493 - for (i = 0; i < val_len / map->format.val_bytes; i++) 1494 - if (!map->writeable_reg(map->dev, 1495 - reg + regmap_get_offset(map, i))) 1496 - return -EINVAL; 1496 + for (i = 0; i < val_len / map->format.val_bytes; i++) 1497 + if (!regmap_writeable(map, 1498 + reg + regmap_get_offset(map, i))) 1499 + return -EINVAL; 1497 1500 1498 1501 if (!map->cache_bypass && map->format.parse_val) { 1499 1502 unsigned int ival;