I've made some fairly extensive I2C logs under Windows and I'm comparing them
with the linux I2C settings. I noticed that the wm8775 settings are
substantially different under Windows. This patch syncs them with the Windows
settings.
I'm curious to see if this makes any difference.
Hans
PS: the patch is against the latest svn version.
Index: wm8775.c
===================================================================
--- wm8775.c (revision 2683)
+++ wm8775.c (working copy)
@@ -166,14 +166,20 @@
if (*input < 0 || *input > 0xf) {
WM8775_INFO("Invalid input %d.\n", *input);
return -EINVAL;
- }
- if (*input) {
- wm8775_powerdn_set(client, 0);
- wm8775_and_or(client, R21, ~0x0f, *input);
- } else {
- wm8775_powerdn_set(client, 1);
- }
- break;
+ }
+#if 0
+ if (*input) {
+ wm8775_powerdn_set(client, 0);
+ wm8775_and_or(client, R21, ~0x0f, *input);
+ } else {
+ wm8775_powerdn_set(client, 1);
+ }
+#endif
+ wm8775_write(client, R21, 0x0c0);
+ wm8775_write(client, R14, 0x1d4);
+ wm8775_write(client, R15, 0x1d4);
+ wm8775_write(client, R21, (*input == 8) ? 0x108 : 0x102);
+ break;
case WM8775_LOG_STATE:
log_state(client);
@@ -250,13 +256,27 @@
client->flags = I2C_CLIENT_ALLOW_USE;
snprintf(client->name, sizeof(client->name) - 1, "wm8775");
- // initialize wm8775
- wm8775_write(client, R23, 0x000); // RESET
- wm8775_write(client, R11, 0x021); // ADCFMT = 1
- wm8775_write(client, R12, 0x102); // ADCMS=1, ADCOSR=0
- wm8775_write(client, R18, 0x082); // DCY=8
- wm8775_write(client, R19, 0x001); // NGAT=1
- wm8775_write(client, R21, 0x102); // LRBOTH=1, AMX=2
+ // initialize wm8775
+ wm8775_write(client, R23, 0x000); // RESET
+ wm8775_write(client, R7, 0x000);
+ wm8775_write(client, R11, 0x021);
+ wm8775_write(client, R12, 0x102);
+ wm8775_write(client, R13, 0x000);
+ wm8775_write(client, R14, 0x1d4);
+ wm8775_write(client, R15, 0x1d4);
+ wm8775_write(client, R16, 0x1bf);
+ wm8775_write(client, R17, 0x185);
+ wm8775_write(client, R18, 0x0a2);
+ wm8775_write(client, R19, 0x005);
+ wm8775_write(client, R20, 0x07a);
+ wm8775_write(client, R21, 0x102);
+ /*
+ wm8775_write(client, R11, 0x021); // ADCFMT = 1
+ wm8775_write(client, R12, 0x102); // ADCMS=1, ADCOSR=0
+ wm8775_write(client, R18, 0x082); // DCY=8
+ wm8775_write(client, R19, 0x001); // NGAT=1
+ wm8775_write(client, R21, 0x102); // LRBOTH=1, AMX=2
+ */
i2c_attach_client(client);
return 0;