devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Varka Bhadram <varkabhadram-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Anders Berg <anders.berg-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
Cc: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2] i2c: axxia: Add I2C driver for AXM55xx
Date: Mon, 29 Sep 2014 16:44:52 +0530	[thread overview]
Message-ID: <54293F2C.2090206@gmail.com> (raw)
In-Reply-To: <CAE0=X_0guSvMqZxHvdS39Zxx4G7qVvnddv96t72rp4FwpJLgfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 09/29/2014 04:43 PM, Anders Berg wrote:
> On Mon, Sep 29, 2014 at 12:07 PM, Varka Bhadram <varkabhadram-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On 09/29/2014 03:02 PM, Anders Berg wrote:
>>> Add I2C bus driver for the controller found in the LSI Axxia family SoCs.
>>> The
>>> driver implements 10-bit addressing and SMBus transfer modes via emulation
>>> (including SMBus block data read).
>>>
>>> Signed-off-by: Anders Berg <anders.berg-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
>>> ---
>>>
> (...)
>>> +
>>> +       if (!idev->msg) {
>>> +               dev_warn(idev->dev, "unexpected interrupt");
>>
>> Missed terminating new line '\n'
>>
> Right, I'll fix that (all occurrences)
>
>>> +               goto out;
>>> +       }
>>> +
>>> +       /* RX FIFO needs service? */
>>> +       if (i2c_m_rd(idev->msg) && (status & MST_STATUS_RFL))
>>> +               axxia_i2c_empty_rx_fifo(idev);
>>> +
>>> +       /* TX FIFO needs service? */
>>> +       if (!i2c_m_rd(idev->msg) && (status & MST_STATUS_TFL)) {
>>> +               if (axxia_i2c_fill_tx_fifo(idev) == 0)
>>> +                       i2c_int_disable(idev, MST_STATUS_TFL);
>>> +       }
>>> +
>>> +       if (status & MST_STATUS_SCC) {
>>> +               /* Stop completed */
>>> +               i2c_int_disable(idev, ~0);
>>> +               complete(&idev->msg_complete);
>>> +       } else if (status & MST_STATUS_SNS) {
>>> +               /* Transfer done */
>>> +               i2c_int_disable(idev, ~0);
>>> +               if (i2c_m_rd(idev->msg) && idev->msg_xfrd <
>>> idev->msg->len)
>>> +                       axxia_i2c_empty_rx_fifo(idev);
>>> +               complete(&idev->msg_complete);
>>> +       } else if (unlikely(status & MST_STATUS_ERR)) {
>>> +               /* Transfer error */
>>> +               i2c_int_disable(idev, ~0);
>>> +               if (status & MST_STATUS_AL)
>>> +                       idev->msg_err = -EAGAIN;
>>> +               else if (status & MST_STATUS_NAK)
>>> +                       idev->msg_err = -ENXIO;
>>> +               else
>>> +                       idev->msg_err = -EIO;
>>> +               dev_dbg(idev->dev, "error %#x, addr=%#x rx=%u/%u
>>> tx=%u/%u\n",
>>> +                       status,
>>> +                       idev->msg->addr,
>>> +                       readl(idev->base + MST_RX_BYTES_XFRD),
>>> +                       readl(idev->base + MST_RX_XFER),
>>> +                       readl(idev->base + MST_TX_BYTES_XFRD),
>>> +                       readl(idev->base + MST_TX_XFER));
>>> +               complete(&idev->msg_complete);
>>> +       }
>>> +
>>> +out:
>>> +       /* Clear interrupt */
>>> +       writel(INT_MST, idev->base + INTERRUPT_STATUS);
>>> +
>>> +       return IRQ_HANDLED;
>>> +}
>>> +
>>
>> Its looks good if we move the entire ISR above probe/remove
>> functionalities...
>>
> Not sure what you mean here... The ISR _is_ above probe/remove.

I mean ISR should immediately above probe functionality. So that we can see
devm_request_irq(..,isr_name,..) ISR directly with isr name..

-- 
Regards,
Varka Bhadram.

  parent reply	other threads:[~2014-09-29 11:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29  9:32 [PATCH v2] i2c: axxia: Add I2C driver for AXM55xx Anders Berg
     [not found] ` <1411983159-4692-1-git-send-email-anders.berg-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
2014-09-29 10:07   ` Varka Bhadram
     [not found]     ` <54292F74.2030209-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-29 10:13       ` Wolfram Sang
2014-09-29 10:13         ` Varka Bhadram
2014-09-29 11:13       ` Anders Berg
     [not found]         ` <CAE0=X_0guSvMqZxHvdS39Zxx4G7qVvnddv96t72rp4FwpJLgfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-29 11:14           ` Varka Bhadram [this message]
     [not found]             ` <54293F2C.2090206-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-29 12:51               ` Wolfram Sang
2014-10-03 10:36   ` Wolfram Sang
2014-10-03 11:04     ` Anders Berg

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=54293F2C.2090206@gmail.com \
    --to=varkabhadram-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=anders.berg-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=wsa-z923LK4zBo2bacvFa/9K2g@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).