Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
bf182bcc
Commit
bf182bcc
authored
Nov 05, 2010
by
Uwe Kleine-König
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARM: imx: dynamically allocate mxc_pwm devices
Signed-off-by:
Uwe Kleine-König
<
u.kleine-koenig@pengutronix.de
>
parent
c0624657
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
20 deletions
+56
-20
arch/arm/mach-imx/devices.c
arch/arm/mach-imx/devices.c
+0
-19
arch/arm/mach-imx/devices.h
arch/arm/mach-imx/devices.h
+0
-1
arch/arm/plat-mxc/devices/Kconfig
arch/arm/plat-mxc/devices/Kconfig
+3
-0
arch/arm/plat-mxc/devices/Makefile
arch/arm/plat-mxc/devices/Makefile
+1
-0
arch/arm/plat-mxc/devices/platform-mxc_pwm.c
arch/arm/plat-mxc/devices/platform-mxc_pwm.c
+45
-0
arch/arm/plat-mxc/include/mach/devices-common.h
arch/arm/plat-mxc/include/mach/devices-common.h
+7
-0
No files found.
arch/arm/mach-imx/devices.c
View file @
bf182bcc
...
...
@@ -77,25 +77,6 @@ int __init imx1_register_gpios(void)
#endif
#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
static
struct
resource
mxc_pwm_resources
[]
=
{
{
.
start
=
MX2x_PWM_BASE_ADDR
,
.
end
=
MX2x_PWM_BASE_ADDR
+
SZ_4K
-
1
,
.
flags
=
IORESOURCE_MEM
,
},
{
.
start
=
MX2x_INT_PWM
,
.
end
=
MX2x_INT_PWM
,
.
flags
=
IORESOURCE_IRQ
,
}
};
struct
platform_device
mxc_pwm_device
=
{
.
name
=
"mxc_pwm"
,
.
id
=
0
,
.
num_resources
=
ARRAY_SIZE
(
mxc_pwm_resources
),
.
resource
=
mxc_pwm_resources
,
};
#define DEFINE_MXC_MMC_DEVICE(n, baseaddr, irq, dmareq) \
static struct resource mxc_sdhc_resources ## n[] = { \
{ \
...
...
arch/arm/mach-imx/devices.h
View file @
bf182bcc
#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
extern
struct
platform_device
mxc_pwm_device
;
extern
struct
platform_device
mxc_sdhc_device0
;
extern
struct
platform_device
mxc_sdhc_device1
;
extern
struct
platform_device
mxc_otg_udc_device
;
...
...
arch/arm/plat-mxc/devices/Kconfig
View file @
bf182bcc
...
...
@@ -40,6 +40,9 @@ config IMX_HAVE_PLATFORM_MX2_CAMERA
config IMX_HAVE_PLATFORM_MXC_NAND
bool
config IMX_HAVE_PLATFORM_MXC_PWM
bool
config IMX_HAVE_PLATFORM_MXC_W1
bool
...
...
arch/arm/plat-mxc/devices/Makefile
View file @
bf182bcc
...
...
@@ -12,5 +12,6 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA)
+=
platform-mx1-camera.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA)
+=
platform-mx2-camera.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND)
+=
platform-mxc_nand.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM)
+=
platform-mxc_pwm.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1)
+=
platform-mxc_w1.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX)
+=
platform-spi_imx.o
arch/arm/plat-mxc/devices/platform-mxc_pwm.c
0 → 100644
View file @
bf182bcc
/*
* Copyright (C) 2009-2010 Pengutronix
* Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
*
* 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 <mach/hardware.h>
#include <mach/devices-common.h>
#define imx_mxc_pwm_data_entry_single(soc) \
{ \
.iobase = soc ## _PWM_BASE_ADDR, \
.irq = soc ## _INT_PWM, \
}
#ifdef CONFIG_SOC_IMX21
const
struct
imx_mxc_pwm_data
imx21_mxc_pwm_data
__initconst
=
imx_mxc_pwm_data_entry_single
(
MX21
);
#endif
/* ifdef CONFIG_SOC_IMX21 */
#ifdef CONFIG_SOC_IMX27
const
struct
imx_mxc_pwm_data
imx27_mxc_pwm_data
__initconst
=
imx_mxc_pwm_data_entry_single
(
MX27
);
#endif
/* ifdef CONFIG_SOC_IMX27 */
struct
platform_device
*
__init
imx_add_mxc_pwm
(
const
struct
imx_mxc_pwm_data
*
data
)
{
struct
resource
res
[]
=
{
{
.
start
=
data
->
iobase
,
.
end
=
data
->
iobase
+
SZ_4K
-
1
,
.
flags
=
IORESOURCE_MEM
,
},
{
.
start
=
data
->
irq
,
.
end
=
data
->
irq
,
.
flags
=
IORESOURCE_IRQ
,
},
};
return
imx_add_platform_device
(
"mxc_pwm"
,
0
,
res
,
ARRAY_SIZE
(
res
),
NULL
,
0
);
}
arch/arm/plat-mxc/include/mach/devices-common.h
View file @
bf182bcc
...
...
@@ -168,6 +168,13 @@ struct platform_device *__init imx_add_mxc_nand(
const
struct
imx_mxc_nand_data
*
data
,
const
struct
mxc_nand_platform_data
*
pdata
);
struct
imx_mxc_pwm_data
{
resource_size_t
iobase
;
resource_size_t
irq
;
};
struct
platform_device
*
__init
imx_add_mxc_pwm
(
const
struct
imx_mxc_pwm_data
*
data
);
struct
imx_mxc_w1_data
{
resource_size_t
iobase
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment