All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Olli Salonen <olli.salonen@iki.fi>, linux-media@vger.kernel.org
Subject: Re: [PATCH 2/2] Revert "[media] saa7164: Improvements for I2C handling"
Date: Sat, 06 Jun 2015 12:11:35 +0300	[thread overview]
Message-ID: <5572B947.1050500@iki.fi> (raw)
In-Reply-To: <1433576698-1780-2-git-send-email-olli.salonen@iki.fi>

On 06/06/2015 10:44 AM, Olli Salonen wrote:
> This reverts commit ad90b6b0f10566d4a5546e27fe455ce3b5e6b6c7.
>
> This patch breaks I2C communication towards Si2168. After reverting and
> applying the other patch in this series the I2C communication is
> correct.
>
> Signed-off-by: Olli Salonen <olli.salonen@iki.fi>

Reviewed-by: Antti Palosaari <crope@iki.fi>

Antti

> ---
>   drivers/media/pci/saa7164/saa7164-api.c | 11 +----------
>   1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/drivers/media/pci/saa7164/saa7164-api.c b/drivers/media/pci/saa7164/saa7164-api.c
> index e807703..e7e586c 100644
> --- a/drivers/media/pci/saa7164/saa7164-api.c
> +++ b/drivers/media/pci/saa7164/saa7164-api.c
> @@ -1385,8 +1385,7 @@ int saa7164_api_i2c_read(struct saa7164_i2c *bus, u8 addr, u32 reglen, u8 *reg,
>   	 *       08... register address
>   	 */
>   	memset(buf, 0, sizeof(buf));
> -	if (reg)
> -		memcpy((buf + 2 * sizeof(u32) + 0), reg, reglen);
> +	memcpy((buf + 2 * sizeof(u32) + 0), reg, reglen);
>   	*((u32 *)(buf + 0 * sizeof(u32))) = reglen;
>   	*((u32 *)(buf + 1 * sizeof(u32))) = datalen;
>
> @@ -1475,14 +1474,6 @@ int saa7164_api_i2c_write(struct saa7164_i2c *bus, u8 addr, u32 datalen,
>   	 *       04-07 dest bytes to write
>   	 *       08... register address
>   	 */
> -	if (datalen == 1) {
> -		/* Workaround for issues with i2c components
> -		 * that issue writes with no data. IE: SI2168/2157
> -		 * Increase reglen by 1, strobe out an additional byte,
> -		 * ignored by SI2168/2157.
> -		 */
> -		datalen++;
> -	}
>   	*((u32 *)(buf + 0 * sizeof(u32))) = reglen;
>   	*((u32 *)(buf + 1 * sizeof(u32))) = datalen - reglen;
>   	memcpy((buf + 2 * sizeof(u32)), data, datalen);
>

-- 
http://palosaari.fi/

  reply	other threads:[~2015-06-06  9:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-06  7:44 [PATCH 1/2] saa7164: change Si2168 reglen to 0 bit Olli Salonen
2015-06-06  7:44 ` [PATCH 2/2] Revert "[media] saa7164: Improvements for I2C handling" Olli Salonen
2015-06-06  9:11   ` Antti Palosaari [this message]
2015-06-11 19:48   ` Steven Toth
2015-06-06  9:10 ` [PATCH 1/2] saa7164: change Si2168 reglen to 0 bit Antti Palosaari
2015-06-11 19:46 ` Steven Toth

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=5572B947.1050500@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=olli.salonen@iki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.