All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>, linux-i2c@vger.kernel.org
Cc: christian.ruppert@alitech.com, linux-kernel@vger.kernel.org,
	mika.westerberg@linux.intel.com,
	"José Roberto de Souza" <jose.souza@intel.com>
Subject: Re: [PATCH v3 2/3] i2c: designware: detect when dynamic tar update is possible
Date: Tue, 16 Aug 2016 17:00:12 +0300	[thread overview]
Message-ID: <f4c1fb29-b315-33ee-f029-684ef9cd6264@linux.intel.com> (raw)
In-Reply-To: <1469743424-2480-3-git-send-email-lucas.demarchi@intel.com>

Hi, + Wolfram

On 07/29/2016 01:03 AM, Lucas De Marchi wrote:
> This adapter can be synthesized with dynamic tar update enabled or disabled.
> When enabled it is not necessary to disable the adapter to change the slave
> address in some situations, which saves some time per transaction.
>
> There is no direct register to know if this feature is enabled but we can do it
> indirectly by writing to the 10BIT_ADDR field in IC_CON: this field is
> read only when dynamic tar update is enabled.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/i2c/busses/i2c-designware-core.c | 37 ++++++++++++++++++++++----------
>  drivers/i2c/busses/i2c-designware-core.h |  1 +
>  2 files changed, 27 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
> index 2c61585..a8408db 100644
> --- a/drivers/i2c/busses/i2c-designware-core.c
> +++ b/drivers/i2c/busses/i2c-designware-core.c
> @@ -388,6 +388,20 @@ int i2c_dw_init(struct dw_i2c_dev *dev)
>  	/* configure the i2c master */
>  	dw_writel(dev, dev->master_cfg , DW_IC_CON);
>
> +	/*
> +	 * Test if dynamic TAR update is enabled in this controller by writing to

Over 80 characters in this line.

> +	 */
> +	reg = dw_readl(dev, DW_IC_CON);
> +	dw_writel(dev, reg ^ DW_IC_CON_10BITADDR_MASTER, DW_IC_CON);
> +
> +	if ((dw_readl(dev, DW_IC_CON) & DW_IC_CON_10BITADDR_MASTER) ==
> +	    (reg & DW_IC_CON_10BITADDR_MASTER)) {
> +		dev->dynamic_tar_update_enabled = true;
> +		dev_dbg(dev->dev, "Dynamic TAR update enabled");
> +	}

Is this possible to move to i2c_dw_probe()? I guess the enabled status 
doesn't change runtime?

-- 
Jarkko

  reply	other threads:[~2016-08-16 14:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28 22:03 [PATCH v3 0/3] i2c: designware: improve performance for transfers Lucas De Marchi
2016-07-28 22:03 ` [PATCH v3 1/3] i2c: designware: wait for disable/enable only if necessary Lucas De Marchi
2016-08-16 13:59   ` Jarkko Nikula
2016-07-28 22:03 ` [PATCH v3 2/3] i2c: designware: detect when dynamic tar update is possible Lucas De Marchi
2016-08-16 14:00   ` Jarkko Nikula [this message]
2016-08-16 14:07     ` De Marchi, Lucas
2016-08-17  8:05       ` Jarkko Nikula
2016-08-17 12:48         ` De Marchi, Lucas
2016-07-28 22:03 ` [PATCH v3 3/3] i2c: designware: do not disable adapter after transfer Lucas De Marchi
2016-08-16 14:00   ` Jarkko Nikula
2016-08-12 14:59 ` [PATCH v3 0/3] i2c: designware: improve performance for transfers Christian Ruppert
2016-08-15 12:34   ` De Marchi, Lucas
2016-08-16 12:14     ` Wolfram Sang

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=f4c1fb29-b315-33ee-f029-684ef9cd6264@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=christian.ruppert@alitech.com \
    --cc=jose.souza@intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=mika.westerberg@linux.intel.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 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.