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
dddd4a49
Commit
dddd4a49
authored
Mar 10, 2009
by
Sascha Hauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm037: add SDHC card detection
Signed-off-by:
Sascha Hauer
<
s.hauer@pengutronix.de
>
parent
01ac7d58
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
arch/arm/mach-mx3/pcm037.c
arch/arm/mach-mx3/pcm037.c
+30
-3
No files found.
arch/arm/mach-mx3/pcm037.c
View file @
dddd4a49
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/i2c.h>
#include <linux/i2c/at24.h>
#include <linux/i2c/at24.h>
#include <linux/delay.h>
#include <linux/spi/spi.h>
#include <linux/irq.h>
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach-types.h>
...
@@ -218,17 +221,41 @@ static struct i2c_board_info pcm037_i2c_devices[] = {
...
@@ -218,17 +221,41 @@ static struct i2c_board_info pcm037_i2c_devices[] = {
};
};
#endif
#endif
static
int
pcm970_sdhc1_init
(
struct
device
*
dev
,
irq_handler_t
h
,
void
*
data
)
/* Not connected by default */
#ifdef PCM970_SDHC_RW_SWITCH
static
int
pcm970_sdhc1_get_ro
(
struct
device
*
dev
)
{
{
return
0
;
return
gpio_get_value
(
IOMUX_TO_GPIO
(
MX31_PIN_SFS6
));
}
#endif
static
int
pcm970_sdhc1_init
(
struct
device
*
dev
,
irq_handler_t
detect_irq
,
void
*
data
)
{
int
ret
;
int
gpio_det
,
gpio_wp
;
gpio_det
=
IOMUX_TO_GPIO
(
MX31_PIN_SCK6
);
gpio_wp
=
IOMUX_TO_GPIO
(
MX31_PIN_SFS6
);
gpio_direction_input
(
gpio_det
);
gpio_direction_input
(
gpio_wp
);
ret
=
request_irq
(
IOMUX_TO_IRQ
(
MX31_PIN_SCK6
),
detect_irq
,
IRQF_DISABLED
|
IRQF_TRIGGER_FALLING
,
"sdhc-detect"
,
data
);
return
ret
;
}
}
static
void
pcm970_sdhc1_exit
(
struct
device
*
dev
,
void
*
data
)
static
void
pcm970_sdhc1_exit
(
struct
device
*
dev
,
void
*
data
)
{
{
free_irq
(
IOMUX_TO_IRQ
(
MX31_PIN_SCK6
),
data
);
}
}
/* No card and rw detection at the moment */
static
struct
imxmmc_platform_data
sdhc_pdata
=
{
static
struct
imxmmc_platform_data
sdhc_pdata
=
{
#ifdef PCM970_SDHC_RW_SWITCH
.
get_ro
=
pcm970_sdhc1_get_ro
,
#endif
.
init
=
pcm970_sdhc1_init
,
.
init
=
pcm970_sdhc1_init
,
.
exit
=
pcm970_sdhc1_exit
,
.
exit
=
pcm970_sdhc1_exit
,
};
};
...
...
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