]> Pileus Git - ~andy/linux/blobdiff - drivers/mfd/wm5102-tables.c
Merge tag 'mfd-3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd...
[~andy/linux] / drivers / mfd / wm5102-tables.c
index f70c4956ff9d146d05d32ea55b3cead45f87595e..155c4a1a6a99e55f733f6d4ed7b38cd2d0634a2b 100644 (file)
@@ -10,6 +10,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/device.h>
 #include <linux/module.h>
 
 #include <linux/mfd/arizona/core.h>
@@ -57,31 +58,54 @@ static const struct reg_default wm5102_reva_patch[] = {
 };
 
 static const struct reg_default wm5102_revb_patch[] = {
+       { 0x19, 0x0001 },
        { 0x80, 0x0003 },
        { 0x081, 0xE022 },
-       { 0x410, 0x4080 },
-       { 0x418, 0x4080 },
-       { 0x420, 0x4080 },
-       { 0x428, 0xC000 },
+       { 0x410, 0x6080 },
+       { 0x418, 0xa080 },
+       { 0x420, 0xa080 },
+       { 0x428, 0xe000 },
+       { 0x443, 0xDC1A },
        { 0x4B0, 0x0066 },
        { 0x458, 0x000b },
        { 0x212, 0x0000 },
+       { 0x171, 0x0000 },
+       { 0x35E, 0x000C },
+       { 0x2D4, 0x0000 },
        { 0x80, 0x0000 },
 };
 
 /* We use a function so we can use ARRAY_SIZE() */
 int wm5102_patch(struct arizona *arizona)
 {
+       const struct reg_default *wm5102_patch;
+       int ret = 0;
+       int i, patch_size;
+
        switch (arizona->rev) {
        case 0:
-               return regmap_register_patch(arizona->regmap,
-                                            wm5102_reva_patch,
-                                            ARRAY_SIZE(wm5102_reva_patch));
+               wm5102_patch = wm5102_reva_patch;
+               patch_size = ARRAY_SIZE(wm5102_reva_patch);
        default:
-               return regmap_register_patch(arizona->regmap,
-                                            wm5102_revb_patch,
-                                            ARRAY_SIZE(wm5102_revb_patch));
+               wm5102_patch = wm5102_revb_patch;
+               patch_size = ARRAY_SIZE(wm5102_revb_patch);
+       }
+
+       regcache_cache_bypass(arizona->regmap, true);
+
+       for (i = 0; i < patch_size; i++) {
+               ret = regmap_write(arizona->regmap, wm5102_patch[i].reg,
+                                  wm5102_patch[i].def);
+               if (ret != 0) {
+                       dev_err(arizona->dev, "Failed to write %x = %x: %d\n",
+                               wm5102_patch[i].reg, wm5102_patch[i].def, ret);
+                       goto out;
+               }
        }
+
+out:
+       regcache_cache_bypass(arizona->regmap, false);
+       return ret;
 }
 
 static const struct regmap_irq wm5102_aod_irqs[ARIZONA_NUM_IRQ] = {
@@ -282,7 +306,7 @@ static const struct reg_default wm5102_reg_default[] = {
        { 0x00000155, 0x0000 },   /* R341   - Rate Estimator 4 */ 
        { 0x00000156, 0x0000 },   /* R342   - Rate Estimator 5 */ 
        { 0x00000161, 0x0000 },   /* R353   - Dynamic Frequency Scaling 1 */ 
-       { 0x00000171, 0x0002 },   /* R369   - FLL1 Control 1 */
+       { 0x00000171, 0x0000 },   /* R369   - FLL1 Control 1 */
        { 0x00000172, 0x0008 },   /* R370   - FLL1 Control 2 */ 
        { 0x00000173, 0x0018 },   /* R371   - FLL1 Control 3 */ 
        { 0x00000174, 0x007D },   /* R372   - FLL1 Control 4 */ 
@@ -366,7 +390,7 @@ static const struct reg_default wm5102_reg_default[] = {
        { 0x00000400, 0x0000 },   /* R1024  - Output Enables 1 */ 
        { 0x00000408, 0x0000 },   /* R1032  - Output Rate 1 */ 
        { 0x00000409, 0x0022 },   /* R1033  - Output Volume Ramp */ 
-       { 0x00000410, 0x4080 },   /* R1040  - Output Path Config 1L */
+       { 0x00000410, 0x6080 },   /* R1040  - Output Path Config 1L */
        { 0x00000411, 0x0180 },   /* R1041  - DAC Digital Volume 1L */ 
        { 0x00000412, 0x0081 },   /* R1042  - DAC Volume Limit 1L */
        { 0x00000413, 0x0001 },   /* R1043  - Noise Gate Select 1L */ 
@@ -374,7 +398,7 @@ static const struct reg_default wm5102_reg_default[] = {
        { 0x00000415, 0x0180 },   /* R1045  - DAC Digital Volume 1R */ 
        { 0x00000416, 0x0081 },   /* R1046  - DAC Volume Limit 1R */
        { 0x00000417, 0x0002 },   /* R1047  - Noise Gate Select 1R */ 
-       { 0x00000418, 0x4080 },   /* R1048  - Output Path Config 2L */
+       { 0x00000418, 0xA080 },   /* R1048  - Output Path Config 2L */
        { 0x00000419, 0x0180 },   /* R1049  - DAC Digital Volume 2L */ 
        { 0x0000041A, 0x0081 },   /* R1050  - DAC Volume Limit 2L */
        { 0x0000041B, 0x0004 },   /* R1051  - Noise Gate Select 2L */ 
@@ -382,11 +406,11 @@ static const struct reg_default wm5102_reg_default[] = {
        { 0x0000041D, 0x0180 },   /* R1053  - DAC Digital Volume 2R */ 
        { 0x0000041E, 0x0081 },   /* R1054  - DAC Volume Limit 2R */
        { 0x0000041F, 0x0008 },   /* R1055  - Noise Gate Select 2R */ 
-       { 0x00000420, 0x4080 },   /* R1056  - Output Path Config 3L */
+       { 0x00000420, 0xA080 },   /* R1056  - Output Path Config 3L */
        { 0x00000421, 0x0180 },   /* R1057  - DAC Digital Volume 3L */ 
        { 0x00000422, 0x0081 },   /* R1058  - DAC Volume Limit 3L */
        { 0x00000423, 0x0010 },   /* R1059  - Noise Gate Select 3L */ 
-       { 0x00000428, 0xC000 },   /* R1064  - Output Path Config 4L */
+       { 0x00000428, 0xE000 },   /* R1064  - Output Path Config 4L */
        { 0x00000429, 0x0180 },   /* R1065  - DAC Digital Volume 4L */ 
        { 0x0000042A, 0x0081 },   /* R1066  - Out Volume 4L */
        { 0x0000042B, 0x0040 },   /* R1067  - Noise Gate Select 4L */ 
@@ -401,7 +425,7 @@ static const struct reg_default wm5102_reg_default[] = {
        { 0x00000436, 0x0081 },   /* R1078  - DAC Volume Limit 5R */
        { 0x00000437, 0x0200 },   /* R1079  - Noise Gate Select 5R */
        { 0x00000450, 0x0000 },   /* R1104  - DAC AEC Control 1 */ 
-       { 0x00000458, 0x0001 },   /* R1112  - Noise Gate Control */ 
+       { 0x00000458, 0x000B },   /* R1112  - Noise Gate Control */
        { 0x00000490, 0x0069 },   /* R1168  - PDM SPK1 CTRL 1 */ 
        { 0x00000491, 0x0000 },   /* R1169  - PDM SPK1 CTRL 2 */ 
        { 0x00000500, 0x000C },   /* R1280  - AIF1 BCLK Ctrl */