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
c2b164fa
Commit
c2b164fa
authored
Nov 08, 2011
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/cache' of
git://opensource.wolfsonmicro.com/regmap
into for-3.3
parents
e94de1e8
8ae0d7e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletion
+24
-1
drivers/base/regmap/internal.h
drivers/base/regmap/internal.h
+1
-0
drivers/base/regmap/regcache.c
drivers/base/regmap/regcache.c
+19
-0
drivers/base/regmap/regmap.c
drivers/base/regmap/regmap.c
+3
-1
include/linux/regmap.h
include/linux/regmap.h
+1
-0
No files found.
drivers/base/regmap/internal.h
View file @
c2b164fa
...
...
@@ -74,6 +74,7 @@ struct regmap {
struct
reg_default
*
reg_defaults
;
const
void
*
reg_defaults_raw
;
void
*
cache
;
bool
cache_dirty
;
};
struct
regcache_ops
{
...
...
drivers/base/regmap/regcache.c
View file @
c2b164fa
...
...
@@ -241,6 +241,8 @@ int regcache_sync(struct regmap *map)
map
->
cache_ops
->
name
);
name
=
map
->
cache_ops
->
name
;
trace_regcache_sync
(
map
->
dev
,
name
,
"start"
);
if
(
!
map
->
cache_dirty
)
goto
out
;
if
(
map
->
cache_ops
->
sync
)
{
ret
=
map
->
cache_ops
->
sync
(
map
);
}
else
{
...
...
@@ -290,6 +292,23 @@ void regcache_cache_only(struct regmap *map, bool enable)
}
EXPORT_SYMBOL_GPL
(
regcache_cache_only
);
/**
* regcache_mark_dirty: Mark the register cache as dirty
*
* @map: map to mark
*
* Mark the register cache as dirty, for example due to the device
* having been powered down for suspend. If the cache is not marked
* as dirty then the cache sync will be suppressed.
*/
void
regcache_mark_dirty
(
struct
regmap
*
map
)
{
mutex_lock
(
&
map
->
lock
);
map
->
cache_dirty
=
true
;
mutex_unlock
(
&
map
->
lock
);
}
EXPORT_SYMBOL_GPL
(
regcache_mark_dirty
);
/**
* regcache_cache_bypass: Put a register map into cache bypass mode
*
...
...
drivers/base/regmap/regmap.c
View file @
c2b164fa
...
...
@@ -306,8 +306,10 @@ int _regmap_write(struct regmap *map, unsigned int reg,
ret
=
regcache_write
(
map
,
reg
,
val
);
if
(
ret
!=
0
)
return
ret
;
if
(
map
->
cache_only
)
if
(
map
->
cache_only
)
{
map
->
cache_dirty
=
true
;
return
0
;
}
}
trace_regmap_reg_write
(
map
->
dev
,
reg
,
val
);
...
...
include/linux/regmap.h
View file @
c2b164fa
...
...
@@ -143,5 +143,6 @@ int regmap_update_bits(struct regmap *map, unsigned int reg,
int
regcache_sync
(
struct
regmap
*
map
);
void
regcache_cache_only
(
struct
regmap
*
map
,
bool
enable
);
void
regcache_cache_bypass
(
struct
regmap
*
map
,
bool
enable
);
void
regcache_mark_dirty
(
struct
regmap
*
map
);
#endif
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