Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb3d3150 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "regmap: create a config option for register writes"

parents 69554c3e e7526d31
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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.
+2 −3
Original line number Diff line number Diff line
@@ -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
@@ -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;