All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cousson, Benoit" <b-cousson-l0cyMroinI0@public.gmane.org>
To: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org>
Cc: Shubhrajyoti <shubhrajyoti-l0cyMroinI0@public.gmane.org>,
	Kevin Hilman <khilman-l0cyMroinI0@public.gmane.org>,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org
Subject: Re: [PATCHv8 4/5] OMAP: I2C: Remove the reset in the init path
Date: Thu, 12 Jan 2012 15:13:47 +0100	[thread overview]
Message-ID: <4F0EEA9B.3030104@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1201110809530.31702-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org>

On 1/11/2012 4:22 PM, Paul Walmsley wrote:
> On Wed, 11 Jan 2012, Cousson, Benoit wrote:
>
>> Something that puzzle me on that point is most architecture does not use
>> plateform_device and thus does not have any pdata to hack some custom function
>> pointers here an there.
>> It means that there is probably some better solution to handle that.
>
> PCI and USB have their own bus-level device reset functions that are
> exported from bus code that lives under drivers/.  In a similar fashion,
> we could export omap_device_reset() from our arch/arm/plat-omap code.
> But that would require that arch/arm/plat-omap and arch/arm/mach-omap2
> code to be compiled for any ARM build that includes i2c-omap.c.  This
> would be good to avoid, under the principle that drivers should be
> buildable for any architecture.  (This is also why we wish to remove
> omap_{read,write}*() and cpu_is_omap() from any drivers which contain
> those.)
>
> The intention a few years ago was to eventually create a a real omap_bus
> and omap_device, with the bus/device integration code living under
> drivers.  In such a situation, we'd be able to use something like the
> PCI/USB approach cleanly, since there wouldn't be dependencies to arch/
> code.

For reset, maybe the custom bus is a better approach, since it is 
something that is handled by the OMAP core infrastructure.
I was referring more to all the other function pointer we have today in 
driver like MMC, DSS that does not necessarily belong to a OMAP core stuff.

>> AFAIU, the way PPC is handling that is by splitting the driver in a generic
>> part and in a platform specific part.
>>
>> You can then add any OMAP specific hacks in the OMAP specific part while
>> keeping most of generic code in a generic driver.
>>
>> In this case, we just have to implement a small shim that will handle the OMAP
>> specific code for the reset. The generic driver will handle the rest.
>>
>> Maybe I'm missing some important details, but that does seems easily doable
>> for the i2c case.
>
> Hmm.  How do those drivers call the platform-specific code in a way that
> allows those drivers to be built for non-PPC platforms?

Well, the point is that a lot of that code should not be in the omap 
arch directory at the first place.
For example, the MMC is using extensively function pointers because of 
the control module dependency.
Having a control module driver will allow stacking the drivers without 
having to get any code in mach-omap directory.

Otherwise, there is as well a dedicated drivers/platform directory that 
can store some platform specific drivers. So far it looks like it is 
used for x86 board kind of drivers only.

Regards,
Benoit

WARNING: multiple messages have this Message-ID (diff)
From: b-cousson@ti.com (Cousson, Benoit)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv8 4/5] OMAP: I2C: Remove the reset in the init path
Date: Thu, 12 Jan 2012 15:13:47 +0100	[thread overview]
Message-ID: <4F0EEA9B.3030104@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1201110809530.31702@utopia.booyaka.com>

On 1/11/2012 4:22 PM, Paul Walmsley wrote:
> On Wed, 11 Jan 2012, Cousson, Benoit wrote:
>
>> Something that puzzle me on that point is most architecture does not use
>> plateform_device and thus does not have any pdata to hack some custom function
>> pointers here an there.
>> It means that there is probably some better solution to handle that.
>
> PCI and USB have their own bus-level device reset functions that are
> exported from bus code that lives under drivers/.  In a similar fashion,
> we could export omap_device_reset() from our arch/arm/plat-omap code.
> But that would require that arch/arm/plat-omap and arch/arm/mach-omap2
> code to be compiled for any ARM build that includes i2c-omap.c.  This
> would be good to avoid, under the principle that drivers should be
> buildable for any architecture.  (This is also why we wish to remove
> omap_{read,write}*() and cpu_is_omap() from any drivers which contain
> those.)
>
> The intention a few years ago was to eventually create a a real omap_bus
> and omap_device, with the bus/device integration code living under
> drivers.  In such a situation, we'd be able to use something like the
> PCI/USB approach cleanly, since there wouldn't be dependencies to arch/
> code.

For reset, maybe the custom bus is a better approach, since it is 
something that is handled by the OMAP core infrastructure.
I was referring more to all the other function pointer we have today in 
driver like MMC, DSS that does not necessarily belong to a OMAP core stuff.

>> AFAIU, the way PPC is handling that is by splitting the driver in a generic
>> part and in a platform specific part.
>>
>> You can then add any OMAP specific hacks in the OMAP specific part while
>> keeping most of generic code in a generic driver.
>>
>> In this case, we just have to implement a small shim that will handle the OMAP
>> specific code for the reset. The generic driver will handle the rest.
>>
>> Maybe I'm missing some important details, but that does seems easily doable
>> for the i2c case.
>
> Hmm.  How do those drivers call the platform-specific code in a way that
> allows those drivers to be built for non-PPC platforms?

Well, the point is that a lot of that code should not be in the omap 
arch directory at the first place.
For example, the MMC is using extensively function pointers because of 
the control module dependency.
Having a control module driver will allow stacking the drivers without 
having to get any code in mach-omap directory.

Otherwise, there is as well a dedicated drivers/platform directory that 
can store some platform specific drivers. So far it looks like it is 
used for x86 board kind of drivers only.

Regards,
Benoit

  parent reply	other threads:[~2012-01-12 14:13 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 10:55 [PATCHv8 0/5] I2C driver updates Shubhrajyoti D
2011-12-13 10:55 ` Shubhrajyoti D
2011-12-13 10:55 ` [PATCHv8 1/5] OMAP3+: HWMOD: Add the default clockactivity for I2C Shubhrajyoti D
2011-12-13 10:55   ` Shubhrajyoti D
     [not found]   ` <1323773758-6375-2-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2011-12-16  8:35     ` Paul Walmsley
2011-12-16  8:35       ` Paul Walmsley
2011-12-13 10:55 ` [PATCHv8 2/5] OMAP: hwmod/device : add omap_device_reset to reset all the hwmods in the device Shubhrajyoti D
2011-12-13 10:55   ` Shubhrajyoti D
     [not found]   ` <1323773758-6375-3-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2011-12-16  8:42     ` Paul Walmsley
2011-12-16  8:42       ` Paul Walmsley
     [not found] ` <1323773758-6375-1-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2011-12-13 10:55   ` [PATCHv8 3/5] OMAP: I2C: Reset support Shubhrajyoti D
2011-12-13 10:55     ` Shubhrajyoti D
2011-12-16  8:38     ` Paul Walmsley
2011-12-16  8:38       ` Paul Walmsley
     [not found]     ` <1323773758-6375-4-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2011-12-16  8:51       ` Cousson, Benoit
2011-12-16  8:51         ` Cousson, Benoit
     [not found]         ` <4EEB068C.3010501-l0cyMroinI0@public.gmane.org>
2011-12-16  8:57           ` Shubhrajyoti
2011-12-16  8:57             ` Shubhrajyoti
     [not found]             ` <4EEB07FA.1020100-l0cyMroinI0@public.gmane.org>
2011-12-16 17:26               ` Tony Lindgren
2011-12-16 17:26                 ` Tony Lindgren
2011-12-13 10:55   ` [PATCHv8 5/5] OMAP: I2C: Remove the SYSC register definition Shubhrajyoti D
2011-12-13 10:55     ` Shubhrajyoti D
2011-12-16  8:41     ` Paul Walmsley
2011-12-16  8:41       ` Paul Walmsley
2011-12-13 10:55 ` [PATCHv8 4/5] OMAP: I2C: Remove the reset in the init path Shubhrajyoti D
2011-12-13 10:55   ` Shubhrajyoti D
     [not found]   ` <1323773758-6375-5-git-send-email-shubhrajyoti-l0cyMroinI0@public.gmane.org>
2011-12-16  8:40     ` Paul Walmsley
2011-12-16  8:40       ` Paul Walmsley
2011-12-16  8:59       ` Shubhrajyoti
2011-12-16  8:59         ` Shubhrajyoti
     [not found]         ` <CANQgH-Ze1S6sy1uhzy_b8GWOCjF4+-9DOCcUn9mq1kAaT+Y7FA@mail.gmail.com>
     [not found]           ` <CANQgH-Ze1S6sy1uhzy_b8GWOCjF4+-9DOCcUn9mq1kAaT+Y7FA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-10  6:24             ` Datta, Shubhrajyoti
2012-01-10  6:24               ` Datta, Shubhrajyoti
2012-01-10 15:26               ` Kevin Hilman
2012-01-10 15:26                 ` Kevin Hilman
     [not found]                 ` <87hb03tw8h.fsf-l0cyMroinI0@public.gmane.org>
2012-01-11  6:06                   ` Shubhrajyoti
2012-01-11  6:06                     ` Shubhrajyoti
2012-01-11 13:29                     ` Paul Walmsley
2012-01-11 13:29                       ` Paul Walmsley
     [not found]                       ` <alpine.DEB.2.00.1201110619090.31702-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org>
2012-01-11 13:58                         ` Shubhrajyoti
2012-01-11 13:58                           ` Shubhrajyoti
     [not found]                           ` <4F0D9589.1080609-l0cyMroinI0@public.gmane.org>
2012-01-11 15:07                             ` Paul Walmsley
2012-01-11 15:07                               ` Paul Walmsley
2012-01-11 14:23                         ` Cousson, Benoit
2012-01-11 14:23                           ` Cousson, Benoit
2012-01-11 15:22                           ` Paul Walmsley
2012-01-11 15:22                             ` Paul Walmsley
     [not found]                             ` <alpine.DEB.2.00.1201110809530.31702-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org>
2012-01-12 14:13                               ` Cousson, Benoit [this message]
2012-01-12 14:13                                 ` Cousson, Benoit
2012-01-12 23:22                                 ` Paul Walmsley
2012-01-12 23:22                                   ` Paul Walmsley

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=4F0EEA9B.3030104@ti.com \
    --to=b-cousson-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 \
    --cc=shubhrajyoti-l0cyMroinI0@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@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 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.