mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
extcon-madera: Export Headset Detection GPIOs
Needed for Factory Test. Exported GPIOs can be found under /sys/class/extcon/extcon4/ Change-Id: Ibb22fa2ad66a36715908ae2ce6d19733122af4f1 Signed-off-by: Ravi Vembu <raviv@motorola.com> Mot-CRs-Fixed: (CR) Change-Id: Ibb22fa2ad66a36715908ae2ce6d19733122af4f1 Reviewed-on: https://gerrit.mot.com/1250211 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Rav(CR) Vembu <raviv@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
0755fead74
commit
7877ed440c
1 changed files with 30 additions and 0 deletions
|
|
@ -2537,12 +2537,42 @@ static void madera_extcon_process_accdet_node(struct madera_extcon *info,
|
|||
node);
|
||||
if (IS_ERR(info->usbc_det_gpio[0]))
|
||||
info->usbc_det_gpio[0] = 0;
|
||||
else {
|
||||
ret = gpio_export(desc_to_gpio(info->usbc_det_gpio[0]),
|
||||
false);
|
||||
if (ret < 0) {
|
||||
dev_err(info->dev,
|
||||
"Failed to export usbsel gpio\n");
|
||||
} else {
|
||||
ret = gpio_export_link(info->dev,
|
||||
"usbsel",
|
||||
desc_to_gpio(info->usbc_det_gpio[0]));
|
||||
if (ret < 0)
|
||||
dev_err(info->dev,
|
||||
"Failed to create usbsel symlink\n");
|
||||
}
|
||||
}
|
||||
|
||||
info->usbc_det_gpio[1] = devm_get_gpiod_from_child(madera->dev,
|
||||
"cirrus,hsdet",
|
||||
node);
|
||||
if (IS_ERR(info->usbc_det_gpio[1]))
|
||||
info->usbc_det_gpio[1] = 0;
|
||||
else {
|
||||
ret = gpio_export(desc_to_gpio(info->usbc_det_gpio[1]),
|
||||
false);
|
||||
if (ret < 0) {
|
||||
dev_err(info->dev,
|
||||
"Failed to export hsdet gpio\n");
|
||||
} else {
|
||||
ret = gpio_export_link(info->dev,
|
||||
"hsdet",
|
||||
desc_to_gpio(info->usbc_det_gpio[1]));
|
||||
if (ret < 0)
|
||||
dev_err(info->dev,
|
||||
"Failed to create hsdet symlink\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue