linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Kamal Dasu <kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	gregory.0xf0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	rjui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org,
	jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org,
	rajeevkumar.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org
Subject: Re: [V4, 1/2] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver
Date: Thu, 4 Jun 2015 00:54:24 +0900	[thread overview]
Message-ID: <20150603155423.GB2873@katana> (raw)
In-Reply-To: <1432052625-6210-1-git-send-email-kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]

On Tue, May 19, 2015 at 12:23:44PM -0400, Kamal Dasu wrote:
> Adding support for i2c controller driver for Broadcom settop
> SoCs.
> 
> Signed-off-by: Kamal Dasu <kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

We are very close.

> +/* Wait for device to be ready */
> +static int brcmstb_i2c_wait_if_busy(struct brcmstb_i2c_dev *dev)
> +{
> +	unsigned long timeout = jiffies + msecs_to_jiffies(I2C_TIMEOUT);
> +
> +	while ((bsc_readl(dev, iic_enable) & BSC_IIC_EN_INTRP_MASK)) {
> +		if (time_after(jiffies, timeout)) {
> +			dev_err(dev->device, "i2c device busy timeout\n");

Don't print out, it will spoil the logs. Timeouts can happen on I2C
busses, no need to inform the user.

...

> +	/* Wait for transaction to finish or timeout */
> +	rc = brcmstb_i2c_wait_for_completion(dev);
> +	if (rc) {
> +		dev_err(dev->device, "intr timeout for cmd %s\n",
> +			cmd_string[cmd]);
> +		goto cmd_out;
> +	}

ditto

> +
> +	if ((CMD_RD || CMD_WR) &&
> +	    bsc_readl(dev, iic_enable) & BSC_IIC_EN_NOACK_MASK) {
> +		rc = -EREMOTEIO;
> +		dev_dbg(dev->device, "controller received NOACK intr for %s\n",
> +			cmd_string[cmd]);

I'd leave this out, too. But you decide.

...

> +	rc = of_property_read_string(dev->device->of_node, "interrupt-names",
> +				     &int_name);

I haven't checked but is that really needed? of_irq_to_resource() seems
to parse the "interrupt-names" property.

Thanks,

   Wolfram


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2015-06-03 15:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19 16:23 [V4, 1/2] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver Kamal Dasu
     [not found] ` <1432052625-6210-1-git-send-email-kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-19 16:23   ` [V4, 2/2] dt-bindings: i2c: Add i2c-brcmstb dt bindings Kamal Dasu
2015-05-19 20:50   ` [V4, 1/2] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver Ray Jui
     [not found]     ` <555BA22B.9020408-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-05-20 20:35       ` Kamal Dasu
     [not found]         ` <CAC=U0a3dxJi1c1FrQaqGojc8JXzs=om2Z1r=nB0dinyrFzz-+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-20 20:37           ` Ray Jui
2015-06-03 15:54   ` Wolfram Sang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-06-09 17:26 Kamal Dasu
     [not found] ` <CAC=U0a2R=G0toDqUQzVueREDXFxs0Dm4eiBAdyhzH7Fp57-nRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-09 22:16   ` 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=20150603155423.GB2873@katana \
    --to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
    --cc=bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=gregory.0xf0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rajeevkumar.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=rjui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).