From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Jackson Subject: Re: [PATCH] Check if the bus is valid prior to discovering edid. Date: Thu, 13 Oct 2011 16:34:21 -0400 Message-ID: <1318538070.7630.2.camel@atropine> References: <1318529492-4019-1-git-send-email-eugeni@dodonov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1194443661==" Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id E9C8B9E78A for ; Thu, 13 Oct 2011 13:34:34 -0700 (PDT) In-Reply-To: <1318529492-4019-1-git-send-email-eugeni@dodonov.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Eugeni Dodonov Cc: intel-gfx@lists.freedesktop.org, ben@bwidawsk.net, Eugeni Dodonov List-Id: intel-gfx@lists.freedesktop.org --===============1194443661== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-di9nl7mJSGd5L97tJW1q" --=-di9nl7mJSGd5L97tJW1q Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2011-10-13 at 15:11 -0300, Eugeni Dodonov wrote: > diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/inte= l_i2c.c > index d98cee6..b3a6eda 100644 > --- a/drivers/gpu/drm/i915/intel_i2c.c > +++ b/drivers/gpu/drm/i915/intel_i2c.c > @@ -470,3 +470,45 @@ void intel_teardown_gmbus(struct drm_device *dev) > kfree(dev_priv->gmbus); > dev_priv->gmbus =3D NULL; > } > + > +/** > + * intel_drm_get_valid_edid - gets edid from existent adapters only > + * @connector: DRM connector device to use > + * @adapter: i2c adapter > + * > + * Verifies if the i2c adapter is responding to our queries before > + * attempting to do proper communication with it. If it does, > + * retreive the EDID with help of drm_get_edid > + */ > +struct edid * > +intel_drm_get_valid_edid(struct drm_connector *connector, > + struct i2c_adapter *adapter) > +{ > + int ret; > + u8 out_buf[] =3D { 0x0, 0x0}; > + u8 buf[2]; > + struct i2c_msg msgs[] =3D { > + { > + .addr =3D 0x50, > + .flags =3D 0, > + .len =3D 1, > + .buf =3D out_buf, > + }, > + { > + .addr =3D 0x50, > + .flags =3D I2C_M_RD, > + .len =3D 1, > + .buf =3D buf, > + } > + }; > + > + /* We just check for -ENXIO - drm_get_edid checks if the transfer > + * works and manages the remaining parts of the EDID */ > + ret =3D i2c_transfer(adapter, msgs, 2); This seems like it should be the implementation body of drm_probe_ddc, and like that function should be EXPORT_SYMBOL()'d. Other people want to do zero-length reads too, you know. - ajax --=-di9nl7mJSGd5L97tJW1q Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk6XS04ACgkQW4otUKDs0NM4CACgmC9Sap2oEr+JGshSSkND1kJ8 rHUAni3jjpQ2qqkX4IpwuDKSc0AnAwYp =10H6 -----END PGP SIGNATURE----- --=-di9nl7mJSGd5L97tJW1q-- --===============1194443661== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1194443661==--