aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-arizona.c
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.wolfsonmicro.com>2015-09-28 07:41:42 -0400
committerChanwoo Choi <cw00.choi@samsung.com>2015-09-29 05:11:10 -0400
commitd8d09564b830c2040a39039dd1e683c26158f466 (patch)
tree4276073a79fae6d00192f0358e2a544f5aa358d9 /drivers/extcon/extcon-arizona.c
parent37e57066d58e6c78cb8e8b22b46c3633630ad411 (diff)
extcon: arizona: Add support for WM8998 and WM1814
This patch adds support for the WM8998 and WM1814 codecs. These use the same IP version as WM5110 but have different clamp control. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon-arizona.c')
-rw-r--r--drivers/extcon/extcon-arizona.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 4479781ee941..b01030735f0c 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * extcon-arizona.c - Extcon driver Wolfson Arizona devices 2 * extcon-arizona.c - Extcon driver Wolfson Arizona devices
3 * 3 *
4 * Copyright (C) 2012 Wolfson Microelectronics plc 4 * Copyright (C) 2012-2014 Wolfson Microelectronics plc
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -154,6 +154,10 @@ static void arizona_extcon_hp_clamp(struct arizona_extcon_info *info,
154 int ret; 154 int ret;
155 155
156 switch (arizona->type) { 156 switch (arizona->type) {
157 case WM8998:
158 case WM1814:
159 mask = 0;
160 break;
157 case WM5110: 161 case WM5110:
158 case WM8280: 162 case WM8280:
159 mask = ARIZONA_HP1L_SHRTO | ARIZONA_HP1L_FLWR | 163 mask = ARIZONA_HP1L_SHRTO | ARIZONA_HP1L_FLWR |
@@ -197,17 +201,19 @@ static void arizona_extcon_hp_clamp(struct arizona_extcon_info *info,
197 ret); 201 ret);
198 } 202 }
199 203
200 ret = regmap_update_bits(arizona->regmap, ARIZONA_HP_CTRL_1L, 204 if (mask) {
201 mask, val); 205 ret = regmap_update_bits(arizona->regmap, ARIZONA_HP_CTRL_1L,
202 if (ret != 0) 206 mask, val);
203 dev_warn(arizona->dev, "Failed to do clamp: %d\n", 207 if (ret != 0)
208 dev_warn(arizona->dev, "Failed to do clamp: %d\n",
204 ret); 209 ret);
205 210
206 ret = regmap_update_bits(arizona->regmap, ARIZONA_HP_CTRL_1R, 211 ret = regmap_update_bits(arizona->regmap, ARIZONA_HP_CTRL_1R,
207 mask, val); 212 mask, val);
208 if (ret != 0) 213 if (ret != 0)
209 dev_warn(arizona->dev, "Failed to do clamp: %d\n", 214 dev_warn(arizona->dev, "Failed to do clamp: %d\n",
210 ret); 215 ret);
216 }
211 217
212 /* Restore the desired state while not doing the clamp */ 218 /* Restore the desired state while not doing the clamp */
213 if (!clamp) { 219 if (!clamp) {
@@ -1289,6 +1295,11 @@ static int arizona_extcon_probe(struct platform_device *pdev)
1289 break; 1295 break;
1290 } 1296 }
1291 break; 1297 break;
1298 case WM8998:
1299 case WM1814:
1300 info->micd_clamp = true;
1301 info->hpdet_ip_version = 2;
1302 break;
1292 default: 1303 default:
1293 break; 1304 break;
1294 } 1305 }