summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHW Lee <hwlee@google.com>2019-01-30 16:03:01 +0800
committerHW Lee <hwlee@google.com>2019-02-21 11:41:35 +0800
commitee5da3155d047e34d2e4fecaafaa106cdb830511 (patch)
treeaeafa3762fb08cb81b8029ed33f6e540c73e6c15
parent37349fa5d8e97a7fd18425a66d9b7307d9003e73 (diff)
downloadmsm-extra-ee5da3155d047e34d2e4fecaafaa106cdb830511.tar.gz
techpack/audio: crus: fix BST_IPK_CTL
Please refer to Cirrus SPEC 7.11.3 The transformation between reg value to current: 16 -> 1.60A 17 -> 1.65A ... 74 -> 4.50A i.e. reg-value = 16 + (current - 1.60)/0.05 Therefore, the original driver missed the offset 16. Bug: 123457129 Test: dump regmap Signed-off-by: HW Lee <hwlee@google.com> Change-Id: Icc0f56aef7fa7ce782625c616d1774de51fd22bb
-rw-r--r--asoc/codecs/cs35l36.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/asoc/codecs/cs35l36.c b/asoc/codecs/cs35l36.c
index 4f941a60..eca82aa2 100644
--- a/asoc/codecs/cs35l36.c
+++ b/asoc/codecs/cs35l36.c
@@ -1235,6 +1235,14 @@ static int cs35l36_handle_of_data(struct i2c_client *i2c_client,
return -EINVAL;
}
+ // see SPEC 7.11.3 BST_IPK_CTL
+ // The transformation between reg value to current:
+ // bst_ipk current
+ // 16 1.60 A
+ // 17 1.65 A
+ // ...
+ // 74 4.50 A
+ // The reg value must have an offset 16 for the minimum
pdata->bst_ipk = (val - 1600) / 50 + 16;
}