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
5eff79fe
Commit
5eff79fe
authored
Oct 28, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regmap/topic/async' into regmap-next
parents
70c1c86d
04c50ccf
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
225 additions
and
50 deletions
+225
-50
drivers/base/regmap/internal.h
drivers/base/regmap/internal.h
+3
-2
drivers/base/regmap/regcache.c
drivers/base/regmap/regcache.c
+15
-4
drivers/base/regmap/regmap-spi.c
drivers/base/regmap/regmap-spi.c
+2
-1
drivers/base/regmap/regmap.c
drivers/base/regmap/regmap.c
+174
-43
include/linux/regmap.h
include/linux/regmap.h
+31
-0
No files found.
drivers/base/regmap/internal.h
View file @
5eff79fe
...
...
@@ -44,7 +44,6 @@ struct regmap_format {
struct
regmap_async
{
struct
list_head
list
;
struct
work_struct
cleanup
;
struct
regmap
*
map
;
void
*
work_buf
;
};
...
...
@@ -64,9 +63,11 @@ struct regmap {
void
*
bus_context
;
const
char
*
name
;
bool
async
;
spinlock_t
async_lock
;
wait_queue_head_t
async_waitq
;
struct
list_head
async_list
;
struct
list_head
async_free
;
int
async_ret
;
#ifdef CONFIG_DEBUG_FS
...
...
@@ -218,7 +219,7 @@ bool regcache_set_val(struct regmap *map, void *base, unsigned int idx,
int
regcache_lookup_reg
(
struct
regmap
*
map
,
unsigned
int
reg
);
int
_regmap_raw_write
(
struct
regmap
*
map
,
unsigned
int
reg
,
const
void
*
val
,
size_t
val_len
,
bool
async
);
const
void
*
val
,
size_t
val_len
);
void
regmap_async_complete_cb
(
struct
regmap_async
*
async
,
int
ret
);
...
...
drivers/base/regmap/regcache.c
View file @
5eff79fe
...
...
@@ -307,6 +307,8 @@ int regcache_sync(struct regmap *map)
if
(
!
map
->
cache_dirty
)
goto
out
;
map
->
async
=
true
;
/* Apply any patch first */
map
->
cache_bypass
=
1
;
for
(
i
=
0
;
i
<
map
->
patch_regs
;
i
++
)
{
...
...
@@ -332,11 +334,15 @@ int regcache_sync(struct regmap *map)
map
->
cache_dirty
=
false
;
out:
trace_regcache_sync
(
map
->
dev
,
name
,
"stop"
);
/* Restore the bypass state */
map
->
async
=
false
;
map
->
cache_bypass
=
bypass
;
map
->
unlock
(
map
->
lock_arg
);
regmap_async_complete
(
map
);
trace_regcache_sync
(
map
->
dev
,
name
,
"stop"
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
regcache_sync
);
...
...
@@ -375,17 +381,23 @@ int regcache_sync_region(struct regmap *map, unsigned int min,
if
(
!
map
->
cache_dirty
)
goto
out
;
map
->
async
=
true
;
if
(
map
->
cache_ops
->
sync
)
ret
=
map
->
cache_ops
->
sync
(
map
,
min
,
max
);
else
ret
=
regcache_default_sync
(
map
,
min
,
max
);
out:
trace_regcache_sync
(
map
->
dev
,
name
,
"stop region"
);
/* Restore the bypass state */
map
->
cache_bypass
=
bypass
;
map
->
async
=
false
;
map
->
unlock
(
map
->
lock_arg
);
regmap_async_complete
(
map
);
trace_regcache_sync
(
map
->
dev
,
name
,
"stop region"
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
regcache_sync_region
);
...
...
@@ -631,8 +643,7 @@ static int regcache_sync_block_raw_flush(struct regmap *map, const void **data,
map
->
cache_bypass
=
1
;
ret
=
_regmap_raw_write
(
map
,
base
,
*
data
,
count
*
val_bytes
,
false
);
ret
=
_regmap_raw_write
(
map
,
base
,
*
data
,
count
*
val_bytes
);
map
->
cache_bypass
=
0
;
...
...
drivers/base/regmap/regmap-spi.c
View file @
5eff79fe
...
...
@@ -73,7 +73,8 @@ static int regmap_spi_async_write(void *context,
spi_message_init
(
&
async
->
m
);
spi_message_add_tail
(
&
async
->
t
[
0
],
&
async
->
m
);
spi_message_add_tail
(
&
async
->
t
[
1
],
&
async
->
m
);
if
(
val
)
spi_message_add_tail
(
&
async
->
t
[
1
],
&
async
->
m
);
async
->
m
.
complete
=
regmap_spi_complete
;
async
->
m
.
context
=
async
;
...
...
drivers/base/regmap/regmap.c
View file @
5eff79fe
This diff is collapsed.
Click to expand it.
include/linux/regmap.h
View file @
5eff79fe
...
...
@@ -374,6 +374,7 @@ int regmap_reinit_cache(struct regmap *map,
const
struct
regmap_config
*
config
);
struct
regmap
*
dev_get_regmap
(
struct
device
*
dev
,
const
char
*
name
);
int
regmap_write
(
struct
regmap
*
map
,
unsigned
int
reg
,
unsigned
int
val
);
int
regmap_write_async
(
struct
regmap
*
map
,
unsigned
int
reg
,
unsigned
int
val
);
int
regmap_raw_write
(
struct
regmap
*
map
,
unsigned
int
reg
,
const
void
*
val
,
size_t
val_len
);
int
regmap_bulk_write
(
struct
regmap
*
map
,
unsigned
int
reg
,
const
void
*
val
,
...
...
@@ -387,9 +388,14 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
size_t
val_count
);
int
regmap_update_bits
(
struct
regmap
*
map
,
unsigned
int
reg
,
unsigned
int
mask
,
unsigned
int
val
);
int
regmap_update_bits_async
(
struct
regmap
*
map
,
unsigned
int
reg
,
unsigned
int
mask
,
unsigned
int
val
);
int
regmap_update_bits_check
(
struct
regmap
*
map
,
unsigned
int
reg
,
unsigned
int
mask
,
unsigned
int
val
,
bool
*
change
);
int
regmap_update_bits_check_async
(
struct
regmap
*
map
,
unsigned
int
reg
,
unsigned
int
mask
,
unsigned
int
val
,
bool
*
change
);
int
regmap_get_val_bytes
(
struct
regmap
*
map
);
int
regmap_async_complete
(
struct
regmap
*
map
);
bool
regmap_can_raw_write
(
struct
regmap
*
map
);
...
...
@@ -527,6 +533,13 @@ static inline int regmap_write(struct regmap *map, unsigned int reg,
return
-
EINVAL
;
}
static
inline
int
regmap_write_async
(
struct
regmap
*
map
,
unsigned
int
reg
,
unsigned
int
val
)
{
WARN_ONCE
(
1
,
"regmap API is disabled"
);
return
-
EINVAL
;
}
static
inline
int
regmap_raw_write
(
struct
regmap
*
map
,
unsigned
int
reg
,
const
void
*
val
,
size_t
val_len
)
{
...
...
@@ -576,6 +589,14 @@ static inline int regmap_update_bits(struct regmap *map, unsigned int reg,
return
-
EINVAL
;
}
static
inline
int
regmap_update_bits_async
(
struct
regmap
*
map
,
unsigned
int
reg
,
unsigned
int
mask
,
unsigned
int
val
)
{
WARN_ONCE
(
1
,
"regmap API is disabled"
);
return
-
EINVAL
;
}
static
inline
int
regmap_update_bits_check
(
struct
regmap
*
map
,
unsigned
int
reg
,
unsigned
int
mask
,
unsigned
int
val
,
...
...
@@ -585,6 +606,16 @@ static inline int regmap_update_bits_check(struct regmap *map,
return
-
EINVAL
;
}
static
inline
int
regmap_update_bits_check_async
(
struct
regmap
*
map
,
unsigned
int
reg
,
unsigned
int
mask
,
unsigned
int
val
,
bool
*
change
)
{
WARN_ONCE
(
1
,
"regmap API is disabled"
);
return
-
EINVAL
;
}
static
inline
int
regmap_get_val_bytes
(
struct
regmap
*
map
)
{
WARN_ONCE
(
1
,
"regmap API is disabled"
);
...
...
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