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
06fae51b
Commit
06fae51b
authored
Jun 29, 2022
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
regmap: Merge up fixes
Needed for the regmap-irq rework.
parents
3d0afe9c
3f05010f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
drivers/base/regmap/regmap-irq.c
drivers/base/regmap/regmap-irq.c
+5
-3
drivers/base/regmap/regmap.c
drivers/base/regmap/regmap.c
+8
-7
No files found.
drivers/base/regmap/regmap-irq.c
View file @
06fae51b
...
...
@@ -252,6 +252,7 @@ static void regmap_irq_enable(struct irq_data *data)
struct
regmap_irq_chip_data
*
d
=
irq_data_get_irq_chip_data
(
data
);
struct
regmap
*
map
=
d
->
map
;
const
struct
regmap_irq
*
irq_data
=
irq_to_regmap_irq
(
d
,
data
->
hwirq
);
unsigned
int
reg
=
irq_data
->
reg_offset
/
map
->
reg_stride
;
unsigned
int
mask
,
type
;
type
=
irq_data
->
type
.
type_falling_val
|
irq_data
->
type
.
type_rising_val
;
...
...
@@ -268,14 +269,14 @@ static void regmap_irq_enable(struct irq_data *data)
* at the corresponding offset in regmap_irq_set_type().
*/
if
(
d
->
chip
->
type_in_mask
&&
type
)
mask
=
d
->
type_buf
[
irq_data
->
reg_offset
/
map
->
reg_stride
]
;
mask
=
d
->
type_buf
[
reg
]
&
irq_data
->
mask
;
else
mask
=
irq_data
->
mask
;
if
(
d
->
chip
->
clear_on_unmask
)
d
->
clear_status
=
true
;
d
->
mask_buf
[
irq_data
->
reg_offset
/
map
->
reg_stride
]
&=
~
mask
;
d
->
mask_buf
[
reg
]
&=
~
mask
;
}
static
void
regmap_irq_disable
(
struct
irq_data
*
data
)
...
...
@@ -386,6 +387,7 @@ static inline int read_sub_irq_data(struct regmap_irq_chip_data *data,
subreg
=
&
chip
->
sub_reg_offsets
[
b
];
for
(
i
=
0
;
i
<
subreg
->
num_regs
;
i
++
)
{
unsigned
int
offset
=
subreg
->
offset
[
i
];
unsigned
int
index
=
offset
/
map
->
reg_stride
;
if
(
chip
->
not_fixed_stride
)
ret
=
regmap_read
(
map
,
...
...
@@ -394,7 +396,7 @@ static inline int read_sub_irq_data(struct regmap_irq_chip_data *data,
else
ret
=
regmap_read
(
map
,
chip
->
status_base
+
offset
,
&
data
->
status_buf
[
offset
]);
&
data
->
status_buf
[
index
]);
if
(
ret
)
break
;
...
...
drivers/base/regmap/regmap.c
View file @
06fae51b
...
...
@@ -1880,8 +1880,7 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
*/
bool
regmap_can_raw_write
(
struct
regmap
*
map
)
{
return
map
->
bus
&&
map
->
bus
->
write
&&
map
->
format
.
format_val
&&
map
->
format
.
format_reg
;
return
map
->
write
&&
map
->
format
.
format_val
&&
map
->
format
.
format_reg
;
}
EXPORT_SYMBOL_GPL
(
regmap_can_raw_write
);
...
...
@@ -2155,10 +2154,9 @@ int regmap_noinc_write(struct regmap *map, unsigned int reg,
size_t
write_len
;
int
ret
;
if
(
!
map
->
bus
)
return
-
EINVAL
;
if
(
!
map
->
bus
->
write
)
if
(
!
map
->
write
)
return
-
ENOTSUPP
;
if
(
val_len
%
map
->
format
.
val_bytes
)
return
-
EINVAL
;
if
(
!
IS_ALIGNED
(
reg
,
map
->
reg_stride
))
...
...
@@ -2300,7 +2298,7 @@ int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
* Some devices don't support bulk write, for them we have a series of
* single write operations.
*/
if
(
!
map
->
bus
||
!
map
->
format
.
parse_inplace
)
{
if
(
!
map
->
write
||
!
map
->
format
.
parse_inplace
)
{
map
->
lock
(
map
->
lock_arg
);
for
(
i
=
0
;
i
<
val_count
;
i
++
)
{
unsigned
int
ival
;
...
...
@@ -2926,6 +2924,9 @@ int regmap_noinc_read(struct regmap *map, unsigned int reg,
size_t
read_len
;
int
ret
;
if
(
!
map
->
read
)
return
-
ENOTSUPP
;
if
(
val_len
%
map
->
format
.
val_bytes
)
return
-
EINVAL
;
if
(
!
IS_ALIGNED
(
reg
,
map
->
reg_stride
))
...
...
@@ -3039,7 +3040,7 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
if
(
val_count
==
0
)
return
-
EINVAL
;
if
(
map
->
format
.
parse_inplace
&&
(
vol
||
map
->
cache_type
==
REGCACHE_NONE
))
{
if
(
map
->
read
&&
map
->
format
.
parse_inplace
&&
(
vol
||
map
->
cache_type
==
REGCACHE_NONE
))
{
ret
=
regmap_raw_read
(
map
,
reg
,
val
,
val_bytes
*
val_count
);
if
(
ret
!=
0
)
return
ret
;
...
...
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