@@ -1257,10 +1257,10 @@ static void anx7625_power_on(struct anx7625_data *ctx)
12571257 usleep_range (11000 , 12000 );
12581258
12591259 /* Power on pin enable */
1260- gpiod_set_value (ctx -> pdata .gpio_p_on , 1 );
1260+ gpiod_set_value_cansleep (ctx -> pdata .gpio_p_on , 1 );
12611261 usleep_range (10000 , 11000 );
12621262 /* Power reset pin enable */
1263- gpiod_set_value (ctx -> pdata .gpio_reset , 1 );
1263+ gpiod_set_value_cansleep (ctx -> pdata .gpio_reset , 1 );
12641264 usleep_range (10000 , 11000 );
12651265
12661266 DRM_DEV_DEBUG_DRIVER (dev , "power on !\n" );
@@ -1280,9 +1280,9 @@ static void anx7625_power_standby(struct anx7625_data *ctx)
12801280 return ;
12811281 }
12821282
1283- gpiod_set_value (ctx -> pdata .gpio_reset , 0 );
1283+ gpiod_set_value_cansleep (ctx -> pdata .gpio_reset , 0 );
12841284 usleep_range (1000 , 1100 );
1285- gpiod_set_value (ctx -> pdata .gpio_p_on , 0 );
1285+ gpiod_set_value_cansleep (ctx -> pdata .gpio_p_on , 0 );
12861286 usleep_range (1000 , 1100 );
12871287
12881288 ret = regulator_bulk_disable (ARRAY_SIZE (ctx -> pdata .supplies ),
@@ -1814,9 +1814,6 @@ static enum drm_connector_status anx7625_sink_detect(struct anx7625_data *ctx)
18141814
18151815 DRM_DEV_DEBUG_DRIVER (dev , "sink detect\n" );
18161816
1817- if (ctx -> pdata .panel_bridge )
1818- return connector_status_connected ;
1819-
18201817 return ctx -> hpd_status ? connector_status_connected :
18211818 connector_status_disconnected ;
18221819}
@@ -2475,6 +2472,22 @@ static const struct drm_edid *anx7625_bridge_edid_read(struct drm_bridge *bridge
24752472 return anx7625_edid_read (ctx );
24762473}
24772474
2475+ static void anx7625_bridge_hpd_enable (struct drm_bridge * bridge )
2476+ {
2477+ struct anx7625_data * ctx = bridge_to_anx7625 (bridge );
2478+ struct device * dev = ctx -> dev ;
2479+
2480+ pm_runtime_get_sync (dev );
2481+ }
2482+
2483+ static void anx7625_bridge_hpd_disable (struct drm_bridge * bridge )
2484+ {
2485+ struct anx7625_data * ctx = bridge_to_anx7625 (bridge );
2486+ struct device * dev = ctx -> dev ;
2487+
2488+ pm_runtime_put_sync (dev );
2489+ }
2490+
24782491static const struct drm_bridge_funcs anx7625_bridge_funcs = {
24792492 .attach = anx7625_bridge_attach ,
24802493 .detach = anx7625_bridge_detach ,
@@ -2488,6 +2501,8 @@ static const struct drm_bridge_funcs anx7625_bridge_funcs = {
24882501 .atomic_reset = drm_atomic_helper_bridge_reset ,
24892502 .detect = anx7625_bridge_detect ,
24902503 .edid_read = anx7625_bridge_edid_read ,
2504+ .hpd_enable = anx7625_bridge_hpd_enable ,
2505+ .hpd_disable = anx7625_bridge_hpd_disable ,
24912506};
24922507
24932508static int anx7625_register_i2c_dummy_clients (struct anx7625_data * ctx ,
@@ -2585,9 +2600,8 @@ static int anx7625_link_bridge(struct drm_dp_aux *aux)
25852600 platform -> bridge .of_node = dev -> of_node ;
25862601 if (!anx7625_of_panel_on_aux_bus (dev ))
25872602 platform -> bridge .ops |= DRM_BRIDGE_OP_EDID ;
2588- if (!platform -> pdata .panel_bridge )
2589- platform -> bridge .ops |= DRM_BRIDGE_OP_HPD |
2590- DRM_BRIDGE_OP_DETECT ;
2603+ if (!platform -> pdata .panel_bridge || !anx7625_of_panel_on_aux_bus (dev ))
2604+ platform -> bridge .ops |= DRM_BRIDGE_OP_HPD | DRM_BRIDGE_OP_DETECT ;
25912605 platform -> bridge .type = platform -> pdata .panel_bridge ?
25922606 DRM_MODE_CONNECTOR_eDP :
25932607 DRM_MODE_CONNECTOR_DisplayPort ;
0 commit comments