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
aaccf386
Commit
aaccf386
authored
Jul 04, 2019
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'regmap-5.3' into regmap-next
parents
ea09b3e2
eff5a850
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
6 deletions
+89
-6
drivers/base/regmap/Kconfig
drivers/base/regmap/Kconfig
+5
-1
drivers/base/regmap/Makefile
drivers/base/regmap/Makefile
+1
-0
drivers/base/regmap/regcache-lzo.c
drivers/base/regmap/regcache-lzo.c
+3
-5
drivers/base/regmap/regmap-i3c.c
drivers/base/regmap/regmap-i3c.c
+60
-0
include/linux/regmap.h
include/linux/regmap.h
+20
-0
No files found.
drivers/base/regmap/Kconfig
View file @
aaccf386
...
...
@@ -4,7 +4,7 @@
# subsystems should select the appropriate symbols.
config REGMAP
default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ
|| REGMAP_SCCB || REGMAP_I3C
)
select IRQ_DOMAIN if REGMAP_IRQ
bool
...
...
@@ -49,3 +49,7 @@ config REGMAP_SOUNDWIRE
config REGMAP_SCCB
tristate
depends on I2C
config REGMAP_I3C
tristate
depends on I3C
drivers/base/regmap/Makefile
View file @
aaccf386
...
...
@@ -16,3 +16,4 @@ obj-$(CONFIG_REGMAP_IRQ) += regmap-irq.o
obj-$(CONFIG_REGMAP_W1)
+=
regmap-w1.o
obj-$(CONFIG_REGMAP_SOUNDWIRE)
+=
regmap-sdw.o
obj-$(CONFIG_REGMAP_SCCB)
+=
regmap-sccb.o
obj-$(CONFIG_REGMAP_I3C)
+=
regmap-i3c.o
drivers/base/regmap/regcache-lzo.c
View file @
aaccf386
...
...
@@ -148,20 +148,18 @@ static int regcache_lzo_init(struct regmap *map)
* that register.
*/
bmp_size
=
map
->
num_reg_defaults_raw
;
sync_bmp
=
kmalloc_array
(
BITS_TO_LONGS
(
bmp_size
),
sizeof
(
long
),
GFP_KERNEL
);
sync_bmp
=
bitmap_zalloc
(
bmp_size
,
GFP_KERNEL
);
if
(
!
sync_bmp
)
{
ret
=
-
ENOMEM
;
goto
err
;
}
bitmap_zero
(
sync_bmp
,
bmp_size
);
/* allocate the lzo blocks and initialize them */
for
(
i
=
0
;
i
<
blkcount
;
i
++
)
{
lzo_blocks
[
i
]
=
kzalloc
(
sizeof
**
lzo_blocks
,
GFP_KERNEL
);
if
(
!
lzo_blocks
[
i
])
{
k
free
(
sync_bmp
);
bitmap_
free
(
sync_bmp
);
ret
=
-
ENOMEM
;
goto
err
;
}
...
...
@@ -213,7 +211,7 @@ static int regcache_lzo_exit(struct regmap *map)
* only once.
*/
if
(
lzo_blocks
[
0
])
k
free
(
lzo_blocks
[
0
]
->
sync_bmp
);
bitmap_
free
(
lzo_blocks
[
0
]
->
sync_bmp
);
for
(
i
=
0
;
i
<
blkcount
;
i
++
)
{
if
(
lzo_blocks
[
i
])
{
kfree
(
lzo_blocks
[
i
]
->
wmem
);
...
...
drivers/base/regmap/regmap-i3c.c
0 → 100644
View file @
aaccf386
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2018 Synopsys, Inc. and/or its affiliates.
#include <linux/regmap.h>
#include <linux/i3c/device.h>
#include <linux/i3c/master.h>
#include <linux/module.h>
static
int
regmap_i3c_write
(
void
*
context
,
const
void
*
data
,
size_t
count
)
{
struct
device
*
dev
=
context
;
struct
i3c_device
*
i3c
=
dev_to_i3cdev
(
dev
);
struct
i3c_priv_xfer
xfers
[]
=
{
{
.
rnw
=
false
,
.
len
=
count
,
.
data
.
out
=
data
,
},
};
return
i3c_device_do_priv_xfers
(
i3c
,
xfers
,
1
);
}
static
int
regmap_i3c_read
(
void
*
context
,
const
void
*
reg
,
size_t
reg_size
,
void
*
val
,
size_t
val_size
)
{
struct
device
*
dev
=
context
;
struct
i3c_device
*
i3c
=
dev_to_i3cdev
(
dev
);
struct
i3c_priv_xfer
xfers
[
2
];
xfers
[
0
].
rnw
=
false
;
xfers
[
0
].
len
=
reg_size
;
xfers
[
0
].
data
.
out
=
reg
;
xfers
[
1
].
rnw
=
true
;
xfers
[
1
].
len
=
val_size
;
xfers
[
1
].
data
.
in
=
val
;
return
i3c_device_do_priv_xfers
(
i3c
,
xfers
,
2
);
}
static
struct
regmap_bus
regmap_i3c
=
{
.
write
=
regmap_i3c_write
,
.
read
=
regmap_i3c_read
,
};
struct
regmap
*
__devm_regmap_init_i3c
(
struct
i3c_device
*
i3c
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
)
{
return
__devm_regmap_init
(
&
i3c
->
dev
,
&
regmap_i3c
,
&
i3c
->
dev
,
config
,
lock_key
,
lock_name
);
}
EXPORT_SYMBOL_GPL
(
__devm_regmap_init_i3c
);
MODULE_AUTHOR
(
"Vitor Soares <vitor.soares@synopsys.com>"
);
MODULE_DESCRIPTION
(
"Regmap I3C Module"
);
MODULE_LICENSE
(
"GPL v2"
);
include/linux/regmap.h
View file @
aaccf386
...
...
@@ -22,6 +22,7 @@ struct module;
struct
clk
;
struct
device
;
struct
i2c_client
;
struct
i3c_device
;
struct
irq_domain
;
struct
slim_device
;
struct
spi_device
;
...
...
@@ -621,6 +622,10 @@ struct regmap *__devm_regmap_init_slimbus(struct slim_device *slimbus,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
struct
regmap
*
__devm_regmap_init_i3c
(
struct
i3c_device
*
i3c
,
const
struct
regmap_config
*
config
,
struct
lock_class_key
*
lock_key
,
const
char
*
lock_name
);
/*
* Wrapper for regmap_init macros to include a unique lockdep key and name
* for each call. No-op if CONFIG_LOCKDEP is not set.
...
...
@@ -979,6 +984,21 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
#define devm_regmap_init_slimbus(slimbus, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_slimbus, #config, \
slimbus, config)
/**
* devm_regmap_init_i3c() - Initialise managed register map
*
* @i3c: Device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_i3c(i3c, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_i3c, #config, \
i3c, 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
);
...
...
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