[PATCH v2 4/4] drm/dp: Allow registering AUX channels as I2C busses

Thierry Reding thierry.reding at gmail.com
Fri Dec 20 01:27:21 PST 2013


On Wed, Dec 18, 2013 at 09:52:47AM +0100, Daniel Vetter wrote:
> On Tue, Dec 17, 2013 at 05:20:07PM +0100, Thierry Reding wrote:
> > Implements an I2C-over-AUX I2C adapter on top of the generic drm_dp_aux
> > infrastructure. It extracts the retry logic from existing drivers, which
> > should help in porting those drivers to this new helper.
> > 
> > Signed-off-by: Thierry Reding <treding at nvidia.com>
> > ---
> >  drivers/gpu/drm/drm_dp_helper.c | 178 ++++++++++++++++++++++++++++++++++++++++
> >  include/drm/drm_dp_helper.h     |   4 +
> >  2 files changed, 182 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> > index 01a8173c6e83..8a64cf8ac8cc 100644
> > --- a/drivers/gpu/drm/drm_dp_helper.c
> > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > @@ -555,3 +555,181 @@ int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link)
> >  
> >  	return 0;
> >  }
> > +
> > +/*
> > + * I2C-over-AUX implementation
> > + */
> > +
> > +struct drm_dp_i2c_adapter {
> > +	struct i2c_adapter adapter;
> > +	struct drm_dp_aux *aux;
> > +};
> 
> I'd just embedded an i2c adapter into the drm_dp_aux structure - I think
> drivers always want such a thing. Then maybe rename the setup function
> from add to register_i2c_bus or so. For smoother transition drivers can
> always store a pointer to this i2c_adapter somewhere more convenient for
> them.

Okay, I've made that change. I was slightly worried that it might cause
lifetime issues, but looking somewhat more closely perhaps that's not an
issue since i2c_adapters seem to be carefully designed to easily allow
being embedded.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20131220/6427301f/attachment.pgp>


More information about the dri-devel mailing list