drm/dp: add drm_dp_link_power_down() helper
[firefly-linux-kernel-4.4.55.git] / include / drm / drm_dp_helper.h
index 9305c718d789b703c3a073f339c9c9b7e0ea352e..7e25030a6aa296e0eae8968e784abf963b7b5aa3 100644 (file)
 #define DP_TEST_CRC_B_CB                   0x244
 
 #define DP_TEST_SINK_MISC                  0x246
-#define DP_TEST_CRC_SUPPORTED              (1 << 5)
+# define DP_TEST_CRC_SUPPORTED             (1 << 5)
+# define DP_TEST_COUNT_MASK                0x7
 
 #define DP_TEST_RESPONSE                   0x260
 # define DP_TEST_ACK                       (1 << 0)
 #define DP_TEST_EDID_CHECKSUM              0x261
 
 #define DP_TEST_SINK                       0x270
-#define DP_TEST_SINK_START         (1 << 0)
+# define DP_TEST_SINK_START                (1 << 0)
 
 #define DP_PAYLOAD_TABLE_UPDATE_STATUS      0x2c0   /* 1.2 MST */
 # define DP_PAYLOAD_TABLE_UPDATED           (1 << 0)
 #define MODE_I2C_READ  4
 #define MODE_I2C_STOP  8
 
-/**
- * struct i2c_algo_dp_aux_data - driver interface structure for i2c over dp
- *                              aux algorithm
- * @running: set by the algo indicating whether an i2c is ongoing or whether
- *          the i2c bus is quiescent
- * @address: i2c target address for the currently ongoing transfer
- * @aux_ch: driver callback to transfer a single byte of the i2c payload
- */
-struct i2c_algo_dp_aux_data {
-       bool running;
-       u16 address;
-       int (*aux_ch) (struct i2c_adapter *adapter,
-                      int mode, uint8_t write_byte,
-                      uint8_t *read_byte);
-};
-
-int
-i2c_dp_aux_add_bus(struct i2c_adapter *adapter);
-
-
 #define DP_LINK_STATUS_SIZE       6
 bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
                          int lane_count);
@@ -550,6 +531,7 @@ struct drm_dp_aux {
        struct mutex hw_mutex;
        ssize_t (*transfer)(struct drm_dp_aux *aux,
                            struct drm_dp_aux_msg *msg);
+       unsigned i2c_nack_count, i2c_defer_count;
 };
 
 ssize_t drm_dp_dpcd_read(struct drm_dp_aux *aux, unsigned int offset,
@@ -604,6 +586,7 @@ struct drm_dp_link {
 
 int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
 int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link);
+int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link);
 int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link);
 
 int drm_dp_aux_register(struct drm_dp_aux *aux);