linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shubhrajyoti <shubhrajyoti-l0cyMroinI0@public.gmane.org>
To: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org>
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	khilman-l0cyMroinI0@public.gmane.org,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org
Subject: Re: [PATCHv7 1/3] OMAP: I2C: Reset support
Date: Fri, 09 Dec 2011 12:51:09 +0530	[thread overview]
Message-ID: <4EE1B6E5.6080401@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1112081812530.6289-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org>

On Friday 09 December 2011 06:45 AM, Paul Walmsley wrote:
> Hi
>
> some comments
>
> On Fri, 2 Dec 2011, Shubhrajyoti D wrote:
>
>> Under some error conditions the i2c driver may do a reset.
>> Adding a reset field and support in the device-specific code.
>>
>> Signed-off-by: Shubhrajyoti D <shubhrajyoti-l0cyMroinI0@public.gmane.org>
>> ---
>>  arch/arm/plat-omap/i2c.c |   18 ++++++++++++++++++
>>  include/linux/i2c-omap.h |    1 +
>>  2 files changed, 19 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
>> index db071bc..883229c 100644
>> --- a/arch/arm/plat-omap/i2c.c
>> +++ b/arch/arm/plat-omap/i2c.c
>> @@ -74,6 +74,22 @@ static struct omap_i2c_bus_platform_data i2c_pdata[OMAP_I2C_MAX_CONTROLLERS];
>>  static struct platform_device omap_i2c_devices[] = {
>>  	I2C_DEV_BUILDER(1, i2c_resources[0], &i2c_pdata[0]),
>>  };
>> +/**
>> + * omap2_i2c_reset - reset the omap i2c module.
>> + * @dev: struct device*
>> + */
>> +
>> +static int omap2_i2c_reset(struct device *dev)
>> +{
>> +	int r = 0;
>> +	struct platform_device *pdev = to_platform_device(dev);
>> +	struct omap_device *odev = to_omap_device(pdev);
>> +	struct omap_hwmod *oh;
>> +
>> +	oh = odev->hwmods[0];
>> +	r = omap_hwmod_reset(oh);
>> +	return r;
>> +}
> This function should go into arch/arm/plat-omap/omap_device.c, and it 
agree
> should be renamed to omap_device_reset(), since it's not I2C specific.  
> Also it shouldn't assume that there's only one hwmod - it should iterate 
> over all of the hwmods in the omap_device and call omap_hwmod_reset() on 
> each.
Yes agree will fix in the next version.

>>  
>>  #define OMAP_I2C_CMDLINE_SETUP	(BIT(31))
>>  
>> @@ -179,6 +195,8 @@ static inline int omap2_i2c_add_bus(int bus_id)
>>  	 */
>>  	if (cpu_is_omap34xx())
>>  		pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat;
>> +
>> +	pdata->device_reset = omap2_i2c_reset;
> omap_device_reset
>
>>  	pdev = omap_device_build(name, bus_id, oh, pdata,
>>  			sizeof(struct omap_i2c_bus_platform_data),
>>  			NULL, 0, 0);
>> diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
>> index 92a0dc7..fd38249 100644
>> --- a/include/linux/i2c-omap.h
>> +++ b/include/linux/i2c-omap.h
>> @@ -35,6 +35,7 @@ struct omap_i2c_bus_platform_data {
>>  	u32		rev;
>>  	u32		flags;
>>  	void		(*set_mpu_wkup_lat)(struct device *dev, long set);
>> +	int		(*device_reset) (struct device *dev);
>>  };
>>  
>>  #endif
>> -- 
>> 1.7.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
> - Paul

  parent reply	other threads:[~2011-12-09  7:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02  9:21 [PATCHv7 0/3] I2C driver updates Shubhrajyoti D
2011-12-02  9:21 ` [PATCHv7 1/3] OMAP: I2C: Reset support Shubhrajyoti D
2011-12-09  1:15   ` Paul Walmsley
     [not found]     ` <alpine.DEB.2.00.1112081812530.6289-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org>
2011-12-09  7:21       ` Shubhrajyoti [this message]
     [not found] ` <1322817674-25384-1-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2011-12-02  9:21   ` [PATCHv7 2/3] OMAP: I2C: Remove the reset in the init path Shubhrajyoti D
2011-12-02 21:37     ` Jon Hunter
     [not found]       ` <4ED94536.2080307-l0cyMroinI0@public.gmane.org>
2011-12-02 21:48         ` Jon Hunter
2011-12-03 10:59         ` Shubhrajyoti
2011-12-02  9:21   ` [PATCHv7 3/3] OMAP: I2C: Remove the SYSC register definition Shubhrajyoti D

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=4EE1B6E5.6080401@ti.com \
    --to=shubhrajyoti-l0cymroini0@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=khilman-l0cyMroinI0@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=paul-DWxLp4Yu+b8AvxtiuMwx3w@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).