[Intel-gfx] [PATCH v4 1/4] drm: Add helper for DP++ adaptors

Ville Syrjälä ville.syrjala at linux.intel.com
Fri May 6 13:10:09 UTC 2016


On Fri, May 06, 2016 at 12:37:51PM +0000, Zanoni, Paulo R wrote:
> Em Ter, 2016-05-03 às 20:56 +0300, ville.syrjala at linux.intel.com
> escreveu:
<snip>
> > +
> > +/**
> > + * drm_dp_dual_mode_read - Read from the DP dual mode adaptor
> > register(s)
> > + * @adapter: I2C adapter for the DDC bus
> > + * @offset: register offset
> > + * @buffer: buffer for return data
> > + * @size: sizo of the buffer
> > + *
> > + * Reads @size bytes from the DP dual mode adaptor registers
> > + * starting at @offset.
> > + *
> > + * Returns:
> > + * 0 on success, negative error code on failure
> > + */
> > +ssize_t drm_dp_dual_mode_read(struct i2c_adapter *adapter,
> > +			      u8 offset, void *buffer, size_t size)
> > +{
> > +	struct i2c_msg msgs[] = {
> > +		{
> > +			.addr = DP_DUAL_MODE_SLAVE_ADDRESS,
> > +			.flags = 0,
> > +			.len = 1,
> > +			.buf = &offset,
> > +		},
> > +		{
> > +			.addr = DP_DUAL_MODE_SLAVE_ADDRESS,
> > +			.flags = I2C_M_RD,
> > +			.len = size,
> > +			.buf = buffer,
> > +		},
> > +	};
> > +	int ret;
> > +
> > +	ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs));
> > +	if (ret < 0)
> > +		return ret;
> > +	if (ret != ARRAY_SIZE(msgs))
> > +		return -EPROTO;
> > +
> > +	return 0;
> > +}
> EXPORT_SYMBOL(drm_dp_dual_mode_read);
> 
> (or make it static and remove from the .h file)

Hmm. My initial idea was that someone might want to use these for debug
and/or accessing some vendor specific register and whatnot. Which is why
I meant to export them (and somehow failed in this case). I guess I
still stand by that reasoning, although right now we have no users
outside this file.

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list