summaryrefslogtreecommitdiff
path: root/cras/src/server/cras_alsa_jack.c
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2021-02-22 10:36:02 +0000
committerFlorian Mayer <fmayer@google.com>2021-02-22 10:36:02 +0000
commit82f9901c43f5c647d7cef5fad37ec991439071a8 (patch)
tree6ac0d69404f90ca1d22a01caa566e328dae8e54f /cras/src/server/cras_alsa_jack.c
parentdc2b74a983c1182f9f4e05a8e6e91beb04792c51 (diff)
downloadadhd-82f9901c43f5c647d7cef5fad37ec991439071a8.tar.gz
Revert "Merge branch 'upstream-master'"
Revert submission 1579283-jemoreira-crosvm-update Reason for revert: Broke build. Reverted Changes: I7cf3fe07f:Merge remote-tracking branch 'aosp/upstream-main' Icb5f26241:Update Android.bp files I25af576b6:Merge branch 'upstream-master' Change-Id: I3dbab90871618dcbaf4404ba0d66c73a64c446f7
Diffstat (limited to 'cras/src/server/cras_alsa_jack.c')
-rw-r--r--cras/src/server/cras_alsa_jack.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/cras/src/server/cras_alsa_jack.c b/cras/src/server/cras_alsa_jack.c
index 6d4d7bf5..52a227e7 100644
--- a/cras/src/server/cras_alsa_jack.c
+++ b/cras/src/server/cras_alsa_jack.c
@@ -734,16 +734,6 @@ static snd_hctl_elem_t *find_eld_control_by_dev_index(snd_hctl_t *hctl,
return snd_hctl_find_elem(hctl, elem_id);
}
-/* For non-gpio jack, check if it's of type hdmi/dp by
- * matching jack name. */
-static int is_jack_hdmi_dp(const char *jack_name)
-{
- // TODO(hychao): Use the information provided in UCM instead of
- // name matching.
- static const char *hdmi_dp = "HDMI";
- return !!strstr(jack_name, hdmi_dp);
-}
-
/* Find GPIO jacks for this jack_list.
* Args:
* jack_list - Jack list to add to.
@@ -782,9 +772,8 @@ static int find_gpio_jacks(struct cras_alsa_jack_list *jack_list,
if (result_jack) {
*result_jack = data.result_jack;
- /* Find ELD control only for HDMI/DP gpio jack. */
- if (*result_jack &&
- is_jack_hdmi_dp((*result_jack)->gpio.device_name))
+ /* Find ELD control for HDMI/DP gpio jack. */
+ if (*result_jack)
(*result_jack)->eld_control =
find_eld_control_by_dev_index(
jack_list->hctl,
@@ -844,6 +833,14 @@ static unsigned int hctl_jack_device_index(const char *name)
return (unsigned int)device_index;
}
+/* For non-gpio jack, check if it's of type hdmi/dp by
+ * matching jack name. */
+static int is_jack_hdmi_dp(const char *jack_name)
+{
+ static const char *hdmi_dp = "HDMI/DP";
+ return strncmp(jack_name, hdmi_dp, strlen(hdmi_dp)) == 0;
+}
+
/* Checks if the given control name is in the supplied list of possible jack
* control base names. */
static int is_jack_control_in_list(const char *const *list,