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
04bc9ac1
Commit
04bc9ac1
authored
Oct 28, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regmap/topic/spmi' into regmap-next
parents
c435d5b9
a01779f8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
1 deletion
+100
-1
drivers/base/regmap/Kconfig
drivers/base/regmap/Kconfig
+4
-1
drivers/base/regmap/Makefile
drivers/base/regmap/Makefile
+1
-0
drivers/base/regmap/regmap-spmi.c
drivers/base/regmap/regmap-spmi.c
+90
-0
include/linux/regmap.h
include/linux/regmap.h
+5
-0
No files found.
drivers/base/regmap/Kconfig
View file @
04bc9ac1
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
# subsystems should select the appropriate symbols.
# subsystems should select the appropriate symbols.
config REGMAP
config REGMAP
default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_MMIO || REGMAP_IRQ)
default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_
SPMI || REGMAP_
MMIO || REGMAP_IRQ)
select LZO_COMPRESS
select LZO_COMPRESS
select LZO_DECOMPRESS
select LZO_DECOMPRESS
select IRQ_DOMAIN if REGMAP_IRQ
select IRQ_DOMAIN if REGMAP_IRQ
...
@@ -15,6 +15,9 @@ config REGMAP_I2C
...
@@ -15,6 +15,9 @@ config REGMAP_I2C
config REGMAP_SPI
config REGMAP_SPI
tristate
tristate
config REGMAP_SPMI
tristate
config REGMAP_MMIO
config REGMAP_MMIO
tristate
tristate
...
...
drivers/base/regmap/Makefile
View file @
04bc9ac1
...
@@ -3,5 +3,6 @@ obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.o regcache-flat.o
...
@@ -3,5 +3,6 @@ obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.o regcache-flat.o
obj-$(CONFIG_DEBUG_FS)
+=
regmap-debugfs.o
obj-$(CONFIG_DEBUG_FS)
+=
regmap-debugfs.o
obj-$(CONFIG_REGMAP_I2C)
+=
regmap-i2c.o
obj-$(CONFIG_REGMAP_I2C)
+=
regmap-i2c.o
obj-$(CONFIG_REGMAP_SPI)
+=
regmap-spi.o
obj-$(CONFIG_REGMAP_SPI)
+=
regmap-spi.o
obj-$(CONFIG_REGMAP_SPMI)
+=
regmap-spmi.o
obj-$(CONFIG_REGMAP_MMIO)
+=
regmap-mmio.o
obj-$(CONFIG_REGMAP_MMIO)
+=
regmap-mmio.o
obj-$(CONFIG_REGMAP_IRQ)
+=
regmap-irq.o
obj-$(CONFIG_REGMAP_IRQ)
+=
regmap-irq.o
drivers/base/regmap/regmap-spmi.c
0 → 100644
View file @
04bc9ac1
/*
* Register map access API - SPMI support
*
* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* Based on regmap-i2c.c:
* Copyright 2011 Wolfson Microelectronics plc
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/regmap.h>
#include <linux/spmi.h>
#include <linux/module.h>
#include <linux/init.h>
static
int
regmap_spmi_read
(
void
*
context
,
const
void
*
reg
,
size_t
reg_size
,
void
*
val
,
size_t
val_size
)
{
BUG_ON
(
reg_size
!=
2
);
return
spmi_ext_register_readl
(
context
,
*
(
u16
*
)
reg
,
val
,
val_size
);
}
static
int
regmap_spmi_gather_write
(
void
*
context
,
const
void
*
reg
,
size_t
reg_size
,
const
void
*
val
,
size_t
val_size
)
{
BUG_ON
(
reg_size
!=
2
);
return
spmi_ext_register_writel
(
context
,
*
(
u16
*
)
reg
,
val
,
val_size
);
}
static
int
regmap_spmi_write
(
void
*
context
,
const
void
*
data
,
size_t
count
)
{
BUG_ON
(
count
<
2
);
return
regmap_spmi_gather_write
(
context
,
data
,
2
,
data
+
2
,
count
-
2
);
}
static
struct
regmap_bus
regmap_spmi
=
{
.
read
=
regmap_spmi_read
,
.
write
=
regmap_spmi_write
,
.
gather_write
=
regmap_spmi_gather_write
,
.
reg_format_endian_default
=
REGMAP_ENDIAN_NATIVE
,
.
val_format_endian_default
=
REGMAP_ENDIAN_NATIVE
,
};
/**
* regmap_init_spmi(): Initialize register map
*
* @sdev: 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.
*/
struct
regmap
*
regmap_init_spmi
(
struct
spmi_device
*
sdev
,
const
struct
regmap_config
*
config
)
{
return
regmap_init
(
&
sdev
->
dev
,
&
regmap_spmi
,
sdev
,
config
);
}
EXPORT_SYMBOL_GPL
(
regmap_init_spmi
);
/**
* devm_regmap_init_spmi(): Initialise managed register map
*
* @sdev: 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.
*/
struct
regmap
*
devm_regmap_init_spmi
(
struct
spmi_device
*
sdev
,
const
struct
regmap_config
*
config
)
{
return
devm_regmap_init
(
&
sdev
->
dev
,
&
regmap_spmi
,
sdev
,
config
);
}
EXPORT_SYMBOL_GPL
(
devm_regmap_init_spmi
);
MODULE_LICENSE
(
"GPL"
);
include/linux/regmap.h
View file @
04bc9ac1
...
@@ -23,6 +23,7 @@ struct device;
...
@@ -23,6 +23,7 @@ struct device;
struct
i2c_client
;
struct
i2c_client
;
struct
irq_domain
;
struct
irq_domain
;
struct
spi_device
;
struct
spi_device
;
struct
spmi_device
;
struct
regmap
;
struct
regmap
;
struct
regmap_range_cfg
;
struct
regmap_range_cfg
;
struct
regmap_field
;
struct
regmap_field
;
...
@@ -320,6 +321,8 @@ struct regmap *regmap_init_i2c(struct i2c_client *i2c,
...
@@ -320,6 +321,8 @@ struct regmap *regmap_init_i2c(struct i2c_client *i2c,
const
struct
regmap_config
*
config
);
const
struct
regmap_config
*
config
);
struct
regmap
*
regmap_init_spi
(
struct
spi_device
*
dev
,
struct
regmap
*
regmap_init_spi
(
struct
spi_device
*
dev
,
const
struct
regmap_config
*
config
);
const
struct
regmap_config
*
config
);
struct
regmap
*
regmap_init_spmi
(
struct
spmi_device
*
dev
,
const
struct
regmap_config
*
config
);
struct
regmap
*
regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
struct
regmap
*
regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
void
__iomem
*
regs
,
void
__iomem
*
regs
,
const
struct
regmap_config
*
config
);
const
struct
regmap_config
*
config
);
...
@@ -332,6 +335,8 @@ struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
...
@@ -332,6 +335,8 @@ struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
const
struct
regmap_config
*
config
);
const
struct
regmap_config
*
config
);
struct
regmap
*
devm_regmap_init_spi
(
struct
spi_device
*
dev
,
struct
regmap
*
devm_regmap_init_spi
(
struct
spi_device
*
dev
,
const
struct
regmap_config
*
config
);
const
struct
regmap_config
*
config
);
struct
regmap
*
devm_regmap_init_spmi
(
struct
spmi_device
*
dev
,
const
struct
regmap_config
*
config
);
struct
regmap
*
devm_regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
struct
regmap
*
devm_regmap_init_mmio_clk
(
struct
device
*
dev
,
const
char
*
clk_id
,
void
__iomem
*
regs
,
void
__iomem
*
regs
,
const
struct
regmap_config
*
config
);
const
struct
regmap_config
*
config
);
...
...
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