disp: msm: dp: Parse device tree to find specific aux switch
Changes to select particular dp_aux_switch based on board requirements. Currently provision to support both fsa4480 and wcd939x as aux switches are provided. Change-Id: Iafbee4d91d14aafb1e7a37ddfa2b1ea0d0e5e784 Signed-off-by: Soutrik Mukhopadhyay <quic_mukhopad@quicinc.com>
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
489e038851
commit
0a9bb868d0
@@ -8,7 +8,8 @@
|
||||
|
||||
#if IS_ENABLED(CONFIG_QCOM_FSA4480_I2C)
|
||||
#include <linux/soc/qcom/fsa4480-i2c.h>
|
||||
#elif IS_ENABLED(CONFIG_QCOM_WCD939X_I2C)
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_QCOM_WCD939X_I2C)
|
||||
#include <linux/soc/qcom/wcd939x-i2c.h>
|
||||
#endif
|
||||
|
||||
@@ -863,7 +864,7 @@ end:
|
||||
|
||||
struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog,
|
||||
struct dp_parser *parser, struct device_node *aux_switch,
|
||||
struct dp_aux_bridge *aux_bridge)
|
||||
struct dp_aux_bridge *aux_bridge, enum dp_aux_switch_type switch_type)
|
||||
{
|
||||
int rc = 0;
|
||||
struct dp_aux_private *aux;
|
||||
@@ -902,15 +903,23 @@ struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog,
|
||||
dp_aux->abort = dp_aux_abort_transaction;
|
||||
dp_aux->set_sim_mode = dp_aux_set_sim_mode;
|
||||
|
||||
/*Condition to avoid allocating function pointers for aux bypass mode*/
|
||||
if (switch_type != DP_AUX_SWITCH_BYPASS) {
|
||||
#if IS_ENABLED(CONFIG_QCOM_FSA4480_I2C)
|
||||
dp_aux->switch_configure = dp_aux_configure_fsa_switch;
|
||||
dp_aux->switch_register_notifier = fsa4480_reg_notifier;
|
||||
dp_aux->switch_unregister_notifier = fsa4480_unreg_notifier;
|
||||
#elif IS_ENABLED(CONFIG_QCOM_WCD939X_I2C)
|
||||
dp_aux->switch_configure = dp_aux_configure_wcd_switch;
|
||||
dp_aux->switch_register_notifier = wcd_usbss_reg_notifier;
|
||||
dp_aux->switch_unregister_notifier = wcd_usbss_unreg_notifier;
|
||||
if (switch_type == DP_AUX_SWITCH_FSA4480) {
|
||||
dp_aux->switch_configure = dp_aux_configure_fsa_switch;
|
||||
dp_aux->switch_register_notifier = fsa4480_reg_notifier;
|
||||
dp_aux->switch_unregister_notifier = fsa4480_unreg_notifier;
|
||||
}
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_QCOM_WCD939X_I2C)
|
||||
if (switch_type == DP_AUX_SWITCH_WCD939x) {
|
||||
dp_aux->switch_configure = dp_aux_configure_wcd_switch;
|
||||
dp_aux->switch_register_notifier = wcd_usbss_reg_notifier;
|
||||
dp_aux->switch_unregister_notifier = wcd_usbss_unreg_notifier;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return dp_aux;
|
||||
error:
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
#define DP_STATE_AUX_TIMEOUT BIT(12)
|
||||
#define DP_STATE_PLL_LOCKED BIT(13)
|
||||
|
||||
enum dp_aux_switch_type {
|
||||
DP_AUX_SWITCH_BYPASS,
|
||||
DP_AUX_SWITCH_FSA4480,
|
||||
DP_AUX_SWITCH_WCD939x,
|
||||
};
|
||||
|
||||
enum dp_aux_error {
|
||||
DP_AUX_ERR_NONE = 0,
|
||||
DP_AUX_ERR_ADDR = -1,
|
||||
@@ -60,7 +66,7 @@ struct dp_aux {
|
||||
|
||||
struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog_aux *catalog,
|
||||
struct dp_parser *parser, struct device_node *aux_switch,
|
||||
struct dp_aux_bridge *aux_bridge);
|
||||
struct dp_aux_bridge *aux_bridge, enum dp_aux_switch_type switch_type);
|
||||
void dp_aux_put(struct dp_aux *aux);
|
||||
|
||||
#endif /*__DP_AUX_H_*/
|
||||
|
||||
@@ -168,6 +168,7 @@ struct dp_display_private {
|
||||
|
||||
enum drm_connector_status cached_connector_status;
|
||||
enum dp_display_states state;
|
||||
enum dp_aux_switch_type switch_type;
|
||||
|
||||
struct platform_device *pdev;
|
||||
struct device_node *aux_switch_node;
|
||||
@@ -2161,8 +2162,15 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
|
||||
dp->no_aux_switch = true;
|
||||
}
|
||||
|
||||
if (!strcmp(dp->aux_switch_node->name, "fsa4480"))
|
||||
dp->switch_type = DP_AUX_SWITCH_FSA4480;
|
||||
else if (!strcmp(dp->aux_switch_node->name, "wcd939x_i2c"))
|
||||
dp->switch_type = DP_AUX_SWITCH_WCD939x;
|
||||
else
|
||||
dp->switch_type = DP_AUX_SWITCH_BYPASS;
|
||||
|
||||
dp->aux = dp_aux_get(dev, &dp->catalog->aux, dp->parser,
|
||||
dp->aux_switch_node, dp->aux_bridge);
|
||||
dp->aux_switch_node, dp->aux_bridge, dp->switch_type);
|
||||
if (IS_ERR(dp->aux)) {
|
||||
rc = PTR_ERR(dp->aux);
|
||||
DP_ERR("failed to initialize aux, rc = %d\n", rc);
|
||||
|
||||
Reference in New Issue
Block a user