diff options
author | Daniel Mack <zonque@gmail.com> | 2013-06-24 10:25:30 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-06-25 05:26:47 -0400 |
commit | 8892d479f1ba505c835e31bb66fcf3994f5127aa (patch) | |
tree | 1465b8aac6977638931f04fc26ba829885807aae /sound | |
parent | 6b36d370ad66aa73328a0cd8763f6028e7b28f6c (diff) |
ASoC: tas5086: add more register defines
Add register definitions for input and output mux registers, and rewrite
the tas5086_accessible_reg() function.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/tas5086.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c index 57c9de02b14f..8130ab5d9848 100644 --- a/sound/soc/codecs/tas5086.c +++ b/sound/soc/codecs/tas5086.c | |||
@@ -83,6 +83,10 @@ | |||
83 | #define TAS5086_SPLIT_CAP_CHARGE 0x1a /* Split cap charge period register */ | 83 | #define TAS5086_SPLIT_CAP_CHARGE 0x1a /* Split cap charge period register */ |
84 | #define TAS5086_OSC_TRIM 0x1b /* Oscillator trim register */ | 84 | #define TAS5086_OSC_TRIM 0x1b /* Oscillator trim register */ |
85 | #define TAS5086_BKNDERR 0x1c | 85 | #define TAS5086_BKNDERR 0x1c |
86 | #define TAS5086_INPUT_MUX 0x20 | ||
87 | #define TAS5086_PWM_OUTPUT_MUX 0x25 | ||
88 | |||
89 | #define TAS5086_MAX_REGISTER TAS5086_PWM_OUTPUT_MUX | ||
86 | 90 | ||
87 | /* | 91 | /* |
88 | * Default TAS5086 power-up configuration | 92 | * Default TAS5086 power-up configuration |
@@ -124,6 +128,9 @@ static int tas5086_register_size(struct device *dev, unsigned int reg) | |||
124 | switch (reg) { | 128 | switch (reg) { |
125 | case TAS5086_DEV_ID ... TAS5086_BKNDERR: | 129 | case TAS5086_DEV_ID ... TAS5086_BKNDERR: |
126 | return 1; | 130 | return 1; |
131 | case TAS5086_INPUT_MUX: | ||
132 | case TAS5086_PWM_OUTPUT_MUX: | ||
133 | return 4; | ||
127 | } | 134 | } |
128 | 135 | ||
129 | dev_err(dev, "Unsupported register address: %d\n", reg); | 136 | dev_err(dev, "Unsupported register address: %d\n", reg); |
@@ -132,7 +139,14 @@ static int tas5086_register_size(struct device *dev, unsigned int reg) | |||
132 | 139 | ||
133 | static bool tas5086_accessible_reg(struct device *dev, unsigned int reg) | 140 | static bool tas5086_accessible_reg(struct device *dev, unsigned int reg) |
134 | { | 141 | { |
135 | return !((reg == 0x0f) || (reg >= 0x11 && reg <= 0x17)); | 142 | switch (reg) { |
143 | case 0x0f: | ||
144 | case 0x11 ... 0x17: | ||
145 | case 0x1d ... 0x1f: | ||
146 | return false; | ||
147 | default: | ||
148 | return true; | ||
149 | } | ||
136 | } | 150 | } |
137 | 151 | ||
138 | static bool tas5086_volatile_reg(struct device *dev, unsigned int reg) | 152 | static bool tas5086_volatile_reg(struct device *dev, unsigned int reg) |
@@ -581,8 +595,8 @@ MODULE_DEVICE_TABLE(i2c, tas5086_i2c_id); | |||
581 | 595 | ||
582 | static const struct regmap_config tas5086_regmap = { | 596 | static const struct regmap_config tas5086_regmap = { |
583 | .reg_bits = 8, | 597 | .reg_bits = 8, |
584 | .val_bits = 8, | 598 | .val_bits = 32, |
585 | .max_register = ARRAY_SIZE(tas5086_reg_defaults), | 599 | .max_register = TAS5086_MAX_REGISTER, |
586 | .reg_defaults = tas5086_reg_defaults, | 600 | .reg_defaults = tas5086_reg_defaults, |
587 | .num_reg_defaults = ARRAY_SIZE(tas5086_reg_defaults), | 601 | .num_reg_defaults = ARRAY_SIZE(tas5086_reg_defaults), |
588 | .cache_type = REGCACHE_RBTREE, | 602 | .cache_type = REGCACHE_RBTREE, |