All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
  2011-06-30 12:25 ` Padmavathi Venna
@ 2011-06-30  7:31   ` Jassi Brar
  -1 siblings, 0 replies; 32+ messages in thread
From: Jassi Brar @ 2011-06-30  7:31 UTC (permalink / raw)
  To: Padmavathi Venna; +Cc: kgene.kim, sbkim73, linux-samsung-soc, linux-arm-kernel

On Thu, Jun 30, 2011 at 5:55 PM, Padmavathi Venna <padma.v@samsung.com> wrote:
> This patchset does the following:
>
> 1. Move duplicated code to common place
> [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
> SPI platform devices are defined in respective machine folder of
> Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
> So all SPI platform devices are moved to a common place.

The machine specific code is put in machine specific location for some reason.
And the code is not duplicated, it's mostly data structures
initialized with machine
specific values.

Have you considered if it would still be possible to build kernel
image supporting
more than 1 soc after your changes ?

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

* [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
@ 2011-06-30  7:31   ` Jassi Brar
  0 siblings, 0 replies; 32+ messages in thread
From: Jassi Brar @ 2011-06-30  7:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 30, 2011 at 5:55 PM, Padmavathi Venna <padma.v@samsung.com> wrote:
> This patchset does the following:
>
> 1. Move duplicated code to common place
> [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
> SPI platform devices are defined in respective machine folder of
> Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
> So all SPI platform devices are moved to a common place.

The machine specific code is put in machine specific location for some reason.
And the code is not duplicated, it's mostly data structures
initialized with machine
specific values.

Have you considered if it would still be possible to build kernel
image supporting
more than 1 soc after your changes ?

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

* RE: [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
  2011-06-30 12:25 ` Padmavathi Venna
@ 2011-06-30  9:25   ` Marek Szyprowski
  -1 siblings, 0 replies; 32+ messages in thread
From: Marek Szyprowski @ 2011-06-30  9:25 UTC (permalink / raw)
  To: 'Padmavathi Venna',
	kgene.kim, jassisinghbrar, sbkim73, linux-samsung-soc,
	linux-arm-kernel

Hello,

On Thursday, June 30, 2011 2:25 PM Padmavathi Venna wrote:

> This patchset does the following:
> 
> 1. Move duplicated code to common place
> [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
> SPI platform devices are defined in respective machine folder of
> Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
> So all SPI platform devices are moved to a common place.
> 
> [PATCH 2/7] ARM: SAMSUNG: Define common macro for SPI physical address
> 
> [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
> Each SoC has it's own set of clock sources for SPI.So they are defined in
> respective machine folder.
> 
> [PATCH 4/7] ARM: SAMSUNG: Create SPI device setup files in
> respective machine folder
> 
> [PATCH 5/7] ARM: SAMSUNG: Add SPI platform specific code
> As SPI platform devices are moved to common place some platform specific
> code need to be initialized in the respective machine file.
> 
> [PATCH 6/7] SPI: S5PC100: Enable the SPI driver for S5PC100
> 
> [PATCH 7/7] SPI: S5PV210: Enable the SPI driver for S5PV210

These patch set improves a bit platform part of SPI driver, but I really
wonder if we really need to pass so many SoC version specific data 
with platform data. Are all these data (clock list, fifo parameters)
specific to SoC version or particular board configuration/implementation?

Maybe it will be much easier to convert the SPI driver to use driver id 
feature and use different platform id's for each SoC version? (please 
refer to drivers/video/s3c-fb.c and plat-samsung/include/plat/fb-core.h
for more information). This will remove the need for SoC specific
parameters in platform data and will group all version dependent 
information in the driver.

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center

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

* [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
@ 2011-06-30  9:25   ` Marek Szyprowski
  0 siblings, 0 replies; 32+ messages in thread
From: Marek Szyprowski @ 2011-06-30  9:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Thursday, June 30, 2011 2:25 PM Padmavathi Venna wrote:

> This patchset does the following:
> 
> 1. Move duplicated code to common place
> [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
> SPI platform devices are defined in respective machine folder of
> Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
> So all SPI platform devices are moved to a common place.
> 
> [PATCH 2/7] ARM: SAMSUNG: Define common macro for SPI physical address
> 
> [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
> Each SoC has it's own set of clock sources for SPI.So they are defined in
> respective machine folder.
> 
> [PATCH 4/7] ARM: SAMSUNG: Create SPI device setup files in
> respective machine folder
> 
> [PATCH 5/7] ARM: SAMSUNG: Add SPI platform specific code
> As SPI platform devices are moved to common place some platform specific
> code need to be initialized in the respective machine file.
> 
> [PATCH 6/7] SPI: S5PC100: Enable the SPI driver for S5PC100
> 
> [PATCH 7/7] SPI: S5PV210: Enable the SPI driver for S5PV210

These patch set improves a bit platform part of SPI driver, but I really
wonder if we really need to pass so many SoC version specific data 
with platform data. Are all these data (clock list, fifo parameters)
specific to SoC version or particular board configuration/implementation?

Maybe it will be much easier to convert the SPI driver to use driver id 
feature and use different platform id's for each SoC version? (please 
refer to drivers/video/s3c-fb.c and plat-samsung/include/plat/fb-core.h
for more information). This will remove the need for SoC specific
parameters in platform data and will group all version dependent 
information in the driver.

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center

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

* Re: [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
  2011-06-30  7:31   ` Jassi Brar
@ 2011-06-30  9:27     ` padma venkat
  -1 siblings, 0 replies; 32+ messages in thread
From: padma venkat @ 2011-06-30  9:27 UTC (permalink / raw)
  To: Jassi Brar
  Cc: Padmavathi Venna, kgene.kim, sbkim73, linux-samsung-soc,
	linux-arm-kernel

Hi,

On Thu, Jun 30, 2011 at 1:01 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> On Thu, Jun 30, 2011 at 5:55 PM, Padmavathi Venna <padma.v@samsung.com> wrote:
>> This patchset does the following:
>>
>> 1. Move duplicated code to common place
>> [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
>> SPI platform devices are defined in respective machine folder of
>> Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
>> So all SPI platform devices are moved to a common place.
>
> The machine specific code is put in machine specific location for some reason.
> And the code is not duplicated, it's mostly data structures
> initialized with machine
> specific values.
>
> Have you considered if it would still be possible to build kernel
> image supporting
> more than 1 soc after your changes ?
I didn't consider the single image scenario. Because as far as I know,
the existing Samsung code doesn't have support for building a single kernel
image for multiple SoCs.

The intention behind my changes were
1) To reuse the dev-spi files for all the SoCs, as this reduces the code size.
Also future SoCs with SPI can use the same file.
2) To be in line with other IPs like i2c,sdhci etc

> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Thanks&Regards
Padma

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

* [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
@ 2011-06-30  9:27     ` padma venkat
  0 siblings, 0 replies; 32+ messages in thread
From: padma venkat @ 2011-06-30  9:27 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Thu, Jun 30, 2011 at 1:01 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> On Thu, Jun 30, 2011 at 5:55 PM, Padmavathi Venna <padma.v@samsung.com> wrote:
>> This patchset does the following:
>>
>> 1. Move duplicated code to common place
>> [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
>> SPI platform devices are defined in respective machine folder of
>> Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
>> So all SPI platform devices are moved to a common place.
>
> The machine specific code is put in machine specific location for some reason.
> And the code is not duplicated, it's mostly data structures
> initialized with machine
> specific values.
>
> Have you considered if it would still be possible to build kernel
> image supporting
> more than 1 soc after your changes ?
I didn't consider the single image scenario. Because as far as I know,
the existing Samsung code doesn't have support for building a single kernel
image for multiple SoCs.

The intention behind my changes were
1) To reuse the dev-spi files for all the SoCs, as this reduces the code size.
Also future SoCs with SPI can use the same file.
2) To be in line with other IPs like i2c,sdhci etc

> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>
Thanks&Regards
Padma

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

* Re: [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
  2011-06-30 12:25   ` Padmavathi Venna
@ 2011-06-30  9:30     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 32+ messages in thread
From: Russell King - ARM Linux @ 2011-06-30  9:30 UTC (permalink / raw)
  To: Padmavathi Venna
  Cc: kgene.kim, jassisinghbrar, sbkim73, linux-samsung-soc, linux-arm-kernel

On Thu, Jun 30, 2011 at 08:25:19AM -0400, Padmavathi Venna wrote:
> SPI Clocks were defined in dev-spi.c of machine specific folder.
> To make SPI devices common across all SoCs,dev-spi.c is moved
> from machine specific folder to plat-samsung. So SPI clock
> definitions has been moved from dev-spi.c to SoC specific machine
> folder for S3C64XX,S5P64X0,S5PC100 and S5PV210

This just shows how sick the Samsung code is by abusing the clk API.
If it stopped that abuse and switched over to clkdev none of this would
be necessary.

So I'm going to NAK this until the Samsung clk code moves over to clkdev.
Sorry, I've made enough requests of Samsung people to do this, and its
time for more effective persuasion by standing in the way of other patches
to make it happen.

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

* [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
@ 2011-06-30  9:30     ` Russell King - ARM Linux
  0 siblings, 0 replies; 32+ messages in thread
From: Russell King - ARM Linux @ 2011-06-30  9:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 30, 2011 at 08:25:19AM -0400, Padmavathi Venna wrote:
> SPI Clocks were defined in dev-spi.c of machine specific folder.
> To make SPI devices common across all SoCs,dev-spi.c is moved
> from machine specific folder to plat-samsung. So SPI clock
> definitions has been moved from dev-spi.c to SoC specific machine
> folder for S3C64XX,S5P64X0,S5PC100 and S5PV210

This just shows how sick the Samsung code is by abusing the clk API.
If it stopped that abuse and switched over to clkdev none of this would
be necessary.

So I'm going to NAK this until the Samsung clk code moves over to clkdev.
Sorry, I've made enough requests of Samsung people to do this, and its
time for more effective persuasion by standing in the way of other patches
to make it happen.

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

* Re: [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
  2011-06-30  9:30     ` Russell King - ARM Linux
@ 2011-06-30  9:43       ` Jassi Brar
  -1 siblings, 0 replies; 32+ messages in thread
From: Jassi Brar @ 2011-06-30  9:43 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Padmavathi Venna, kgene.kim, sbkim73, linux-samsung-soc,
	linux-arm-kernel

On Thu, Jun 30, 2011 at 3:00 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Thu, Jun 30, 2011 at 08:25:19AM -0400, Padmavathi Venna wrote:
>> SPI Clocks were defined in dev-spi.c of machine specific folder.
>> To make SPI devices common across all SoCs,dev-spi.c is moved
>> from machine specific folder to plat-samsung. So SPI clock
>> definitions has been moved from dev-spi.c to SoC specific machine
>> folder for S3C64XX,S5P64X0,S5PC100 and S5PV210
>
> This just shows how sick the Samsung code is by abusing the clk API.
> If it stopped that abuse and switched over to clkdev none of this would
> be necessary.
I am anyways not for the patch set.
Though this 'sickness' predates clkdev, and I agree it should be changed now.

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

* [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
@ 2011-06-30  9:43       ` Jassi Brar
  0 siblings, 0 replies; 32+ messages in thread
From: Jassi Brar @ 2011-06-30  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 30, 2011 at 3:00 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Thu, Jun 30, 2011 at 08:25:19AM -0400, Padmavathi Venna wrote:
>> SPI Clocks were defined in dev-spi.c of machine specific folder.
>> To make SPI devices common across all SoCs,dev-spi.c is moved
>> from machine specific folder to plat-samsung. So SPI clock
>> definitions has been moved from dev-spi.c to SoC specific machine
>> folder for S3C64XX,S5P64X0,S5PC100 and S5PV210
>
> This just shows how sick the Samsung code is by abusing the clk API.
> If it stopped that abuse and switched over to clkdev none of this would
> be necessary.
I am anyways not for the patch set.
Though this 'sickness' predates clkdev, and I agree it should be changed now.

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

* Re: [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
  2011-06-30  9:27     ` padma venkat
@ 2011-06-30 10:14       ` Jassi Brar
  -1 siblings, 0 replies; 32+ messages in thread
From: Jassi Brar @ 2011-06-30 10:14 UTC (permalink / raw)
  To: padma venkat
  Cc: Padmavathi Venna, kgene.kim, sbkim73, linux-samsung-soc,
	linux-arm-kernel

On Thu, Jun 30, 2011 at 2:57 PM, padma venkat <padma.kvr@gmail.com> wrote:
> Hi,
>
> On Thu, Jun 30, 2011 at 1:01 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
>> On Thu, Jun 30, 2011 at 5:55 PM, Padmavathi Venna <padma.v@samsung.com> wrote:
>>> This patchset does the following:
>>>
>>> 1. Move duplicated code to common place
>>> [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
>>> SPI platform devices are defined in respective machine folder of
>>> Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
>>> So all SPI platform devices are moved to a common place.
>>
>> The machine specific code is put in machine specific location for some reason.
>> And the code is not duplicated, it's mostly data structures
>> initialized with machine
>> specific values.
>>
>> Have you considered if it would still be possible to build kernel
>> image supporting
>> more than 1 soc after your changes ?
> I didn't consider the single image scenario. Because as far as I know,
> the existing Samsung code doesn't have support for building a single kernel
> image for multiple SoCs.

Samsung did use to support during 24xx days. Unfortunately not much with
new generation SoCs.
This patch-set only takes us further away from having multiple SoCs
supported in a single kernel image some day.

>
> The intention behind my changes were
> 1) To reuse the dev-spi files for all the SoCs, as this reduces the code size.
I already decided in favor of being able to support multiple SoCs in
single image.

> Also future SoCs with SPI can use the same file.
Only if they have _exactly_ same SPI block. Then most probably they'll have most
other blocks identical too (not sure if I can name such examples in public) and
can be supported under the same SoC name.
Otherwise different SoCs spanning last 5yrs are already supported by
the same SPI
driver. We must provide SoC specific bits to the driver either via one
place or the other.

-j

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

* [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
@ 2011-06-30 10:14       ` Jassi Brar
  0 siblings, 0 replies; 32+ messages in thread
From: Jassi Brar @ 2011-06-30 10:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 30, 2011 at 2:57 PM, padma venkat <padma.kvr@gmail.com> wrote:
> Hi,
>
> On Thu, Jun 30, 2011 at 1:01 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
>> On Thu, Jun 30, 2011 at 5:55 PM, Padmavathi Venna <padma.v@samsung.com> wrote:
>>> This patchset does the following:
>>>
>>> 1. Move duplicated code to common place
>>> [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
>>> SPI platform devices are defined in respective machine folder of
>>> Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
>>> So all SPI platform devices are moved to a common place.
>>
>> The machine specific code is put in machine specific location for some reason.
>> And the code is not duplicated, it's mostly data structures
>> initialized with machine
>> specific values.
>>
>> Have you considered if it would still be possible to build kernel
>> image supporting
>> more than 1 soc after your changes ?
> I didn't consider the single image scenario. Because as far as I know,
> the existing Samsung code doesn't have support for building a single kernel
> image for multiple SoCs.

Samsung did use to support during 24xx days. Unfortunately not much with
new generation SoCs.
This patch-set only takes us further away from having multiple SoCs
supported in a single kernel image some day.

>
> The intention behind my changes were
> 1) To reuse the dev-spi files for all the SoCs, as this reduces the code size.
I already decided in favor of being able to support multiple SoCs in
single image.

> Also future SoCs with SPI can use the same file.
Only if they have _exactly_ same SPI block. Then most probably they'll have most
other blocks identical too (not sure if I can name such examples in public) and
can be supported under the same SoC name.
Otherwise different SoCs spanning last 5yrs are already supported by
the same SPI
driver. We must provide SoC specific bits to the driver either via one
place or the other.

-j

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

* [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
@ 2011-06-30 12:25 ` Padmavathi Venna
  0 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: kgene.kim, jassisinghbrar, sbkim73, linux-samsung-soc, linux-arm-kernel

This patchset does the following:

1. Move duplicated code to common place
[PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
SPI platform devices are defined in respective machine folder of
Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
So all SPI platform devices are moved to a common place.

[PATCH 2/7] ARM: SAMSUNG: Define common macro for SPI physical address

[PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
Each SoC has it's own set of clock sources for SPI.So they are defined in
respective machine folder.

[PATCH 4/7] ARM: SAMSUNG: Create SPI device setup files in
respective machine folder

[PATCH 5/7] ARM: SAMSUNG: Add SPI platform specific code
As SPI platform devices are moved to common place some platform specific
code need to be initialized in the respective machine file.

[PATCH 6/7] SPI: S5PC100: Enable the SPI driver for S5PC100

[PATCH 7/7] SPI: S5PV210: Enable the SPI driver for S5PV210

 arch/arm/mach-s3c64xx/Kconfig                    |   14 ++
 arch/arm/mach-s3c64xx/Makefile                   |    3 +-
 arch/arm/mach-s3c64xx/dev-spi.c                  |  177 -----------------
 arch/arm/mach-s3c64xx/include/mach/map.h         |    2 +
 arch/arm/mach-s3c64xx/include/mach/spi-clocks.h  |    6 +
 arch/arm/mach-s3c64xx/mach-smdk6410.c            |   11 +
 arch/arm/mach-s3c64xx/setup-spi0.c               |   21 ++
 arch/arm/mach-s3c64xx/setup-spi1.c               |   21 ++
 arch/arm/mach-s5p64x0/Kconfig                    |   20 ++-
 arch/arm/mach-s5p64x0/Makefile                   |    3 +-
 arch/arm/mach-s5p64x0/dev-spi.c                  |  222 ---------------------
 arch/arm/mach-s5p64x0/include/mach/map.h         |    2 +
 arch/arm/mach-s5p64x0/include/mach/spi-clocks.h  |    5 +
 arch/arm/mach-s5p64x0/mach-smdk6440.c            |   11 +
 arch/arm/mach-s5p64x0/mach-smdk6450.c            |   11 +
 arch/arm/mach-s5p64x0/setup-spi0.c               |   31 +++
 arch/arm/mach-s5p64x0/setup-spi1.c               |   31 +++
 arch/arm/mach-s5pc100/Kconfig                    |   21 ++
 arch/arm/mach-s5pc100/Makefile                   |    4 +-
 arch/arm/mach-s5pc100/dev-spi.c                  |  223 ----------------------
 arch/arm/mach-s5pc100/include/mach/map.h         |    3 +
 arch/arm/mach-s5pc100/include/mach/spi-clocks.h  |    6 +
 arch/arm/mach-s5pc100/mach-smdkc100.c            |   19 ++
 arch/arm/mach-s5pc100/setup-spi0.c               |   21 ++
 arch/arm/mach-s5pc100/setup-spi1.c               |   21 ++
 arch/arm/mach-s5pc100/setup-spi2.c               |   23 +++
 arch/arm/mach-s5pv210/Kconfig                    |   14 ++
 arch/arm/mach-s5pv210/Makefile                   |    3 +-
 arch/arm/mach-s5pv210/dev-spi.c                  |  173 -----------------
 arch/arm/mach-s5pv210/include/mach/map.h         |    2 +
 arch/arm/mach-s5pv210/include/mach/spi-clocks.h  |    5 +
 arch/arm/mach-s5pv210/mach-smdkv210.c            |   12 ++
 arch/arm/mach-s5pv210/setup-spi0.c               |   23 +++
 arch/arm/mach-s5pv210/setup-spi1.c               |   23 +++
 arch/arm/plat-samsung/Kconfig                    |   15 ++-
 arch/arm/plat-samsung/Makefile                   |    3 +
 arch/arm/plat-samsung/dev-spi0.c                 |   87 +++++++++
 arch/arm/plat-samsung/dev-spi1.c                 |   87 +++++++++
 arch/arm/plat-samsung/dev-spi2.c                 |   87 +++++++++
 arch/arm/plat-samsung/include/plat/devs.h        |   12 +-
 arch/arm/plat-samsung/include/plat/s3c64xx-spi.h |   18 ++-
 drivers/spi/Kconfig                              |    3 +-
 42 files changed, 677 insertions(+), 822 deletions(-)
 delete mode 100644 arch/arm/mach-s3c64xx/dev-spi.c
 create mode 100644 arch/arm/mach-s3c64xx/setup-spi0.c
 create mode 100644 arch/arm/mach-s3c64xx/setup-spi1.c
 delete mode 100644 arch/arm/mach-s5p64x0/dev-spi.c
 create mode 100644 arch/arm/mach-s5p64x0/setup-spi0.c
 create mode 100644 arch/arm/mach-s5p64x0/setup-spi1.c
 delete mode 100644 arch/arm/mach-s5pc100/dev-spi.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi0.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi1.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi2.c
 delete mode 100644 arch/arm/mach-s5pv210/dev-spi.c
 create mode 100644 arch/arm/mach-s5pv210/setup-spi0.c
 create mode 100644 arch/arm/mach-s5pv210/setup-spi1.c
 create mode 100644 arch/arm/plat-samsung/dev-spi0.c
 create mode 100644 arch/arm/plat-samsung/dev-spi1.c
 create mode 100644 arch/arm/plat-samsung/dev-spi2.c

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

* [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
@ 2011-06-30 12:25 ` Padmavathi Venna
  0 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

This patchset does the following:

1. Move duplicated code to common place
[PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
SPI platform devices are defined in respective machine folder of
Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
So all SPI platform devices are moved to a common place.

[PATCH 2/7] ARM: SAMSUNG: Define common macro for SPI physical address

[PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
Each SoC has it's own set of clock sources for SPI.So they are defined in
respective machine folder.

[PATCH 4/7] ARM: SAMSUNG: Create SPI device setup files in
respective machine folder

[PATCH 5/7] ARM: SAMSUNG: Add SPI platform specific code
As SPI platform devices are moved to common place some platform specific
code need to be initialized in the respective machine file.

[PATCH 6/7] SPI: S5PC100: Enable the SPI driver for S5PC100

[PATCH 7/7] SPI: S5PV210: Enable the SPI driver for S5PV210

 arch/arm/mach-s3c64xx/Kconfig                    |   14 ++
 arch/arm/mach-s3c64xx/Makefile                   |    3 +-
 arch/arm/mach-s3c64xx/dev-spi.c                  |  177 -----------------
 arch/arm/mach-s3c64xx/include/mach/map.h         |    2 +
 arch/arm/mach-s3c64xx/include/mach/spi-clocks.h  |    6 +
 arch/arm/mach-s3c64xx/mach-smdk6410.c            |   11 +
 arch/arm/mach-s3c64xx/setup-spi0.c               |   21 ++
 arch/arm/mach-s3c64xx/setup-spi1.c               |   21 ++
 arch/arm/mach-s5p64x0/Kconfig                    |   20 ++-
 arch/arm/mach-s5p64x0/Makefile                   |    3 +-
 arch/arm/mach-s5p64x0/dev-spi.c                  |  222 ---------------------
 arch/arm/mach-s5p64x0/include/mach/map.h         |    2 +
 arch/arm/mach-s5p64x0/include/mach/spi-clocks.h  |    5 +
 arch/arm/mach-s5p64x0/mach-smdk6440.c            |   11 +
 arch/arm/mach-s5p64x0/mach-smdk6450.c            |   11 +
 arch/arm/mach-s5p64x0/setup-spi0.c               |   31 +++
 arch/arm/mach-s5p64x0/setup-spi1.c               |   31 +++
 arch/arm/mach-s5pc100/Kconfig                    |   21 ++
 arch/arm/mach-s5pc100/Makefile                   |    4 +-
 arch/arm/mach-s5pc100/dev-spi.c                  |  223 ----------------------
 arch/arm/mach-s5pc100/include/mach/map.h         |    3 +
 arch/arm/mach-s5pc100/include/mach/spi-clocks.h  |    6 +
 arch/arm/mach-s5pc100/mach-smdkc100.c            |   19 ++
 arch/arm/mach-s5pc100/setup-spi0.c               |   21 ++
 arch/arm/mach-s5pc100/setup-spi1.c               |   21 ++
 arch/arm/mach-s5pc100/setup-spi2.c               |   23 +++
 arch/arm/mach-s5pv210/Kconfig                    |   14 ++
 arch/arm/mach-s5pv210/Makefile                   |    3 +-
 arch/arm/mach-s5pv210/dev-spi.c                  |  173 -----------------
 arch/arm/mach-s5pv210/include/mach/map.h         |    2 +
 arch/arm/mach-s5pv210/include/mach/spi-clocks.h  |    5 +
 arch/arm/mach-s5pv210/mach-smdkv210.c            |   12 ++
 arch/arm/mach-s5pv210/setup-spi0.c               |   23 +++
 arch/arm/mach-s5pv210/setup-spi1.c               |   23 +++
 arch/arm/plat-samsung/Kconfig                    |   15 ++-
 arch/arm/plat-samsung/Makefile                   |    3 +
 arch/arm/plat-samsung/dev-spi0.c                 |   87 +++++++++
 arch/arm/plat-samsung/dev-spi1.c                 |   87 +++++++++
 arch/arm/plat-samsung/dev-spi2.c                 |   87 +++++++++
 arch/arm/plat-samsung/include/plat/devs.h        |   12 +-
 arch/arm/plat-samsung/include/plat/s3c64xx-spi.h |   18 ++-
 drivers/spi/Kconfig                              |    3 +-
 42 files changed, 677 insertions(+), 822 deletions(-)
 delete mode 100644 arch/arm/mach-s3c64xx/dev-spi.c
 create mode 100644 arch/arm/mach-s3c64xx/setup-spi0.c
 create mode 100644 arch/arm/mach-s3c64xx/setup-spi1.c
 delete mode 100644 arch/arm/mach-s5p64x0/dev-spi.c
 create mode 100644 arch/arm/mach-s5p64x0/setup-spi0.c
 create mode 100644 arch/arm/mach-s5p64x0/setup-spi1.c
 delete mode 100644 arch/arm/mach-s5pc100/dev-spi.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi0.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi1.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi2.c
 delete mode 100644 arch/arm/mach-s5pv210/dev-spi.c
 create mode 100644 arch/arm/mach-s5pv210/setup-spi0.c
 create mode 100644 arch/arm/mach-s5pv210/setup-spi1.c
 create mode 100644 arch/arm/plat-samsung/dev-spi0.c
 create mode 100644 arch/arm/plat-samsung/dev-spi1.c
 create mode 100644 arch/arm/plat-samsung/dev-spi2.c

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

* [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
  2011-06-30 12:25 ` Padmavathi Venna
@ 2011-06-30 12:25   ` Padmavathi Venna
  -1 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: kgene.kim, jassisinghbrar, sbkim73, linux-samsung-soc, linux-arm-kernel

Move all SPI platform device definitions from respective machine
folder to plat-samsung

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/mach-s3c64xx/dev-spi.c                  |  177 -----------------
 arch/arm/mach-s5p64x0/dev-spi.c                  |  222 ---------------------
 arch/arm/mach-s5pc100/dev-spi.c                  |  223 ----------------------
 arch/arm/mach-s5pv210/dev-spi.c                  |  173 -----------------
 arch/arm/plat-samsung/Kconfig                    |   15 ++-
 arch/arm/plat-samsung/Makefile                   |    3 +
 arch/arm/plat-samsung/dev-spi0.c                 |   87 +++++++++
 arch/arm/plat-samsung/dev-spi1.c                 |   87 +++++++++
 arch/arm/plat-samsung/dev-spi2.c                 |   87 +++++++++
 arch/arm/plat-samsung/include/plat/devs.h        |   12 +-
 arch/arm/plat-samsung/include/plat/s3c64xx-spi.h |   18 ++-
 11 files changed, 289 insertions(+), 815 deletions(-)
 delete mode 100644 arch/arm/mach-s3c64xx/dev-spi.c
 delete mode 100644 arch/arm/mach-s5p64x0/dev-spi.c
 delete mode 100644 arch/arm/mach-s5pc100/dev-spi.c
 delete mode 100644 arch/arm/mach-s5pv210/dev-spi.c
 create mode 100644 arch/arm/plat-samsung/dev-spi0.c
 create mode 100644 arch/arm/plat-samsung/dev-spi1.c
 create mode 100644 arch/arm/plat-samsung/dev-spi2.c

diff --git a/arch/arm/mach-s3c64xx/dev-spi.c b/arch/arm/mach-s3c64xx/dev-spi.c
deleted file mode 100644
index 82db072..0000000
--- a/arch/arm/mach-s3c64xx/dev-spi.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/* linux/arch/arm/plat-s3c64xx/dev-spi.c
- *
- * Copyright (C) 2009 Samsung Electronics Ltd.
- *	Jaswinder Singh <jassi.brar@samsung.com>
- *
- * 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.
- */
-
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/gpio.h>
-
-#include <mach/dma.h>
-#include <mach/map.h>
-#include <mach/spi-clocks.h>
-#include <mach/irqs.h>
-
-#include <plat/s3c64xx-spi.h>
-#include <plat/gpio-cfg.h>
-#include <plat/devs.h>
-
-static char *spi_src_clks[] = {
-	[S3C64XX_SPI_SRCCLK_PCLK] = "pclk",
-	[S3C64XX_SPI_SRCCLK_SPIBUS] = "spi-bus",
-	[S3C64XX_SPI_SRCCLK_48M] = "spi_48m",
-};
-
-/* SPI Controller platform_devices */
-
-/* Since we emulate multi-cs capability, we do not touch the GPC-3,7.
- * The emulated CS is toggled by board specific mechanism, as it can
- * be either some immediate GPIO or some signal out of some other
- * chip in between ... or some yet another way.
- * We simply do not assume anything about CS.
- */
-static int s3c64xx_spi_cfg_gpio(struct platform_device *pdev)
-{
-	unsigned int base;
-
-	switch (pdev->id) {
-	case 0:
-		base = S3C64XX_GPC(0);
-		break;
-
-	case 1:
-		base = S3C64XX_GPC(4);
-		break;
-
-	default:
-		dev_err(&pdev->dev, "Invalid SPI Controller number!");
-		return -EINVAL;
-	}
-
-	s3c_gpio_cfgall_range(base, 3,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-
-	return 0;
-}
-
-static struct resource s3c64xx_spi0_resource[] = {
-	[0] = {
-		.start = S3C64XX_PA_SPI0,
-		.end   = S3C64XX_PA_SPI0 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI0_TX,
-		.end   = DMACH_SPI0_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI0_RX,
-		.end   = DMACH_SPI0_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI0,
-		.end   = IRQ_SPI0,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s3c64xx_spi0_pdata = {
-	.cfg_gpio = s3c64xx_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 13,
-};
-
-static u64 spi_dmamask = DMA_BIT_MASK(32);
-
-struct platform_device s3c64xx_device_spi0 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 0,
-	.num_resources	  = ARRAY_SIZE(s3c64xx_spi0_resource),
-	.resource	  = s3c64xx_spi0_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s3c64xx_spi0_pdata,
-	},
-};
-EXPORT_SYMBOL(s3c64xx_device_spi0);
-
-static struct resource s3c64xx_spi1_resource[] = {
-	[0] = {
-		.start = S3C64XX_PA_SPI1,
-		.end   = S3C64XX_PA_SPI1 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI1_TX,
-		.end   = DMACH_SPI1_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI1_RX,
-		.end   = DMACH_SPI1_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI1,
-		.end   = IRQ_SPI1,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s3c64xx_spi1_pdata = {
-	.cfg_gpio = s3c64xx_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 13,
-};
-
-struct platform_device s3c64xx_device_spi1 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 1,
-	.num_resources	  = ARRAY_SIZE(s3c64xx_spi1_resource),
-	.resource	  = s3c64xx_spi1_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s3c64xx_spi1_pdata,
-	},
-};
-EXPORT_SYMBOL(s3c64xx_device_spi1);
-
-void __init s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
-{
-	struct s3c64xx_spi_info *pd;
-
-	/* Reject invalid configuration */
-	if (!num_cs || src_clk_nr < 0
-			|| src_clk_nr > S3C64XX_SPI_SRCCLK_48M) {
-		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
-		return;
-	}
-
-	switch (cntrlr) {
-	case 0:
-		pd = &s3c64xx_spi0_pdata;
-		break;
-	case 1:
-		pd = &s3c64xx_spi1_pdata;
-		break;
-	default:
-		printk(KERN_ERR "%s: Invalid SPI controller(%d)\n",
-							__func__, cntrlr);
-		return;
-	}
-
-	pd->num_cs = num_cs;
-	pd->src_clk_nr = src_clk_nr;
-	pd->src_clk_name = spi_src_clks[src_clk_nr];
-}
diff --git a/arch/arm/mach-s5p64x0/dev-spi.c b/arch/arm/mach-s5p64x0/dev-spi.c
deleted file mode 100644
index e78ee18..0000000
--- a/arch/arm/mach-s5p64x0/dev-spi.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/* linux/arch/arm/mach-s5p64x0/dev-spi.c
- *
- * Copyright (c) 2010 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com
- *
- * Copyright (C) 2010 Samsung Electronics Co. Ltd.
- *	Jaswinder Singh <jassi.brar@samsung.com>
- *
- * 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.
-*/
-
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/gpio.h>
-
-#include <mach/dma.h>
-#include <mach/map.h>
-#include <mach/irqs.h>
-#include <mach/regs-clock.h>
-#include <mach/spi-clocks.h>
-
-#include <plat/s3c64xx-spi.h>
-#include <plat/gpio-cfg.h>
-
-static char *s5p64x0_spi_src_clks[] = {
-	[S5P64X0_SPI_SRCCLK_PCLK] = "pclk",
-	[S5P64X0_SPI_SRCCLK_SCLK] = "sclk_spi",
-};
-
-/* SPI Controller platform_devices */
-
-/* Since we emulate multi-cs capability, we do not touch the CS.
- * The emulated CS is toggled by board specific mechanism, as it can
- * be either some immediate GPIO or some signal out of some other
- * chip in between ... or some yet another way.
- * We simply do not assume anything about CS.
- */
-static int s5p6440_spi_cfg_gpio(struct platform_device *pdev)
-{
-	unsigned int base;
-
-	switch (pdev->id) {
-	case 0:
-		base = S5P6440_GPC(0);
-		break;
-
-	case 1:
-		base = S5P6440_GPC(4);
-		break;
-
-	default:
-		dev_err(&pdev->dev, "Invalid SPI Controller number!");
-		return -EINVAL;
-	}
-
-	s3c_gpio_cfgall_range(base, 3,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-
-	return 0;
-}
-
-static int s5p6450_spi_cfg_gpio(struct platform_device *pdev)
-{
-	unsigned int base;
-
-	switch (pdev->id) {
-	case 0:
-		base = S5P6450_GPC(0);
-		break;
-
-	case 1:
-		base = S5P6450_GPC(4);
-		break;
-
-	default:
-		dev_err(&pdev->dev, "Invalid SPI Controller number!");
-		return -EINVAL;
-	}
-
-	s3c_gpio_cfgall_range(base, 3,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-
-	return 0;
-}
-
-static struct resource s5p64x0_spi0_resource[] = {
-	[0] = {
-		.start	= S5P64X0_PA_SPI0,
-		.end	= S5P64X0_PA_SPI0 + 0x100 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= DMACH_SPI0_TX,
-		.end	= DMACH_SPI0_TX,
-		.flags	= IORESOURCE_DMA,
-	},
-	[2] = {
-		.start	= DMACH_SPI0_RX,
-		.end	= DMACH_SPI0_RX,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		.start	= IRQ_SPI0,
-		.end	= IRQ_SPI0,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5p6440_spi0_pdata = {
-	.cfg_gpio	= s5p6440_spi_cfg_gpio,
-	.fifo_lvl_mask	= 0x1ff,
-	.rx_lvl_offset	= 15,
-};
-
-static struct s3c64xx_spi_info s5p6450_spi0_pdata = {
-	.cfg_gpio	= s5p6450_spi_cfg_gpio,
-	.fifo_lvl_mask	= 0x1ff,
-	.rx_lvl_offset	= 15,
-};
-
-static u64 spi_dmamask = DMA_BIT_MASK(32);
-
-struct platform_device s5p64x0_device_spi0 = {
-	.name		= "s3c64xx-spi",
-	.id		= 0,
-	.num_resources	= ARRAY_SIZE(s5p64x0_spi0_resource),
-	.resource	= s5p64x0_spi0_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-	},
-};
-
-static struct resource s5p64x0_spi1_resource[] = {
-	[0] = {
-		.start	= S5P64X0_PA_SPI1,
-		.end	= S5P64X0_PA_SPI1 + 0x100 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= DMACH_SPI1_TX,
-		.end	= DMACH_SPI1_TX,
-		.flags	= IORESOURCE_DMA,
-	},
-	[2] = {
-		.start	= DMACH_SPI1_RX,
-		.end	= DMACH_SPI1_RX,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		.start	= IRQ_SPI1,
-		.end	= IRQ_SPI1,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5p6440_spi1_pdata = {
-	.cfg_gpio	= s5p6440_spi_cfg_gpio,
-	.fifo_lvl_mask	= 0x7f,
-	.rx_lvl_offset	= 15,
-};
-
-static struct s3c64xx_spi_info s5p6450_spi1_pdata = {
-	.cfg_gpio	= s5p6450_spi_cfg_gpio,
-	.fifo_lvl_mask	= 0x7f,
-	.rx_lvl_offset	= 15,
-};
-
-struct platform_device s5p64x0_device_spi1 = {
-	.name		= "s3c64xx-spi",
-	.id		= 1,
-	.num_resources	= ARRAY_SIZE(s5p64x0_spi1_resource),
-	.resource	= s5p64x0_spi1_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-	},
-};
-
-void __init s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
-{
-	unsigned int id;
-	struct s3c64xx_spi_info *pd;
-
-	id = __raw_readl(S5P64X0_SYS_ID) & 0xFF000;
-
-	/* Reject invalid configuration */
-	if (!num_cs || src_clk_nr < 0
-			|| src_clk_nr > S5P64X0_SPI_SRCCLK_SCLK) {
-		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
-		return;
-	}
-
-	switch (cntrlr) {
-	case 0:
-		if (id == 0x50000)
-			pd = &s5p6450_spi0_pdata;
-		else
-			pd = &s5p6440_spi0_pdata;
-
-		s5p64x0_device_spi0.dev.platform_data = pd;
-		break;
-	case 1:
-		if (id == 0x50000)
-			pd = &s5p6450_spi1_pdata;
-		else
-			pd = &s5p6440_spi1_pdata;
-
-		s5p64x0_device_spi1.dev.platform_data = pd;
-		break;
-	default:
-		printk(KERN_ERR "%s: Invalid SPI controller(%d)\n",
-							__func__, cntrlr);
-		return;
-	}
-
-	pd->num_cs = num_cs;
-	pd->src_clk_nr = src_clk_nr;
-	pd->src_clk_name = s5p64x0_spi_src_clks[src_clk_nr];
-}
diff --git a/arch/arm/mach-s5pc100/dev-spi.c b/arch/arm/mach-s5pc100/dev-spi.c
deleted file mode 100644
index 57b1979..0000000
--- a/arch/arm/mach-s5pc100/dev-spi.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/* linux/arch/arm/mach-s5pc100/dev-spi.c
- *
- * Copyright (C) 2010 Samsung Electronics Co. Ltd.
- *	Jaswinder Singh <jassi.brar@samsung.com>
- *
- * 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.
- */
-
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/gpio.h>
-
-#include <mach/dma.h>
-#include <mach/map.h>
-#include <mach/spi-clocks.h>
-
-#include <plat/s3c64xx-spi.h>
-#include <plat/gpio-cfg.h>
-#include <plat/irqs.h>
-
-static char *spi_src_clks[] = {
-	[S5PC100_SPI_SRCCLK_PCLK] = "pclk",
-	[S5PC100_SPI_SRCCLK_48M] = "spi_48m",
-	[S5PC100_SPI_SRCCLK_SPIBUS] = "spi_bus",
-};
-
-/* SPI Controller platform_devices */
-
-/* Since we emulate multi-cs capability, we do not touch the CS.
- * The emulated CS is toggled by board specific mechanism, as it can
- * be either some immediate GPIO or some signal out of some other
- * chip in between ... or some yet another way.
- * We simply do not assume anything about CS.
- */
-static int s5pc100_spi_cfg_gpio(struct platform_device *pdev)
-{
-	switch (pdev->id) {
-	case 0:
-		s3c_gpio_cfgall_range(S5PC100_GPB(0), 3,
-				      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-		break;
-
-	case 1:
-		s3c_gpio_cfgall_range(S5PC100_GPB(4), 3,
-				      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-		break;
-
-	case 2:
-		s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(3));
-		s3c_gpio_setpull(S5PC100_GPG3(0), S3C_GPIO_PULL_UP);
-		s3c_gpio_cfgall_range(S5PC100_GPB(2), 2,
-				      S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
-		break;
-
-	default:
-		dev_err(&pdev->dev, "Invalid SPI Controller number!");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-static struct resource s5pc100_spi0_resource[] = {
-	[0] = {
-		.start = S5PC100_PA_SPI0,
-		.end   = S5PC100_PA_SPI0 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI0_TX,
-		.end   = DMACH_SPI0_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI0_RX,
-		.end   = DMACH_SPI0_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI0,
-		.end   = IRQ_SPI0,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5pc100_spi0_pdata = {
-	.cfg_gpio = s5pc100_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 13,
-	.high_speed = 1,
-};
-
-static u64 spi_dmamask = DMA_BIT_MASK(32);
-
-struct platform_device s5pc100_device_spi0 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 0,
-	.num_resources	  = ARRAY_SIZE(s5pc100_spi0_resource),
-	.resource	  = s5pc100_spi0_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s5pc100_spi0_pdata,
-	},
-};
-
-static struct resource s5pc100_spi1_resource[] = {
-	[0] = {
-		.start = S5PC100_PA_SPI1,
-		.end   = S5PC100_PA_SPI1 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI1_TX,
-		.end   = DMACH_SPI1_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI1_RX,
-		.end   = DMACH_SPI1_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI1,
-		.end   = IRQ_SPI1,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5pc100_spi1_pdata = {
-	.cfg_gpio = s5pc100_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 13,
-	.high_speed = 1,
-};
-
-struct platform_device s5pc100_device_spi1 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 1,
-	.num_resources	  = ARRAY_SIZE(s5pc100_spi1_resource),
-	.resource	  = s5pc100_spi1_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s5pc100_spi1_pdata,
-	},
-};
-
-static struct resource s5pc100_spi2_resource[] = {
-	[0] = {
-		.start = S5PC100_PA_SPI2,
-		.end   = S5PC100_PA_SPI2 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI2_TX,
-		.end   = DMACH_SPI2_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI2_RX,
-		.end   = DMACH_SPI2_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI2,
-		.end   = IRQ_SPI2,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5pc100_spi2_pdata = {
-	.cfg_gpio = s5pc100_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 13,
-	.high_speed = 1,
-};
-
-struct platform_device s5pc100_device_spi2 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 2,
-	.num_resources	  = ARRAY_SIZE(s5pc100_spi2_resource),
-	.resource	  = s5pc100_spi2_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s5pc100_spi2_pdata,
-	},
-};
-
-void __init s5pc100_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
-{
-	struct s3c64xx_spi_info *pd;
-
-	/* Reject invalid configuration */
-	if (!num_cs || src_clk_nr < 0
-			|| src_clk_nr > S5PC100_SPI_SRCCLK_SPIBUS) {
-		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
-		return;
-	}
-
-	switch (cntrlr) {
-	case 0:
-		pd = &s5pc100_spi0_pdata;
-		break;
-	case 1:
-		pd = &s5pc100_spi1_pdata;
-		break;
-	case 2:
-		pd = &s5pc100_spi2_pdata;
-		break;
-	default:
-		printk(KERN_ERR "%s: Invalid SPI controller(%d)\n",
-							__func__, cntrlr);
-		return;
-	}
-
-	pd->num_cs = num_cs;
-	pd->src_clk_nr = src_clk_nr;
-	pd->src_clk_name = spi_src_clks[src_clk_nr];
-}
diff --git a/arch/arm/mach-s5pv210/dev-spi.c b/arch/arm/mach-s5pv210/dev-spi.c
deleted file mode 100644
index e3249a4..0000000
--- a/arch/arm/mach-s5pv210/dev-spi.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/* linux/arch/arm/mach-s5pv210/dev-spi.c
- *
- * Copyright (C) 2010 Samsung Electronics Co. Ltd.
- *	Jaswinder Singh <jassi.brar@samsung.com>
- *
- * 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.
- */
-
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/gpio.h>
-
-#include <mach/dma.h>
-#include <mach/map.h>
-#include <mach/irqs.h>
-#include <mach/spi-clocks.h>
-
-#include <plat/s3c64xx-spi.h>
-#include <plat/gpio-cfg.h>
-
-static char *spi_src_clks[] = {
-	[S5PV210_SPI_SRCCLK_PCLK] = "pclk",
-	[S5PV210_SPI_SRCCLK_SCLK] = "sclk_spi",
-};
-
-/* SPI Controller platform_devices */
-
-/* Since we emulate multi-cs capability, we do not touch the CS.
- * The emulated CS is toggled by board specific mechanism, as it can
- * be either some immediate GPIO or some signal out of some other
- * chip in between ... or some yet another way.
- * We simply do not assume anything about CS.
- */
-static int s5pv210_spi_cfg_gpio(struct platform_device *pdev)
-{
-	unsigned int base;
-
-	switch (pdev->id) {
-	case 0:
-		base = S5PV210_GPB(0);
-		break;
-
-	case 1:
-		base = S5PV210_GPB(4);
-		break;
-
-	default:
-		dev_err(&pdev->dev, "Invalid SPI Controller number!");
-		return -EINVAL;
-	}
-
-	s3c_gpio_cfgall_range(base, 3,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-
-	return 0;
-}
-
-static struct resource s5pv210_spi0_resource[] = {
-	[0] = {
-		.start = S5PV210_PA_SPI0,
-		.end   = S5PV210_PA_SPI0 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI0_TX,
-		.end   = DMACH_SPI0_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI0_RX,
-		.end   = DMACH_SPI0_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI0,
-		.end   = IRQ_SPI0,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5pv210_spi0_pdata = {
-	.cfg_gpio = s5pv210_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x1ff,
-	.rx_lvl_offset = 15,
-	.high_speed = 1,
-};
-
-static u64 spi_dmamask = DMA_BIT_MASK(32);
-
-struct platform_device s5pv210_device_spi0 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 0,
-	.num_resources	  = ARRAY_SIZE(s5pv210_spi0_resource),
-	.resource	  = s5pv210_spi0_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s5pv210_spi0_pdata,
-	},
-};
-
-static struct resource s5pv210_spi1_resource[] = {
-	[0] = {
-		.start = S5PV210_PA_SPI1,
-		.end   = S5PV210_PA_SPI1 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI1_TX,
-		.end   = DMACH_SPI1_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI1_RX,
-		.end   = DMACH_SPI1_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI1,
-		.end   = IRQ_SPI1,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5pv210_spi1_pdata = {
-	.cfg_gpio = s5pv210_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 15,
-	.high_speed = 1,
-};
-
-struct platform_device s5pv210_device_spi1 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 1,
-	.num_resources	  = ARRAY_SIZE(s5pv210_spi1_resource),
-	.resource	  = s5pv210_spi1_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s5pv210_spi1_pdata,
-	},
-};
-
-void __init s5pv210_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
-{
-	struct s3c64xx_spi_info *pd;
-
-	/* Reject invalid configuration */
-	if (!num_cs || src_clk_nr < 0
-			|| src_clk_nr > S5PV210_SPI_SRCCLK_SCLK) {
-		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
-		return;
-	}
-
-	switch (cntrlr) {
-	case 0:
-		pd = &s5pv210_spi0_pdata;
-		break;
-	case 1:
-		pd = &s5pv210_spi1_pdata;
-		break;
-	default:
-		printk(KERN_ERR "%s: Invalid SPI controller(%d)\n",
-							__func__, cntrlr);
-		return;
-	}
-
-	pd->num_cs = num_cs;
-	pd->src_clk_nr = src_clk_nr;
-	pd->src_clk_name = spi_src_clks[src_clk_nr];
-}
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 4d79519..0feb5ed 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -258,11 +258,20 @@ config SAMSUNG_DEV_IDE
 	help
 	  Compile in platform device definitions for IDE
 
-config S3C64XX_DEV_SPI
+config SAMSUNG_DEV_SPI0
 	bool
 	help
-	  Compile in platform device definitions for S3C64XX's type
-	  SPI controllers.
+	  Compile in platform device definitions for SPI channel 0
+
+config SAMSUNG_DEV_SPI1
+	bool
+	help
+	  Compile in platform device definitions for SPI channel 1
+
+config SAMSUNG_DEV_SPI2
+	bool
+	help
+	  Compile in platform device definitions for SPI channel 2
 
 config SAMSUNG_DEV_TS
 	bool
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 53eb15b..f226283 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -53,6 +53,9 @@ obj-$(CONFIG_S3C_DEV_WDT)	+= dev-wdt.o
 obj-$(CONFIG_S3C_DEV_NAND)	+= dev-nand.o
 obj-$(CONFIG_S3C_DEV_ONENAND)	+= dev-onenand.o
 obj-$(CONFIG_S3C_DEV_RTC)	+= dev-rtc.o
+obj-$(CONFIG_SAMSUNG_DEV_SPI0)	+= dev-spi0.o
+obj-$(CONFIG_SAMSUNG_DEV_SPI1)	+= dev-spi1.o
+obj-$(CONFIG_SAMSUNG_DEV_SPI2)	+= dev-spi2.o
 
 obj-$(CONFIG_SAMSUNG_DEV_ADC)	+= dev-adc.o
 obj-$(CONFIG_SAMSUNG_DEV_IDE)	+= dev-ide.o
diff --git a/arch/arm/plat-samsung/dev-spi0.c b/arch/arm/plat-samsung/dev-spi0.c
new file mode 100644
index 0000000..3d2c8bf
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-spi0.c
@@ -0,0 +1,87 @@
+/* linux/arch/arm/plat-samsung/dev-spi0.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+
+#include <mach/dma.h>
+#include <mach/map.h>
+#include <mach/spi-clocks.h>
+#include <mach/irqs.h>
+
+#include <plat/s3c64xx-spi.h>
+#include <plat/devs.h>
+
+static struct resource s3c_spi0_resource[] = {
+	[0] = {
+		.start	= S3C_PA_SPI0,
+		.end	= S3C_PA_SPI0 + SZ_256 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= DMACH_SPI0_TX,
+		.end	= DMACH_SPI0_TX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[2] = {
+		.start	= DMACH_SPI0_RX,
+		.end	= DMACH_SPI0_RX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[3] = {
+		.start	= IRQ_SPI0,
+		.end	= IRQ_SPI0,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct s3c64xx_spi_info s3c_spi0_def_pdata = {
+	.cfg_gpio	= s3c_spi0_cfg_gpio,
+};
+
+static u64 spi_dmamask = DMA_BIT_MASK(32);
+
+struct platform_device s3c_device_spi0 = {
+	.name		= "s3c64xx-spi",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(s3c_spi0_resource),
+	.resource	= s3c_spi0_resource,
+	.dev = {
+		.dma_mask		= &spi_dmamask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+		.platform_data		= &s3c_spi0_def_pdata,
+	},
+};
+
+void __init s3c_spi0_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs)
+{
+	struct s3c64xx_spi_info *spi_info = &s3c_spi0_def_pdata;
+	if (NULL == pd) {
+		printk(KERN_ERR "%s: Need to pass platform data\n", __func__);
+		return;
+	}
+	spi_info->fifo_lvl_mask = pd->fifo_lvl_mask;
+	spi_info->rx_lvl_offset = pd->rx_lvl_offset;
+	/* Reject invalid configuration */
+	if (!num_cs || src_clk_nr < 0
+			|| src_clk_nr > ARRAY_SIZE(spi_src_clks)) {
+		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
+		return;
+	}
+	spi_info->num_cs = num_cs;
+	spi_info->src_clk_nr = src_clk_nr;
+	spi_info->src_clk_name = spi_src_clks[src_clk_nr];
+	if (pd->high_speed)
+		spi_info->high_speed = pd->high_speed;
+	if (pd->clk_from_cmu)
+		spi_info->clk_from_cmu = pd->clk_from_cmu;
+}
diff --git a/arch/arm/plat-samsung/dev-spi1.c b/arch/arm/plat-samsung/dev-spi1.c
new file mode 100644
index 0000000..2aaa251
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-spi1.c
@@ -0,0 +1,87 @@
+/* linux/arch/arm/plat-samsung/dev-spi1.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+
+#include <mach/dma.h>
+#include <mach/map.h>
+#include <mach/spi-clocks.h>
+#include <mach/irqs.h>
+
+#include <plat/s3c64xx-spi.h>
+#include <plat/devs.h>
+
+static struct resource s3c_spi1_resource[] = {
+	[0] = {
+		.start	= S3C_PA_SPI1,
+		.end	= S3C_PA_SPI1 + SZ_256 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= DMACH_SPI1_TX,
+		.end	= DMACH_SPI1_TX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[2] = {
+		.start	= DMACH_SPI1_RX,
+		.end	= DMACH_SPI1_RX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[3] = {
+		.start	= IRQ_SPI1,
+		.end	= IRQ_SPI1,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct s3c64xx_spi_info s3c_spi1_def_pdata = {
+	.cfg_gpio	= s3c_spi1_cfg_gpio,
+};
+
+static u64 spi_dmamask = DMA_BIT_MASK(32);
+
+struct platform_device s3c_device_spi1 = {
+	.name		= "s3c64xx-spi",
+	.id		= 1,
+	.num_resources	= ARRAY_SIZE(s3c_spi1_resource),
+	.resource	= s3c_spi1_resource,
+	.dev = {
+		.dma_mask		= &spi_dmamask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+		.platform_data		= &s3c_spi1_def_pdata,
+	},
+};
+
+void __init s3c_spi1_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs)
+{
+	struct s3c64xx_spi_info *spi_info = &s3c_spi1_def_pdata;
+	if (NULL == pd) {
+		printk(KERN_ERR "%s: Need to pass platform data\n", __func__);
+		return;
+	}
+	spi_info->fifo_lvl_mask = pd->fifo_lvl_mask;
+	spi_info->rx_lvl_offset = pd->rx_lvl_offset;
+	/* Reject invalid configuration */
+	if (!num_cs || src_clk_nr < 0
+			|| src_clk_nr > ARRAY_SIZE(spi_src_clks)) {
+		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
+		return;
+	}
+	spi_info->num_cs = num_cs;
+	spi_info->src_clk_nr = src_clk_nr;
+	spi_info->src_clk_name = spi_src_clks[src_clk_nr];
+	if (pd->high_speed)
+		spi_info->high_speed = pd->high_speed;
+	if (pd->clk_from_cmu)
+		spi_info->clk_from_cmu = pd->clk_from_cmu;
+}
diff --git a/arch/arm/plat-samsung/dev-spi2.c b/arch/arm/plat-samsung/dev-spi2.c
new file mode 100644
index 0000000..15218b5
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-spi2.c
@@ -0,0 +1,87 @@
+/* linux/arch/arm/plat-samsung/dev-spi2.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+
+#include <mach/dma.h>
+#include <mach/map.h>
+#include <mach/spi-clocks.h>
+#include <mach/irqs.h>
+
+#include <plat/s3c64xx-spi.h>
+#include <plat/devs.h>
+
+static struct resource s3c_spi2_resource[] = {
+	[0] = {
+		.start	= S3C_PA_SPI2,
+		.end	= S3C_PA_SPI2 + SZ_256 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= DMACH_SPI2_TX,
+		.end	= DMACH_SPI2_TX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[2] = {
+		.start	= DMACH_SPI2_RX,
+		.end	= DMACH_SPI2_RX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[3] = {
+		.start	= IRQ_SPI2,
+		.end	= IRQ_SPI2,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct s3c64xx_spi_info s3c_spi2_def_pdata = {
+	.cfg_gpio	= s3c_spi2_cfg_gpio,
+};
+
+static u64 spi_dmamask = DMA_BIT_MASK(32);
+
+struct platform_device s3c_device_spi2 = {
+	.name		= "s3c64xx-spi",
+	.id		= 2,
+	.num_resources	= ARRAY_SIZE(s3c_spi2_resource),
+	.resource	= s3c_spi2_resource,
+	.dev = {
+		.dma_mask		= &spi_dmamask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+		.platform_data		= &s3c_spi2_def_pdata,
+	},
+};
+
+void __init s3c_spi2_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs)
+{
+	struct s3c64xx_spi_info *spi_info = &s3c_spi2_def_pdata;
+	if (NULL == pd) {
+		printk(KERN_ERR "%s: Need to pass platform data\n", __func__);
+		return;
+	}
+	spi_info->fifo_lvl_mask = pd->fifo_lvl_mask;
+	spi_info->rx_lvl_offset = pd->rx_lvl_offset;
+	/* Reject invalid configuration */
+	if (!num_cs || src_clk_nr < 0
+			|| src_clk_nr > ARRAY_SIZE(spi_src_clks)) {
+		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
+		return;
+	}
+	spi_info->num_cs = num_cs;
+	spi_info->src_clk_nr = src_clk_nr;
+	spi_info->src_clk_name = spi_src_clks[src_clk_nr];
+	if (pd->high_speed)
+		spi_info->high_speed = pd->high_speed;
+	if (pd->clk_from_cmu)
+		spi_info->clk_from_cmu = pd->clk_from_cmu;
+}
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index e3b31c2..96fc424 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -36,9 +36,6 @@ extern struct platform_device s3c64xx_device_iis0;
 extern struct platform_device s3c64xx_device_iis1;
 extern struct platform_device s3c64xx_device_iisv4;
 
-extern struct platform_device s3c64xx_device_spi0;
-extern struct platform_device s3c64xx_device_spi1;
-
 extern struct platform_device samsung_asoc_dma;
 
 extern struct platform_device s3c64xx_device_pcm0;
@@ -73,14 +70,7 @@ extern struct platform_device s3c_device_cfcon;
 
 extern struct platform_device s3c_device_spi0;
 extern struct platform_device s3c_device_spi1;
-
-extern struct platform_device s5pc100_device_spi0;
-extern struct platform_device s5pc100_device_spi1;
-extern struct platform_device s5pc100_device_spi2;
-extern struct platform_device s5pv210_device_spi0;
-extern struct platform_device s5pv210_device_spi1;
-extern struct platform_device s5p64x0_device_spi0;
-extern struct platform_device s5p64x0_device_spi1;
+extern struct platform_device s3c_device_spi2;
 
 extern struct platform_device s3c_device_hwmon;
 
diff --git a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
index 0ffe34a..b9f6a4b 100644
--- a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
+++ b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
@@ -56,18 +56,24 @@ struct s3c64xx_spi_info {
 };
 
 /**
- * s3c64xx_spi_set_info - SPI Controller configure callback by the board
+ * s3c_spi_set_info - SPI Controller configure callback by the board
  *				initialization code.
- * @cntrlr: SPI controller number the configuration is for.
  * @src_clk_nr: Clock the SPI controller is to use to generate SPI clocks.
  * @num_cs: Number of elements in the 'cs' array.
  *
  * Call this from machine init code for each SPI Controller that
  * has some chips attached to it.
  */
-extern void s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
-extern void s5pc100_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
-extern void s5pv210_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
-extern void s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
+extern void s3c_spi0_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs);
+extern void s3c_spi1_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs);
+extern void s3c_spi2_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs);
+
+/* defined by architecture to configure gpio */
+extern int s3c_spi0_cfg_gpio(struct platform_device *dev);
+extern int s3c_spi1_cfg_gpio(struct platform_device *dev);
+extern int s3c_spi2_cfg_gpio(struct platform_device *dev);
 
 #endif /* __S3C64XX_PLAT_SPI_H */
-- 
1.7.0.4

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

* [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
@ 2011-06-30 12:25   ` Padmavathi Venna
  0 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

Move all SPI platform device definitions from respective machine
folder to plat-samsung

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/mach-s3c64xx/dev-spi.c                  |  177 -----------------
 arch/arm/mach-s5p64x0/dev-spi.c                  |  222 ---------------------
 arch/arm/mach-s5pc100/dev-spi.c                  |  223 ----------------------
 arch/arm/mach-s5pv210/dev-spi.c                  |  173 -----------------
 arch/arm/plat-samsung/Kconfig                    |   15 ++-
 arch/arm/plat-samsung/Makefile                   |    3 +
 arch/arm/plat-samsung/dev-spi0.c                 |   87 +++++++++
 arch/arm/plat-samsung/dev-spi1.c                 |   87 +++++++++
 arch/arm/plat-samsung/dev-spi2.c                 |   87 +++++++++
 arch/arm/plat-samsung/include/plat/devs.h        |   12 +-
 arch/arm/plat-samsung/include/plat/s3c64xx-spi.h |   18 ++-
 11 files changed, 289 insertions(+), 815 deletions(-)
 delete mode 100644 arch/arm/mach-s3c64xx/dev-spi.c
 delete mode 100644 arch/arm/mach-s5p64x0/dev-spi.c
 delete mode 100644 arch/arm/mach-s5pc100/dev-spi.c
 delete mode 100644 arch/arm/mach-s5pv210/dev-spi.c
 create mode 100644 arch/arm/plat-samsung/dev-spi0.c
 create mode 100644 arch/arm/plat-samsung/dev-spi1.c
 create mode 100644 arch/arm/plat-samsung/dev-spi2.c

diff --git a/arch/arm/mach-s3c64xx/dev-spi.c b/arch/arm/mach-s3c64xx/dev-spi.c
deleted file mode 100644
index 82db072..0000000
--- a/arch/arm/mach-s3c64xx/dev-spi.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/* linux/arch/arm/plat-s3c64xx/dev-spi.c
- *
- * Copyright (C) 2009 Samsung Electronics Ltd.
- *	Jaswinder Singh <jassi.brar@samsung.com>
- *
- * 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.
- */
-
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/gpio.h>
-
-#include <mach/dma.h>
-#include <mach/map.h>
-#include <mach/spi-clocks.h>
-#include <mach/irqs.h>
-
-#include <plat/s3c64xx-spi.h>
-#include <plat/gpio-cfg.h>
-#include <plat/devs.h>
-
-static char *spi_src_clks[] = {
-	[S3C64XX_SPI_SRCCLK_PCLK] = "pclk",
-	[S3C64XX_SPI_SRCCLK_SPIBUS] = "spi-bus",
-	[S3C64XX_SPI_SRCCLK_48M] = "spi_48m",
-};
-
-/* SPI Controller platform_devices */
-
-/* Since we emulate multi-cs capability, we do not touch the GPC-3,7.
- * The emulated CS is toggled by board specific mechanism, as it can
- * be either some immediate GPIO or some signal out of some other
- * chip in between ... or some yet another way.
- * We simply do not assume anything about CS.
- */
-static int s3c64xx_spi_cfg_gpio(struct platform_device *pdev)
-{
-	unsigned int base;
-
-	switch (pdev->id) {
-	case 0:
-		base = S3C64XX_GPC(0);
-		break;
-
-	case 1:
-		base = S3C64XX_GPC(4);
-		break;
-
-	default:
-		dev_err(&pdev->dev, "Invalid SPI Controller number!");
-		return -EINVAL;
-	}
-
-	s3c_gpio_cfgall_range(base, 3,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-
-	return 0;
-}
-
-static struct resource s3c64xx_spi0_resource[] = {
-	[0] = {
-		.start = S3C64XX_PA_SPI0,
-		.end   = S3C64XX_PA_SPI0 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI0_TX,
-		.end   = DMACH_SPI0_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI0_RX,
-		.end   = DMACH_SPI0_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI0,
-		.end   = IRQ_SPI0,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s3c64xx_spi0_pdata = {
-	.cfg_gpio = s3c64xx_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 13,
-};
-
-static u64 spi_dmamask = DMA_BIT_MASK(32);
-
-struct platform_device s3c64xx_device_spi0 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 0,
-	.num_resources	  = ARRAY_SIZE(s3c64xx_spi0_resource),
-	.resource	  = s3c64xx_spi0_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s3c64xx_spi0_pdata,
-	},
-};
-EXPORT_SYMBOL(s3c64xx_device_spi0);
-
-static struct resource s3c64xx_spi1_resource[] = {
-	[0] = {
-		.start = S3C64XX_PA_SPI1,
-		.end   = S3C64XX_PA_SPI1 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI1_TX,
-		.end   = DMACH_SPI1_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI1_RX,
-		.end   = DMACH_SPI1_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI1,
-		.end   = IRQ_SPI1,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s3c64xx_spi1_pdata = {
-	.cfg_gpio = s3c64xx_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 13,
-};
-
-struct platform_device s3c64xx_device_spi1 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 1,
-	.num_resources	  = ARRAY_SIZE(s3c64xx_spi1_resource),
-	.resource	  = s3c64xx_spi1_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s3c64xx_spi1_pdata,
-	},
-};
-EXPORT_SYMBOL(s3c64xx_device_spi1);
-
-void __init s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
-{
-	struct s3c64xx_spi_info *pd;
-
-	/* Reject invalid configuration */
-	if (!num_cs || src_clk_nr < 0
-			|| src_clk_nr > S3C64XX_SPI_SRCCLK_48M) {
-		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
-		return;
-	}
-
-	switch (cntrlr) {
-	case 0:
-		pd = &s3c64xx_spi0_pdata;
-		break;
-	case 1:
-		pd = &s3c64xx_spi1_pdata;
-		break;
-	default:
-		printk(KERN_ERR "%s: Invalid SPI controller(%d)\n",
-							__func__, cntrlr);
-		return;
-	}
-
-	pd->num_cs = num_cs;
-	pd->src_clk_nr = src_clk_nr;
-	pd->src_clk_name = spi_src_clks[src_clk_nr];
-}
diff --git a/arch/arm/mach-s5p64x0/dev-spi.c b/arch/arm/mach-s5p64x0/dev-spi.c
deleted file mode 100644
index e78ee18..0000000
--- a/arch/arm/mach-s5p64x0/dev-spi.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/* linux/arch/arm/mach-s5p64x0/dev-spi.c
- *
- * Copyright (c) 2010 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com
- *
- * Copyright (C) 2010 Samsung Electronics Co. Ltd.
- *	Jaswinder Singh <jassi.brar@samsung.com>
- *
- * 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.
-*/
-
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/gpio.h>
-
-#include <mach/dma.h>
-#include <mach/map.h>
-#include <mach/irqs.h>
-#include <mach/regs-clock.h>
-#include <mach/spi-clocks.h>
-
-#include <plat/s3c64xx-spi.h>
-#include <plat/gpio-cfg.h>
-
-static char *s5p64x0_spi_src_clks[] = {
-	[S5P64X0_SPI_SRCCLK_PCLK] = "pclk",
-	[S5P64X0_SPI_SRCCLK_SCLK] = "sclk_spi",
-};
-
-/* SPI Controller platform_devices */
-
-/* Since we emulate multi-cs capability, we do not touch the CS.
- * The emulated CS is toggled by board specific mechanism, as it can
- * be either some immediate GPIO or some signal out of some other
- * chip in between ... or some yet another way.
- * We simply do not assume anything about CS.
- */
-static int s5p6440_spi_cfg_gpio(struct platform_device *pdev)
-{
-	unsigned int base;
-
-	switch (pdev->id) {
-	case 0:
-		base = S5P6440_GPC(0);
-		break;
-
-	case 1:
-		base = S5P6440_GPC(4);
-		break;
-
-	default:
-		dev_err(&pdev->dev, "Invalid SPI Controller number!");
-		return -EINVAL;
-	}
-
-	s3c_gpio_cfgall_range(base, 3,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-
-	return 0;
-}
-
-static int s5p6450_spi_cfg_gpio(struct platform_device *pdev)
-{
-	unsigned int base;
-
-	switch (pdev->id) {
-	case 0:
-		base = S5P6450_GPC(0);
-		break;
-
-	case 1:
-		base = S5P6450_GPC(4);
-		break;
-
-	default:
-		dev_err(&pdev->dev, "Invalid SPI Controller number!");
-		return -EINVAL;
-	}
-
-	s3c_gpio_cfgall_range(base, 3,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-
-	return 0;
-}
-
-static struct resource s5p64x0_spi0_resource[] = {
-	[0] = {
-		.start	= S5P64X0_PA_SPI0,
-		.end	= S5P64X0_PA_SPI0 + 0x100 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= DMACH_SPI0_TX,
-		.end	= DMACH_SPI0_TX,
-		.flags	= IORESOURCE_DMA,
-	},
-	[2] = {
-		.start	= DMACH_SPI0_RX,
-		.end	= DMACH_SPI0_RX,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		.start	= IRQ_SPI0,
-		.end	= IRQ_SPI0,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5p6440_spi0_pdata = {
-	.cfg_gpio	= s5p6440_spi_cfg_gpio,
-	.fifo_lvl_mask	= 0x1ff,
-	.rx_lvl_offset	= 15,
-};
-
-static struct s3c64xx_spi_info s5p6450_spi0_pdata = {
-	.cfg_gpio	= s5p6450_spi_cfg_gpio,
-	.fifo_lvl_mask	= 0x1ff,
-	.rx_lvl_offset	= 15,
-};
-
-static u64 spi_dmamask = DMA_BIT_MASK(32);
-
-struct platform_device s5p64x0_device_spi0 = {
-	.name		= "s3c64xx-spi",
-	.id		= 0,
-	.num_resources	= ARRAY_SIZE(s5p64x0_spi0_resource),
-	.resource	= s5p64x0_spi0_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-	},
-};
-
-static struct resource s5p64x0_spi1_resource[] = {
-	[0] = {
-		.start	= S5P64X0_PA_SPI1,
-		.end	= S5P64X0_PA_SPI1 + 0x100 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= DMACH_SPI1_TX,
-		.end	= DMACH_SPI1_TX,
-		.flags	= IORESOURCE_DMA,
-	},
-	[2] = {
-		.start	= DMACH_SPI1_RX,
-		.end	= DMACH_SPI1_RX,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		.start	= IRQ_SPI1,
-		.end	= IRQ_SPI1,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5p6440_spi1_pdata = {
-	.cfg_gpio	= s5p6440_spi_cfg_gpio,
-	.fifo_lvl_mask	= 0x7f,
-	.rx_lvl_offset	= 15,
-};
-
-static struct s3c64xx_spi_info s5p6450_spi1_pdata = {
-	.cfg_gpio	= s5p6450_spi_cfg_gpio,
-	.fifo_lvl_mask	= 0x7f,
-	.rx_lvl_offset	= 15,
-};
-
-struct platform_device s5p64x0_device_spi1 = {
-	.name		= "s3c64xx-spi",
-	.id		= 1,
-	.num_resources	= ARRAY_SIZE(s5p64x0_spi1_resource),
-	.resource	= s5p64x0_spi1_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-	},
-};
-
-void __init s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
-{
-	unsigned int id;
-	struct s3c64xx_spi_info *pd;
-
-	id = __raw_readl(S5P64X0_SYS_ID) & 0xFF000;
-
-	/* Reject invalid configuration */
-	if (!num_cs || src_clk_nr < 0
-			|| src_clk_nr > S5P64X0_SPI_SRCCLK_SCLK) {
-		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
-		return;
-	}
-
-	switch (cntrlr) {
-	case 0:
-		if (id == 0x50000)
-			pd = &s5p6450_spi0_pdata;
-		else
-			pd = &s5p6440_spi0_pdata;
-
-		s5p64x0_device_spi0.dev.platform_data = pd;
-		break;
-	case 1:
-		if (id == 0x50000)
-			pd = &s5p6450_spi1_pdata;
-		else
-			pd = &s5p6440_spi1_pdata;
-
-		s5p64x0_device_spi1.dev.platform_data = pd;
-		break;
-	default:
-		printk(KERN_ERR "%s: Invalid SPI controller(%d)\n",
-							__func__, cntrlr);
-		return;
-	}
-
-	pd->num_cs = num_cs;
-	pd->src_clk_nr = src_clk_nr;
-	pd->src_clk_name = s5p64x0_spi_src_clks[src_clk_nr];
-}
diff --git a/arch/arm/mach-s5pc100/dev-spi.c b/arch/arm/mach-s5pc100/dev-spi.c
deleted file mode 100644
index 57b1979..0000000
--- a/arch/arm/mach-s5pc100/dev-spi.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/* linux/arch/arm/mach-s5pc100/dev-spi.c
- *
- * Copyright (C) 2010 Samsung Electronics Co. Ltd.
- *	Jaswinder Singh <jassi.brar@samsung.com>
- *
- * 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.
- */
-
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/gpio.h>
-
-#include <mach/dma.h>
-#include <mach/map.h>
-#include <mach/spi-clocks.h>
-
-#include <plat/s3c64xx-spi.h>
-#include <plat/gpio-cfg.h>
-#include <plat/irqs.h>
-
-static char *spi_src_clks[] = {
-	[S5PC100_SPI_SRCCLK_PCLK] = "pclk",
-	[S5PC100_SPI_SRCCLK_48M] = "spi_48m",
-	[S5PC100_SPI_SRCCLK_SPIBUS] = "spi_bus",
-};
-
-/* SPI Controller platform_devices */
-
-/* Since we emulate multi-cs capability, we do not touch the CS.
- * The emulated CS is toggled by board specific mechanism, as it can
- * be either some immediate GPIO or some signal out of some other
- * chip in between ... or some yet another way.
- * We simply do not assume anything about CS.
- */
-static int s5pc100_spi_cfg_gpio(struct platform_device *pdev)
-{
-	switch (pdev->id) {
-	case 0:
-		s3c_gpio_cfgall_range(S5PC100_GPB(0), 3,
-				      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-		break;
-
-	case 1:
-		s3c_gpio_cfgall_range(S5PC100_GPB(4), 3,
-				      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-		break;
-
-	case 2:
-		s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(3));
-		s3c_gpio_setpull(S5PC100_GPG3(0), S3C_GPIO_PULL_UP);
-		s3c_gpio_cfgall_range(S5PC100_GPB(2), 2,
-				      S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
-		break;
-
-	default:
-		dev_err(&pdev->dev, "Invalid SPI Controller number!");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-static struct resource s5pc100_spi0_resource[] = {
-	[0] = {
-		.start = S5PC100_PA_SPI0,
-		.end   = S5PC100_PA_SPI0 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI0_TX,
-		.end   = DMACH_SPI0_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI0_RX,
-		.end   = DMACH_SPI0_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI0,
-		.end   = IRQ_SPI0,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5pc100_spi0_pdata = {
-	.cfg_gpio = s5pc100_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 13,
-	.high_speed = 1,
-};
-
-static u64 spi_dmamask = DMA_BIT_MASK(32);
-
-struct platform_device s5pc100_device_spi0 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 0,
-	.num_resources	  = ARRAY_SIZE(s5pc100_spi0_resource),
-	.resource	  = s5pc100_spi0_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s5pc100_spi0_pdata,
-	},
-};
-
-static struct resource s5pc100_spi1_resource[] = {
-	[0] = {
-		.start = S5PC100_PA_SPI1,
-		.end   = S5PC100_PA_SPI1 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI1_TX,
-		.end   = DMACH_SPI1_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI1_RX,
-		.end   = DMACH_SPI1_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI1,
-		.end   = IRQ_SPI1,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5pc100_spi1_pdata = {
-	.cfg_gpio = s5pc100_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 13,
-	.high_speed = 1,
-};
-
-struct platform_device s5pc100_device_spi1 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 1,
-	.num_resources	  = ARRAY_SIZE(s5pc100_spi1_resource),
-	.resource	  = s5pc100_spi1_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s5pc100_spi1_pdata,
-	},
-};
-
-static struct resource s5pc100_spi2_resource[] = {
-	[0] = {
-		.start = S5PC100_PA_SPI2,
-		.end   = S5PC100_PA_SPI2 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI2_TX,
-		.end   = DMACH_SPI2_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI2_RX,
-		.end   = DMACH_SPI2_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI2,
-		.end   = IRQ_SPI2,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5pc100_spi2_pdata = {
-	.cfg_gpio = s5pc100_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 13,
-	.high_speed = 1,
-};
-
-struct platform_device s5pc100_device_spi2 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 2,
-	.num_resources	  = ARRAY_SIZE(s5pc100_spi2_resource),
-	.resource	  = s5pc100_spi2_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s5pc100_spi2_pdata,
-	},
-};
-
-void __init s5pc100_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
-{
-	struct s3c64xx_spi_info *pd;
-
-	/* Reject invalid configuration */
-	if (!num_cs || src_clk_nr < 0
-			|| src_clk_nr > S5PC100_SPI_SRCCLK_SPIBUS) {
-		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
-		return;
-	}
-
-	switch (cntrlr) {
-	case 0:
-		pd = &s5pc100_spi0_pdata;
-		break;
-	case 1:
-		pd = &s5pc100_spi1_pdata;
-		break;
-	case 2:
-		pd = &s5pc100_spi2_pdata;
-		break;
-	default:
-		printk(KERN_ERR "%s: Invalid SPI controller(%d)\n",
-							__func__, cntrlr);
-		return;
-	}
-
-	pd->num_cs = num_cs;
-	pd->src_clk_nr = src_clk_nr;
-	pd->src_clk_name = spi_src_clks[src_clk_nr];
-}
diff --git a/arch/arm/mach-s5pv210/dev-spi.c b/arch/arm/mach-s5pv210/dev-spi.c
deleted file mode 100644
index e3249a4..0000000
--- a/arch/arm/mach-s5pv210/dev-spi.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/* linux/arch/arm/mach-s5pv210/dev-spi.c
- *
- * Copyright (C) 2010 Samsung Electronics Co. Ltd.
- *	Jaswinder Singh <jassi.brar@samsung.com>
- *
- * 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.
- */
-
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/gpio.h>
-
-#include <mach/dma.h>
-#include <mach/map.h>
-#include <mach/irqs.h>
-#include <mach/spi-clocks.h>
-
-#include <plat/s3c64xx-spi.h>
-#include <plat/gpio-cfg.h>
-
-static char *spi_src_clks[] = {
-	[S5PV210_SPI_SRCCLK_PCLK] = "pclk",
-	[S5PV210_SPI_SRCCLK_SCLK] = "sclk_spi",
-};
-
-/* SPI Controller platform_devices */
-
-/* Since we emulate multi-cs capability, we do not touch the CS.
- * The emulated CS is toggled by board specific mechanism, as it can
- * be either some immediate GPIO or some signal out of some other
- * chip in between ... or some yet another way.
- * We simply do not assume anything about CS.
- */
-static int s5pv210_spi_cfg_gpio(struct platform_device *pdev)
-{
-	unsigned int base;
-
-	switch (pdev->id) {
-	case 0:
-		base = S5PV210_GPB(0);
-		break;
-
-	case 1:
-		base = S5PV210_GPB(4);
-		break;
-
-	default:
-		dev_err(&pdev->dev, "Invalid SPI Controller number!");
-		return -EINVAL;
-	}
-
-	s3c_gpio_cfgall_range(base, 3,
-			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
-
-	return 0;
-}
-
-static struct resource s5pv210_spi0_resource[] = {
-	[0] = {
-		.start = S5PV210_PA_SPI0,
-		.end   = S5PV210_PA_SPI0 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI0_TX,
-		.end   = DMACH_SPI0_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI0_RX,
-		.end   = DMACH_SPI0_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI0,
-		.end   = IRQ_SPI0,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5pv210_spi0_pdata = {
-	.cfg_gpio = s5pv210_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x1ff,
-	.rx_lvl_offset = 15,
-	.high_speed = 1,
-};
-
-static u64 spi_dmamask = DMA_BIT_MASK(32);
-
-struct platform_device s5pv210_device_spi0 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 0,
-	.num_resources	  = ARRAY_SIZE(s5pv210_spi0_resource),
-	.resource	  = s5pv210_spi0_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s5pv210_spi0_pdata,
-	},
-};
-
-static struct resource s5pv210_spi1_resource[] = {
-	[0] = {
-		.start = S5PV210_PA_SPI1,
-		.end   = S5PV210_PA_SPI1 + 0x100 - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = DMACH_SPI1_TX,
-		.end   = DMACH_SPI1_TX,
-		.flags = IORESOURCE_DMA,
-	},
-	[2] = {
-		.start = DMACH_SPI1_RX,
-		.end   = DMACH_SPI1_RX,
-		.flags = IORESOURCE_DMA,
-	},
-	[3] = {
-		.start = IRQ_SPI1,
-		.end   = IRQ_SPI1,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct s3c64xx_spi_info s5pv210_spi1_pdata = {
-	.cfg_gpio = s5pv210_spi_cfg_gpio,
-	.fifo_lvl_mask = 0x7f,
-	.rx_lvl_offset = 15,
-	.high_speed = 1,
-};
-
-struct platform_device s5pv210_device_spi1 = {
-	.name		  = "s3c64xx-spi",
-	.id		  = 1,
-	.num_resources	  = ARRAY_SIZE(s5pv210_spi1_resource),
-	.resource	  = s5pv210_spi1_resource,
-	.dev = {
-		.dma_mask		= &spi_dmamask,
-		.coherent_dma_mask	= DMA_BIT_MASK(32),
-		.platform_data = &s5pv210_spi1_pdata,
-	},
-};
-
-void __init s5pv210_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
-{
-	struct s3c64xx_spi_info *pd;
-
-	/* Reject invalid configuration */
-	if (!num_cs || src_clk_nr < 0
-			|| src_clk_nr > S5PV210_SPI_SRCCLK_SCLK) {
-		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
-		return;
-	}
-
-	switch (cntrlr) {
-	case 0:
-		pd = &s5pv210_spi0_pdata;
-		break;
-	case 1:
-		pd = &s5pv210_spi1_pdata;
-		break;
-	default:
-		printk(KERN_ERR "%s: Invalid SPI controller(%d)\n",
-							__func__, cntrlr);
-		return;
-	}
-
-	pd->num_cs = num_cs;
-	pd->src_clk_nr = src_clk_nr;
-	pd->src_clk_name = spi_src_clks[src_clk_nr];
-}
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 4d79519..0feb5ed 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -258,11 +258,20 @@ config SAMSUNG_DEV_IDE
 	help
 	  Compile in platform device definitions for IDE
 
-config S3C64XX_DEV_SPI
+config SAMSUNG_DEV_SPI0
 	bool
 	help
-	  Compile in platform device definitions for S3C64XX's type
-	  SPI controllers.
+	  Compile in platform device definitions for SPI channel 0
+
+config SAMSUNG_DEV_SPI1
+	bool
+	help
+	  Compile in platform device definitions for SPI channel 1
+
+config SAMSUNG_DEV_SPI2
+	bool
+	help
+	  Compile in platform device definitions for SPI channel 2
 
 config SAMSUNG_DEV_TS
 	bool
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 53eb15b..f226283 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -53,6 +53,9 @@ obj-$(CONFIG_S3C_DEV_WDT)	+= dev-wdt.o
 obj-$(CONFIG_S3C_DEV_NAND)	+= dev-nand.o
 obj-$(CONFIG_S3C_DEV_ONENAND)	+= dev-onenand.o
 obj-$(CONFIG_S3C_DEV_RTC)	+= dev-rtc.o
+obj-$(CONFIG_SAMSUNG_DEV_SPI0)	+= dev-spi0.o
+obj-$(CONFIG_SAMSUNG_DEV_SPI1)	+= dev-spi1.o
+obj-$(CONFIG_SAMSUNG_DEV_SPI2)	+= dev-spi2.o
 
 obj-$(CONFIG_SAMSUNG_DEV_ADC)	+= dev-adc.o
 obj-$(CONFIG_SAMSUNG_DEV_IDE)	+= dev-ide.o
diff --git a/arch/arm/plat-samsung/dev-spi0.c b/arch/arm/plat-samsung/dev-spi0.c
new file mode 100644
index 0000000..3d2c8bf
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-spi0.c
@@ -0,0 +1,87 @@
+/* linux/arch/arm/plat-samsung/dev-spi0.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+
+#include <mach/dma.h>
+#include <mach/map.h>
+#include <mach/spi-clocks.h>
+#include <mach/irqs.h>
+
+#include <plat/s3c64xx-spi.h>
+#include <plat/devs.h>
+
+static struct resource s3c_spi0_resource[] = {
+	[0] = {
+		.start	= S3C_PA_SPI0,
+		.end	= S3C_PA_SPI0 + SZ_256 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= DMACH_SPI0_TX,
+		.end	= DMACH_SPI0_TX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[2] = {
+		.start	= DMACH_SPI0_RX,
+		.end	= DMACH_SPI0_RX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[3] = {
+		.start	= IRQ_SPI0,
+		.end	= IRQ_SPI0,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct s3c64xx_spi_info s3c_spi0_def_pdata = {
+	.cfg_gpio	= s3c_spi0_cfg_gpio,
+};
+
+static u64 spi_dmamask = DMA_BIT_MASK(32);
+
+struct platform_device s3c_device_spi0 = {
+	.name		= "s3c64xx-spi",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(s3c_spi0_resource),
+	.resource	= s3c_spi0_resource,
+	.dev = {
+		.dma_mask		= &spi_dmamask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+		.platform_data		= &s3c_spi0_def_pdata,
+	},
+};
+
+void __init s3c_spi0_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs)
+{
+	struct s3c64xx_spi_info *spi_info = &s3c_spi0_def_pdata;
+	if (NULL == pd) {
+		printk(KERN_ERR "%s: Need to pass platform data\n", __func__);
+		return;
+	}
+	spi_info->fifo_lvl_mask = pd->fifo_lvl_mask;
+	spi_info->rx_lvl_offset = pd->rx_lvl_offset;
+	/* Reject invalid configuration */
+	if (!num_cs || src_clk_nr < 0
+			|| src_clk_nr > ARRAY_SIZE(spi_src_clks)) {
+		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
+		return;
+	}
+	spi_info->num_cs = num_cs;
+	spi_info->src_clk_nr = src_clk_nr;
+	spi_info->src_clk_name = spi_src_clks[src_clk_nr];
+	if (pd->high_speed)
+		spi_info->high_speed = pd->high_speed;
+	if (pd->clk_from_cmu)
+		spi_info->clk_from_cmu = pd->clk_from_cmu;
+}
diff --git a/arch/arm/plat-samsung/dev-spi1.c b/arch/arm/plat-samsung/dev-spi1.c
new file mode 100644
index 0000000..2aaa251
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-spi1.c
@@ -0,0 +1,87 @@
+/* linux/arch/arm/plat-samsung/dev-spi1.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+
+#include <mach/dma.h>
+#include <mach/map.h>
+#include <mach/spi-clocks.h>
+#include <mach/irqs.h>
+
+#include <plat/s3c64xx-spi.h>
+#include <plat/devs.h>
+
+static struct resource s3c_spi1_resource[] = {
+	[0] = {
+		.start	= S3C_PA_SPI1,
+		.end	= S3C_PA_SPI1 + SZ_256 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= DMACH_SPI1_TX,
+		.end	= DMACH_SPI1_TX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[2] = {
+		.start	= DMACH_SPI1_RX,
+		.end	= DMACH_SPI1_RX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[3] = {
+		.start	= IRQ_SPI1,
+		.end	= IRQ_SPI1,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct s3c64xx_spi_info s3c_spi1_def_pdata = {
+	.cfg_gpio	= s3c_spi1_cfg_gpio,
+};
+
+static u64 spi_dmamask = DMA_BIT_MASK(32);
+
+struct platform_device s3c_device_spi1 = {
+	.name		= "s3c64xx-spi",
+	.id		= 1,
+	.num_resources	= ARRAY_SIZE(s3c_spi1_resource),
+	.resource	= s3c_spi1_resource,
+	.dev = {
+		.dma_mask		= &spi_dmamask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+		.platform_data		= &s3c_spi1_def_pdata,
+	},
+};
+
+void __init s3c_spi1_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs)
+{
+	struct s3c64xx_spi_info *spi_info = &s3c_spi1_def_pdata;
+	if (NULL == pd) {
+		printk(KERN_ERR "%s: Need to pass platform data\n", __func__);
+		return;
+	}
+	spi_info->fifo_lvl_mask = pd->fifo_lvl_mask;
+	spi_info->rx_lvl_offset = pd->rx_lvl_offset;
+	/* Reject invalid configuration */
+	if (!num_cs || src_clk_nr < 0
+			|| src_clk_nr > ARRAY_SIZE(spi_src_clks)) {
+		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
+		return;
+	}
+	spi_info->num_cs = num_cs;
+	spi_info->src_clk_nr = src_clk_nr;
+	spi_info->src_clk_name = spi_src_clks[src_clk_nr];
+	if (pd->high_speed)
+		spi_info->high_speed = pd->high_speed;
+	if (pd->clk_from_cmu)
+		spi_info->clk_from_cmu = pd->clk_from_cmu;
+}
diff --git a/arch/arm/plat-samsung/dev-spi2.c b/arch/arm/plat-samsung/dev-spi2.c
new file mode 100644
index 0000000..15218b5
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-spi2.c
@@ -0,0 +1,87 @@
+/* linux/arch/arm/plat-samsung/dev-spi2.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+
+#include <mach/dma.h>
+#include <mach/map.h>
+#include <mach/spi-clocks.h>
+#include <mach/irqs.h>
+
+#include <plat/s3c64xx-spi.h>
+#include <plat/devs.h>
+
+static struct resource s3c_spi2_resource[] = {
+	[0] = {
+		.start	= S3C_PA_SPI2,
+		.end	= S3C_PA_SPI2 + SZ_256 - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= DMACH_SPI2_TX,
+		.end	= DMACH_SPI2_TX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[2] = {
+		.start	= DMACH_SPI2_RX,
+		.end	= DMACH_SPI2_RX,
+		.flags	= IORESOURCE_DMA,
+	},
+	[3] = {
+		.start	= IRQ_SPI2,
+		.end	= IRQ_SPI2,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct s3c64xx_spi_info s3c_spi2_def_pdata = {
+	.cfg_gpio	= s3c_spi2_cfg_gpio,
+};
+
+static u64 spi_dmamask = DMA_BIT_MASK(32);
+
+struct platform_device s3c_device_spi2 = {
+	.name		= "s3c64xx-spi",
+	.id		= 2,
+	.num_resources	= ARRAY_SIZE(s3c_spi2_resource),
+	.resource	= s3c_spi2_resource,
+	.dev = {
+		.dma_mask		= &spi_dmamask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+		.platform_data		= &s3c_spi2_def_pdata,
+	},
+};
+
+void __init s3c_spi2_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs)
+{
+	struct s3c64xx_spi_info *spi_info = &s3c_spi2_def_pdata;
+	if (NULL == pd) {
+		printk(KERN_ERR "%s: Need to pass platform data\n", __func__);
+		return;
+	}
+	spi_info->fifo_lvl_mask = pd->fifo_lvl_mask;
+	spi_info->rx_lvl_offset = pd->rx_lvl_offset;
+	/* Reject invalid configuration */
+	if (!num_cs || src_clk_nr < 0
+			|| src_clk_nr > ARRAY_SIZE(spi_src_clks)) {
+		printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
+		return;
+	}
+	spi_info->num_cs = num_cs;
+	spi_info->src_clk_nr = src_clk_nr;
+	spi_info->src_clk_name = spi_src_clks[src_clk_nr];
+	if (pd->high_speed)
+		spi_info->high_speed = pd->high_speed;
+	if (pd->clk_from_cmu)
+		spi_info->clk_from_cmu = pd->clk_from_cmu;
+}
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index e3b31c2..96fc424 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -36,9 +36,6 @@ extern struct platform_device s3c64xx_device_iis0;
 extern struct platform_device s3c64xx_device_iis1;
 extern struct platform_device s3c64xx_device_iisv4;
 
-extern struct platform_device s3c64xx_device_spi0;
-extern struct platform_device s3c64xx_device_spi1;
-
 extern struct platform_device samsung_asoc_dma;
 
 extern struct platform_device s3c64xx_device_pcm0;
@@ -73,14 +70,7 @@ extern struct platform_device s3c_device_cfcon;
 
 extern struct platform_device s3c_device_spi0;
 extern struct platform_device s3c_device_spi1;
-
-extern struct platform_device s5pc100_device_spi0;
-extern struct platform_device s5pc100_device_spi1;
-extern struct platform_device s5pc100_device_spi2;
-extern struct platform_device s5pv210_device_spi0;
-extern struct platform_device s5pv210_device_spi1;
-extern struct platform_device s5p64x0_device_spi0;
-extern struct platform_device s5p64x0_device_spi1;
+extern struct platform_device s3c_device_spi2;
 
 extern struct platform_device s3c_device_hwmon;
 
diff --git a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
index 0ffe34a..b9f6a4b 100644
--- a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
+++ b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
@@ -56,18 +56,24 @@ struct s3c64xx_spi_info {
 };
 
 /**
- * s3c64xx_spi_set_info - SPI Controller configure callback by the board
+ * s3c_spi_set_info - SPI Controller configure callback by the board
  *				initialization code.
- * @cntrlr: SPI controller number the configuration is for.
  * @src_clk_nr: Clock the SPI controller is to use to generate SPI clocks.
  * @num_cs: Number of elements in the 'cs' array.
  *
  * Call this from machine init code for each SPI Controller that
  * has some chips attached to it.
  */
-extern void s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
-extern void s5pc100_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
-extern void s5pv210_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
-extern void s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
+extern void s3c_spi0_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs);
+extern void s3c_spi1_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs);
+extern void s3c_spi2_set_info(struct s3c64xx_spi_info *pd,
+				int src_clk_nr, int num_cs);
+
+/* defined by architecture to configure gpio */
+extern int s3c_spi0_cfg_gpio(struct platform_device *dev);
+extern int s3c_spi1_cfg_gpio(struct platform_device *dev);
+extern int s3c_spi2_cfg_gpio(struct platform_device *dev);
 
 #endif /* __S3C64XX_PLAT_SPI_H */
-- 
1.7.0.4

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

* [PATCH 2/7] ARM: SAMSUNG: Define common macro for SPI physical address
  2011-06-30 12:25 ` Padmavathi Venna
@ 2011-06-30 12:25   ` Padmavathi Venna
  -1 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: kgene.kim, jassisinghbrar, sbkim73, linux-samsung-soc, linux-arm-kernel

A common macro has been defined for SPI physical address as
SPI has been made common across all the S3C64xx and S5P series.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/mach-s3c64xx/include/mach/map.h |    2 ++
 arch/arm/mach-s5p64x0/include/mach/map.h |    2 ++
 arch/arm/mach-s5pc100/include/mach/map.h |    3 +++
 arch/arm/mach-s5pv210/include/mach/map.h |    2 ++
 4 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/include/mach/map.h b/arch/arm/mach-s3c64xx/include/mach/map.h
index a1f13f0..1082e2e 100644
--- a/arch/arm/mach-s3c64xx/include/mach/map.h
+++ b/arch/arm/mach-s3c64xx/include/mach/map.h
@@ -122,6 +122,8 @@
 #define S3C_VA_USB_HSPHY	S3C64XX_VA_USB_HSPHY
 #define S3C_PA_RTC		S3C64XX_PA_RTC
 #define S3C_PA_WDT		S3C64XX_PA_WATCHDOG
+#define S3C_PA_SPI0		S3C64XX_PA_SPI0
+#define S3C_PA_SPI1		S3C64XX_PA_SPI1
 
 #define SAMSUNG_PA_ADC		S3C64XX_PA_ADC
 #define SAMSUNG_PA_CFCON	S3C64XX_PA_CFCON
diff --git a/arch/arm/mach-s5p64x0/include/mach/map.h b/arch/arm/mach-s5p64x0/include/mach/map.h
index 95c9125..13f453c 100644
--- a/arch/arm/mach-s5p64x0/include/mach/map.h
+++ b/arch/arm/mach-s5p64x0/include/mach/map.h
@@ -64,6 +64,8 @@
 #define S3C_PA_IIC1		S5P6440_PA_IIC1
 #define S3C_PA_RTC		S5P64X0_PA_RTC
 #define S3C_PA_WDT		S5P64X0_PA_WDT
+#define S3C_PA_SPI0		S5P64X0_PA_SPI0
+#define S3C_PA_SPI1		S5P64X0_PA_SPI1
 
 #define S5P_PA_CHIPID		S5P64X0_PA_CHIPID
 #define S5P_PA_SROMC		S5P64X0_PA_SROMC
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h
index ccbe6b7..54bc4f8 100644
--- a/arch/arm/mach-s5pc100/include/mach/map.h
+++ b/arch/arm/mach-s5pc100/include/mach/map.h
@@ -100,6 +100,9 @@
 #define S3C_PA_USB_HSOTG		S5PC100_PA_USB_HSOTG
 #define S3C_PA_USB_HSPHY		S5PC100_PA_USB_HSPHY
 #define S3C_PA_WDT			S5PC100_PA_WATCHDOG
+#define S3C_PA_SPI0			S5PC100_PA_SPI0
+#define S3C_PA_SPI1			S5PC100_PA_SPI1
+#define S3C_PA_SPI2			S5PC100_PA_SPI2
 
 #define S5P_PA_CHIPID			S5PC100_PA_CHIPID
 #define S5P_PA_FIMC0			S5PC100_PA_FIMC0
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
index 1dd5883..3fdacfa 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -101,6 +101,8 @@
 #define S3C_PA_RTC			S5PV210_PA_RTC
 #define S3C_PA_USB_HSOTG		S5PV210_PA_HSOTG
 #define S3C_PA_WDT			S5PV210_PA_WATCHDOG
+#define S3C_PA_SPI0			S5PV210_PA_SPI0
+#define S3C_PA_SPI1			S5PV210_PA_SPI1
 
 #define S5P_PA_CHIPID			S5PV210_PA_CHIPID
 #define S5P_PA_FIMC0			S5PV210_PA_FIMC0
-- 
1.7.0.4

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

* [PATCH 2/7] ARM: SAMSUNG: Define common macro for SPI physical address
@ 2011-06-30 12:25   ` Padmavathi Venna
  0 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

A common macro has been defined for SPI physical address as
SPI has been made common across all the S3C64xx and S5P series.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/mach-s3c64xx/include/mach/map.h |    2 ++
 arch/arm/mach-s5p64x0/include/mach/map.h |    2 ++
 arch/arm/mach-s5pc100/include/mach/map.h |    3 +++
 arch/arm/mach-s5pv210/include/mach/map.h |    2 ++
 4 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/include/mach/map.h b/arch/arm/mach-s3c64xx/include/mach/map.h
index a1f13f0..1082e2e 100644
--- a/arch/arm/mach-s3c64xx/include/mach/map.h
+++ b/arch/arm/mach-s3c64xx/include/mach/map.h
@@ -122,6 +122,8 @@
 #define S3C_VA_USB_HSPHY	S3C64XX_VA_USB_HSPHY
 #define S3C_PA_RTC		S3C64XX_PA_RTC
 #define S3C_PA_WDT		S3C64XX_PA_WATCHDOG
+#define S3C_PA_SPI0		S3C64XX_PA_SPI0
+#define S3C_PA_SPI1		S3C64XX_PA_SPI1
 
 #define SAMSUNG_PA_ADC		S3C64XX_PA_ADC
 #define SAMSUNG_PA_CFCON	S3C64XX_PA_CFCON
diff --git a/arch/arm/mach-s5p64x0/include/mach/map.h b/arch/arm/mach-s5p64x0/include/mach/map.h
index 95c9125..13f453c 100644
--- a/arch/arm/mach-s5p64x0/include/mach/map.h
+++ b/arch/arm/mach-s5p64x0/include/mach/map.h
@@ -64,6 +64,8 @@
 #define S3C_PA_IIC1		S5P6440_PA_IIC1
 #define S3C_PA_RTC		S5P64X0_PA_RTC
 #define S3C_PA_WDT		S5P64X0_PA_WDT
+#define S3C_PA_SPI0		S5P64X0_PA_SPI0
+#define S3C_PA_SPI1		S5P64X0_PA_SPI1
 
 #define S5P_PA_CHIPID		S5P64X0_PA_CHIPID
 #define S5P_PA_SROMC		S5P64X0_PA_SROMC
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h
index ccbe6b7..54bc4f8 100644
--- a/arch/arm/mach-s5pc100/include/mach/map.h
+++ b/arch/arm/mach-s5pc100/include/mach/map.h
@@ -100,6 +100,9 @@
 #define S3C_PA_USB_HSOTG		S5PC100_PA_USB_HSOTG
 #define S3C_PA_USB_HSPHY		S5PC100_PA_USB_HSPHY
 #define S3C_PA_WDT			S5PC100_PA_WATCHDOG
+#define S3C_PA_SPI0			S5PC100_PA_SPI0
+#define S3C_PA_SPI1			S5PC100_PA_SPI1
+#define S3C_PA_SPI2			S5PC100_PA_SPI2
 
 #define S5P_PA_CHIPID			S5PC100_PA_CHIPID
 #define S5P_PA_FIMC0			S5PC100_PA_FIMC0
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
index 1dd5883..3fdacfa 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -101,6 +101,8 @@
 #define S3C_PA_RTC			S5PV210_PA_RTC
 #define S3C_PA_USB_HSOTG		S5PV210_PA_HSOTG
 #define S3C_PA_WDT			S5PV210_PA_WATCHDOG
+#define S3C_PA_SPI0			S5PV210_PA_SPI0
+#define S3C_PA_SPI1			S5PV210_PA_SPI1
 
 #define S5P_PA_CHIPID			S5PV210_PA_CHIPID
 #define S5P_PA_FIMC0			S5PV210_PA_FIMC0
-- 
1.7.0.4

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

* [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
  2011-06-30 12:25 ` Padmavathi Venna
@ 2011-06-30 12:25   ` Padmavathi Venna
  -1 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: kgene.kim, jassisinghbrar, sbkim73, linux-samsung-soc, linux-arm-kernel

SPI Clocks were defined in dev-spi.c of machine specific folder.
To make SPI devices common across all SoCs,dev-spi.c is moved
from machine specific folder to plat-samsung. So SPI clock
definitions has been moved from dev-spi.c to SoC specific machine
folder for S3C64XX,S5P64X0,S5PC100 and S5PV210

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/mach-s3c64xx/include/mach/spi-clocks.h |    6 ++++++
 arch/arm/mach-s5p64x0/include/mach/spi-clocks.h |    5 +++++
 arch/arm/mach-s5pc100/include/mach/spi-clocks.h |    6 ++++++
 arch/arm/mach-s5pv210/include/mach/spi-clocks.h |    5 +++++
 4 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h b/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h
index 9d0c43b..525f96b 100644
--- a/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h
+++ b/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h
@@ -15,4 +15,10 @@
 #define S3C64XX_SPI_SRCCLK_SPIBUS	1
 #define S3C64XX_SPI_SRCCLK_48M		2
 
+static char *spi_src_clks[] = {
+	[S3C64XX_SPI_SRCCLK_PCLK] = "pclk",
+	[S3C64XX_SPI_SRCCLK_SPIBUS] = "spi-bus",
+	[S3C64XX_SPI_SRCCLK_48M] = "spi_48m",
+};
+
 #endif /* __S3C64XX_PLAT_SPI_CLKS_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/spi-clocks.h b/arch/arm/mach-s5p64x0/include/mach/spi-clocks.h
index 170a20a..3995de1 100644
--- a/arch/arm/mach-s5p64x0/include/mach/spi-clocks.h
+++ b/arch/arm/mach-s5p64x0/include/mach/spi-clocks.h
@@ -17,4 +17,9 @@
 #define S5P64X0_SPI_SRCCLK_PCLK		0
 #define S5P64X0_SPI_SRCCLK_SCLK		1
 
+static char *spi_src_clks[] = {
+	[S5P64X0_SPI_SRCCLK_PCLK] = "pclk",
+	[S5P64X0_SPI_SRCCLK_SCLK] = "sclk_spi",
+};
+
 #endif /* __ASM_ARCH_SPI_CLKS_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/spi-clocks.h b/arch/arm/mach-s5pc100/include/mach/spi-clocks.h
index 65e4263..c182b02 100644
--- a/arch/arm/mach-s5pc100/include/mach/spi-clocks.h
+++ b/arch/arm/mach-s5pc100/include/mach/spi-clocks.h
@@ -15,4 +15,10 @@
 #define S5PC100_SPI_SRCCLK_48M		1
 #define S5PC100_SPI_SRCCLK_SPIBUS	2
 
+static char *spi_src_clks[] = {
+	[S5PC100_SPI_SRCCLK_PCLK] = "pclk",
+	[S5PC100_SPI_SRCCLK_48M] = "spi_48m",
+	[S5PC100_SPI_SRCCLK_SPIBUS] = "spi_bus",
+};
+
 #endif /* __S5PC100_PLAT_SPI_CLKS_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/spi-clocks.h b/arch/arm/mach-s5pv210/include/mach/spi-clocks.h
index 02acded..fa17815 100644
--- a/arch/arm/mach-s5pv210/include/mach/spi-clocks.h
+++ b/arch/arm/mach-s5pv210/include/mach/spi-clocks.h
@@ -14,4 +14,9 @@
 #define S5PV210_SPI_SRCCLK_PCLK		0
 #define S5PV210_SPI_SRCCLK_SCLK		1
 
+static char *spi_src_clks[] = {
+	[S5PV210_SPI_SRCCLK_PCLK] = "pclk",
+	[S5PV210_SPI_SRCCLK_SCLK] = "sclk_spi",
+};
+
 #endif /* __S5PV210_PLAT_SPI_CLKS_H */
-- 
1.7.0.4

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

* [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
@ 2011-06-30 12:25   ` Padmavathi Venna
  0 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

SPI Clocks were defined in dev-spi.c of machine specific folder.
To make SPI devices common across all SoCs,dev-spi.c is moved
from machine specific folder to plat-samsung. So SPI clock
definitions has been moved from dev-spi.c to SoC specific machine
folder for S3C64XX,S5P64X0,S5PC100 and S5PV210

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/mach-s3c64xx/include/mach/spi-clocks.h |    6 ++++++
 arch/arm/mach-s5p64x0/include/mach/spi-clocks.h |    5 +++++
 arch/arm/mach-s5pc100/include/mach/spi-clocks.h |    6 ++++++
 arch/arm/mach-s5pv210/include/mach/spi-clocks.h |    5 +++++
 4 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h b/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h
index 9d0c43b..525f96b 100644
--- a/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h
+++ b/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h
@@ -15,4 +15,10 @@
 #define S3C64XX_SPI_SRCCLK_SPIBUS	1
 #define S3C64XX_SPI_SRCCLK_48M		2
 
+static char *spi_src_clks[] = {
+	[S3C64XX_SPI_SRCCLK_PCLK] = "pclk",
+	[S3C64XX_SPI_SRCCLK_SPIBUS] = "spi-bus",
+	[S3C64XX_SPI_SRCCLK_48M] = "spi_48m",
+};
+
 #endif /* __S3C64XX_PLAT_SPI_CLKS_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/spi-clocks.h b/arch/arm/mach-s5p64x0/include/mach/spi-clocks.h
index 170a20a..3995de1 100644
--- a/arch/arm/mach-s5p64x0/include/mach/spi-clocks.h
+++ b/arch/arm/mach-s5p64x0/include/mach/spi-clocks.h
@@ -17,4 +17,9 @@
 #define S5P64X0_SPI_SRCCLK_PCLK		0
 #define S5P64X0_SPI_SRCCLK_SCLK		1
 
+static char *spi_src_clks[] = {
+	[S5P64X0_SPI_SRCCLK_PCLK] = "pclk",
+	[S5P64X0_SPI_SRCCLK_SCLK] = "sclk_spi",
+};
+
 #endif /* __ASM_ARCH_SPI_CLKS_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/spi-clocks.h b/arch/arm/mach-s5pc100/include/mach/spi-clocks.h
index 65e4263..c182b02 100644
--- a/arch/arm/mach-s5pc100/include/mach/spi-clocks.h
+++ b/arch/arm/mach-s5pc100/include/mach/spi-clocks.h
@@ -15,4 +15,10 @@
 #define S5PC100_SPI_SRCCLK_48M		1
 #define S5PC100_SPI_SRCCLK_SPIBUS	2
 
+static char *spi_src_clks[] = {
+	[S5PC100_SPI_SRCCLK_PCLK] = "pclk",
+	[S5PC100_SPI_SRCCLK_48M] = "spi_48m",
+	[S5PC100_SPI_SRCCLK_SPIBUS] = "spi_bus",
+};
+
 #endif /* __S5PC100_PLAT_SPI_CLKS_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/spi-clocks.h b/arch/arm/mach-s5pv210/include/mach/spi-clocks.h
index 02acded..fa17815 100644
--- a/arch/arm/mach-s5pv210/include/mach/spi-clocks.h
+++ b/arch/arm/mach-s5pv210/include/mach/spi-clocks.h
@@ -14,4 +14,9 @@
 #define S5PV210_SPI_SRCCLK_PCLK		0
 #define S5PV210_SPI_SRCCLK_SCLK		1
 
+static char *spi_src_clks[] = {
+	[S5PV210_SPI_SRCCLK_PCLK] = "pclk",
+	[S5PV210_SPI_SRCCLK_SCLK] = "sclk_spi",
+};
+
 #endif /* __S5PV210_PLAT_SPI_CLKS_H */
-- 
1.7.0.4

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

* [PATCH 4/7] ARM: SAMSUNG: Create SPI device setup files in respective machine folder
  2011-06-30 12:25 ` Padmavathi Venna
@ 2011-06-30 12:25   ` Padmavathi Venna
  -1 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: kgene.kim, jassisinghbrar, sbkim73, linux-samsung-soc, linux-arm-kernel

SPI device specific setup files are created for S3C64XX,S5P64X0,S5PC100
and S5PV210 to configure the GPIO pins corresponding to specific SoC.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/mach-s3c64xx/Kconfig      |   14 ++++++++++++++
 arch/arm/mach-s3c64xx/Makefile     |    3 ++-
 arch/arm/mach-s3c64xx/setup-spi0.c |   21 +++++++++++++++++++++
 arch/arm/mach-s3c64xx/setup-spi1.c |   21 +++++++++++++++++++++
 arch/arm/mach-s5p64x0/Kconfig      |   20 ++++++++++++++++++--
 arch/arm/mach-s5p64x0/Makefile     |    3 ++-
 arch/arm/mach-s5p64x0/setup-spi0.c |   31 +++++++++++++++++++++++++++++++
 arch/arm/mach-s5p64x0/setup-spi1.c |   31 +++++++++++++++++++++++++++++++
 arch/arm/mach-s5pc100/Kconfig      |   21 +++++++++++++++++++++
 arch/arm/mach-s5pc100/Makefile     |    4 +++-
 arch/arm/mach-s5pc100/setup-spi0.c |   21 +++++++++++++++++++++
 arch/arm/mach-s5pc100/setup-spi1.c |   21 +++++++++++++++++++++
 arch/arm/mach-s5pc100/setup-spi2.c |   23 +++++++++++++++++++++++
 arch/arm/mach-s5pv210/Kconfig      |   14 ++++++++++++++
 arch/arm/mach-s5pv210/Makefile     |    3 ++-
 arch/arm/mach-s5pv210/setup-spi0.c |   23 +++++++++++++++++++++++
 arch/arm/mach-s5pv210/setup-spi1.c |   23 +++++++++++++++++++++++
 17 files changed, 291 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/mach-s3c64xx/setup-spi0.c
 create mode 100644 arch/arm/mach-s3c64xx/setup-spi1.c
 create mode 100644 arch/arm/mach-s5p64x0/setup-spi0.c
 create mode 100644 arch/arm/mach-s5p64x0/setup-spi1.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi0.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi1.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi2.c
 create mode 100644 arch/arm/mach-s5pv210/setup-spi0.c
 create mode 100644 arch/arm/mach-s5pv210/setup-spi1.c

diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 4e2c371..d2acce0 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -77,6 +77,16 @@ config S3C64XX_SETUP_SDHCI_GPIO
 	help
 	  Common setup code for S3C64XX SDHCI GPIO configurations
 
+config S3C64XX_SETUP_SPI0
+	bool
+	help
+	  Common setup code for SPI channel 0
+
+config S3C64XX_SETUP_SPI1
+	bool
+	help
+	  Common setup code for SPI channel 1
+
 # S36400 Macchine support
 
 config MACH_SMDK6400
@@ -142,6 +152,8 @@ config MACH_SMDK6410
 	select S3C_DEV_USB_HOST
 	select S3C_DEV_USB_HSOTG
 	select S3C_DEV_WDT
+	select SAMSUNG_DEV_SPI0
+	select SAMSUNG_DEV_SPI1
 	select SAMSUNG_DEV_KEYPAD
 	select SAMSUNG_DEV_PWM
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@ -150,6 +162,8 @@ config MACH_SMDK6410
 	select S3C64XX_SETUP_IDE
 	select S3C64XX_SETUP_FB_24BPP
 	select S3C64XX_SETUP_KEYPAD
+	select S3C64XX_SETUP_SPI0
+	select S3C64XX_SETUP_SPI1
 	help
 	  Machine support for the Samsung SMDK6410
 
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index 88d7fd2..f3d2f81 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -40,6 +40,8 @@ obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o
 obj-$(CONFIG_S3C64XX_SETUP_SDHCI) += setup-sdhci.o
 obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
 obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
+obj-$(CONFIG_S3C64XX_SETUP_SPI0) += setup-spi0.o
+obj-$(CONFIG_S3C64XX_SETUP_SPI1) += setup-spi1.o
 
 # PM
 
@@ -65,6 +67,5 @@ obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o
 
 obj-y				+= dev-uart.o
 obj-y				+= dev-audio.o
-obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
 obj-$(CONFIG_S3C64XX_DEV_TS)	+= dev-ts.o
 obj-$(CONFIG_S3C64XX_DEV_ONENAND1)	+= dev-onenand1.o
diff --git a/arch/arm/mach-s3c64xx/setup-spi0.c b/arch/arm/mach-s3c64xx/setup-spi0.c
new file mode 100644
index 0000000..bdf881d
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/setup-spi0.c
@@ -0,0 +1,21 @@
+/* linux/arch/arm/mach-s3c64xx/setup-spi0.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi0_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgall_range(S3C64XX_GPC(0), 3,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s3c64xx/setup-spi1.c b/arch/arm/mach-s3c64xx/setup-spi1.c
new file mode 100644
index 0000000..3d8acad
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/setup-spi1.c
@@ -0,0 +1,21 @@
+/* linux/arch/arm/mach-s3c64xx/setup-spi1.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi1_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgall_range(S3C64XX_GPC(4), 3,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 017af4c..6f3ac6f 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -26,6 +26,16 @@ config S5P64X0_SETUP_I2C1
 	help
 	  Common setup code for i2c bus 1.
 
+config S5P64X0_SETUP_SPI0
+	bool
+	help
+	  Common setup code for SPI channel 0
+
+config S5P64X0_SETUP_SPI1
+	bool
+	help
+	  Common setup code for SPI channel 1
+
 # machine support
 
 config MACH_SMDK6440
@@ -34,11 +44,14 @@ config MACH_SMDK6440
 	select S3C_DEV_I2C1
 	select S3C_DEV_RTC
 	select S3C_DEV_WDT
-	select S3C64XX_DEV_SPI
+	select SAMSUNG_DEV_SPI0
+	select SAMSUNG_DEV_SPI1
 	select SAMSUNG_DEV_ADC
 	select SAMSUNG_DEV_PWM
 	select SAMSUNG_DEV_TS
 	select S5P64X0_SETUP_I2C1
+	select S5P64X0_SETUP_SPI0
+	select S5P64X0_SETUP_SPI1
 	help
 	  Machine support for the Samsung SMDK6440
 
@@ -48,11 +61,14 @@ config MACH_SMDK6450
 	select S3C_DEV_I2C1
 	select S3C_DEV_RTC
 	select S3C_DEV_WDT
-	select S3C64XX_DEV_SPI
+	select SAMSUNG_DEV_SPI0
+	select SAMSUNG_DEV_SPI1
 	select SAMSUNG_DEV_ADC
 	select SAMSUNG_DEV_PWM
 	select SAMSUNG_DEV_TS
 	select S5P64X0_SETUP_I2C1
+	select S5P64X0_SETUP_SPI0
+	select S5P64X0_SETUP_SPI1
 	help
 	  Machine support for the Samsung SMDK6450
 
diff --git a/arch/arm/mach-s5p64x0/Makefile b/arch/arm/mach-s5p64x0/Makefile
index ae6bf6f..4af3b11 100644
--- a/arch/arm/mach-s5p64x0/Makefile
+++ b/arch/arm/mach-s5p64x0/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_MACH_SMDK6450)	+= mach-smdk6450.o
 # device support
 
 obj-y				+= dev-audio.o
-obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
 
 obj-$(CONFIG_S5P64X0_SETUP_I2C1)	+= setup-i2c1.o
+obj-$(CONFIG_S5P64X0_SETUP_SPI0)	+= setup-spi0.o
+obj-$(CONFIG_S5P64X0_SETUP_SPI1)	+= setup-spi1.o
diff --git a/arch/arm/mach-s5p64x0/setup-spi0.c b/arch/arm/mach-s5p64x0/setup-spi0.c
new file mode 100644
index 0000000..aa8db6a
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/setup-spi0.c
@@ -0,0 +1,31 @@
+/* linux/arch/arm/mach-s5p64x0/setup-spi0.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/io.h>
+
+#include <plat/gpio-cfg.h>
+
+#include <mach/regs-clock.h>
+
+int s3c_spi0_cfg_gpio(struct platform_device *dev)
+{
+	unsigned int id;
+	id = __raw_readl(S5P64X0_SYS_ID) & 0xFF000;
+
+	if (id == 0x50000)
+		s3c_gpio_cfgall_range(S5P6450_GPC(0), 3,
+					S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	else
+		s3c_gpio_cfgall_range(S5P6440_GPC(0), 3,
+					S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5p64x0/setup-spi1.c b/arch/arm/mach-s5p64x0/setup-spi1.c
new file mode 100644
index 0000000..44cef48
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/setup-spi1.c
@@ -0,0 +1,31 @@
+/* linux/arch/arm/mach-s5p64x0/setup-spi1.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/io.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+#include <mach/regs-clock.h>
+
+int s3c_spi1_cfg_gpio(struct platform_device *dev)
+{
+	unsigned int id;
+	id = __raw_readl(S5P64X0_SYS_ID) & 0xFF000;
+
+	if (id == 0x50000)
+		s3c_gpio_cfgall_range(S5P6450_GPC(4), 3,
+					S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	else
+		s3c_gpio_cfgall_range(S5P6440_GPC(4), 3,
+					S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 608722f..eac5dc9 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -45,6 +45,21 @@ config S5PC100_SETUP_SDHCI_GPIO
 	help
 	  Common setup code for SDHCI gpio.
 
+config S5PC100_SETUP_SPI0
+	bool
+	help
+	  Common setup code for SPI channel 0
+
+config S5PC100_SETUP_SPI1
+	bool
+	help
+	  Common setup code for SPI channel 1
+
+config S5PC100_SETUP_SPI2
+	bool
+	help
+	  Common setup code for SPI channel 2
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
@@ -55,6 +70,9 @@ config MACH_SMDKC100
 	select S3C_DEV_I2C1
 	select S3C_DEV_RTC
 	select S3C_DEV_WDT
+	select SAMSUNG_DEV_SPI0
+	select SAMSUNG_DEV_SPI1
+	select SAMSUNG_DEV_SPI2
 	select SAMSUNG_DEV_ADC
 	select SAMSUNG_DEV_IDE
 	select SAMSUNG_DEV_KEYPAD
@@ -65,6 +83,9 @@ config MACH_SMDKC100
 	select S5PC100_SETUP_IDE
 	select S5PC100_SETUP_KEYPAD
 	select S5PC100_SETUP_SDHCI
+	select S5PC100_SETUP_SPI0
+	select S5PC100_SETUP_SPI1
+	select S5PC100_SETUP_SPI2
 	select S5P_DEV_FIMC0
 	select S5P_DEV_FIMC1
 	select S5P_DEV_FIMC2
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index a5e6e60..76052ca 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -23,10 +23,12 @@ obj-$(CONFIG_S5PC100_SETUP_IDE)		+= setup-ide.o
 obj-$(CONFIG_S5PC100_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PC100_SETUP_SDHCI)	+= setup-sdhci.o
 obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
+obj-$(CONFIG_S5PC100_SETUP_SPI0)	+= setup-spi0.o
+obj-$(CONFIG_S5PC100_SETUP_SPI1)	+= setup-spi1.o
+obj-$(CONFIG_S5PC100_SETUP_SPI2)	+= setup-spi2.o
 
 # device support
 obj-y				+= dev-audio.o
-obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
 
 # machine support
 
diff --git a/arch/arm/mach-s5pc100/setup-spi0.c b/arch/arm/mach-s5pc100/setup-spi0.c
new file mode 100644
index 0000000..05882e9
--- /dev/null
+++ b/arch/arm/mach-s5pc100/setup-spi0.c
@@ -0,0 +1,21 @@
+/* linux/arch/arm/mach-s5pc100/setup-spi0.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi0_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgall_range(S5PC100_GPB(0), 3,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5pc100/setup-spi1.c b/arch/arm/mach-s5pc100/setup-spi1.c
new file mode 100644
index 0000000..b567f34
--- /dev/null
+++ b/arch/arm/mach-s5pc100/setup-spi1.c
@@ -0,0 +1,21 @@
+/* linux/arch/arm/mach-s5pc100/setup-spi1.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi1_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgall_range(S5PC100_GPB(4), 3,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5pc100/setup-spi2.c b/arch/arm/mach-s5pc100/setup-spi2.c
new file mode 100644
index 0000000..54c29e3
--- /dev/null
+++ b/arch/arm/mach-s5pc100/setup-spi2.c
@@ -0,0 +1,23 @@
+/* linux/arch/arm/mach-s5pc100/setup-spi2.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi2_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(3));
+	s3c_gpio_setpull(S5PC100_GPG3(0), S3C_GPIO_PULL_UP);
+	s3c_gpio_cfgall_range(S5PC100_GPB(2), 2,
+				S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 37b5a97..59879ee 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -59,6 +59,16 @@ config S5PV210_SETUP_FIMC
 	help
 	  Common setup code for the camera interfaces.
 
+config S5PV210_SETUP_SPI0
+	bool
+	help
+	  Common setup code for SPI channel 0
+
+config S5PV210_SETUP_SPI1
+	bool
+	help
+	  Common setup code for SPI channel 1
+
 menu "S5PC110 Machines"
 
 config MACH_AQUILA
@@ -138,12 +148,16 @@ config MACH_SMDKV210
 	select SAMSUNG_DEV_KEYPAD
 	select SAMSUNG_DEV_PWM
 	select SAMSUNG_DEV_TS
+	select SAMSUNG_DEV_SPI0
+	select SAMSUNG_DEV_SPI1
 	select S5PV210_SETUP_FB_24BPP
 	select S5PV210_SETUP_I2C1
 	select S5PV210_SETUP_I2C2
 	select S5PV210_SETUP_IDE
 	select S5PV210_SETUP_KEYPAD
 	select S5PV210_SETUP_SDHCI
+	select S5PV210_SETUP_SPI0
+	select S5PV210_SETUP_SPI1
 	help
 	  Machine support for Samsung SMDKV210
 
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 50907ac..283b04b 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -28,7 +28,6 @@ obj-$(CONFIG_MACH_TORBRECK)	+= mach-torbreck.o
 # device support
 
 obj-y				+= dev-audio.o
-obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
 
 obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
 obj-$(CONFIG_S5PV210_SETUP_FIMC)	+= setup-fimc.o
@@ -38,3 +37,5 @@ obj-$(CONFIG_S5PV210_SETUP_IDE)		+= setup-ide.o
 obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
+obj-$(CONFIG_S5PV210_SETUP_SPI0)	+= setup-spi0.o
+obj-$(CONFIG_S5PV210_SETUP_SPI1)	+= setup-spi1.o
diff --git a/arch/arm/mach-s5pv210/setup-spi0.c b/arch/arm/mach-s5pv210/setup-spi0.c
new file mode 100644
index 0000000..7c3256b
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-spi0.c
@@ -0,0 +1,23 @@
+/* linux/arch/arm/mach-s5pv210/setup-spi0.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi0_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgpin(S5PV210_GPB(0), S3C_GPIO_SFN(2));
+	s3c_gpio_setpull(S5PV210_GPB(0), S3C_GPIO_PULL_UP);
+	s3c_gpio_cfgall_range(S5PV210_GPB(2), 2,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5pv210/setup-spi1.c b/arch/arm/mach-s5pv210/setup-spi1.c
new file mode 100644
index 0000000..b22e56e
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-spi1.c
@@ -0,0 +1,23 @@
+/* linux/arch/arm/mach-s5pv210/setup-spi1.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi1_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgpin(S5PV210_GPB(4), S3C_GPIO_SFN(2));
+	s3c_gpio_setpull(S5PV210_GPB(4), S3C_GPIO_PULL_UP);
+	s3c_gpio_cfgall_range(S5PV210_GPB(6), 2,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
-- 
1.7.0.4

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

* [PATCH 4/7] ARM: SAMSUNG: Create SPI device setup files in respective machine folder
@ 2011-06-30 12:25   ` Padmavathi Venna
  0 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

SPI device specific setup files are created for S3C64XX,S5P64X0,S5PC100
and S5PV210 to configure the GPIO pins corresponding to specific SoC.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/mach-s3c64xx/Kconfig      |   14 ++++++++++++++
 arch/arm/mach-s3c64xx/Makefile     |    3 ++-
 arch/arm/mach-s3c64xx/setup-spi0.c |   21 +++++++++++++++++++++
 arch/arm/mach-s3c64xx/setup-spi1.c |   21 +++++++++++++++++++++
 arch/arm/mach-s5p64x0/Kconfig      |   20 ++++++++++++++++++--
 arch/arm/mach-s5p64x0/Makefile     |    3 ++-
 arch/arm/mach-s5p64x0/setup-spi0.c |   31 +++++++++++++++++++++++++++++++
 arch/arm/mach-s5p64x0/setup-spi1.c |   31 +++++++++++++++++++++++++++++++
 arch/arm/mach-s5pc100/Kconfig      |   21 +++++++++++++++++++++
 arch/arm/mach-s5pc100/Makefile     |    4 +++-
 arch/arm/mach-s5pc100/setup-spi0.c |   21 +++++++++++++++++++++
 arch/arm/mach-s5pc100/setup-spi1.c |   21 +++++++++++++++++++++
 arch/arm/mach-s5pc100/setup-spi2.c |   23 +++++++++++++++++++++++
 arch/arm/mach-s5pv210/Kconfig      |   14 ++++++++++++++
 arch/arm/mach-s5pv210/Makefile     |    3 ++-
 arch/arm/mach-s5pv210/setup-spi0.c |   23 +++++++++++++++++++++++
 arch/arm/mach-s5pv210/setup-spi1.c |   23 +++++++++++++++++++++++
 17 files changed, 291 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/mach-s3c64xx/setup-spi0.c
 create mode 100644 arch/arm/mach-s3c64xx/setup-spi1.c
 create mode 100644 arch/arm/mach-s5p64x0/setup-spi0.c
 create mode 100644 arch/arm/mach-s5p64x0/setup-spi1.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi0.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi1.c
 create mode 100644 arch/arm/mach-s5pc100/setup-spi2.c
 create mode 100644 arch/arm/mach-s5pv210/setup-spi0.c
 create mode 100644 arch/arm/mach-s5pv210/setup-spi1.c

diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 4e2c371..d2acce0 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -77,6 +77,16 @@ config S3C64XX_SETUP_SDHCI_GPIO
 	help
 	  Common setup code for S3C64XX SDHCI GPIO configurations
 
+config S3C64XX_SETUP_SPI0
+	bool
+	help
+	  Common setup code for SPI channel 0
+
+config S3C64XX_SETUP_SPI1
+	bool
+	help
+	  Common setup code for SPI channel 1
+
 # S36400 Macchine support
 
 config MACH_SMDK6400
@@ -142,6 +152,8 @@ config MACH_SMDK6410
 	select S3C_DEV_USB_HOST
 	select S3C_DEV_USB_HSOTG
 	select S3C_DEV_WDT
+	select SAMSUNG_DEV_SPI0
+	select SAMSUNG_DEV_SPI1
 	select SAMSUNG_DEV_KEYPAD
 	select SAMSUNG_DEV_PWM
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@ -150,6 +162,8 @@ config MACH_SMDK6410
 	select S3C64XX_SETUP_IDE
 	select S3C64XX_SETUP_FB_24BPP
 	select S3C64XX_SETUP_KEYPAD
+	select S3C64XX_SETUP_SPI0
+	select S3C64XX_SETUP_SPI1
 	help
 	  Machine support for the Samsung SMDK6410
 
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index 88d7fd2..f3d2f81 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -40,6 +40,8 @@ obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o
 obj-$(CONFIG_S3C64XX_SETUP_SDHCI) += setup-sdhci.o
 obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
 obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
+obj-$(CONFIG_S3C64XX_SETUP_SPI0) += setup-spi0.o
+obj-$(CONFIG_S3C64XX_SETUP_SPI1) += setup-spi1.o
 
 # PM
 
@@ -65,6 +67,5 @@ obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o
 
 obj-y				+= dev-uart.o
 obj-y				+= dev-audio.o
-obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
 obj-$(CONFIG_S3C64XX_DEV_TS)	+= dev-ts.o
 obj-$(CONFIG_S3C64XX_DEV_ONENAND1)	+= dev-onenand1.o
diff --git a/arch/arm/mach-s3c64xx/setup-spi0.c b/arch/arm/mach-s3c64xx/setup-spi0.c
new file mode 100644
index 0000000..bdf881d
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/setup-spi0.c
@@ -0,0 +1,21 @@
+/* linux/arch/arm/mach-s3c64xx/setup-spi0.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi0_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgall_range(S3C64XX_GPC(0), 3,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s3c64xx/setup-spi1.c b/arch/arm/mach-s3c64xx/setup-spi1.c
new file mode 100644
index 0000000..3d8acad
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/setup-spi1.c
@@ -0,0 +1,21 @@
+/* linux/arch/arm/mach-s3c64xx/setup-spi1.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi1_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgall_range(S3C64XX_GPC(4), 3,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 017af4c..6f3ac6f 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -26,6 +26,16 @@ config S5P64X0_SETUP_I2C1
 	help
 	  Common setup code for i2c bus 1.
 
+config S5P64X0_SETUP_SPI0
+	bool
+	help
+	  Common setup code for SPI channel 0
+
+config S5P64X0_SETUP_SPI1
+	bool
+	help
+	  Common setup code for SPI channel 1
+
 # machine support
 
 config MACH_SMDK6440
@@ -34,11 +44,14 @@ config MACH_SMDK6440
 	select S3C_DEV_I2C1
 	select S3C_DEV_RTC
 	select S3C_DEV_WDT
-	select S3C64XX_DEV_SPI
+	select SAMSUNG_DEV_SPI0
+	select SAMSUNG_DEV_SPI1
 	select SAMSUNG_DEV_ADC
 	select SAMSUNG_DEV_PWM
 	select SAMSUNG_DEV_TS
 	select S5P64X0_SETUP_I2C1
+	select S5P64X0_SETUP_SPI0
+	select S5P64X0_SETUP_SPI1
 	help
 	  Machine support for the Samsung SMDK6440
 
@@ -48,11 +61,14 @@ config MACH_SMDK6450
 	select S3C_DEV_I2C1
 	select S3C_DEV_RTC
 	select S3C_DEV_WDT
-	select S3C64XX_DEV_SPI
+	select SAMSUNG_DEV_SPI0
+	select SAMSUNG_DEV_SPI1
 	select SAMSUNG_DEV_ADC
 	select SAMSUNG_DEV_PWM
 	select SAMSUNG_DEV_TS
 	select S5P64X0_SETUP_I2C1
+	select S5P64X0_SETUP_SPI0
+	select S5P64X0_SETUP_SPI1
 	help
 	  Machine support for the Samsung SMDK6450
 
diff --git a/arch/arm/mach-s5p64x0/Makefile b/arch/arm/mach-s5p64x0/Makefile
index ae6bf6f..4af3b11 100644
--- a/arch/arm/mach-s5p64x0/Makefile
+++ b/arch/arm/mach-s5p64x0/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_MACH_SMDK6450)	+= mach-smdk6450.o
 # device support
 
 obj-y				+= dev-audio.o
-obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
 
 obj-$(CONFIG_S5P64X0_SETUP_I2C1)	+= setup-i2c1.o
+obj-$(CONFIG_S5P64X0_SETUP_SPI0)	+= setup-spi0.o
+obj-$(CONFIG_S5P64X0_SETUP_SPI1)	+= setup-spi1.o
diff --git a/arch/arm/mach-s5p64x0/setup-spi0.c b/arch/arm/mach-s5p64x0/setup-spi0.c
new file mode 100644
index 0000000..aa8db6a
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/setup-spi0.c
@@ -0,0 +1,31 @@
+/* linux/arch/arm/mach-s5p64x0/setup-spi0.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/io.h>
+
+#include <plat/gpio-cfg.h>
+
+#include <mach/regs-clock.h>
+
+int s3c_spi0_cfg_gpio(struct platform_device *dev)
+{
+	unsigned int id;
+	id = __raw_readl(S5P64X0_SYS_ID) & 0xFF000;
+
+	if (id == 0x50000)
+		s3c_gpio_cfgall_range(S5P6450_GPC(0), 3,
+					S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	else
+		s3c_gpio_cfgall_range(S5P6440_GPC(0), 3,
+					S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5p64x0/setup-spi1.c b/arch/arm/mach-s5p64x0/setup-spi1.c
new file mode 100644
index 0000000..44cef48
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/setup-spi1.c
@@ -0,0 +1,31 @@
+/* linux/arch/arm/mach-s5p64x0/setup-spi1.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/io.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+#include <mach/regs-clock.h>
+
+int s3c_spi1_cfg_gpio(struct platform_device *dev)
+{
+	unsigned int id;
+	id = __raw_readl(S5P64X0_SYS_ID) & 0xFF000;
+
+	if (id == 0x50000)
+		s3c_gpio_cfgall_range(S5P6450_GPC(4), 3,
+					S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	else
+		s3c_gpio_cfgall_range(S5P6440_GPC(4), 3,
+					S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 608722f..eac5dc9 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -45,6 +45,21 @@ config S5PC100_SETUP_SDHCI_GPIO
 	help
 	  Common setup code for SDHCI gpio.
 
+config S5PC100_SETUP_SPI0
+	bool
+	help
+	  Common setup code for SPI channel 0
+
+config S5PC100_SETUP_SPI1
+	bool
+	help
+	  Common setup code for SPI channel 1
+
+config S5PC100_SETUP_SPI2
+	bool
+	help
+	  Common setup code for SPI channel 2
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
@@ -55,6 +70,9 @@ config MACH_SMDKC100
 	select S3C_DEV_I2C1
 	select S3C_DEV_RTC
 	select S3C_DEV_WDT
+	select SAMSUNG_DEV_SPI0
+	select SAMSUNG_DEV_SPI1
+	select SAMSUNG_DEV_SPI2
 	select SAMSUNG_DEV_ADC
 	select SAMSUNG_DEV_IDE
 	select SAMSUNG_DEV_KEYPAD
@@ -65,6 +83,9 @@ config MACH_SMDKC100
 	select S5PC100_SETUP_IDE
 	select S5PC100_SETUP_KEYPAD
 	select S5PC100_SETUP_SDHCI
+	select S5PC100_SETUP_SPI0
+	select S5PC100_SETUP_SPI1
+	select S5PC100_SETUP_SPI2
 	select S5P_DEV_FIMC0
 	select S5P_DEV_FIMC1
 	select S5P_DEV_FIMC2
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index a5e6e60..76052ca 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -23,10 +23,12 @@ obj-$(CONFIG_S5PC100_SETUP_IDE)		+= setup-ide.o
 obj-$(CONFIG_S5PC100_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PC100_SETUP_SDHCI)	+= setup-sdhci.o
 obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
+obj-$(CONFIG_S5PC100_SETUP_SPI0)	+= setup-spi0.o
+obj-$(CONFIG_S5PC100_SETUP_SPI1)	+= setup-spi1.o
+obj-$(CONFIG_S5PC100_SETUP_SPI2)	+= setup-spi2.o
 
 # device support
 obj-y				+= dev-audio.o
-obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
 
 # machine support
 
diff --git a/arch/arm/mach-s5pc100/setup-spi0.c b/arch/arm/mach-s5pc100/setup-spi0.c
new file mode 100644
index 0000000..05882e9
--- /dev/null
+++ b/arch/arm/mach-s5pc100/setup-spi0.c
@@ -0,0 +1,21 @@
+/* linux/arch/arm/mach-s5pc100/setup-spi0.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi0_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgall_range(S5PC100_GPB(0), 3,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5pc100/setup-spi1.c b/arch/arm/mach-s5pc100/setup-spi1.c
new file mode 100644
index 0000000..b567f34
--- /dev/null
+++ b/arch/arm/mach-s5pc100/setup-spi1.c
@@ -0,0 +1,21 @@
+/* linux/arch/arm/mach-s5pc100/setup-spi1.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi1_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgall_range(S5PC100_GPB(4), 3,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5pc100/setup-spi2.c b/arch/arm/mach-s5pc100/setup-spi2.c
new file mode 100644
index 0000000..54c29e3
--- /dev/null
+++ b/arch/arm/mach-s5pc100/setup-spi2.c
@@ -0,0 +1,23 @@
+/* linux/arch/arm/mach-s5pc100/setup-spi2.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi2_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgpin(S5PC100_GPG3(0), S3C_GPIO_SFN(3));
+	s3c_gpio_setpull(S5PC100_GPG3(0), S3C_GPIO_PULL_UP);
+	s3c_gpio_cfgall_range(S5PC100_GPB(2), 2,
+				S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 37b5a97..59879ee 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -59,6 +59,16 @@ config S5PV210_SETUP_FIMC
 	help
 	  Common setup code for the camera interfaces.
 
+config S5PV210_SETUP_SPI0
+	bool
+	help
+	  Common setup code for SPI channel 0
+
+config S5PV210_SETUP_SPI1
+	bool
+	help
+	  Common setup code for SPI channel 1
+
 menu "S5PC110 Machines"
 
 config MACH_AQUILA
@@ -138,12 +148,16 @@ config MACH_SMDKV210
 	select SAMSUNG_DEV_KEYPAD
 	select SAMSUNG_DEV_PWM
 	select SAMSUNG_DEV_TS
+	select SAMSUNG_DEV_SPI0
+	select SAMSUNG_DEV_SPI1
 	select S5PV210_SETUP_FB_24BPP
 	select S5PV210_SETUP_I2C1
 	select S5PV210_SETUP_I2C2
 	select S5PV210_SETUP_IDE
 	select S5PV210_SETUP_KEYPAD
 	select S5PV210_SETUP_SDHCI
+	select S5PV210_SETUP_SPI0
+	select S5PV210_SETUP_SPI1
 	help
 	  Machine support for Samsung SMDKV210
 
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 50907ac..283b04b 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -28,7 +28,6 @@ obj-$(CONFIG_MACH_TORBRECK)	+= mach-torbreck.o
 # device support
 
 obj-y				+= dev-audio.o
-obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
 
 obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
 obj-$(CONFIG_S5PV210_SETUP_FIMC)	+= setup-fimc.o
@@ -38,3 +37,5 @@ obj-$(CONFIG_S5PV210_SETUP_IDE)		+= setup-ide.o
 obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
+obj-$(CONFIG_S5PV210_SETUP_SPI0)	+= setup-spi0.o
+obj-$(CONFIG_S5PV210_SETUP_SPI1)	+= setup-spi1.o
diff --git a/arch/arm/mach-s5pv210/setup-spi0.c b/arch/arm/mach-s5pv210/setup-spi0.c
new file mode 100644
index 0000000..7c3256b
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-spi0.c
@@ -0,0 +1,23 @@
+/* linux/arch/arm/mach-s5pv210/setup-spi0.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi0_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgpin(S5PV210_GPB(0), S3C_GPIO_SFN(2));
+	s3c_gpio_setpull(S5PV210_GPB(0), S3C_GPIO_PULL_UP);
+	s3c_gpio_cfgall_range(S5PV210_GPB(2), 2,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
diff --git a/arch/arm/mach-s5pv210/setup-spi1.c b/arch/arm/mach-s5pv210/setup-spi1.c
new file mode 100644
index 0000000..b22e56e
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-spi1.c
@@ -0,0 +1,23 @@
+/* linux/arch/arm/mach-s5pv210/setup-spi1.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <plat/gpio-cfg.h>
+
+int s3c_spi1_cfg_gpio(struct platform_device *dev)
+{
+	s3c_gpio_cfgpin(S5PV210_GPB(4), S3C_GPIO_SFN(2));
+	s3c_gpio_setpull(S5PV210_GPB(4), S3C_GPIO_PULL_UP);
+	s3c_gpio_cfgall_range(S5PV210_GPB(6), 2,
+				S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
+	return 0;
+}
-- 
1.7.0.4

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

* [PATCH 5/7] ARM: SAMSUNG: Add SPI platform specific code
  2011-06-30 12:25 ` Padmavathi Venna
@ 2011-06-30 12:25   ` Padmavathi Venna
  -1 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: kgene.kim, jassisinghbrar, sbkim73, linux-samsung-soc, linux-arm-kernel

SPI platform specific data has been initialized in SMDK6410,
SMDK6440,SMDK6450,SMDKC100 and SMDKV210 machine file

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/mach-s3c64xx/mach-smdk6410.c |   11 +++++++++++
 arch/arm/mach-s5p64x0/mach-smdk6440.c |   11 +++++++++++
 arch/arm/mach-s5p64x0/mach-smdk6450.c |   11 +++++++++++
 arch/arm/mach-s5pc100/mach-smdkc100.c |   19 +++++++++++++++++++
 arch/arm/mach-s5pv210/mach-smdkv210.c |   12 ++++++++++++
 5 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index e0521e0..ff31a3d 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -71,6 +71,7 @@
 #include <plat/adc.h>
 #include <plat/ts.h>
 #include <plat/keypad.h>
+#include <plat/s3c64xx-spi.h>
 
 #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
@@ -208,6 +209,16 @@ static struct platform_device smdk6410_smsc911x = {
 	},
 };
 
+static struct s3c64xx_spi_info s3c_spi0_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 13,
+};
+
+static struct s3c64xx_spi_info s3c_spi1_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 13,
+};
+
 #ifdef CONFIG_REGULATOR
 static struct regulator_consumer_supply smdk6410_b_pwr_5v_consumers[] __initdata = {
 	REGULATOR_SUPPLY("PVDD", "0-001b"),
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 2d559f1..03469bc 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -46,6 +46,7 @@
 #include <plat/adc.h>
 #include <plat/ts.h>
 #include <plat/s5p-time.h>
+#include <plat/s3c64xx-spi.h>
 
 #define SMDK6440_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				S3C2410_UCON_RXILEVEL |		\
@@ -130,6 +131,16 @@ static struct platform_device smdk6440_backlight_device = {
 	},
 };
 
+static struct s3c64xx_spi_info s3c_spi0_pdata __initdata = {
+	.fifo_lvl_mask	= 0x1ff,
+	.rx_lvl_offset	= 15,
+};
+
+static struct s3c64xx_spi_info s3c_spi1_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 15,
+};
+
 static struct platform_device *smdk6440_devices[] __initdata = {
 	&s3c_device_adc,
 	&s3c_device_rtc,
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index d19c469..4048447 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -46,6 +46,7 @@
 #include <plat/adc.h>
 #include <plat/ts.h>
 #include <plat/s5p-time.h>
+#include <plat/s3c64xx-spi.h>
 
 #define SMDK6450_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				S3C2410_UCON_RXILEVEL |		\
@@ -148,6 +149,16 @@ static struct platform_device smdk6450_backlight_device = {
 	},
 };
 
+static struct s3c64xx_spi_info s3c_spi0_pdata __initdata = {
+	.fifo_lvl_mask	= 0x1ff,
+	.rx_lvl_offset	= 15,
+};
+
+static struct s3c64xx_spi_info s3c_spi1_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 15,
+};
+
 static struct platform_device *smdk6450_devices[] __initdata = {
 	&s3c_device_adc,
 	&s3c_device_rtc,
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 0525cb3..127f7b6 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -51,6 +51,7 @@
 #include <plat/keypad.h>
 #include <plat/ts.h>
 #include <plat/audio.h>
+#include <plat/s3c64xx-spi.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKC100_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -218,6 +219,24 @@ static struct platform_device smdkc100_backlight_device = {
 	},
 };
 
+static struct s3c64xx_spi_info s3c_spi0_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 13,
+	.high_speed	= 1,
+};
+
+static struct s3c64xx_spi_info s3c_spi1_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 13,
+	.high_speed	= 1,
+};
+
+static struct s3c64xx_spi_info s3c_spi2_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 13,
+	.high_speed	= 1,
+};
+
 static struct platform_device *smdkc100_devices[] __initdata = {
 	&s3c_device_adc,
 	&s3c_device_cfcon,
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index c6a9e86..8978757 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -45,6 +45,7 @@
 #include <plat/pm.h>
 #include <plat/fb.h>
 #include <plat/s5p-time.h>
+#include <plat/s3c64xx-spi.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKV210_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -249,6 +250,17 @@ static struct platform_device smdkv210_backlight_device = {
 	},
 };
 
+static struct s3c64xx_spi_info s3c_spi0_pdata __initdata = {
+	.fifo_lvl_mask	= 0x1ff,
+	.rx_lvl_offset	= 15,
+	.high_speed	= 1,
+};
+
+static struct s3c64xx_spi_info s3c_spi1_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 15,
+	.high_speed	= 1,
+};
 static struct platform_device *smdkv210_devices[] __initdata = {
 	&s3c_device_adc,
 	&s3c_device_cfcon,
-- 
1.7.0.4

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

* [PATCH 5/7] ARM: SAMSUNG: Add SPI platform specific code
@ 2011-06-30 12:25   ` Padmavathi Venna
  0 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

SPI platform specific data has been initialized in SMDK6410,
SMDK6440,SMDK6450,SMDKC100 and SMDKV210 machine file

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/mach-s3c64xx/mach-smdk6410.c |   11 +++++++++++
 arch/arm/mach-s5p64x0/mach-smdk6440.c |   11 +++++++++++
 arch/arm/mach-s5p64x0/mach-smdk6450.c |   11 +++++++++++
 arch/arm/mach-s5pc100/mach-smdkc100.c |   19 +++++++++++++++++++
 arch/arm/mach-s5pv210/mach-smdkv210.c |   12 ++++++++++++
 5 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index e0521e0..ff31a3d 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -71,6 +71,7 @@
 #include <plat/adc.h>
 #include <plat/ts.h>
 #include <plat/keypad.h>
+#include <plat/s3c64xx-spi.h>
 
 #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
@@ -208,6 +209,16 @@ static struct platform_device smdk6410_smsc911x = {
 	},
 };
 
+static struct s3c64xx_spi_info s3c_spi0_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 13,
+};
+
+static struct s3c64xx_spi_info s3c_spi1_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 13,
+};
+
 #ifdef CONFIG_REGULATOR
 static struct regulator_consumer_supply smdk6410_b_pwr_5v_consumers[] __initdata = {
 	REGULATOR_SUPPLY("PVDD", "0-001b"),
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 2d559f1..03469bc 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -46,6 +46,7 @@
 #include <plat/adc.h>
 #include <plat/ts.h>
 #include <plat/s5p-time.h>
+#include <plat/s3c64xx-spi.h>
 
 #define SMDK6440_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				S3C2410_UCON_RXILEVEL |		\
@@ -130,6 +131,16 @@ static struct platform_device smdk6440_backlight_device = {
 	},
 };
 
+static struct s3c64xx_spi_info s3c_spi0_pdata __initdata = {
+	.fifo_lvl_mask	= 0x1ff,
+	.rx_lvl_offset	= 15,
+};
+
+static struct s3c64xx_spi_info s3c_spi1_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 15,
+};
+
 static struct platform_device *smdk6440_devices[] __initdata = {
 	&s3c_device_adc,
 	&s3c_device_rtc,
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index d19c469..4048447 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -46,6 +46,7 @@
 #include <plat/adc.h>
 #include <plat/ts.h>
 #include <plat/s5p-time.h>
+#include <plat/s3c64xx-spi.h>
 
 #define SMDK6450_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				S3C2410_UCON_RXILEVEL |		\
@@ -148,6 +149,16 @@ static struct platform_device smdk6450_backlight_device = {
 	},
 };
 
+static struct s3c64xx_spi_info s3c_spi0_pdata __initdata = {
+	.fifo_lvl_mask	= 0x1ff,
+	.rx_lvl_offset	= 15,
+};
+
+static struct s3c64xx_spi_info s3c_spi1_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 15,
+};
+
 static struct platform_device *smdk6450_devices[] __initdata = {
 	&s3c_device_adc,
 	&s3c_device_rtc,
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 0525cb3..127f7b6 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -51,6 +51,7 @@
 #include <plat/keypad.h>
 #include <plat/ts.h>
 #include <plat/audio.h>
+#include <plat/s3c64xx-spi.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKC100_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -218,6 +219,24 @@ static struct platform_device smdkc100_backlight_device = {
 	},
 };
 
+static struct s3c64xx_spi_info s3c_spi0_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 13,
+	.high_speed	= 1,
+};
+
+static struct s3c64xx_spi_info s3c_spi1_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 13,
+	.high_speed	= 1,
+};
+
+static struct s3c64xx_spi_info s3c_spi2_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 13,
+	.high_speed	= 1,
+};
+
 static struct platform_device *smdkc100_devices[] __initdata = {
 	&s3c_device_adc,
 	&s3c_device_cfcon,
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index c6a9e86..8978757 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -45,6 +45,7 @@
 #include <plat/pm.h>
 #include <plat/fb.h>
 #include <plat/s5p-time.h>
+#include <plat/s3c64xx-spi.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKV210_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -249,6 +250,17 @@ static struct platform_device smdkv210_backlight_device = {
 	},
 };
 
+static struct s3c64xx_spi_info s3c_spi0_pdata __initdata = {
+	.fifo_lvl_mask	= 0x1ff,
+	.rx_lvl_offset	= 15,
+	.high_speed	= 1,
+};
+
+static struct s3c64xx_spi_info s3c_spi1_pdata __initdata = {
+	.fifo_lvl_mask	= 0x7f,
+	.rx_lvl_offset	= 15,
+	.high_speed	= 1,
+};
 static struct platform_device *smdkv210_devices[] __initdata = {
 	&s3c_device_adc,
 	&s3c_device_cfcon,
-- 
1.7.0.4

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

* [PATCH 6/7] SPI: S5PC100: Enable the SPI driver for S5PC100
  2011-06-30 12:25 ` Padmavathi Venna
@ 2011-06-30 12:25   ` Padmavathi Venna
  -1 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: kgene.kim, jassisinghbrar, sbkim73, linux-samsung-soc, linux-arm-kernel
  Cc: padmavathi venna

From: padmavathi venna <padma.v@samsung.com>

The SPI module on S5PC100 is similar to the earlier Samsung SoCs like
S3C64XX. Enable the existing SPI driver for use on S5PC100.

Signed-off-by: padmavathi venna <padma.v@samsung.com>
---
 drivers/spi/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index de35c3a..91d607b 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -340,7 +340,7 @@ config SPI_S3C24XX_GPIO
 
 config SPI_S3C64XX
 	tristate "Samsung S3C64XX series type SPI"
-	depends on (ARCH_S3C64XX || ARCH_S5P64X0)
+	depends on (ARCH_S3C64XX || ARCH_S5P64X0 || ARCH_S5PC100)
 	select S3C64XX_DMA if ARCH_S3C64XX
 	help
 	  SPI driver for Samsung S3C64XX and newer SoCs.
-- 
1.7.0.4

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

* [PATCH 6/7] SPI: S5PC100: Enable the SPI driver for S5PC100
@ 2011-06-30 12:25   ` Padmavathi Venna
  0 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

From: padmavathi venna <padma.v@samsung.com>

The SPI module on S5PC100 is similar to the earlier Samsung SoCs like
S3C64XX. Enable the existing SPI driver for use on S5PC100.

Signed-off-by: padmavathi venna <padma.v@samsung.com>
---
 drivers/spi/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index de35c3a..91d607b 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -340,7 +340,7 @@ config SPI_S3C24XX_GPIO
 
 config SPI_S3C64XX
 	tristate "Samsung S3C64XX series type SPI"
-	depends on (ARCH_S3C64XX || ARCH_S5P64X0)
+	depends on (ARCH_S3C64XX || ARCH_S5P64X0 || ARCH_S5PC100)
 	select S3C64XX_DMA if ARCH_S3C64XX
 	help
 	  SPI driver for Samsung S3C64XX and newer SoCs.
-- 
1.7.0.4

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

* [PATCH 7/7] SPI: S5PV210: Enable the SPI driver for S5PV210
  2011-06-30 12:25 ` Padmavathi Venna
@ 2011-06-30 12:25   ` Padmavathi Venna
  -1 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: kgene.kim, jassisinghbrar, sbkim73, linux-samsung-soc, linux-arm-kernel

The SPI module on S5PV210 is similar to the earlier Samsung SoCs like
S3C64XX. Enable the existing SPI driver for use on S5PV210.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 drivers/spi/Kconfig |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 91d607b..ed1ebea 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -340,7 +340,8 @@ config SPI_S3C24XX_GPIO
 
 config SPI_S3C64XX
 	tristate "Samsung S3C64XX series type SPI"
-	depends on (ARCH_S3C64XX || ARCH_S5P64X0 || ARCH_S5PC100)
+	depends on (ARCH_S3C64XX || ARCH_S5P64X0 || ARCH_S5PC100 \
+			|| ARCH_S5PV210)
 	select S3C64XX_DMA if ARCH_S3C64XX
 	help
 	  SPI driver for Samsung S3C64XX and newer SoCs.
-- 
1.7.0.4

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

* [PATCH 7/7] SPI: S5PV210: Enable the SPI driver for S5PV210
@ 2011-06-30 12:25   ` Padmavathi Venna
  0 siblings, 0 replies; 32+ messages in thread
From: Padmavathi Venna @ 2011-06-30 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

The SPI module on S5PV210 is similar to the earlier Samsung SoCs like
S3C64XX. Enable the existing SPI driver for use on S5PV210.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 drivers/spi/Kconfig |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 91d607b..ed1ebea 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -340,7 +340,8 @@ config SPI_S3C24XX_GPIO
 
 config SPI_S3C64XX
 	tristate "Samsung S3C64XX series type SPI"
-	depends on (ARCH_S3C64XX || ARCH_S5P64X0 || ARCH_S5PC100)
+	depends on (ARCH_S3C64XX || ARCH_S5P64X0 || ARCH_S5PC100 \
+			|| ARCH_S5PV210)
 	select S3C64XX_DMA if ARCH_S3C64XX
 	help
 	  SPI driver for Samsung S3C64XX and newer SoCs.
-- 
1.7.0.4

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

* Re: [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
  2011-06-30  9:43       ` Jassi Brar
@ 2011-07-01  3:31         ` padma venkat
  -1 siblings, 0 replies; 32+ messages in thread
From: padma venkat @ 2011-07-01  3:31 UTC (permalink / raw)
  To: Jassi Brar
  Cc: Russell King - ARM Linux, Padmavathi Venna, kgene.kim, sbkim73,
	linux-samsung-soc, linux-arm-kernel

Hi Russell,Jassi

On Thu, Jun 30, 2011 at 3:13 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> On Thu, Jun 30, 2011 at 3:00 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
>> On Thu, Jun 30, 2011 at 08:25:19AM -0400, Padmavathi Venna wrote:
>>> SPI Clocks were defined in dev-spi.c of machine specific folder.
>>> To make SPI devices common across all SoCs,dev-spi.c is moved
>>> from machine specific folder to plat-samsung. So SPI clock
>>> definitions has been moved from dev-spi.c to SoC specific machine
>>> folder for S3C64XX,S5P64X0,S5PC100 and S5PV210
>>
>> This just shows how sick the Samsung code is by abusing the clk API.
>> If it stopped that abuse and switched over to clkdev none of this would
>> be necessary.
> I am anyways not for the patch set.
> Though this 'sickness' predates clkdev, and I agree it should be changed now.

I will prepare new set of patches based on clkdev code and send for review.

Thanks&Regards
Padma

> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
@ 2011-07-01  3:31         ` padma venkat
  0 siblings, 0 replies; 32+ messages in thread
From: padma venkat @ 2011-07-01  3:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Russell,Jassi

On Thu, Jun 30, 2011 at 3:13 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> On Thu, Jun 30, 2011 at 3:00 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
>> On Thu, Jun 30, 2011 at 08:25:19AM -0400, Padmavathi Venna wrote:
>>> SPI Clocks were defined in dev-spi.c of machine specific folder.
>>> To make SPI devices common across all SoCs,dev-spi.c is moved
>>> from machine specific folder to plat-samsung. So SPI clock
>>> definitions has been moved from dev-spi.c to SoC specific machine
>>> folder for S3C64XX,S5P64X0,S5PC100 and S5PV210
>>
>> This just shows how sick the Samsung code is by abusing the clk API.
>> If it stopped that abuse and switched over to clkdev none of this would
>> be necessary.
> I am anyways not for the patch set.
> Though this 'sickness' predates clkdev, and I agree it should be changed now.

I will prepare new set of patches based on clkdev code and send for review.

Thanks&Regards
Padma

> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
  2011-06-30  9:25   ` Marek Szyprowski
@ 2011-07-01  3:35     ` padma venkat
  -1 siblings, 0 replies; 32+ messages in thread
From: padma venkat @ 2011-07-01  3:35 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Padmavathi Venna, kgene.kim, jassisinghbrar, sbkim73,
	linux-samsung-soc, linux-arm-kernel, Kyungmin Park

Hi Marek,

On Thu, Jun 30, 2011 at 2:55 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> Hello,
>
> On Thursday, June 30, 2011 2:25 PM Padmavathi Venna wrote:
>
>> This patchset does the following:
>>
>> 1. Move duplicated code to common place
>> [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
>> SPI platform devices are defined in respective machine folder of
>> Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
>> So all SPI platform devices are moved to a common place.
>>
>> [PATCH 2/7] ARM: SAMSUNG: Define common macro for SPI physical address
>>
>> [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
>> Each SoC has it's own set of clock sources for SPI.So they are defined in
>> respective machine folder.
>>
>> [PATCH 4/7] ARM: SAMSUNG: Create SPI device setup files in
>> respective machine folder
>>
>> [PATCH 5/7] ARM: SAMSUNG: Add SPI platform specific code
>> As SPI platform devices are moved to common place some platform specific
>> code need to be initialized in the respective machine file.
>>
>> [PATCH 6/7] SPI: S5PC100: Enable the SPI driver for S5PC100
>>
>> [PATCH 7/7] SPI: S5PV210: Enable the SPI driver for S5PV210
>
> These patch set improves a bit platform part of SPI driver, but I really
> wonder if we really need to pass so many SoC version specific data
> with platform data. Are all these data (clock list, fifo parameters)
> specific to SoC version or particular board configuration/implementation?
>
> Maybe it will be much easier to convert the SPI driver to use driver id
> feature and use different platform id's for each SoC version? (please
> refer to drivers/video/s3c-fb.c and plat-samsung/include/plat/fb-core.h
> for more information). This will remove the need for SoC specific
> parameters in platform data and will group all version dependent
> information in the driver.

Thanks for your suggestion. I will consider your comments for the
next patch set based on clkdev code.

Thanks&Regards
Padma
>
> Best regards
> --
> Marek Szyprowski
> Samsung Poland R&D Center
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code
@ 2011-07-01  3:35     ` padma venkat
  0 siblings, 0 replies; 32+ messages in thread
From: padma venkat @ 2011-07-01  3:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Marek,

On Thu, Jun 30, 2011 at 2:55 PM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> Hello,
>
> On Thursday, June 30, 2011 2:25 PM Padmavathi Venna wrote:
>
>> This patchset does the following:
>>
>> 1. Move duplicated code to common place
>> [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung
>> SPI platform devices are defined in respective machine folder of
>> Samsung S3C64XX and S5P series SoCs.This is duplicated for every SoC.
>> So all SPI platform devices are moved to a common place.
>>
>> [PATCH 2/7] ARM: SAMSUNG: Define common macro for SPI physical address
>>
>> [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs
>> Each SoC has it's own set of clock sources for SPI.So they are defined in
>> respective machine folder.
>>
>> [PATCH 4/7] ARM: SAMSUNG: Create SPI device setup files in
>> respective machine folder
>>
>> [PATCH 5/7] ARM: SAMSUNG: Add SPI platform specific code
>> As SPI platform devices are moved to common place some platform specific
>> code need to be initialized in the respective machine file.
>>
>> [PATCH 6/7] SPI: S5PC100: Enable the SPI driver for S5PC100
>>
>> [PATCH 7/7] SPI: S5PV210: Enable the SPI driver for S5PV210
>
> These patch set improves a bit platform part of SPI driver, but I really
> wonder if we really need to pass so many SoC version specific data
> with platform data. Are all these data (clock list, fifo parameters)
> specific to SoC version or particular board configuration/implementation?
>
> Maybe it will be much easier to convert the SPI driver to use driver id
> feature and use different platform id's for each SoC version? (please
> refer to drivers/video/s3c-fb.c and plat-samsung/include/plat/fb-core.h
> for more information). This will remove the need for SoC specific
> parameters in platform data and will group all version dependent
> information in the driver.

Thanks for your suggestion. I will consider your comments for the
next patch set based on clkdev code.

Thanks&Regards
Padma
>
> Best regards
> --
> Marek Szyprowski
> Samsung Poland R&D Center
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>


>From bogus@does.not.exist.com  Mon Jun 27 16:47:34 2011
From: bogus@does.not.exist.com ()
Date: Mon, 27 Jun 2011 20:47:34 -0000
Subject: No subject
Message-ID: <mailman.4.1309855788.20020.linux-arm-kernel@lists.infradead.org>

- Rebased on v3.0-rc5
- Rename gic_ppi_to_vppi() to gic_ppi_map()
- Rename CONFIG_ARM_GIC_VPPI to CONFIG_ARM_GIC_PPI_MAP
- Add gic_ppi_map_on_cpu()


>From bogus@does.not.exist.com  Mon Jun 27 16:47:34 2011
From: bogus@does.not.exist.com ()
Date: Mon, 27 Jun 2011 20:47:34 -0000
Subject: No subject
Message-ID: <mailman.5.1309855789.20020.linux-arm-kernel@lists.infradead.org>

- Fix compilation when !CONFIG_PM.


>From bogus@does.not.exist.com  Mon Jun 27 16:47:34 2011
From: bogus@does.not.exist.com ()
Date: Mon, 27 Jun 2011 20:47:34 -0000
Subject: No subject
Message-ID: <mailman.6.1309855789.20020.linux-arm-kernel@lists.infradead.org>

- Update Exynos4 MCT to use the local timer infrastructure, now that
  it doesn't depend on PPIs anymore. Untested, as the board I have
  doesn't implement MCT (EVT0 syndrome).


>From bogus@does.not.exist.com  Mon Jun 27 16:47:34 2011
From: bogus@does.not.exist.com ()
Date: Mon, 27 Jun 2011 20:47:34 -0000
Subject: No subject
Message-ID: <mailman.7.1309855789.20020.linux-arm-kernel@lists.infradead.org>

- Fix arch/arm/common/Kconfig indentation
- Fix MSM warning when building UP.


>From bogus@does.not.exist.com  Mon Jun 27 16:47:34 2011
From: bogus@does.not.exist.com ()
Date: Mon, 27 Jun 2011 20:47:34 -0000
Subject: No subject
Message-ID: <mailman.8.1309855789.20020.linux-arm-kernel@lists.infradead.org>

- Fix yet another CPU_HOTPLUG problem: instead of calling free_irq()
  on timer halt, just disable the interrupt. On timer restart, detect
  that the interrupt has been requested already and just enable the
  interrupt back. This avoid doing a request_irq() with preemption
  disabled, which triggers an ugly warning. Reported by Stephen Boyd.


>From bogus@does.not.exist.com  Mon Jun 27 16:47:34 2011
From: bogus@does.not.exist.com ()
Date: Mon, 27 Jun 2011 20:47:34 -0000
Subject: No subject
Message-ID: <mailman.9.1309855789.20020.linux-arm-kernel@lists.infradead.org>

- More MSM fixes
- Dropped MSM interrupt handler removal, as this requires more discussion,
  and will be addressed in a separate series.
- Moved introduction of percpu_timer_handler to a separate patch


>From bogus@does.not.exist.com  Mon Jun 27 16:47:34 2011
From: bogus@does.not.exist.com ()
Date: Mon, 27 Jun 2011 20:47:34 -0000
Subject: No subject
Message-ID: <mailman.10.1309855789.20020.linux-arm-kernel@lists.infradead.org>

- Fix crash while hotpluging a CPU
- Use handle_percpu_irq() instead of handle_fasteoi_irq()
- MSM fixes courtesy of Stephen Boyd
- MSM switched to percpu_timer_handler()
- Remove local timer interrupt accounting
- Restructure patches #1 and #2

Marc Zyngier (14):
  ARM: gic: add per-cpu interrupt mapping
  ARM: smp: add interrupt handler for local timers
  ARM: smp_twd: add support for remapped PPI interrupts
  ARM: omap4: use remapped PPI interrupts for local timer
  ARM: versatile: use remapped PPI interrupts for local timer
  ARM: shmobile: use remapped PPI interrupts for local timer
  ARM: ux500: use remapped PPI interrupts for local timer
  ARM: tegra: use remapped PPI interrupts for local timer
  ARM: msm: use remapped PPI interrupts for local timer
  ARM: exynos4: use remapped PPI interrupts for local timer
  ARM: gic: remove previous local timer interrupt handling
  ARM: gic: add compute_irqnr macro for exynos4
  ARM: SMP: automatically select ARM_GIC_PPI_MAP
  ARM: gic: add gic_ppi_map_on_cpu()

 arch/arm/Kconfig                                  |    1 +
 arch/arm/common/Kconfig                           |    5 +
 arch/arm/common/gic.c                             |  152 +++++++++++++++++=
++--
 arch/arm/include/asm/entry-macro-multi.S          |    7 -
 arch/arm/include/asm/hardirq.h                    |    3 -
 arch/arm/include/asm/hardware/entry-macro-gic.S   |   31 ++---
 arch/arm/include/asm/hardware/gic.h               |   11 ++-
 arch/arm/include/asm/localtimer.h                 |    7 +-
 arch/arm/include/asm/smp.h                        |    5 -
 arch/arm/kernel/irq.c                             |   11 +-
 arch/arm/kernel/smp.c                             |   27 +---
 arch/arm/kernel/smp_twd.c                         |   25 +++-
 arch/arm/mach-exynos4/include/mach/entry-macro.S  |   70 +---------
 arch/arm/mach-exynos4/localtimer.c                |    3 +-
 arch/arm/mach-msm/board-msm8x60.c                 |   11 --
 arch/arm/mach-msm/include/mach/entry-macro-qgic.S |   73 +----------
 arch/arm/mach-msm/timer.c                         |   58 ++++----
 arch/arm/mach-omap2/include/mach/entry-macro.S    |   14 +--
 arch/arm/mach-omap2/timer-mpu.c                   |    3 +-
 arch/arm/mach-shmobile/entry-intc.S               |    3 -
 arch/arm/mach-shmobile/include/mach/entry-macro.S |    3 -
 arch/arm/mach-shmobile/localtimer.c               |    3 +-
 arch/arm/mach-tegra/localtimer.c                  |    3 +-
 arch/arm/mach-ux500/localtimer.c                  |    3 +-
 arch/arm/plat-versatile/localtimer.c              |    3 +-
 25 files changed, 253 insertions(+), 282 deletions(-)




>From bogus@does.not.exist.com  Mon Jun 27 16:47:34 2011
From: bogus@does.not.exist.com ()
Date: Mon, 27 Jun 2011 20:47:34 -0000
Subject: No subject
Message-ID: <mailman.12.1309969792.20020.linux-arm-kernel@lists.infradead.org>

this in Mainline versions. I think we have to do something.

Maybe we can handle this in a way that when no bad block table is
present we create one with the correct values? This way we could
eliminate the problem at least on boards with virgin flashes.

This whole topic totally sucks. Whatever we do now we end up with
corrupted flashes in one way or the other.

BTW the Bootrom code expects non swapped flash layout, so applying
a swap patch makes it impossible to update the bootloader in NAND.
Maybe that's the reason the FSL code has this disable_bi_swap sysfs
attribute in it.

Not calling this a bug makes me think you work for the Freescale
marketing department ;)

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


>From bogus@does.not.exist.com  Mon Jun 27 16:47:34 2011
From: bogus@does.not.exist.com ()
Date: Mon, 27 Jun 2011 20:47:34 -0000
Subject: No subject
Message-ID: <mailman.16.1310115268.20020.linux-arm-kernel@lists.infradead.org>

- Interrupt controller sort function
- Bug fixes
- Added documentation

Marc Zyngier (4):
  dt: expose device resource allocator
  Core device subsystem implementation
  Core devices: add OF interrupt controller sorting method
  Core devices: documentation

 Documentation/core_devices.txt    |  247 +++++++++++++++++++++++++++++++++=
++++
 arch/arm/kernel/vmlinux.lds.S     |    1 +
 drivers/base/Makefile             |    3 +-
 drivers/base/core_device.c        |  217 ++++++++++++++++++++++++++++++++
 drivers/of/platform.c             |   60 ++++++---
 include/asm-generic/vmlinux.lds.h |    6 +
 include/linux/core_device.h       |   71 +++++++++++
 include/linux/of_platform.h       |    2 +
 8 files changed, 587 insertions(+), 20 deletions(-)
 create mode 100644 Documentation/core_devices.txt
 create mode 100644 drivers/base/core_device.c
 create mode 100644 include/linux/core_device.h

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

end of thread, other threads:[~2011-07-01  3:35 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 12:25 [PATCH 0/7] ARM: SAMSUNG: Cleanup SPI platform specific code Padmavathi Venna
2011-06-30 12:25 ` Padmavathi Venna
2011-06-30  7:31 ` Jassi Brar
2011-06-30  7:31   ` Jassi Brar
2011-06-30  9:27   ` padma venkat
2011-06-30  9:27     ` padma venkat
2011-06-30 10:14     ` Jassi Brar
2011-06-30 10:14       ` Jassi Brar
2011-06-30  9:25 ` Marek Szyprowski
2011-06-30  9:25   ` Marek Szyprowski
2011-07-01  3:35   ` padma venkat
2011-07-01  3:35     ` padma venkat
2011-06-30 12:25 ` [PATCH 1/7] ARM: SAMSUNG: Move SPI device definitions to plat-samsung Padmavathi Venna
2011-06-30 12:25   ` Padmavathi Venna
2011-06-30 12:25 ` [PATCH 2/7] ARM: SAMSUNG: Define common macro for SPI physical address Padmavathi Venna
2011-06-30 12:25   ` Padmavathi Venna
2011-06-30 12:25 ` [PATCH 3/7] ARM: SAMSUNG: Add SPI clock definitions for SAMSUNG SoCs Padmavathi Venna
2011-06-30 12:25   ` Padmavathi Venna
2011-06-30  9:30   ` Russell King - ARM Linux
2011-06-30  9:30     ` Russell King - ARM Linux
2011-06-30  9:43     ` Jassi Brar
2011-06-30  9:43       ` Jassi Brar
2011-07-01  3:31       ` padma venkat
2011-07-01  3:31         ` padma venkat
2011-06-30 12:25 ` [PATCH 4/7] ARM: SAMSUNG: Create SPI device setup files in respective machine folder Padmavathi Venna
2011-06-30 12:25   ` Padmavathi Venna
2011-06-30 12:25 ` [PATCH 5/7] ARM: SAMSUNG: Add SPI platform specific code Padmavathi Venna
2011-06-30 12:25   ` Padmavathi Venna
2011-06-30 12:25 ` [PATCH 6/7] SPI: S5PC100: Enable the SPI driver for S5PC100 Padmavathi Venna
2011-06-30 12:25   ` Padmavathi Venna
2011-06-30 12:25 ` [PATCH 7/7] SPI: S5PV210: Enable the SPI driver for S5PV210 Padmavathi Venna
2011-06-30 12:25   ` Padmavathi Venna

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.