dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Shirish S <s.shirish@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH V4] drm: edid: add support for E-DDC
Date: Wed, 29 Aug 2012 14:08:44 +0300	[thread overview]
Message-ID: <20120829110843.GE4421@intel.com> (raw)
In-Reply-To: <1345887836-15314-2-git-send-email-s.shirish@samsung.com>

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 <s.shirish@samsung.com>
> ---
>  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, unsigned char *buf,
>  		      int block, int len)
>  {
>  	unsigned char start = block * EDID_LENGTH;
> +	unsigned char segment = block >> 1;
> +	unsigned char xfers = segment ? 3 : 2;
>  	int ret, retries = 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, unsigned char *buf,
>  	 */
>  	do {
>  		struct i2c_msg msgs[] = {
> -			{
> +			{ /*set segment pointer */

Missing whitespace after '/*'. Perhaps just drop the comment. I don't
see much value in it.

> +				.addr	= DDC_SEGMENT_ADDR,
> +				.flags	= segment ? 0 : I2C_M_IGNORE_NAK,
> +				.len	= 1,
> +				.buf	= &segment,
> +			}, {
>  				.addr	= DDC_ADDR,
>  				.flags	= 0,
>  				.len	= 1,
> @@ -276,15 +283,22 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,
>  				.buf	= buf,
>  			}
>  		};
> -		ret = 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älä
Intel OTC

  parent reply	other threads:[~2012-08-29 11:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-25  9:43 [PATCH V4] drm: edid: add support for E-DDC Shirish S
2012-08-25  9:43 ` Shirish S
2012-08-26 18:44   ` Daniel Vetter
2012-08-29 11:08   ` Ville Syrjälä [this message]
2012-08-29 13:54     ` Shirish S
2012-08-29 13:44   ` Jean Delvare
2012-08-30  0:22     ` Shirish S

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120829110843.GE4421@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=s.shirish@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox