All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Add high resolution generic time support for S3C64xx
@ 2011-08-31 12:33 Tomasz Figa
  2011-08-31 12:34 ` [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name Tomasz Figa
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Tomasz Figa @ 2011-08-31 12:33 UTC (permalink / raw)
  To: linux-arm-kernel



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-08-31 12:33 [PATCH 0/5] Add high resolution generic time support for S3C64xx Tomasz Figa
@ 2011-08-31 12:34 ` Tomasz Figa
  2011-08-31 12:44   ` Mark Brown
  2011-08-31 12:34 ` [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time support using PWM timers Tomasz Figa
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Tomasz Figa @ 2011-08-31 12:34 UTC (permalink / raw)
  To: linux-arm-kernel



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time support using PWM timers.
  2011-08-31 12:33 [PATCH 0/5] Add high resolution generic time support for S3C64xx Tomasz Figa
  2011-08-31 12:34 ` [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name Tomasz Figa
@ 2011-08-31 12:34 ` Tomasz Figa
  2011-10-10  9:57   ` Kukjin Kim
  2011-10-13 14:22   ` Russell King - ARM Linux
  2011-08-31 12:35 ` [PATCH 3/5] ARM: Samsung: pwm: Exclude timer 3 on S3C64xx if generic time is enabled Tomasz Figa
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 22+ messages in thread
From: Tomasz Figa @ 2011-08-31 12:34 UTC (permalink / raw)
  To: linux-arm-kernel



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 3/5] ARM: Samsung: pwm: Exclude timer 3 on S3C64xx if generic time is enabled.
  2011-08-31 12:33 [PATCH 0/5] Add high resolution generic time support for S3C64xx Tomasz Figa
  2011-08-31 12:34 ` [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name Tomasz Figa
  2011-08-31 12:34 ` [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time support using PWM timers Tomasz Figa
@ 2011-08-31 12:35 ` Tomasz Figa
  2011-08-31 12:35 ` [PATCH 4/5] ARM: s3c64xx: Move all machines to s3c64xx_timer Tomasz Figa
  2011-08-31 12:36 ` [PATCH 5/5] ARM: s3c64xx: Add optional local sched_clock implementation Tomasz Figa
  4 siblings, 0 replies; 22+ messages in thread
From: Tomasz Figa @ 2011-08-31 12:35 UTC (permalink / raw)
  To: linux-arm-kernel



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 4/5] ARM: s3c64xx: Move all machines to s3c64xx_timer.
  2011-08-31 12:33 [PATCH 0/5] Add high resolution generic time support for S3C64xx Tomasz Figa
                   ` (2 preceding siblings ...)
  2011-08-31 12:35 ` [PATCH 3/5] ARM: Samsung: pwm: Exclude timer 3 on S3C64xx if generic time is enabled Tomasz Figa
@ 2011-08-31 12:35 ` Tomasz Figa
  2011-08-31 12:36 ` [PATCH 5/5] ARM: s3c64xx: Add optional local sched_clock implementation Tomasz Figa
  4 siblings, 0 replies; 22+ messages in thread
From: Tomasz Figa @ 2011-08-31 12:35 UTC (permalink / raw)
  To: linux-arm-kernel



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 5/5] ARM: s3c64xx: Add optional local sched_clock implementation.
  2011-08-31 12:33 [PATCH 0/5] Add high resolution generic time support for S3C64xx Tomasz Figa
                   ` (3 preceding siblings ...)
  2011-08-31 12:35 ` [PATCH 4/5] ARM: s3c64xx: Move all machines to s3c64xx_timer Tomasz Figa
@ 2011-08-31 12:36 ` Tomasz Figa
  4 siblings, 0 replies; 22+ messages in thread
From: Tomasz Figa @ 2011-08-31 12:36 UTC (permalink / raw)
  To: linux-arm-kernel



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-08-31 12:34 ` [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name Tomasz Figa
@ 2011-08-31 12:44   ` Mark Brown
  2011-08-31 13:30     ` Tomasz Figa
  0 siblings, 1 reply; 22+ messages in thread
From: Mark Brown @ 2011-08-31 12:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 31, 2011 at 02:34:15PM +0200, Tomasz Figa wrote:

> This patch is a prerequisite to adding generic time support for S3C64xx.
> It makes possible to differentiate SoCs, required to exclude timers 3 and 4
> from PWM driver only on S3C64xx.

Now we have the cpu_is_foo() support for Samsung CPUs can we use that
instead?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-08-31 12:44   ` Mark Brown
@ 2011-08-31 13:30     ` Tomasz Figa
  2011-09-01  2:26       ` Kukjin Kim
  0 siblings, 1 reply; 22+ messages in thread
From: Tomasz Figa @ 2011-08-31 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

2011/8/31 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Wed, Aug 31, 2011 at 02:34:15PM +0200, Tomasz Figa wrote:
>
>> This patch is a prerequisite to adding generic time support for S3C64xx.
>> It makes possible to differentiate SoCs, required to exclude timers 3 and 4
>> from PWM driver only on S3C64xx.
>
> Now we have the cpu_is_foo() support for Samsung CPUs can we use that
> instead?
>

Well, I thought about it, but I based my patches on latest stable sources and
cpu_is_s3c64xx wasn't there yet. Should I rebase them to Linus' tree?

I'm not yet fully used to submitting patches here, so things like choosing the
base for patches are sometimes a bit confusing to me and I couldn't find any
guide. Should fixes be based on stable tree and new features implemented on
top of current Linus' tree? Could you give me some advice on this?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-08-31 13:30     ` Tomasz Figa
@ 2011-09-01  2:26       ` Kukjin Kim
  2011-09-01  3:33         ` Kyungmin Park
  0 siblings, 1 reply; 22+ messages in thread
From: Kukjin Kim @ 2011-09-01  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz Figa wrote:
> 
> 2011/8/31 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> > On Wed, Aug 31, 2011 at 02:34:15PM +0200, Tomasz Figa wrote:
> >
> >> This patch is a prerequisite to adding generic time support for
S3C64xx.
> >> It makes possible to differentiate SoCs, required to exclude timers 3
and 4
> >> from PWM driver only on S3C64xx.
> >
> > Now we have the cpu_is_foo() support for Samsung CPUs can we use that
> > instead?
> >
> 
> Well, I thought about it, but I based my patches on latest stable sources
and
> cpu_is_s3c64xx wasn't there yet. Should I rebase them to Linus' tree?
> 
> I'm not yet fully used to submitting patches here, so things like choosing
the
> base for patches are sometimes a bit confusing to me and I couldn't find
any
> guide. Should fixes be based on stable tree and new features implemented
on
> top of current Linus' tree? Could you give me some advice on this?

Hi Tomasz,

You can use "soc_is_s3c64xx()" based on Samsung -next tree.
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
for-next

In addition, would be better to me if you could work about Samsung stuff
based on it.

As a note, your previous patches are in there :)

If any problems, please let me know...

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-09-01  2:26       ` Kukjin Kim
@ 2011-09-01  3:33         ` Kyungmin Park
  2011-09-01 11:18           ` Tomasz Figa
  0 siblings, 1 reply; 22+ messages in thread
From: Kyungmin Park @ 2011-09-01  3:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 1, 2011 at 11:26 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> Tomasz Figa wrote:
>>
>> 2011/8/31 Mark Brown <broonie@opensource.wolfsonmicro.com>:
>> > On Wed, Aug 31, 2011 at 02:34:15PM +0200, Tomasz Figa wrote:
>> >
>> >> This patch is a prerequisite to adding generic time support for
> S3C64xx.
>> >> It makes possible to differentiate SoCs, required to exclude timers 3
> and 4
>> >> from PWM driver only on S3C64xx.
>> >
>> > Now we have the cpu_is_foo() support for Samsung CPUs can we use that
>> > instead?
>> >
>>
>> Well, I thought about it, but I based my patches on latest stable sources
> and
>> cpu_is_s3c64xx wasn't there yet. Should I rebase them to Linus' tree?
>>
>> I'm not yet fully used to submitting patches here, so things like choosing
> the
>> base for patches are sometimes a bit confusing to me and I couldn't find
> any
>> guide. Should fixes be based on stable tree and new features implemented
> on
>> top of current Linus' tree? Could you give me some advice on this?
>
> Hi Tomasz,
>
> You can use "soc_is_s3c64xx()" based on Samsung -next tree.
> git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> for-next

+static struct platform_device_id s3c_pwm_driver_ids[] = {
+       {
+               .name           = "s3c24xx-pwm",
+               .driver_data    = TYPE_GENERIC,
+       }, {
+               .name           = "s3c64xx-pwm",
+               .driver_data    = TYPE_S3C64XX,
+       },
+};
+MODULE_DEVICE_TABLE(platform, s3c_pwm_driver_ids);

doesn't it right way?
do you want to use the soc_is_* at device?

>
> In addition, would be better to me if you could work about Samsung stuff
> based on it.
>
> As a note, your previous patches are in there :)
>
> If any problems, please let me know...
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-09-01  3:33         ` Kyungmin Park
@ 2011-09-01 11:18           ` Tomasz Figa
  2011-09-01 12:32             ` Mark Brown
  2011-09-06 10:41             ` Tomasz Figa
  0 siblings, 2 replies; 22+ messages in thread
From: Tomasz Figa @ 2011-09-01 11:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 01 of September 2011 at 12:33:10, Kyungmin Park wrote:
> On Thu, Sep 1, 2011 at 11:26 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> > Tomasz Figa wrote:
> >>
> >> 2011/8/31 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> >> > On Wed, Aug 31, 2011 at 02:34:15PM +0200, Tomasz Figa wrote:
> >> >
> >> >> This patch is a prerequisite to adding generic time support for
> > S3C64xx.
> >> >> It makes possible to differentiate SoCs, required to exclude timers 3
> > and 4
> >> >> from PWM driver only on S3C64xx.
> >> >
> >> > Now we have the cpu_is_foo() support for Samsung CPUs can we use that
> >> > instead?
> >>
> >> [snip]
> >
> > Hi Tomasz,
> >
> > You can use "soc_is_s3c64xx()" based on Samsung -next tree.
> > git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> > for-next
> 
> +static struct platform_device_id s3c_pwm_driver_ids[] = {
> +       {
> +               .name           = "s3c24xx-pwm",
> +               .driver_data    = TYPE_GENERIC,
> +       }, {
> +               .name           = "s3c64xx-pwm",
> +               .driver_data    = TYPE_S3C64XX,
> +       },
> +};
> +MODULE_DEVICE_TABLE(platform, s3c_pwm_driver_ids);
> 
> doesn't it right way?
> do you want to use the soc_is_* at device?
> 

Well, now we have three alternatives:
- to leave it as is (i.e. changing platform device names)
- to use cpu_is_* (does it ever exist for S3C64xx or soc_is_s3c64xx is its equivalent?)
- to use soc_is_* 

Waiting for more comments then.

Best regards,
Tom

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-09-01 11:18           ` Tomasz Figa
@ 2011-09-01 12:32             ` Mark Brown
  2011-09-06 10:41             ` Tomasz Figa
  1 sibling, 0 replies; 22+ messages in thread
From: Mark Brown @ 2011-09-01 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 01, 2011 at 01:18:32PM +0200, Tomasz Figa wrote:
> On Thursday 01 of September 2011 at 12:33:10, Kyungmin Park wrote:

> Well, now we have three alternatives:
> - to leave it as is (i.e. changing platform device names)
> - to use cpu_is_* (does it ever exist for S3C64xx or soc_is_s3c64xx is its equivalent?)
> - to use soc_is_* 

soc_is is the same thing.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-09-01 11:18           ` Tomasz Figa
  2011-09-01 12:32             ` Mark Brown
@ 2011-09-06 10:41             ` Tomasz Figa
  2011-09-06 11:03               ` Russell King - ARM Linux
  1 sibling, 1 reply; 22+ messages in thread
From: Tomasz Figa @ 2011-09-06 10:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 01 of September 2011 at 13:18:32, Tomasz Figa wrote:
> On Thursday 01 of September 2011 at 12:33:10, Kyungmin Park wrote:
> > On Thu, Sep 1, 2011 at 11:26 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> > > Tomasz Figa wrote:
> > >>
> > >> 2011/8/31 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> > >> > On Wed, Aug 31, 2011 at 02:34:15PM +0200, Tomasz Figa wrote:
> > >> >
> > >> >> This patch is a prerequisite to adding generic time support for
> > > S3C64xx.
> > >> >> It makes possible to differentiate SoCs, required to exclude timers 3
> > > and 4
> > >> >> from PWM driver only on S3C64xx.
> > >> >
> > >> > Now we have the cpu_is_foo() support for Samsung CPUs can we use that
> > >> > instead?
> > >>
> > >> [snip]
> > >
> > > Hi Tomasz,
> > >
> > > You can use "soc_is_s3c64xx()" based on Samsung -next tree.
> > > git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> > > for-next
> > 
> > +static struct platform_device_id s3c_pwm_driver_ids[] = {
> > +       {
> > +               .name           = "s3c24xx-pwm",
> > +               .driver_data    = TYPE_GENERIC,
> > +       }, {
> > +               .name           = "s3c64xx-pwm",
> > +               .driver_data    = TYPE_S3C64XX,
> > +       },
> > +};
> > +MODULE_DEVICE_TABLE(platform, s3c_pwm_driver_ids);
> > 
> > doesn't it right way?
> > do you want to use the soc_is_* at device?
> > 
> 
> Well, now we have three alternatives:
> - to leave it as is (i.e. changing platform device names)
> - to use cpu_is_* (does it ever exist for S3C64xx or soc_is_s3c64xx is its equivalent?)
> - to use soc_is_* 
> 
> Waiting for more comments then.
> 
Ping.

Should I keep it as is or rather change it to use soc_is_s3c64xx instead?

Best regards,
Tom

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-09-06 10:41             ` Tomasz Figa
@ 2011-09-06 11:03               ` Russell King - ARM Linux
  2011-09-06 11:35                 ` Tomasz Figa
  0 siblings, 1 reply; 22+ messages in thread
From: Russell King - ARM Linux @ 2011-09-06 11:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 06, 2011 at 12:41:07PM +0200, Tomasz Figa wrote:
> On Thursday 01 of September 2011 at 13:18:32, Tomasz Figa wrote:
> > Well, now we have three alternatives:
> > - to leave it as is (i.e. changing platform device names)
> > - to use cpu_is_* (does it ever exist for S3C64xx or soc_is_s3c64xx is its equivalent?)
> > - to use soc_is_* 
> > 
> > Waiting for more comments then.
> > 
> Ping.
> 
> Should I keep it as is or rather change it to use soc_is_s3c64xx instead?

I don't know what question you're asking (the questions don't make sense
in terms of the quoted context.)

If you're asking whether you should use a cpu_ prefix instead of a soc_
prefix for identifying s3c64xx, then consider the question.

What is the CPU?

What are S3C64xx / OMAP / PXA310 / SA-11x0 / AT91RM9200?  CPU or SoC ?
What are Cortex A8/A9 / Xscale / StrongARM / ARM920?  CPU or SoC ?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-09-06 11:03               ` Russell King - ARM Linux
@ 2011-09-06 11:35                 ` Tomasz Figa
  2011-09-06 12:04                   ` Russell King - ARM Linux
  0 siblings, 1 reply; 22+ messages in thread
From: Tomasz Figa @ 2011-09-06 11:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 06 of September 2011 at 12:03:11, Russell King - ARM Linux wrote:
> On Tue, Sep 06, 2011 at 12:41:07PM +0200, Tomasz Figa wrote:
> > On Thursday 01 of September 2011 at 13:18:32, Tomasz Figa wrote:
> > > Well, now we have three alternatives:
> > > - to leave it as is (i.e. changing platform device names)
> > > - to use cpu_is_* (does it ever exist for S3C64xx or soc_is_s3c64xx is its equivalent?)
> > > - to use soc_is_* 
> > > 
> > > Waiting for more comments then.
> > > 
> > Ping.
> > 
> > Should I keep it as is or rather change it to use soc_is_s3c64xx instead?
> 
> I don't know what question you're asking (the questions don't make sense
> in terms of the quoted context.)
> 
> If you're asking whether you should use a cpu_ prefix instead of a soc_
> prefix for identifying s3c64xx, then consider the question.
> 
> What is the CPU?
> 
> What are S3C64xx / OMAP / PXA310 / SA-11x0 / AT91RM9200?  CPU or SoC ?
> What are Cortex A8/A9 / Xscale / StrongARM / ARM920?  CPU or SoC ?

Well, I believe that the context I quoted explains everything, but let me
explain that again:

The patch is about a driver being able to check to what SoC a device belongs,
but there are at least two ways to achieve that.

I can see many drivers using the way I used, i.e. distinct platform device names
for each SoC that has to be differentiated plus a generic one. However, I was
suggested that using cpu_is_*/soc_is_* might be a better approach, while at the
same time I received an opinion that the original method is the preferred one.

Best regards,
Tom

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-09-06 11:35                 ` Tomasz Figa
@ 2011-09-06 12:04                   ` Russell King - ARM Linux
  2011-09-07 19:01                     ` Mark Brown
  0 siblings, 1 reply; 22+ messages in thread
From: Russell King - ARM Linux @ 2011-09-06 12:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 06, 2011 at 01:35:58PM +0200, Tomasz Figa wrote:
> Well, I believe that the context I quoted explains everything, but let me
> explain that again:
> 
> The patch is about a driver being able to check to what SoC a device belongs,
> but there are at least two ways to achieve that.
> 
> I can see many drivers using the way I used, i.e. distinct platform device names
> for each SoC that has to be differentiated plus a generic one. However, I was
> suggested that using cpu_is_*/soc_is_* might be a better approach, while at the
> same time I received an opinion that the original method is the preferred one.

Ok.  There's pros and cons here:

Pros to soc_is_*:
1. Doesn't require additional storage in every driver but does require code.
2. Obvious what's going on for a specific SoC when reading the code.

Cons:
1. Needs to be updated each time a new SoC is added.
2. Doesn't scale well - number of soc_is_* will grow to unmanageable levels
   over time.

Pros to platform driver name:
1. Can re-use existing names if feature compatible without driver mods.
2. Scales well with an increasing number of SoCs.

Cons:
1. People will hate having SoC names which don't refer to their exact SoC.
2. Probably requires storage of a set of flags in driver private data
   to identify SoC specific features.
3. Requires additional string space to identify each driver name.

However, thinking about this more wrt DT, there's another aspect to this.
Rather than encoding into the driver "this SoC has features and quirks
X,Y,Z" maybe that information should be in the device tree itself.  For
example, SoC 1 has X and Z, SoC 2 has Y.  Then a new SoC 3 comes along
with X and Y but not Z.  If X, Y, Z are encoded into DT then there's no
need to touch the kernel to support SoC 3, not even to change driver
names or soc_is_xxx macros etc.

So maybe the answer is: platform driver name determines a set of feature
flags for the driver in lieu of DT support, and when DT support comes
along the flags are controlled by DT properties instead.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-09-06 12:04                   ` Russell King - ARM Linux
@ 2011-09-07 19:01                     ` Mark Brown
  2011-10-10  9:58                       ` Kukjin Kim
  0 siblings, 1 reply; 22+ messages in thread
From: Mark Brown @ 2011-09-07 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 06, 2011 at 01:04:30PM +0100, Russell King - ARM Linux wrote:

> Pros to platform driver name:
> 1. Can re-use existing names if feature compatible without driver mods.
> 2. Scales well with an increasing number of SoCs.

> Cons:
> 1. People will hate having SoC names which don't refer to their exact SoC.
> 2. Probably requires storage of a set of flags in driver private data
>    to identify SoC specific features.
> 3. Requires additional string space to identify each driver name.

There's also an issue with actually getting the devices together to
register which causes fragility here.

> However, thinking about this more wrt DT, there's another aspect to this.
> Rather than encoding into the driver "this SoC has features and quirks
> X,Y,Z" maybe that information should be in the device tree itself.  For
> example, SoC 1 has X and Z, SoC 2 has Y.  Then a new SoC 3 comes along
> with X and Y but not Z.  If X, Y, Z are encoded into DT then there's no
> need to touch the kernel to support SoC 3, not even to change driver
> names or soc_is_xxx macros etc.

This does depend pretty strongly on making sure that the SoC DT is
distributed separately to the board DT - that should be solved now.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time support using PWM timers.
  2011-08-31 12:34 ` [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time support using PWM timers Tomasz Figa
@ 2011-10-10  9:57   ` Kukjin Kim
  2011-10-11 13:32     ` Tomasz Figa
  2011-10-13 14:22   ` Russell King - ARM Linux
  1 sibling, 1 reply; 22+ messages in thread
From: Kukjin Kim @ 2011-10-10  9:57 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz Figa wrote:
> 
> From d1fa581f09d8f8a3cc24d05420e9e65112fd8c12 Mon Sep 17 00:00:00 2001
> From: Tomasz Figa <tomasz.figa@gmail.com>
> Date: Sun, 28 Aug 2011 02:45:06 +0200
> Subject: [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time
support
>  using PWM timers.
> 
> This patch adds a sys_timer implementing generic clock source and clock
event
> device on S3C64xx using PWM timers 3 and 4. It can be enabled by a Kconfig
> option, based on which either the new sys_timer is used as s3c64xx_timer
or
> s3c64xx_timer is defined to s3c24xx_timer which is the old tick timer.
> 
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> ---
>  arch/arm/Kconfig                         |    1 -
>  arch/arm/mach-s3c64xx/Kconfig            |   12 ++
>  arch/arm/mach-s3c64xx/Makefile           |    3 +
>  arch/arm/mach-s3c64xx/time.c             |  320
> ++++++++++++++++++++++++++++++
>  arch/arm/plat-samsung/include/plat/cpu.h |    7 +
>  5 files changed, 342 insertions(+), 1 deletions(-)
>  create mode 100644 arch/arm/mach-s3c64xx/time.c
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 9adc278..05941f6 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -700,7 +700,6 @@ config ARCH_S3C64XX
>  	select ARM_VIC
>  	select HAVE_CLK
>  	select NO_IOPORT
> -	select ARCH_USES_GETTIMEOFFSET
>  	select ARCH_HAS_CPUFREQ
>  	select ARCH_REQUIRE_GPIOLIB
>  	select SAMSUNG_CLKSRC
> diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
> index e4177e2..2db76fd 100644
> --- a/arch/arm/mach-s3c64xx/Kconfig
> +++ b/arch/arm/mach-s3c64xx/Kconfig
> @@ -25,6 +25,18 @@ config CPU_S3C6410
>  	help
>  	  Enable S3C6410 CPU support
> 
> +config S3C64XX_GENERIC_CLOCKEVENTS
> +	bool "Enable high resolution generic time support using PWM timers"
> +	select GENERIC_CLOCKEVENTS
> +	help
> +	  This option enables high resolution generic time support
> +	  on S3C6400/S3C6410 SoCs using PWM timers 3 and 4 instead
> +	  of standard periodic tick using PWM timer 4.
> +
> +config S3C64XX_ARCH_USES_GETTIMEOFFSET
> +	def_bool y if !S3C64XX_GENERIC_CLOCKEVENTS
> +	select ARCH_USES_GETTIMEOFFSET
> +
>  config S3C64XX_DMA
>  	bool "S3C64XX DMA"
>  	select S3C_DMA
> diff --git a/arch/arm/mach-s3c64xx/Makefile
b/arch/arm/mach-s3c64xx/Makefile
> index 4657363..a152002 100644
> --- a/arch/arm/mach-s3c64xx/Makefile
> +++ b/arch/arm/mach-s3c64xx/Makefile
> @@ -15,6 +15,9 @@ obj-y				+= cpu.o
>  obj-y				+= clock.o
>  obj-y				+= gpiolib.o
> 
> +# Generic clockevents
> +obj-$(CONFIG_S3C64XX_GENERIC_CLOCKEVENTS) += time.o
> +
>  # Core support for S3C6400 system
> 
>  obj-$(CONFIG_CPU_S3C6400)	+= s3c6400.o
> diff --git a/arch/arm/mach-s3c64xx/time.c b/arch/arm/mach-s3c64xx/time.c
> new file mode 100644
> index 0000000..4fa57f0
> --- /dev/null
> +++ b/arch/arm/mach-s3c64xx/time.c
> @@ -0,0 +1,320 @@
> +/* linux/arch/arm/mach-s3c64xx/time.c
> + *
> + * Copyright (c) 2011 Tomasz Figa <tomasz.figa@gmail.com>
> + *
> + * based on linux/arch/arm/plat-samsung/s5p-time.c
> + *
> + * S3C64XX generic high resolution time support using PWM 3 and PWM 4
timers.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * Notes:
> + * - Frequency divisors are currently hardcoded to make both timers
operate
> + *   at 1/6 the frequency of PCLK, so with the usual PCLK frequency of 66
MHz,
> + *   the timers are clocked at 11 MHz giving us the operating range from
> + *   90 nsec to 386 sec.
> + * - PWM registers, especially TCON, are shared with PWM driver, but
since
> + *   all the clock event callbacks are run in atomic context
synchronization
> + *   is not needed.
> + */
> +
> +#include <linux/sched.h>
> +#include <linux/interrupt.h>
> +#include <linux/irq.h>
> +#include <linux/err.h>
> +#include <linux/clk.h>
> +#include <linux/clockchips.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/map.h>
> +#include <plat/regs-timer.h>
> +#include <asm/mach/time.h>
> +
> +#define PWM_EVENT	(3)
> +#define PWM_SOURCE	(4)
> +
> +#define ONESHOT		(0)
> +#define PERIODIC	(1)
> +
> +#define TCNT_MAX	(0xffffffff)
> +
> +static struct clk *timerclk;
> +
> +/*
> + * PWM timers setup code
> + */
> +
> +static inline void s3c64xx_pwm_stop(unsigned int pwm_id)
> +{
> +	unsigned long tcon = __raw_readl(S3C2410_TCON);
> +
> +	switch (pwm_id) {
> +	case 3:
> +		tcon &= ~S3C2410_TCON_T3START;
> +		break;
> +	case 4:
> +		tcon &= ~S3C2410_TCON_T4START;
> +		break;
> +	}
> +
> +	__raw_writel(tcon, S3C2410_TCON);
> +}
> +
> +static inline void s3c64xx_pwm_init(unsigned int pwm_id, unsigned long
tcnt)
> +{
> +	unsigned long tcon = __raw_readl(S3C2410_TCON);
> +
> +	/* timers reload after counting zero, so reduce the count by 1 */
> +	--tcnt;
> +
> +	/* stop the timer and ask it to load the new value */
> +	switch (pwm_id) {
> +	case 3:
> +		tcon &= ~(0xf<<16);
> +		tcon |= S3C2410_TCON_T3MANUALUPD;
> +		break;
> +	case 4:
> +		tcon &= ~(7<<20);
> +		tcon |= S3C2410_TCON_T4MANUALUPD;
> +		break;
> +	}
> +
> +	__raw_writel(tcnt, S3C2410_TCNTB(pwm_id));
> +	__raw_writel(tcnt, S3C2410_TCMPB(pwm_id));
> +	__raw_writel(tcon, S3C2410_TCON);
> +}
> +
> +static inline void s3c64xx_pwm_start(unsigned int pwm_id, bool periodic)
> +{
> +	unsigned long tcon = __raw_readl(S3C2410_TCON);
> +
> +	switch (pwm_id) {
> +	case 3:
> +		tcon |= S3C2410_TCON_T3START;
> +		tcon &= ~S3C2410_TCON_T3MANUALUPD;
> +
> +		if (periodic)
> +			tcon |= S3C2410_TCON_T3RELOAD;
> +		else
> +			tcon &= ~S3C2410_TCON_T3RELOAD;
> +		break;
> +	case 4:
> +		tcon |= S3C2410_TCON_T4START;
> +		tcon &= ~S3C2410_TCON_T4MANUALUPD;
> +
> +		if (periodic)
> +			tcon |= S3C2410_TCON_T4RELOAD;
> +		else
> +			tcon &= ~S3C2410_TCON_T4RELOAD;
> +		break;
> +	}
> +
> +	__raw_writel(tcon, S3C2410_TCON);
> +}
> +
> +/*
> + * Clock event
> + */
> +
> +static struct clk *event_in;
> +static struct clk *event_div;
> +
> +static unsigned long clock_count_per_tick;
> +
> +static int s3c64xx_clock_event_set_next_event(unsigned long cycles,
> +						struct clock_event_device
> *evt)
> +{
> +	s3c64xx_pwm_init(PWM_EVENT, cycles);
> +	s3c64xx_pwm_start(PWM_EVENT, ONESHOT);
> +	return 0;
> +}
> +
> +static void s3c64xx_clock_event_resume(void)
> +{
> +	unsigned long pclk;
> +	struct clk *tscaler;
> +
> +	pclk = clk_get_rate(timerclk);
> +	tscaler = clk_get_parent(event_div);
> +	clk_set_rate(tscaler, pclk / 3);
> +
> +	clk_set_rate(event_div, pclk / 6);
> +	clk_set_parent(event_in, event_div);
> +
> +	s3c64xx_pwm_init(PWM_EVENT, clock_count_per_tick);
> +	s3c64xx_pwm_start(PWM_EVENT, PERIODIC);
> +}
> +
> +static void s3c64xx_clock_event_set_mode(enum clock_event_mode mode,
> +						struct clock_event_device
> *evt)
> +{
> +	s3c64xx_pwm_stop(PWM_EVENT);
> +
> +	switch (mode) {
> +	case CLOCK_EVT_MODE_PERIODIC:
> +		s3c64xx_pwm_init(PWM_EVENT, clock_count_per_tick);
> +		s3c64xx_pwm_start(PWM_EVENT, PERIODIC);
> +		break;
> +	case CLOCK_EVT_MODE_ONESHOT:
> +		break;
> +	case CLOCK_EVT_MODE_UNUSED:
> +	case CLOCK_EVT_MODE_SHUTDOWN:
> +		break;
> +	case CLOCK_EVT_MODE_RESUME:
> +		s3c64xx_clock_event_resume();
> +		break;
> +	}
> +}
> +
> +static struct clock_event_device s3c64xx_clock_event_device = {
> +	.name		= "s3c64xx_clkevt",
> +	.features       = CLOCK_EVT_FEAT_PERIODIC |
> CLOCK_EVT_FEAT_ONESHOT,
> +	.rating		= 200,
> +	.shift		= 32,
> +	.set_next_event	= s3c64xx_clock_event_set_next_event,
> +	.set_mode	= s3c64xx_clock_event_set_mode,
> +};
> +
> +static irqreturn_t s3c64xx_clock_event_isr(int irq, void *dev_id)
> +{
> +	struct clock_event_device *evt = &s3c64xx_clock_event_device;
> +
> +	evt->event_handler(evt);
> +
> +	return IRQ_HANDLED;
> +}
> +
> +static struct irqaction s3c64xx_clock_event_irq = {
> +	.name		= "s3c64xx_clkevt_irq",
> +	.flags		= IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
> +	.handler	= s3c64xx_clock_event_isr,
> +};
> +
> +static void __init s3c64xx_clock_event_init(void)
> +{
> +	unsigned long clock_rate;
> +
> +	clock_rate = clk_get_rate(event_in);
> +
> +	clock_count_per_tick = clock_rate / HZ;
> +
> +	s3c64xx_clock_event_device.mult = div_sc(clock_rate,
> +			NSEC_PER_SEC, s3c64xx_clock_event_device.shift);
> +	s3c64xx_clock_event_device.max_delta_ns =
> +			clockevent_delta2ns(-1,
&s3c64xx_clock_event_device);
> +	s3c64xx_clock_event_device.min_delta_ns =
> +			clockevent_delta2ns(1, &s3c64xx_clock_event_device);
> +
> +	s3c64xx_clock_event_device.cpumask = cpumask_of(0);
> +	clockevents_register_device(&s3c64xx_clock_event_device);
> +
> +	setup_irq(IRQ_TIMER3, &s3c64xx_clock_event_irq);
> +}
> +
> +/*
> + * Clock source
> + */
> +
> +static struct clk *source_in;
> +static struct clk *source_div;
> +
> +static cycle_t s3c64xx_clocksource_read(struct clocksource *cs)
> +{
> +	return (cycle_t) ~__raw_readl(S3C2410_TCNTO(PWM_SOURCE));
> +}
> +
> +static void s3c64xx_clocksource_resume(struct clocksource *cs)
> +{
> +	unsigned long pclk;
> +	struct clk *tscaler;
> +
> +	pclk = clk_get_rate(timerclk);
> +	tscaler = clk_get_parent(source_div);
> +	clk_set_rate(tscaler, pclk / 3);
> +
> +	clk_set_rate(source_div, pclk / 6);
> +	clk_set_parent(source_in, source_div);
> +
> +	s3c64xx_pwm_init(PWM_SOURCE, TCNT_MAX);
> +	s3c64xx_pwm_start(PWM_SOURCE, PERIODIC);
> +}
> +
> +static struct clocksource pwm_clocksource = {
> +	.name		= "s3c64xx_clksrc",
> +	.rating		= 250,
> +	.read		= s3c64xx_clocksource_read,
> +	.mask		= CLOCKSOURCE_MASK(32),
> +	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
> +	.resume		= s3c64xx_clocksource_resume,
> +};
> +
> +static void __init s3c64xx_clocksource_init(void)
> +{
> +	unsigned long clock_rate;
> +
> +	clock_rate = clk_get_rate(source_in);
> +
> +	s3c64xx_pwm_init(PWM_SOURCE, TCNT_MAX);
> +	s3c64xx_pwm_start(PWM_SOURCE, PERIODIC);
> +
> +	if (clocksource_register_hz(&pwm_clocksource, clock_rate))
> +		panic("%s: can't register clocksource\n",
> pwm_clocksource.name);
> +}
> +
> +static void __init s3c64xx_timer_init_common(void)
> +{
> +	struct platform_device tmpdev;
> +	unsigned long pclk;
> +	struct clk *tscaler;
> +
> +	tmpdev.dev.bus = &platform_bus_type;
> +
> +	timerclk = clk_get(NULL, "timers");
> +	if (IS_ERR(timerclk))
> +		panic("failed to get timers clock for system timer");
> +
> +	tmpdev.id = PWM_EVENT;
> +	event_in = clk_get(&tmpdev.dev, "pwm-tin");
> +	if (IS_ERR(event_in))
> +		panic("failed to get pwm-event_in clock for system timer");
> +
> +	event_div = clk_get(&tmpdev.dev, "pwm-tdiv");
> +	if (IS_ERR(event_div))
> +		panic("failed to get pwm-event_div clock for system timer");
> +
> +	tmpdev.id = PWM_SOURCE;
> +	source_in = clk_get(&tmpdev.dev, "pwm-tin");
> +	if (IS_ERR(source_in))
> +		panic("failed to get pwm-source_in clock for system timer");
> +
> +	source_div = clk_get(&tmpdev.dev, "pwm-tdiv");
> +	if (IS_ERR(source_div))
> +		panic("failed to get pwm-source_div clock for system
timer");
> +
> +	pclk = clk_get_rate(timerclk);
> +	tscaler = clk_get_parent(event_div);
> +	clk_set_rate(tscaler, pclk / 3);
> +
> +	clk_set_rate(event_div, pclk / 6);
> +	clk_set_parent(event_in, event_div);
> +
> +	clk_set_rate(source_div, pclk / 6);
> +	clk_set_parent(source_in, source_div);
> +
> +	clk_enable(timerclk);
> +	clk_enable(event_in);
> +	clk_enable(source_in);
> +}
> +
> +static void __init s3c64xx_timer_init(void)
> +{
> +	s3c64xx_timer_init_common();
> +	s3c64xx_clock_event_init();
> +	s3c64xx_clocksource_init();
> +}
> +
> +struct sys_timer s3c64xx_timer = {
> +	.init		= s3c64xx_timer_init,
> +};
> diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-
> samsung/include/plat/cpu.h
> index c0a5741..e1fcad0 100644
> --- a/arch/arm/plat-samsung/include/plat/cpu.h
> +++ b/arch/arm/plat-samsung/include/plat/cpu.h
> @@ -74,6 +74,13 @@ extern struct syscore_ops s3c2416_pm_syscore_ops;
>  extern struct syscore_ops s3c244x_pm_syscore_ops;
>  extern struct syscore_ops s3c64xx_irq_syscore_ops;
> 
> +/* timer for 64xx */
> +#ifdef CONFIG_S3C64XX_GENERIC_CLOCKEVENTS
> +extern struct sys_timer s3c64xx_timer;
> +#else
> +#define s3c64xx_timer s3c24xx_timer
> +#endif
> +
>  /* system device classes */
> 
>  extern struct sysdev_class s3c2410_sysclass;
> --
> 1.7.6.1

Hi Tomasz Figa,

Sorry for late response, probably I'm missing this......and I couldn't
review this in detail :(

But as you know above mach-s3c64xx/time.c is similar with
plat-s5p/s5p-time.c so I'd prefer that you could consolidate them,
samsung_timer into plat-samsung directory. In addition, if you need to
implement SoC specific feature, you can use soc_is_xxxx() like
soc_is_s3c64xx() there.

If any problems, please let me know.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
  2011-09-07 19:01                     ` Mark Brown
@ 2011-10-10  9:58                       ` Kukjin Kim
  0 siblings, 0 replies; 22+ messages in thread
From: Kukjin Kim @ 2011-10-10  9:58 UTC (permalink / raw)
  To: linux-arm-kernel

Mark Brown wrote:
> 
> On Tue, Sep 06, 2011 at 01:04:30PM +0100, Russell King - ARM Linux wrote:
> 
> > Pros to platform driver name:
> > 1. Can re-use existing names if feature compatible without driver mods.
> > 2. Scales well with an increasing number of SoCs.
> 
> > Cons:
> > 1. People will hate having SoC names which don't refer to their exact
SoC.
> > 2. Probably requires storage of a set of flags in driver private data
> >    to identify SoC specific features.
> > 3. Requires additional string space to identify each driver name.
> 
> There's also an issue with actually getting the devices together to
> register which causes fragility here.
> 
> > However, thinking about this more wrt DT, there's another aspect to
this.
> > Rather than encoding into the driver "this SoC has features and quirks
> > X,Y,Z" maybe that information should be in the device tree itself.  For
> > example, SoC 1 has X and Z, SoC 2 has Y.  Then a new SoC 3 comes along
> > with X and Y but not Z.  If X, Y, Z are encoded into DT then there's no
> > need to touch the kernel to support SoC 3, not even to change driver
> > names or soc_is_xxx macros etc.
> 
> This does depend pretty strongly on making sure that the SoC DT is
> distributed separately to the board DT - that should be solved now.

Yes, I agree. So we can keep the current way to support each SoCs' device
with one driver until DT world.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time support using PWM timers.
  2011-10-10  9:57   ` Kukjin Kim
@ 2011-10-11 13:32     ` Tomasz Figa
  0 siblings, 0 replies; 22+ messages in thread
From: Tomasz Figa @ 2011-10-11 13:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 10 of October 2011 at 18:57:58, Kukjin Kim wrote:
> Tomasz Figa wrote:
> > 
> > From d1fa581f09d8f8a3cc24d05420e9e65112fd8c12 Mon Sep 17 00:00:00 2001
> > From: Tomasz Figa <tomasz.figa@gmail.com>
> > Date: Sun, 28 Aug 2011 02:45:06 +0200
> > Subject: [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time
> support
> >  using PWM timers.
> > 
> > This patch adds a sys_timer implementing generic clock source and clock
> event
> > device on S3C64xx using PWM timers 3 and 4. It can be enabled by a Kconfig
> > option, based on which either the new sys_timer is used as s3c64xx_timer
> or
> > s3c64xx_timer is defined to s3c24xx_timer which is the old tick timer.
> > 
> > Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> > ---
> >  arch/arm/Kconfig                         |    1 -
> >  arch/arm/mach-s3c64xx/Kconfig            |   12 ++
> >  arch/arm/mach-s3c64xx/Makefile           |    3 +
> >  arch/arm/mach-s3c64xx/time.c             |  320
> > ++++++++++++++++++++++++++++++
> >  arch/arm/plat-samsung/include/plat/cpu.h |    7 +
> >  5 files changed, 342 insertions(+), 1 deletions(-)
> >  create mode 100644 arch/arm/mach-s3c64xx/time.c
> > 
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 9adc278..05941f6 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -700,7 +700,6 @@ config ARCH_S3C64XX
> >  	select ARM_VIC
> >  	select HAVE_CLK
> >  	select NO_IOPORT
> > -	select ARCH_USES_GETTIMEOFFSET
> >  	select ARCH_HAS_CPUFREQ
> >  	select ARCH_REQUIRE_GPIOLIB
> >  	select SAMSUNG_CLKSRC
> > diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
> > index e4177e2..2db76fd 100644
> > --- a/arch/arm/mach-s3c64xx/Kconfig
> > +++ b/arch/arm/mach-s3c64xx/Kconfig
> > @@ -25,6 +25,18 @@ config CPU_S3C6410
> >  	help
> >  	  Enable S3C6410 CPU support
> > 
> > +config S3C64XX_GENERIC_CLOCKEVENTS
> > +	bool "Enable high resolution generic time support using PWM timers"
> > +	select GENERIC_CLOCKEVENTS
> > +	help
> > +	  This option enables high resolution generic time support
> > +	  on S3C6400/S3C6410 SoCs using PWM timers 3 and 4 instead
> > +	  of standard periodic tick using PWM timer 4.
> > +
> > +config S3C64XX_ARCH_USES_GETTIMEOFFSET
> > +	def_bool y if !S3C64XX_GENERIC_CLOCKEVENTS
> > +	select ARCH_USES_GETTIMEOFFSET
> > +
> >  config S3C64XX_DMA
> >  	bool "S3C64XX DMA"
> >  	select S3C_DMA
> > diff --git a/arch/arm/mach-s3c64xx/Makefile
> b/arch/arm/mach-s3c64xx/Makefile
> > index 4657363..a152002 100644
> > --- a/arch/arm/mach-s3c64xx/Makefile
> > +++ b/arch/arm/mach-s3c64xx/Makefile
> > @@ -15,6 +15,9 @@ obj-y				+= cpu.o
> >  obj-y				+= clock.o
> >  obj-y				+= gpiolib.o
> > 
> > +# Generic clockevents
> > +obj-$(CONFIG_S3C64XX_GENERIC_CLOCKEVENTS) += time.o
> > +
> >  # Core support for S3C6400 system
> > 
> >  obj-$(CONFIG_CPU_S3C6400)	+= s3c6400.o
> > diff --git a/arch/arm/mach-s3c64xx/time.c b/arch/arm/mach-s3c64xx/time.c
> > new file mode 100644
> > index 0000000..4fa57f0
> > --- /dev/null
> > +++ b/arch/arm/mach-s3c64xx/time.c
> > @@ -0,0 +1,320 @@
> > +/* linux/arch/arm/mach-s3c64xx/time.c
> > + *
> > + * Copyright (c) 2011 Tomasz Figa <tomasz.figa@gmail.com>
> > + *
> > + * based on linux/arch/arm/plat-samsung/s5p-time.c
> > + *
> > + * S3C64XX generic high resolution time support using PWM 3 and PWM 4
> timers.
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + *
> > + * Notes:
> > + * - Frequency divisors are currently hardcoded to make both timers
> operate
> > + *   at 1/6 the frequency of PCLK, so with the usual PCLK frequency of 66
> MHz,
> > + *   the timers are clocked at 11 MHz giving us the operating range from
> > + *   90 nsec to 386 sec.
> > + * - PWM registers, especially TCON, are shared with PWM driver, but
> since
> > + *   all the clock event callbacks are run in atomic context
> synchronization
> > + *   is not needed.
> > + */
> > +
> > +#include <linux/sched.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/irq.h>
> > +#include <linux/err.h>
> > +#include <linux/clk.h>
> > +#include <linux/clockchips.h>
> > +#include <linux/platform_device.h>
> > +
> > +#include <mach/map.h>
> > +#include <plat/regs-timer.h>
> > +#include <asm/mach/time.h>
> > +
> > +#define PWM_EVENT	(3)
> > +#define PWM_SOURCE	(4)
> > +
> > +#define ONESHOT		(0)
> > +#define PERIODIC	(1)
> > +
> > +#define TCNT_MAX	(0xffffffff)
> > +
> > +static struct clk *timerclk;
> > +
> > +/*
> > + * PWM timers setup code
> > + */
> > +
> > +static inline void s3c64xx_pwm_stop(unsigned int pwm_id)
> > +{
> > +	unsigned long tcon = __raw_readl(S3C2410_TCON);
> > +
> > +	switch (pwm_id) {
> > +	case 3:
> > +		tcon &= ~S3C2410_TCON_T3START;
> > +		break;
> > +	case 4:
> > +		tcon &= ~S3C2410_TCON_T4START;
> > +		break;
> > +	}
> > +
> > +	__raw_writel(tcon, S3C2410_TCON);
> > +}
> > +
> > +static inline void s3c64xx_pwm_init(unsigned int pwm_id, unsigned long
> tcnt)
> > +{
> > +	unsigned long tcon = __raw_readl(S3C2410_TCON);
> > +
> > +	/* timers reload after counting zero, so reduce the count by 1 */
> > +	--tcnt;
> > +
> > +	/* stop the timer and ask it to load the new value */
> > +	switch (pwm_id) {
> > +	case 3:
> > +		tcon &= ~(0xf<<16);
> > +		tcon |= S3C2410_TCON_T3MANUALUPD;
> > +		break;
> > +	case 4:
> > +		tcon &= ~(7<<20);
> > +		tcon |= S3C2410_TCON_T4MANUALUPD;
> > +		break;
> > +	}
> > +
> > +	__raw_writel(tcnt, S3C2410_TCNTB(pwm_id));
> > +	__raw_writel(tcnt, S3C2410_TCMPB(pwm_id));
> > +	__raw_writel(tcon, S3C2410_TCON);
> > +}
> > +
> > +static inline void s3c64xx_pwm_start(unsigned int pwm_id, bool periodic)
> > +{
> > +	unsigned long tcon = __raw_readl(S3C2410_TCON);
> > +
> > +	switch (pwm_id) {
> > +	case 3:
> > +		tcon |= S3C2410_TCON_T3START;
> > +		tcon &= ~S3C2410_TCON_T3MANUALUPD;
> > +
> > +		if (periodic)
> > +			tcon |= S3C2410_TCON_T3RELOAD;
> > +		else
> > +			tcon &= ~S3C2410_TCON_T3RELOAD;
> > +		break;
> > +	case 4:
> > +		tcon |= S3C2410_TCON_T4START;
> > +		tcon &= ~S3C2410_TCON_T4MANUALUPD;
> > +
> > +		if (periodic)
> > +			tcon |= S3C2410_TCON_T4RELOAD;
> > +		else
> > +			tcon &= ~S3C2410_TCON_T4RELOAD;
> > +		break;
> > +	}
> > +
> > +	__raw_writel(tcon, S3C2410_TCON);
> > +}
> > +
> > +/*
> > + * Clock event
> > + */
> > +
> > +static struct clk *event_in;
> > +static struct clk *event_div;
> > +
> > +static unsigned long clock_count_per_tick;
> > +
> > +static int s3c64xx_clock_event_set_next_event(unsigned long cycles,
> > +						struct clock_event_device
> > *evt)
> > +{
> > +	s3c64xx_pwm_init(PWM_EVENT, cycles);
> > +	s3c64xx_pwm_start(PWM_EVENT, ONESHOT);
> > +	return 0;
> > +}
> > +
> > +static void s3c64xx_clock_event_resume(void)
> > +{
> > +	unsigned long pclk;
> > +	struct clk *tscaler;
> > +
> > +	pclk = clk_get_rate(timerclk);
> > +	tscaler = clk_get_parent(event_div);
> > +	clk_set_rate(tscaler, pclk / 3);
> > +
> > +	clk_set_rate(event_div, pclk / 6);
> > +	clk_set_parent(event_in, event_div);
> > +
> > +	s3c64xx_pwm_init(PWM_EVENT, clock_count_per_tick);
> > +	s3c64xx_pwm_start(PWM_EVENT, PERIODIC);
> > +}
> > +
> > +static void s3c64xx_clock_event_set_mode(enum clock_event_mode mode,
> > +						struct clock_event_device
> > *evt)
> > +{
> > +	s3c64xx_pwm_stop(PWM_EVENT);
> > +
> > +	switch (mode) {
> > +	case CLOCK_EVT_MODE_PERIODIC:
> > +		s3c64xx_pwm_init(PWM_EVENT, clock_count_per_tick);
> > +		s3c64xx_pwm_start(PWM_EVENT, PERIODIC);
> > +		break;
> > +	case CLOCK_EVT_MODE_ONESHOT:
> > +		break;
> > +	case CLOCK_EVT_MODE_UNUSED:
> > +	case CLOCK_EVT_MODE_SHUTDOWN:
> > +		break;
> > +	case CLOCK_EVT_MODE_RESUME:
> > +		s3c64xx_clock_event_resume();
> > +		break;
> > +	}
> > +}
> > +
> > +static struct clock_event_device s3c64xx_clock_event_device = {
> > +	.name		= "s3c64xx_clkevt",
> > +	.features       = CLOCK_EVT_FEAT_PERIODIC |
> > CLOCK_EVT_FEAT_ONESHOT,
> > +	.rating		= 200,
> > +	.shift		= 32,
> > +	.set_next_event	= s3c64xx_clock_event_set_next_event,
> > +	.set_mode	= s3c64xx_clock_event_set_mode,
> > +};
> > +
> > +static irqreturn_t s3c64xx_clock_event_isr(int irq, void *dev_id)
> > +{
> > +	struct clock_event_device *evt = &s3c64xx_clock_event_device;
> > +
> > +	evt->event_handler(evt);
> > +
> > +	return IRQ_HANDLED;
> > +}
> > +
> > +static struct irqaction s3c64xx_clock_event_irq = {
> > +	.name		= "s3c64xx_clkevt_irq",
> > +	.flags		= IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
> > +	.handler	= s3c64xx_clock_event_isr,
> > +};
> > +
> > +static void __init s3c64xx_clock_event_init(void)
> > +{
> > +	unsigned long clock_rate;
> > +
> > +	clock_rate = clk_get_rate(event_in);
> > +
> > +	clock_count_per_tick = clock_rate / HZ;
> > +
> > +	s3c64xx_clock_event_device.mult = div_sc(clock_rate,
> > +			NSEC_PER_SEC, s3c64xx_clock_event_device.shift);
> > +	s3c64xx_clock_event_device.max_delta_ns =
> > +			clockevent_delta2ns(-1,
> &s3c64xx_clock_event_device);
> > +	s3c64xx_clock_event_device.min_delta_ns =
> > +			clockevent_delta2ns(1, &s3c64xx_clock_event_device);
> > +
> > +	s3c64xx_clock_event_device.cpumask = cpumask_of(0);
> > +	clockevents_register_device(&s3c64xx_clock_event_device);
> > +
> > +	setup_irq(IRQ_TIMER3, &s3c64xx_clock_event_irq);
> > +}
> > +
> > +/*
> > + * Clock source
> > + */
> > +
> > +static struct clk *source_in;
> > +static struct clk *source_div;
> > +
> > +static cycle_t s3c64xx_clocksource_read(struct clocksource *cs)
> > +{
> > +	return (cycle_t) ~__raw_readl(S3C2410_TCNTO(PWM_SOURCE));
> > +}
> > +
> > +static void s3c64xx_clocksource_resume(struct clocksource *cs)
> > +{
> > +	unsigned long pclk;
> > +	struct clk *tscaler;
> > +
> > +	pclk = clk_get_rate(timerclk);
> > +	tscaler = clk_get_parent(source_div);
> > +	clk_set_rate(tscaler, pclk / 3);
> > +
> > +	clk_set_rate(source_div, pclk / 6);
> > +	clk_set_parent(source_in, source_div);
> > +
> > +	s3c64xx_pwm_init(PWM_SOURCE, TCNT_MAX);
> > +	s3c64xx_pwm_start(PWM_SOURCE, PERIODIC);
> > +}
> > +
> > +static struct clocksource pwm_clocksource = {
> > +	.name		= "s3c64xx_clksrc",
> > +	.rating		= 250,
> > +	.read		= s3c64xx_clocksource_read,
> > +	.mask		= CLOCKSOURCE_MASK(32),
> > +	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
> > +	.resume		= s3c64xx_clocksource_resume,
> > +};
> > +
> > +static void __init s3c64xx_clocksource_init(void)
> > +{
> > +	unsigned long clock_rate;
> > +
> > +	clock_rate = clk_get_rate(source_in);
> > +
> > +	s3c64xx_pwm_init(PWM_SOURCE, TCNT_MAX);
> > +	s3c64xx_pwm_start(PWM_SOURCE, PERIODIC);
> > +
> > +	if (clocksource_register_hz(&pwm_clocksource, clock_rate))
> > +		panic("%s: can't register clocksource\n",
> > pwm_clocksource.name);
> > +}
> > +
> > +static void __init s3c64xx_timer_init_common(void)
> > +{
> > +	struct platform_device tmpdev;
> > +	unsigned long pclk;
> > +	struct clk *tscaler;
> > +
> > +	tmpdev.dev.bus = &platform_bus_type;
> > +
> > +	timerclk = clk_get(NULL, "timers");
> > +	if (IS_ERR(timerclk))
> > +		panic("failed to get timers clock for system timer");
> > +
> > +	tmpdev.id = PWM_EVENT;
> > +	event_in = clk_get(&tmpdev.dev, "pwm-tin");
> > +	if (IS_ERR(event_in))
> > +		panic("failed to get pwm-event_in clock for system timer");
> > +
> > +	event_div = clk_get(&tmpdev.dev, "pwm-tdiv");
> > +	if (IS_ERR(event_div))
> > +		panic("failed to get pwm-event_div clock for system timer");
> > +
> > +	tmpdev.id = PWM_SOURCE;
> > +	source_in = clk_get(&tmpdev.dev, "pwm-tin");
> > +	if (IS_ERR(source_in))
> > +		panic("failed to get pwm-source_in clock for system timer");
> > +
> > +	source_div = clk_get(&tmpdev.dev, "pwm-tdiv");
> > +	if (IS_ERR(source_div))
> > +		panic("failed to get pwm-source_div clock for system
> timer");
> > +
> > +	pclk = clk_get_rate(timerclk);
> > +	tscaler = clk_get_parent(event_div);
> > +	clk_set_rate(tscaler, pclk / 3);
> > +
> > +	clk_set_rate(event_div, pclk / 6);
> > +	clk_set_parent(event_in, event_div);
> > +
> > +	clk_set_rate(source_div, pclk / 6);
> > +	clk_set_parent(source_in, source_div);
> > +
> > +	clk_enable(timerclk);
> > +	clk_enable(event_in);
> > +	clk_enable(source_in);
> > +}
> > +
> > +static void __init s3c64xx_timer_init(void)
> > +{
> > +	s3c64xx_timer_init_common();
> > +	s3c64xx_clock_event_init();
> > +	s3c64xx_clocksource_init();
> > +}
> > +
> > +struct sys_timer s3c64xx_timer = {
> > +	.init		= s3c64xx_timer_init,
> > +};
> > diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-
> > samsung/include/plat/cpu.h
> > index c0a5741..e1fcad0 100644
> > --- a/arch/arm/plat-samsung/include/plat/cpu.h
> > +++ b/arch/arm/plat-samsung/include/plat/cpu.h
> > @@ -74,6 +74,13 @@ extern struct syscore_ops s3c2416_pm_syscore_ops;
> >  extern struct syscore_ops s3c244x_pm_syscore_ops;
> >  extern struct syscore_ops s3c64xx_irq_syscore_ops;
> > 
> > +/* timer for 64xx */
> > +#ifdef CONFIG_S3C64XX_GENERIC_CLOCKEVENTS
> > +extern struct sys_timer s3c64xx_timer;
> > +#else
> > +#define s3c64xx_timer s3c24xx_timer
> > +#endif
> > +
> >  /* system device classes */
> > 
> >  extern struct sysdev_class s3c2410_sysclass;
> > --
> > 1.7.6.1
> 
> Hi Tomasz Figa,
> 
> Sorry for late response, probably I'm missing this......and I couldn't
> review this in detail :(

Hi,

Same on my side, sorry for my absence on the list. I've been very busy, with
no time for mainline submissions.

> But as you know above mach-s3c64xx/time.c is similar with
> plat-s5p/s5p-time.c so I'd prefer that you could consolidate them,
> samsung_timer into plat-samsung directory. In addition, if you need to
> implement SoC specific feature, you can use soc_is_xxxx() like
> soc_is_s3c64xx() there.

OK, I will do that.

> If any problems, please let me know.

OK, thanks.

Best regards,
Tom

> Thanks.
> 
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time support using PWM timers.
  2011-08-31 12:34 ` [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time support using PWM timers Tomasz Figa
  2011-10-10  9:57   ` Kukjin Kim
@ 2011-10-13 14:22   ` Russell King - ARM Linux
  1 sibling, 0 replies; 22+ messages in thread
From: Russell King - ARM Linux @ 2011-10-13 14:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 31, 2011 at 02:34:52PM +0200, Tomasz Figa wrote:
> +/*
> + * Clock source
> + */
> +
> +static struct clk *source_in;
> +static struct clk *source_div;
> +
> +static cycle_t s3c64xx_clocksource_read(struct clocksource *cs)
> +{
> +	return (cycle_t) ~__raw_readl(S3C2410_TCNTO(PWM_SOURCE));
> +}

This looks like a very simple MMIO clocksource...  This looks the
same as clocksource_mmio_readl_down().

> +
> +static void s3c64xx_clocksource_resume(struct clocksource *cs)
> +{
> +	unsigned long pclk;
> +	struct clk *tscaler;
> +
> +	pclk = clk_get_rate(timerclk);
> +	tscaler = clk_get_parent(source_div);
> +	clk_set_rate(tscaler, pclk / 3);
> +
> +	clk_set_rate(source_div, pclk / 6);
> +	clk_set_parent(source_in, source_div);
> +
> +	s3c64xx_pwm_init(PWM_SOURCE, TCNT_MAX);
> +	s3c64xx_pwm_start(PWM_SOURCE, PERIODIC);
> +}
> +
> +static struct clocksource pwm_clocksource = {
> +	.name		= "s3c64xx_clksrc",
> +	.rating		= 250,
> +	.read		= s3c64xx_clocksource_read,
> +	.mask		= CLOCKSOURCE_MASK(32),
> +	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
> +	.resume		= s3c64xx_clocksource_resume,
> +};
> +
> +static void __init s3c64xx_clocksource_init(void)
> +{
> +	unsigned long clock_rate;
> +
> +	clock_rate = clk_get_rate(source_in);
> +
> +	s3c64xx_pwm_init(PWM_SOURCE, TCNT_MAX);
> +	s3c64xx_pwm_start(PWM_SOURCE, PERIODIC);
> +
> +	if (clocksource_register_hz(&pwm_clocksource, clock_rate))
> +		panic("%s: can't register clocksource\n", pwm_clocksource.name);

Apart from the resume entry, this looks like it could use
drivers/clocksource/mmio.c - and so avoid yet another clocksource
creation.

Maybe adding some kind of resume support to mmio.c would be a good
idea?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name.
@ 2011-08-27 23:32 Tomasz Figa
  0 siblings, 0 replies; 22+ messages in thread
From: Tomasz Figa @ 2011-08-27 23:32 UTC (permalink / raw)
  To: linux-arm-kernel

This patch is a prerequisite to adding generic time support for S3C64xx.
It makes possible to differentiate SoCs, required to exclude timers 3 and 4
from PWM driver only on S3C64xx.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 arch/arm/mach-s3c64xx/s3c6400.c               |    2 ++
 arch/arm/mach-s3c64xx/s3c6410.c               |    2 ++
 arch/arm/plat-samsung/dev-pwm.c               |    8 ++++++++
 arch/arm/plat-samsung/include/plat/pwm-core.h |   21 +++++++++++++++++++++
 arch/arm/plat-samsung/pwm.c                   |   19 ++++++++++++++++++-
 5 files changed, 51 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/plat-samsung/include/plat/pwm-core.h

diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
index 5e93fe3..6418832 100644
--- a/arch/arm/mach-s3c64xx/s3c6400.c
+++ b/arch/arm/mach-s3c64xx/s3c6400.c
@@ -38,6 +38,7 @@
 #include <plat/sdhci.h>
 #include <plat/iic-core.h>
 #include <plat/onenand-core.h>
+#include <plat/pwm-core.h>
 #include <mach/s3c6400.h>
 
 void __init s3c6400_map_io(void)
@@ -55,6 +56,7 @@ void __init s3c6400_map_io(void)
 
 	s3c_onenand_setname("s3c6400-onenand");
 	s3c64xx_onenand1_setname("s3c6400-onenand");
+	s3c_pwm_setname("s3c64xx-pwm");
 }
 
 void __init s3c6400_init_clocks(int xtal)
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c
index 312aa6b..4f66c25 100644
--- a/arch/arm/mach-s3c64xx/s3c6410.c
+++ b/arch/arm/mach-s3c64xx/s3c6410.c
@@ -41,6 +41,7 @@
 #include <plat/adc-core.h>
 #include <plat/iic-core.h>
 #include <plat/onenand-core.h>
+#include <plat/pwm-core.h>
 #include <mach/s3c6400.h>
 #include <mach/s3c6410.h>
 
@@ -60,6 +61,7 @@ void __init s3c6410_map_io(void)
 	s3c_onenand_setname("s3c6410-onenand");
 	s3c64xx_onenand1_setname("s3c6410-onenand");
 	s3c_cfcon_setname("s3c64xx-pata");
+	s3c_pwm_setname("s3c64xx-pwm");
 }
 
 void __init s3c6410_init_clocks(int xtal)
diff --git a/arch/arm/plat-samsung/dev-pwm.c b/arch/arm/plat-samsung/dev-pwm.c
index dab47b0..751286a 100644
--- a/arch/arm/plat-samsung/dev-pwm.c
+++ b/arch/arm/plat-samsung/dev-pwm.c
@@ -20,6 +20,7 @@
 #include <mach/irqs.h>
 
 #include <plat/devs.h>
+#include <plat/pwm-core.h>
 
 #define TIMER_RESOURCE_SIZE (1)
 
@@ -51,3 +52,10 @@ struct platform_device s3c_device_timer[] = {
 	[4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
 };
 EXPORT_SYMBOL(s3c_device_timer);
+
+void s3c_pwm_setname(const char *name)
+{
+	int i;
+	for (i = 0; i < ARRAY_SIZE(s3c_device_timer); ++i)
+		s3c_device_timer[i].name = name;
+}
diff --git a/arch/arm/plat-samsung/include/plat/pwm-core.h b/arch/arm/plat-samsung/include/plat/pwm-core.h
new file mode 100644
index 0000000..651d7a4
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/pwm-core.h
@@ -0,0 +1,21 @@
+/* arch/arm/plat-samsung/include/plat/pwm-core.h
+ *
+ * Copyright 2011 Tomasz Figa <tomasz.figa@gmail.com>
+ *
+ * S3C - PWM Controller core functions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_PWM_CORE_H
+#define __ASM_ARCH_PWM_CORE_H __FILE__
+
+/* These functions are only for use with the core support code, such as
+ * the cpu specific initialisation code
+ */
+
+extern void s3c_pwm_setname(const char *name);
+
+#endif /* __ASM_ARCH_PWM_H */
diff --git a/arch/arm/plat-samsung/pwm.c b/arch/arm/plat-samsung/pwm.c
index f37457c..27b5353 100644
--- a/arch/arm/plat-samsung/pwm.c
+++ b/arch/arm/plat-samsung/pwm.c
@@ -24,6 +24,11 @@
 
 #include <plat/regs-timer.h>
 
+enum soc_type {
+	TYPE_GENERIC,
+	TYPE_S3C64XX,
+};
+
 struct pwm_device {
 	struct list_head	 list;
 	struct platform_device	*pdev;
@@ -380,11 +385,23 @@ static int s3c_pwm_resume(struct platform_device *pdev)
 #define s3c_pwm_resume NULL
 #endif
 
+static struct platform_device_id s3c_pwm_driver_ids[] = {
+	{
+		.name		= "s3c24xx-pwm",
+		.driver_data	= TYPE_GENERIC,
+	}, {
+		.name		= "s3c64xx-pwm",
+		.driver_data	= TYPE_S3C64XX,
+	},
+};
+MODULE_DEVICE_TABLE(platform, s3c_pwm_driver_ids);
+
 static struct platform_driver s3c_pwm_driver = {
 	.driver		= {
-		.name	= "s3c24xx-pwm",
+		.name	= "samsung-pwm",
 		.owner	= THIS_MODULE,
 	},
+	.id_table	= s3c_pwm_driver_ids,
 	.probe		= s3c_pwm_probe,
 	.remove		= __devexit_p(s3c_pwm_remove),
 	.suspend	= s3c_pwm_suspend,
-- 
1.7.6.1

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2011-10-13 14:22 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-31 12:33 [PATCH 0/5] Add high resolution generic time support for S3C64xx Tomasz Figa
2011-08-31 12:34 ` [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name Tomasz Figa
2011-08-31 12:44   ` Mark Brown
2011-08-31 13:30     ` Tomasz Figa
2011-09-01  2:26       ` Kukjin Kim
2011-09-01  3:33         ` Kyungmin Park
2011-09-01 11:18           ` Tomasz Figa
2011-09-01 12:32             ` Mark Brown
2011-09-06 10:41             ` Tomasz Figa
2011-09-06 11:03               ` Russell King - ARM Linux
2011-09-06 11:35                 ` Tomasz Figa
2011-09-06 12:04                   ` Russell King - ARM Linux
2011-09-07 19:01                     ` Mark Brown
2011-10-10  9:58                       ` Kukjin Kim
2011-08-31 12:34 ` [PATCH 2/5] ARM: s3c64xx: Add generic high resolution time support using PWM timers Tomasz Figa
2011-10-10  9:57   ` Kukjin Kim
2011-10-11 13:32     ` Tomasz Figa
2011-10-13 14:22   ` Russell King - ARM Linux
2011-08-31 12:35 ` [PATCH 3/5] ARM: Samsung: pwm: Exclude timer 3 on S3C64xx if generic time is enabled Tomasz Figa
2011-08-31 12:35 ` [PATCH 4/5] ARM: s3c64xx: Move all machines to s3c64xx_timer Tomasz Figa
2011-08-31 12:36 ` [PATCH 5/5] ARM: s3c64xx: Add optional local sched_clock implementation Tomasz Figa
  -- strict thread matches above, loose matches on Subject: below --
2011-08-27 23:32 [PATCH 1/5] ARM: Samsung: PWM: Allow to differentiate SoCs based on platform device name Tomasz Figa

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.