linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manish Badarkhe <badarkhe.manish@gmail.com>
To: Ravikumar Kattekola <rk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
	wsa@the-dreams.de, linux-omap@vger.kernel.org,
	linux-i2c@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC 1/1] drivers: i2c: omap: Add slave support
Date: Thu, 26 May 2016 21:37:21 +0530	[thread overview]
Message-ID: <CAKDJKT4Ws3XusYJTkojjeMvwxc2R9BRYpmn6HwGOH_8QF+pe0A@mail.gmail.com> (raw)
In-Reply-To: <20160525141119.14486-2-rk@ti.com>

Hi Ravikumar

Some sanity comments, just good to have.

> +#ifdef CONFIG_I2C_SLAVE
> +static int omap_i2c_slave_irq(struct omap_i2c_dev *omap)
> +{
> +       u16 stat_raw;
> +       u16 stat;
> +       u16 bits;
> +       u8 value;
> +
> +       stat_raw = omap_i2c_read_reg(omap, OMAP_I2C_IP_V2_IRQSTATUS_RAW);
> +       bits = omap_i2c_read_reg(omap, OMAP_I2C_IE_REG);
> +       stat_raw &= bits;
> +
> +       if (stat_raw & OMAP_I2C_STAT_AAS) {
> +               omap_i2c_ack_stat(omap, OMAP_I2C_STAT_AAS);
> +               stat_raw &= ~OMAP_I2C_STAT_AAS;
> +       }
> +
> +out:
> +       return 0;
> +}
> +#endif

This function always return 0.

> +#ifdef CONFIG_I2C_SLAVE
> +static int omap_i2c_reg_slave(struct i2c_client *slave)
> +{
> +       struct omap_i2c_dev *omap = i2c_get_adapdata(slave->adapter);
> +       u16 reg;
> +       int ret = 0;
> +       /* Enable necessary interrupts */
> +       omap_i2c_write_reg(omap, OMAP_I2C_IE_REG, omap->iestate);
> +
> +       return 0;
> +
> +}

Better to return "ret" here as already been initialized to 0

> +
> +static int omap_i2c_unreg_slave(struct i2c_client *slave)
> +{
> +       struct omap_i2c_dev *omap = i2c_get_adapdata(slave->adapter);
> +       u16 reg;
> +
> +       pm_runtime_put(omap->dev);
> +       return 0;
> +}
> +#endif

This function always return 0


Regards
Manish Badarkhe

  reply	other threads:[~2016-05-26 16:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 14:11 [RFC 0/1] i2c: omap: Add support for switching to slave mode Ravikumar Kattekola
2016-05-25 14:11 ` [RFC 1/1] drivers: i2c: omap: Add slave support Ravikumar Kattekola
2016-05-26 16:07   ` Manish Badarkhe [this message]
2016-08-25 17:14   ` Wolfram Sang
2016-08-27 13:59     ` Matthijs van Duin
2016-08-27 17:22       ` Wolfram Sang
2016-08-27 23:38         ` Matthijs van Duin
2016-08-28  5:35           ` Wolfram Sang
2016-08-29  3:43             ` Matthijs van Duin
2016-10-14  8:57               ` Ravikumar
2016-10-17  6:15                 ` Matthijs van Duin
2016-10-14  8:03       ` Ravikumar
2016-10-14  7:56     ` Ravikumar

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=CAKDJKT4Ws3XusYJTkojjeMvwxc2R9BRYpmn6HwGOH_8QF+pe0A@mail.gmail.com \
    --to=badarkhe.manish@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rk@ti.com \
    --cc=tony@atomide.com \
    --cc=wsa@the-dreams.de \
    /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).