Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
7c107dcb
Commit
7c107dcb
authored
Dec 19, 2008
by
Sascha Hauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm970 baseboard: Add SDHC support
Signed-off-by:
Sascha Hauer
<
s.hauer@pengutronix.de
>
parent
f2cb641f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
arch/arm/mach-mx2/pcm970-baseboard.c
arch/arm/mach-mx2/pcm970-baseboard.c
+63
-0
No files found.
arch/arm/mach-mx2/pcm970-baseboard.c
View file @
7c107dcb
...
...
@@ -17,16 +17,78 @@
*/
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/irq.h>
#include <asm/mach/arch.h>
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/mmc.h>
#include <mach/imxfb.h>
#include <mach/iomux.h>
#include "devices.h"
static
int
pcm970_sdhc2_get_ro
(
struct
device
*
dev
)
{
return
gpio_get_value
(
GPIO_PORTC
+
28
);
}
static
int
pcm970_sdhc2_pins
[]
=
{
PB4_PF_SD2_D0
,
PB5_PF_SD2_D1
,
PB6_PF_SD2_D2
,
PB7_PF_SD2_D3
,
PB8_PF_SD2_CMD
,
PB9_PF_SD2_CLK
,
};
static
int
pcm970_sdhc2_init
(
struct
device
*
dev
,
irq_handler_t
detect_irq
,
void
*
data
)
{
int
ret
;
ret
=
mxc_gpio_setup_multiple_pins
(
pcm970_sdhc2_pins
,
ARRAY_SIZE
(
pcm970_sdhc2_pins
),
"sdhc2"
);
if
(
ret
)
return
ret
;
ret
=
request_irq
(
IRQ_GPIOC
(
29
),
detect_irq
,
0
,
"imx-mmc-detect"
,
data
);
if
(
ret
)
goto
out_release_gpio
;
set_irq_type
(
IRQ_GPIOC
(
29
),
IRQF_TRIGGER_FALLING
);
ret
=
gpio_request
(
GPIO_PORTC
+
28
,
"imx-mmc-ro"
);
if
(
ret
)
goto
out_release_gpio
;
mxc_gpio_mode
((
GPIO_PORTC
|
28
)
|
GPIO_GPIO
|
GPIO_IN
);
gpio_direction_input
(
GPIO_PORTC
+
28
);
return
0
;
out_release_gpio:
mxc_gpio_release_multiple_pins
(
pcm970_sdhc2_pins
,
ARRAY_SIZE
(
pcm970_sdhc2_pins
));
return
ret
;
}
static
void
pcm970_sdhc2_exit
(
struct
device
*
dev
,
void
*
data
)
{
free_irq
(
IRQ_GPIOC
(
29
),
data
);
gpio_free
(
GPIO_PORTC
+
28
);
mxc_gpio_release_multiple_pins
(
pcm970_sdhc2_pins
,
ARRAY_SIZE
(
pcm970_sdhc2_pins
));
}
static
struct
imxmmc_platform_data
sdhc_pdata
=
{
.
get_ro
=
pcm970_sdhc2_get_ro
,
.
init
=
pcm970_sdhc2_init
,
.
exit
=
pcm970_sdhc2_exit
,
};
static
int
mxc_fb_pins
[]
=
{
PA5_PF_LSCLK
,
PA6_PF_LD0
,
PA7_PF_LD1
,
PA8_PF_LD2
,
PA9_PF_LD3
,
PA10_PF_LD4
,
PA11_PF_LD5
,
PA12_PF_LD6
,
...
...
@@ -96,4 +158,5 @@ static struct imx_fb_platform_data pcm038_fb_data = {
void
__init
pcm970_baseboard_init
(
void
)
{
mxc_register_device
(
&
mxc_fb_device
,
&
pcm038_fb_data
);
mxc_register_device
(
&
mxc_sdhc_device1
,
&
sdhc_pdata
);
}
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