Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
28893126
Commit
28893126
authored
Mar 12, 2018
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branches 'regmap/topic/debugfs' and 'regmap/topic/mmio-clk' into regmap-next
parents
493ea0c8
59dd2a85
31895662
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
2 deletions
+47
-2
drivers/base/regmap/regmap-debugfs.c
drivers/base/regmap/regmap-debugfs.c
+18
-2
drivers/base/regmap/regmap-mmio.c
drivers/base/regmap/regmap-mmio.c
+24
-0
drivers/base/regmap/regmap.c
drivers/base/regmap/regmap.c
+2
-0
include/linux/regmap.h
include/linux/regmap.h
+3
-0
No files found.
drivers/base/regmap/regmap-debugfs.c
View file @
28893126
...
@@ -25,6 +25,7 @@ struct regmap_debugfs_node {
...
@@ -25,6 +25,7 @@ struct regmap_debugfs_node {
struct
list_head
link
;
struct
list_head
link
;
};
};
static
unsigned
int
dummy_index
;
static
struct
dentry
*
regmap_debugfs_root
;
static
struct
dentry
*
regmap_debugfs_root
;
static
LIST_HEAD
(
regmap_debugfs_early_list
);
static
LIST_HEAD
(
regmap_debugfs_early_list
);
static
DEFINE_MUTEX
(
regmap_debugfs_early_lock
);
static
DEFINE_MUTEX
(
regmap_debugfs_early_lock
);
...
@@ -40,6 +41,7 @@ static ssize_t regmap_name_read_file(struct file *file,
...
@@ -40,6 +41,7 @@ static ssize_t regmap_name_read_file(struct file *file,
loff_t
*
ppos
)
loff_t
*
ppos
)
{
{
struct
regmap
*
map
=
file
->
private_data
;
struct
regmap
*
map
=
file
->
private_data
;
const
char
*
name
=
"nodev"
;
int
ret
;
int
ret
;
char
*
buf
;
char
*
buf
;
...
@@ -47,7 +49,10 @@ static ssize_t regmap_name_read_file(struct file *file,
...
@@ -47,7 +49,10 @@ static ssize_t regmap_name_read_file(struct file *file,
if
(
!
buf
)
if
(
!
buf
)
return
-
ENOMEM
;
return
-
ENOMEM
;
ret
=
snprintf
(
buf
,
PAGE_SIZE
,
"%s
\n
"
,
map
->
dev
->
driver
->
name
);
if
(
map
->
dev
&&
map
->
dev
->
driver
)
name
=
map
->
dev
->
driver
->
name
;
ret
=
snprintf
(
buf
,
PAGE_SIZE
,
"%s
\n
"
,
name
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
kfree
(
buf
);
kfree
(
buf
);
return
ret
;
return
ret
;
...
@@ -569,9 +574,20 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
...
@@ -569,9 +574,20 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
name
=
devname
;
name
=
devname
;
}
}
if
(
!
strcmp
(
name
,
"dummy"
))
{
map
->
debugfs_name
=
kasprintf
(
GFP_KERNEL
,
"dummy%d"
,
dummy_index
);
name
=
map
->
debugfs_name
;
dummy_index
++
;
}
map
->
debugfs
=
debugfs_create_dir
(
name
,
regmap_debugfs_root
);
map
->
debugfs
=
debugfs_create_dir
(
name
,
regmap_debugfs_root
);
if
(
!
map
->
debugfs
)
{
if
(
!
map
->
debugfs
)
{
dev_warn
(
map
->
dev
,
"Failed to create debugfs directory
\n
"
);
dev_warn
(
map
->
dev
,
"Failed to create %s debugfs directory
\n
"
,
name
);
kfree
(
map
->
debugfs_name
);
map
->
debugfs_name
=
NULL
;
return
;
return
;
}
}
...
...
drivers/base/regmap/regmap-mmio.c
View file @
28893126
...
@@ -28,6 +28,8 @@
...
@@ -28,6 +28,8 @@
struct
regmap_mmio_context
{
struct
regmap_mmio_context
{
void
__iomem
*
regs
;
void
__iomem
*
regs
;
unsigned
val_bytes
;
unsigned
val_bytes
;
bool
attached_clk
;
struct
clk
*
clk
;
struct
clk
*
clk
;
void
(
*
reg_write
)(
struct
regmap_mmio_context
*
ctx
,
void
(
*
reg_write
)(
struct
regmap_mmio_context
*
ctx
,
...
@@ -363,4 +365,26 @@ struct regmap *__devm_regmap_init_mmio_clk(struct device *dev,
...
@@ -363,4 +365,26 @@ struct regmap *__devm_regmap_init_mmio_clk(struct device *dev,
}
}
EXPORT_SYMBOL_GPL
(
__devm_regmap_init_mmio_clk
);
EXPORT_SYMBOL_GPL
(
__devm_regmap_init_mmio_clk
);
int
regmap_mmio_attach_clk
(
struct
regmap
*
map
,
struct
clk
*
clk
)
{
struct
regmap_mmio_context
*
ctx
=
map
->
bus_context
;
ctx
->
clk
=
clk
;
ctx
->
attached_clk
=
true
;
return
clk_prepare
(
ctx
->
clk
);
}
EXPORT_SYMBOL_GPL
(
regmap_mmio_attach_clk
);
void
regmap_mmio_detach_clk
(
struct
regmap
*
map
)
{
struct
regmap_mmio_context
*
ctx
=
map
->
bus_context
;
clk_unprepare
(
ctx
->
clk
);
ctx
->
attached_clk
=
false
;
ctx
->
clk
=
NULL
;
}
EXPORT_SYMBOL_GPL
(
regmap_mmio_detach_clk
);
MODULE_LICENSE
(
"GPL v2"
);
MODULE_LICENSE
(
"GPL v2"
);
drivers/base/regmap/regmap.c
View file @
28893126
...
@@ -1116,6 +1116,8 @@ struct regmap *__regmap_init(struct device *dev,
...
@@ -1116,6 +1116,8 @@ struct regmap *__regmap_init(struct device *dev,
ret
=
regmap_attach_dev
(
dev
,
map
,
config
);
ret
=
regmap_attach_dev
(
dev
,
map
,
config
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
goto
err_regcache
;
goto
err_regcache
;
}
else
{
regmap_debugfs_init
(
map
,
config
->
name
);
}
}
return
map
;
return
map
;
...
...
include/linux/regmap.h
View file @
28893126
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <linux/lockdep.h>
#include <linux/lockdep.h>
struct
module
;
struct
module
;
struct
clk
;
struct
device
;
struct
device
;
struct
i2c_client
;
struct
i2c_client
;
struct
irq_domain
;
struct
irq_domain
;
...
@@ -905,6 +906,8 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
...
@@ -905,6 +906,8 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
__regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config, \
__regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config, \
sdw, config)
sdw, config)
int
regmap_mmio_attach_clk
(
struct
regmap
*
map
,
struct
clk
*
clk
);
void
regmap_mmio_detach_clk
(
struct
regmap
*
map
);
void
regmap_exit
(
struct
regmap
*
map
);
void
regmap_exit
(
struct
regmap
*
map
);
int
regmap_reinit_cache
(
struct
regmap
*
map
,
int
regmap_reinit_cache
(
struct
regmap
*
map
,
const
struct
regmap_config
*
config
);
const
struct
regmap_config
*
config
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment