Commit 34602486 authored by Nikesh Oswal's avatar Nikesh Oswal Committed by Chanwoo Choi

extcon: arizona: Use extcon cable API with index of extcon cable instead of string

Use extcon cable API instead of state API as it is much more
idiomatic.
Signed-off-by: default avatarNikesh Oswal <Nikesh.Oswal@wolfsonmicro.com>
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
[Modify patch title by Chanwoo Choi]
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent 5a8844b5
...@@ -669,9 +669,8 @@ static void arizona_identify_headphone(struct arizona_extcon_info *info) ...@@ -669,9 +669,8 @@ static void arizona_identify_headphone(struct arizona_extcon_info *info)
ARIZONA_ACCDET_MODE_MASK, ARIZONA_ACCDET_MODE_MIC); ARIZONA_ACCDET_MODE_MASK, ARIZONA_ACCDET_MODE_MIC);
/* Just report headphone */ /* Just report headphone */
ret = extcon_update_state(info->edev, ret = extcon_set_cable_state_(info->edev,
1 << ARIZONA_CABLE_HEADPHONE, ARIZONA_CABLE_HEADPHONE, true);
1 << ARIZONA_CABLE_HEADPHONE);
if (ret != 0) if (ret != 0)
dev_err(arizona->dev, "Failed to report headphone: %d\n", ret); dev_err(arizona->dev, "Failed to report headphone: %d\n", ret);
...@@ -728,9 +727,8 @@ static void arizona_start_hpdet_acc_id(struct arizona_extcon_info *info) ...@@ -728,9 +727,8 @@ static void arizona_start_hpdet_acc_id(struct arizona_extcon_info *info)
ARIZONA_ACCDET_MODE_MASK, ARIZONA_ACCDET_MODE_MIC); ARIZONA_ACCDET_MODE_MASK, ARIZONA_ACCDET_MODE_MIC);
/* Just report headphone */ /* Just report headphone */
ret = extcon_update_state(info->edev, ret = extcon_set_cable_state_(info->edev,
1 << ARIZONA_CABLE_HEADPHONE, ARIZONA_CABLE_HEADPHONE, true);
1 << ARIZONA_CABLE_HEADPHONE);
if (ret != 0) if (ret != 0)
dev_err(arizona->dev, "Failed to report headphone: %d\n", ret); dev_err(arizona->dev, "Failed to report headphone: %d\n", ret);
...@@ -817,9 +815,8 @@ static void arizona_micd_detect(struct work_struct *work) ...@@ -817,9 +815,8 @@ static void arizona_micd_detect(struct work_struct *work)
if (info->detecting && (val & ARIZONA_MICD_LVL_8)) { if (info->detecting && (val & ARIZONA_MICD_LVL_8)) {
arizona_identify_headphone(info); arizona_identify_headphone(info);
ret = extcon_update_state(info->edev, ret = extcon_set_cable_state_(info->edev,
1 << ARIZONA_CABLE_MICROPHONE, ARIZONA_CABLE_MICROPHONE, true);
1 << ARIZONA_CABLE_MICROPHONE);
if (ret != 0) if (ret != 0)
dev_err(arizona->dev, "Headset report failed: %d\n", dev_err(arizona->dev, "Headset report failed: %d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment