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
Kirill Smelkov
linux
Commits
ca5537c9
Commit
ca5537c9
authored
Aug 26, 2021
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regmap/for-5.15' into regmap-next
parents
e22ce8eb
d287801c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
16 deletions
+48
-16
drivers/base/regmap/internal.h
drivers/base/regmap/internal.h
+4
-0
drivers/base/regmap/regmap-debugfs.c
drivers/base/regmap/regmap-debugfs.c
+1
-1
drivers/base/regmap/regmap-mmio.c
drivers/base/regmap/regmap-mmio.c
+1
-1
drivers/base/regmap/regmap.c
drivers/base/regmap/regmap.c
+37
-12
include/linux/regmap.h
include/linux/regmap.h
+5
-2
No files found.
drivers/base/regmap/internal.h
View file @
ca5537c9
...
...
@@ -53,6 +53,10 @@ struct regmap {
spinlock_t
spinlock
;
unsigned
long
spinlock_flags
;
};
struct
{
raw_spinlock_t
raw_spinlock
;
unsigned
long
raw_spinlock_flags
;
};
};
regmap_lock
lock
;
regmap_unlock
unlock
;
...
...
drivers/base/regmap/regmap-debugfs.c
View file @
ca5537c9
...
...
@@ -368,7 +368,7 @@ static ssize_t regmap_reg_ranges_read_file(struct file *file,
char
*
buf
;
char
*
entry
;
int
ret
;
unsigned
entry_len
;
unsigned
int
entry_len
;
if
(
*
ppos
<
0
||
!
count
)
return
-
EINVAL
;
...
...
drivers/base/regmap/regmap-mmio.c
View file @
ca5537c9
...
...
@@ -15,7 +15,7 @@
struct
regmap_mmio_context
{
void
__iomem
*
regs
;
unsigned
val_bytes
;
unsigned
int
val_bytes
;
bool
relaxed_mmio
;
bool
attached_clk
;
...
...
drivers/base/regmap/regmap.c
View file @
ca5537c9
...
...
@@ -533,6 +533,23 @@ __releases(&map->spinlock)
spin_unlock_irqrestore
(
&
map
->
spinlock
,
map
->
spinlock_flags
);
}
static
void
regmap_lock_raw_spinlock
(
void
*
__map
)
__acquires
(
&
map
->
raw_spinlock
)
{
struct
regmap
*
map
=
__map
;
unsigned
long
flags
;
raw_spin_lock_irqsave
(
&
map
->
raw_spinlock
,
flags
);
map
->
raw_spinlock_flags
=
flags
;
}
static
void
regmap_unlock_raw_spinlock
(
void
*
__map
)
__releases
(
&
map
->
raw_spinlock
)
{
struct
regmap
*
map
=
__map
;
raw_spin_unlock_irqrestore
(
&
map
->
raw_spinlock
,
map
->
raw_spinlock_flags
);
}
static
void
dev_get_regmap_release
(
struct
device
*
dev
,
void
*
res
)
{
/*
...
...
@@ -770,11 +787,19 @@ struct regmap *__regmap_init(struct device *dev,
}
else
{
if
((
bus
&&
bus
->
fast_io
)
||
config
->
fast_io
)
{
spin_lock_init
(
&
map
->
spinlock
);
map
->
lock
=
regmap_lock_spinlock
;
map
->
unlock
=
regmap_unlock_spinlock
;
lockdep_set_class_and_name
(
&
map
->
spinlock
,
lock_key
,
lock_name
);
if
(
config
->
use_raw_spinlock
)
{
raw_spin_lock_init
(
&
map
->
raw_spinlock
);
map
->
lock
=
regmap_lock_raw_spinlock
;
map
->
unlock
=
regmap_unlock_raw_spinlock
;
lockdep_set_class_and_name
(
&
map
->
raw_spinlock
,
lock_key
,
lock_name
);
}
else
{
spin_lock_init
(
&
map
->
spinlock
);
map
->
lock
=
regmap_lock_spinlock
;
map
->
unlock
=
regmap_unlock_spinlock
;
lockdep_set_class_and_name
(
&
map
->
spinlock
,
lock_key
,
lock_name
);
}
}
else
{
mutex_init
(
&
map
->
mutex
);
map
->
lock
=
regmap_lock_mutex
;
...
...
@@ -1126,10 +1151,10 @@ struct regmap *__regmap_init(struct device *dev,
/* Make sure, that this register range has no selector
or data window within its boundary */
for
(
j
=
0
;
j
<
config
->
num_ranges
;
j
++
)
{
unsigned
sel_reg
=
config
->
ranges
[
j
].
selector_reg
;
unsigned
win_min
=
config
->
ranges
[
j
].
window_start
;
unsigned
win_max
=
win_min
+
config
->
ranges
[
j
].
window_len
-
1
;
unsigned
int
sel_reg
=
config
->
ranges
[
j
].
selector_reg
;
unsigned
int
win_min
=
config
->
ranges
[
j
].
window_start
;
unsigned
int
win_max
=
win_min
+
config
->
ranges
[
j
].
window_len
-
1
;
/* Allow data window inside its own virtual range */
if
(
j
==
i
)
...
...
@@ -1298,7 +1323,7 @@ EXPORT_SYMBOL_GPL(devm_regmap_field_alloc);
*/
int
regmap_field_bulk_alloc
(
struct
regmap
*
regmap
,
struct
regmap_field
**
rm_field
,
struct
reg_field
*
reg_field
,
const
struct
reg_field
*
reg_field
,
int
num_fields
)
{
struct
regmap_field
*
rf
;
...
...
@@ -1334,7 +1359,7 @@ EXPORT_SYMBOL_GPL(regmap_field_bulk_alloc);
int
devm_regmap_field_bulk_alloc
(
struct
device
*
dev
,
struct
regmap
*
regmap
,
struct
regmap_field
**
rm_field
,
struct
reg_field
*
reg_field
,
const
struct
reg_field
*
reg_field
,
int
num_fields
)
{
struct
regmap_field
*
rf
;
...
...
@@ -1667,7 +1692,7 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
if
(
ret
)
{
dev_err
(
map
->
dev
,
"Error in caching of register: %x ret: %d
\n
"
,
reg
+
i
,
ret
);
reg
+
regmap_get_offset
(
map
,
i
)
,
ret
);
return
ret
;
}
}
...
...
include/linux/regmap.h
View file @
ca5537c9
...
...
@@ -344,6 +344,7 @@ typedef void (*regmap_unlock)(void *);
* @ranges: Array of configuration entries for virtual address ranges.
* @num_ranges: Number of range configuration entries.
* @use_hwlock: Indicate if a hardware spinlock should be used.
* @use_raw_spinlock: Indicate if a raw spinlock should be used.
* @hwlock_id: Specify the hardware spinlock id.
* @hwlock_mode: The hardware spinlock mode, should be HWLOCK_IRQSTATE,
* HWLOCK_IRQ or 0.
...
...
@@ -403,6 +404,7 @@ struct regmap_config {
unsigned
int
num_ranges
;
bool
use_hwlock
;
bool
use_raw_spinlock
;
unsigned
int
hwlock_id
;
unsigned
int
hwlock_mode
;
...
...
@@ -1269,12 +1271,13 @@ void devm_regmap_field_free(struct device *dev, struct regmap_field *field);
int
regmap_field_bulk_alloc
(
struct
regmap
*
regmap
,
struct
regmap_field
**
rm_field
,
struct
reg_field
*
reg_field
,
const
struct
reg_field
*
reg_field
,
int
num_fields
);
void
regmap_field_bulk_free
(
struct
regmap_field
*
field
);
int
devm_regmap_field_bulk_alloc
(
struct
device
*
dev
,
struct
regmap
*
regmap
,
struct
regmap_field
**
field
,
struct
reg_field
*
reg_field
,
int
num_fields
);
const
struct
reg_field
*
reg_field
,
int
num_fields
);
void
devm_regmap_field_bulk_free
(
struct
device
*
dev
,
struct
regmap_field
*
field
);
...
...
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