From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH V4] drm: edid: add support for E-DDC Date: Wed, 29 Aug 2012 14:08:44 +0300 Message-ID: <20120829110843.GE4421@intel.com> References: <1345887836-15314-1-git-send-email-s.shirish@samsung.com> <1345887836-15314-2-git-send-email-s.shirish@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E5719E747 for ; Wed, 29 Aug 2012 04:09:00 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1345887836-15314-2-git-send-email-s.shirish@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Shirish S Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Sat, Aug 25, 2012 at 03:13:56PM +0530, Shirish S wrote: > The current logic for probing ddc is limited to > 2 blocks (256 bytes), this patch adds support > for the 4 block (512) data. > = > To do this, a single 8-bit segment index is > passed to the display via the I2C address 30h. > Data from the selected segment is then immediately > read via the regular DDC2 address using a repeated > I2C 'START' signal. > = > Signed-off-by: Shirish S > --- > drivers/gpu/drm/drm_edid.c | 22 ++++++++++++++++++---- > 1 files changed, 18 insertions(+), 4 deletions(-) > = > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index a8743c3..cde7af0 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -254,6 +254,8 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, un= signed char *buf, > int block, int len) > { > unsigned char start =3D block * EDID_LENGTH; > + unsigned char segment =3D block >> 1; > + unsigned char xfers =3D segment ? 3 : 2; > int ret, retries =3D 5; > = > /* The core i2c driver will automatically retry the transfer if the > @@ -264,7 +266,12 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, u= nsigned char *buf, > */ > do { > struct i2c_msg msgs[] =3D { > - { > + { /*set segment pointer */ Missing whitespace after '/*'. Perhaps just drop the comment. I don't see much value in it. > + .addr =3D DDC_SEGMENT_ADDR, > + .flags =3D segment ? 0 : I2C_M_IGNORE_NAK, > + .len =3D 1, > + .buf =3D &segment, > + }, { > .addr =3D DDC_ADDR, > .flags =3D 0, > .len =3D 1, > @@ -276,15 +283,22 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, = unsigned char *buf, > .buf =3D buf, > } > }; > - ret =3D i2c_transfer(adapter, msgs, 2); > + /* Avoid sending the segment addr to not upset non-compliant ddc > + * monitors. > + */ Wrong indentation and comment style is wrong. I'm guessing this didn't go through checkpatch.pl. Otherwise looks OK to me. -- = Ville Syrj=E4l=E4 Intel OTC