Subversion Repositories Kolibri OS

Rev

Rev 3031 | Rev 4103 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3031 Rev 3192
Line 23... Line 23...
23
#ifndef _DRM_DP_HELPER_H_
23
#ifndef _DRM_DP_HELPER_H_
24
#define _DRM_DP_HELPER_H_
24
#define _DRM_DP_HELPER_H_
Line 25... Line 25...
25
 
25
 
26
#include 
26
#include 
-
 
27
#include 
Line 27... Line 28...
27
#include 
28
#include 
28
 
29
 
29
/*
30
/*
30
 * Unless otherwise noted, all values are from the DP 1.1a spec.  Note that
31
 * Unless otherwise noted, all values are from the DP 1.1a spec.  Note that
Line 309... Line 310...
309
#define MODE_I2C_START	1
310
#define MODE_I2C_START	1
310
#define MODE_I2C_WRITE	2
311
#define MODE_I2C_WRITE	2
311
#define MODE_I2C_READ	4
312
#define MODE_I2C_READ	4
312
#define MODE_I2C_STOP	8
313
#define MODE_I2C_STOP	8
Line -... Line 314...
-
 
314
 
-
 
315
/**
-
 
316
 * struct i2c_algo_dp_aux_data - driver interface structure for i2c over dp
-
 
317
 * 				 aux algorithm
-
 
318
 * @running: set by the algo indicating whether an i2c is ongoing or whether
-
 
319
 * 	     the i2c bus is quiescent
-
 
320
 * @address: i2c target address for the currently ongoing transfer
-
 
321
 * @aux_ch: driver callback to transfer a single byte of the i2c payload
313
 
322
 */
314
struct i2c_algo_dp_aux_data {
323
struct i2c_algo_dp_aux_data {
315
	bool running;
324
	bool running;
316
	u16 address;
325
	u16 address;
317
	int (*aux_ch) (struct i2c_adapter *adapter,
326
	int (*aux_ch) (struct i2c_adapter *adapter,
Line 320... Line 329...
320
};
329
};
Line 321... Line 330...
321
 
330
 
322
int
331
int
Line -... Line 332...
-
 
332
i2c_dp_aux_add_bus(struct i2c_adapter *adapter);
-
 
333
 
-
 
334
 
-
 
335
#define DP_LINK_STATUS_SIZE	   6
-
 
336
bool drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE],
-
 
337
			  int lane_count);
-
 
338
bool drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE],
-
 
339
			      int lane_count);
-
 
340
u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
-
 
341
				     int lane);
-
 
342
u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
-
 
343
					  int lane);
-
 
344
 
-
 
345
#define DP_RECEIVER_CAP_SIZE	0xf
-
 
346
void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]);
-
 
347
void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]);
-
 
348
 
-
 
349
u8 drm_dp_link_rate_to_bw_code(int link_rate);
-
 
350
int drm_dp_bw_code_to_link_rate(u8 link_bw);
-
 
351
 
-
 
352
static inline int
-
 
353
drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE])
-
 
354
{
-
 
355
	return drm_dp_bw_code_to_link_rate(dpcd[DP_MAX_LINK_RATE]);
-
 
356
}
-
 
357
 
-
 
358
static inline u8
-
 
359
drm_dp_max_lane_count(u8 dpcd[DP_RECEIVER_CAP_SIZE])
-
 
360
{
-
 
361
	return dpcd[DP_MAX_LANE_COUNT] & DP_MAX_LANE_COUNT_MASK;
323
i2c_dp_aux_add_bus(struct i2c_adapter *adapter);
362
}