disp: msm: dp: fix configuration of aux switches and HPD sources
Decouple the configuration and parsing of aux switches with the parsing and configuration of HPD sources. HPD notification can come from either GPIO based approach or a PD module through a SW interface. The presence of AUX switch on the board should have no bearing in deciding which configuration for HPD detection is used. Update the implementation to allow for flexibility in selecting any combination of the HPD source and aux switches. Change-Id: I96d558f1d88a359d523fae6dc746045393884d5a Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org> Signed-off-by: Rajkumar Subbiah <quic_rsubbia@quicinc.com> Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
This commit is contained in:

committed by
Sandeep Gangadharaiah

parent
135e318102
commit
78c45e9d5d
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
@@ -218,6 +219,7 @@ struct dp_hpd *dp_gpio_hpd_get(struct device *dev,
|
||||
const char *hpd_gpio_name = "qcom,dp-hpd-gpio";
|
||||
struct dp_gpio_hpd_private *gpio_hpd;
|
||||
struct dp_pinctrl pinctrl = {0};
|
||||
unsigned int gpio;
|
||||
|
||||
if (!dev || !cb) {
|
||||
DP_ERR("invalid device\n");
|
||||
@@ -225,6 +227,13 @@ struct dp_hpd *dp_gpio_hpd_get(struct device *dev,
|
||||
goto error;
|
||||
}
|
||||
|
||||
gpio = of_get_named_gpio(dev->of_node, hpd_gpio_name, 0);
|
||||
if (!gpio_is_valid(gpio)) {
|
||||
DP_DEBUG("%s gpio not specified\n", hpd_gpio_name);
|
||||
rc = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
gpio_hpd = devm_kzalloc(dev, sizeof(*gpio_hpd), GFP_KERNEL);
|
||||
if (!gpio_hpd) {
|
||||
rc = -ENOMEM;
|
||||
@@ -245,14 +254,7 @@ struct dp_hpd *dp_gpio_hpd_get(struct device *dev,
|
||||
}
|
||||
}
|
||||
|
||||
gpio_hpd->gpio_cfg.gpio = of_get_named_gpio(dev->of_node,
|
||||
hpd_gpio_name, 0);
|
||||
if (!gpio_is_valid(gpio_hpd->gpio_cfg.gpio)) {
|
||||
DP_ERR("%s gpio not specified\n", hpd_gpio_name);
|
||||
rc = -EINVAL;
|
||||
goto gpio_error;
|
||||
}
|
||||
|
||||
gpio_hpd->gpio_cfg.gpio = gpio;
|
||||
strlcpy(gpio_hpd->gpio_cfg.gpio_name, hpd_gpio_name,
|
||||
sizeof(gpio_hpd->gpio_cfg.gpio_name));
|
||||
gpio_hpd->gpio_cfg.value = 0;
|
||||
|
Reference in New Issue
Block a user