summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-frontends/rtl2832.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-12-14 22:23:28 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-03 21:10:54 +0300
commitdcadb82a7a1d844f79c83578b5d2840fdb2a3ddd (patch)
tree855b5ed3c1867a7a93980454d64ddef5939e4379 /drivers/media/dvb-frontends/rtl2832.c
parente20b0cf2f394304577df86417f37f02e26caa9fa (diff)
downloadlinux-dcadb82a7a1d844f79c83578b5d2840fdb2a3ddd.tar.xz
[media] rtl2832: use regmap reg cache
Enable regmap register cache in order to reduce IO. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/rtl2832.c')
-rw-r--r--drivers/media/dvb-frontends/rtl2832.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c
index e59765fa8e7c..66f915dd24a6 100644
--- a/drivers/media/dvb-frontends/rtl2832.c
+++ b/drivers/media/dvb-frontends/rtl2832.c
@@ -986,6 +986,22 @@ static struct dvb_frontend_ops rtl2832_ops = {
.read_ber = rtl2832_read_ber,
};
+static bool rtl2832_volatile_reg(struct device *dev, unsigned int reg)
+{
+ switch (reg) {
+ case 0x305:
+ case 0x33c:
+ case 0x34e:
+ case 0x351:
+ case 0x40c ... 0x40d:
+ return true;
+ default:
+ break;
+ }
+
+ return false;
+}
+
/*
* We implement own I2C access routines for regmap in order to get manual access
* to I2C adapter lock, which is needed for I2C mux adapter.
@@ -1240,9 +1256,11 @@ static int rtl2832_probe(struct i2c_client *client,
static const struct regmap_config regmap_config = {
.reg_bits = 8,
.val_bits = 8,
+ .volatile_reg = rtl2832_volatile_reg,
.max_register = 5 * 0x100,
.ranges = regmap_range_cfg,
.num_ranges = ARRAY_SIZE(regmap_range_cfg),
+ .cache_type = REGCACHE_RBTREE,
};
dev_dbg(&client->dev, "\n");