Loading drivers/base/regmap/Kconfig +10 −0 Original line number Diff line number Diff line Loading @@ -29,3 +29,13 @@ config REGMAP_IRQ config REGMAP_SWR tristate config REGMAP_ALLOW_WRITE_DEBUGFS bool "Allow register writes through debugfs" depends on DEBUG_FS depends on REGMAP help Add support to allow register writes through debugfs. Client driver can enable this config option to write registers using debugfs from regmap registers file. drivers/base/regmap/regmap-debugfs.c +2 −3 Original line number Diff line number Diff line Loading @@ -261,8 +261,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf, count, ppos); } #undef REGMAP_ALLOW_WRITE_DEBUGFS #ifdef REGMAP_ALLOW_WRITE_DEBUGFS #if IS_ENABLED(CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS) /* * This can be dangerous especially when we have clients such as * PMICs, therefore don't provide any real compile time configuration option Loading Loading @@ -518,7 +517,7 @@ void regmap_debugfs_init(struct regmap *map, const char *name) if (map->max_register || regmap_readable(map, 0)) { umode_t registers_mode; if (IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS)) if (IS_ENABLED(CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS)) registers_mode = 0600; else registers_mode = 0400; Loading Loading
drivers/base/regmap/Kconfig +10 −0 Original line number Diff line number Diff line Loading @@ -29,3 +29,13 @@ config REGMAP_IRQ config REGMAP_SWR tristate config REGMAP_ALLOW_WRITE_DEBUGFS bool "Allow register writes through debugfs" depends on DEBUG_FS depends on REGMAP help Add support to allow register writes through debugfs. Client driver can enable this config option to write registers using debugfs from regmap registers file.
drivers/base/regmap/regmap-debugfs.c +2 −3 Original line number Diff line number Diff line Loading @@ -261,8 +261,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf, count, ppos); } #undef REGMAP_ALLOW_WRITE_DEBUGFS #ifdef REGMAP_ALLOW_WRITE_DEBUGFS #if IS_ENABLED(CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS) /* * This can be dangerous especially when we have clients such as * PMICs, therefore don't provide any real compile time configuration option Loading Loading @@ -518,7 +517,7 @@ void regmap_debugfs_init(struct regmap *map, const char *name) if (map->max_register || regmap_readable(map, 0)) { umode_t registers_mode; if (IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS)) if (IS_ENABLED(CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS)) registers_mode = 0600; else registers_mode = 0400; Loading