On Tue, Dec 17, 2013 at 06:44:30PM +0200, Jani Nikula wrote:
On Tue, 17 Dec 2013, Thierry Reding thierry.reding@gmail.com wrote:
[...]
+/**
- drm_dp_dpcd_write() - write a series of bytes to the DPCD
- @aux: DisplayPort AUX channel
- @offset: address of the (first) register to write
- @buffer: buffer containing the values to write
- @size: number of bytes in @buffer
- Returns the number of bytes transferred on success, or a negative error
- code on failure.
- */
+ssize_t drm_dp_dpcd_write(struct drm_dp_aux *aux, unsigned int offset,
void *buffer, size_t size)
[...]
switch (msg.reply & DP_AUX_NATIVE_REPLY_MASK) {
case DP_AUX_NATIVE_REPLY_ACK:
return 0;
"Returns the number of bytes transferred on success, or a negative error code on failure." Compare drm_dp_dpcd_read.
Good catch!
You could add an internal helper to do both read and write, it's mostly the same code.
Yes, I've factored out drm_dp_dpcd_access() which takes an additional request parameter. That's the only difference between both functions.
Thanks, Thierry