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
e63f591a
Commit
e63f591a
authored
Jan 08, 2010
by
Eric Miao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] pxa/corgi: use generic GPIO API and remove pxa_gpio_mode()
Signed-off-by:
Eric Miao
<
eric.y.miao@gmail.com
>
parent
b6eede11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
21 deletions
+25
-21
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/corgi.c
+6
-2
arch/arm/mach-pxa/corgi_pm.c
arch/arm/mach-pxa/corgi_pm.c
+19
-19
No files found.
arch/arm/mach-pxa/corgi.c
View file @
e63f591a
...
@@ -130,11 +130,15 @@ static unsigned long corgi_pin_config[] __initdata = {
...
@@ -130,11 +130,15 @@ static unsigned long corgi_pin_config[] __initdata = {
/* GPIO */
/* GPIO */
GPIO9_GPIO
,
/* CORGI_GPIO_nSD_DETECT */
GPIO9_GPIO
,
/* CORGI_GPIO_nSD_DETECT */
GPIO7_GPIO
,
/* CORGI_GPIO_nSD_WP */
GPIO7_GPIO
,
/* CORGI_GPIO_nSD_WP */
GPIO
33_GPIO
,
/* CORGI_GPIO_SD_PWR
*/
GPIO
21_GPIO
,
/* CORGI_GPIO_ADC_TEMP
*/
GPIO22_GPIO
,
/* CORGI_GPIO_IR_ON */
GPIO22_GPIO
,
/* CORGI_GPIO_IR_ON */
GPIO33_GPIO
,
/* CORGI_GPIO_SD_PWR */
GPIO38_GPIO
,
/* CORGI_GPIO_CHRG_ON */
GPIO43_GPIO
,
/* CORGI_GPIO_CHRG_UKN */
GPIO44_GPIO
,
/* CORGI_GPIO_HSYNC */
GPIO44_GPIO
,
/* CORGI_GPIO_HSYNC */
GPIO1_GPIO
|
WAKEUP_ON_EDGE_RISE
,
GPIO0_GPIO
|
WAKEUP_ON_EDGE_BOTH
,
/* CORGI_GPIO_KEY_INT */
GPIO1_GPIO
|
WAKEUP_ON_EDGE_RISE
,
/* CORGI_GPIO_AC_IN */
};
};
/*
/*
...
...
arch/arm/mach-pxa/corgi_pm.c
View file @
e63f591a
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include <linux/init.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/apm-emulation.h>
#include <linux/apm-emulation.h>
...
@@ -25,7 +26,8 @@
...
@@ -25,7 +26,8 @@
#include <mach/sharpsl.h>
#include <mach/sharpsl.h>
#include <mach/corgi.h>
#include <mach/corgi.h>
#include <mach/pxa2xx-regs.h>
#include <mach/pxa2xx-regs.h>
#include <mach/pxa2xx-gpio.h>
#include "generic.h"
#include "sharpsl.h"
#include "sharpsl.h"
#define SHARPSL_CHARGE_ON_VOLT 0x99
/* 2.9V */
#define SHARPSL_CHARGE_ON_VOLT 0x99
/* 2.9V */
...
@@ -35,44 +37,42 @@
...
@@ -35,44 +37,42 @@
#define SHARPSL_FATAL_ACIN_VOLT 182
/* 3.45V */
#define SHARPSL_FATAL_ACIN_VOLT 182
/* 3.45V */
#define SHARPSL_FATAL_NOACIN_VOLT 170
/* 3.40V */
#define SHARPSL_FATAL_NOACIN_VOLT 170
/* 3.40V */
static
struct
gpio
charger_gpios
[]
=
{
{
CORGI_GPIO_ADC_TEMP_ON
,
GPIOF_OUT_INIT_LOW
,
"ADC Temp On"
},
{
CORGI_GPIO_CHRG_ON
,
GPIOF_OUT_INIT_LOW
,
"Charger On"
},
{
CORGI_GPIO_CHRG_UKN
,
GPIOF_OUT_INIT_LOW
,
"Charger Unknown"
},
{
CORGI_GPIO_KEY_INT
,
GPIOF_IN
,
"Key Interrupt"
},
};
static
void
corgi_charger_init
(
void
)
static
void
corgi_charger_init
(
void
)
{
{
pxa_gpio_mode
(
CORGI_GPIO_ADC_TEMP_ON
|
GPIO_OUT
);
gpio_request_array
(
ARRAY_AND_SIZE
(
charger_gpios
));
pxa_gpio_mode
(
CORGI_GPIO_CHRG_ON
|
GPIO_OUT
);
pxa_gpio_mode
(
CORGI_GPIO_CHRG_UKN
|
GPIO_OUT
);
pxa_gpio_mode
(
CORGI_GPIO_KEY_INT
|
GPIO_IN
);
}
}
static
void
corgi_measure_temp
(
int
on
)
static
void
corgi_measure_temp
(
int
on
)
{
{
if
(
on
)
gpio_set_value
(
CORGI_GPIO_ADC_TEMP_ON
,
on
);
GPSR
(
CORGI_GPIO_ADC_TEMP_ON
)
=
GPIO_bit
(
CORGI_GPIO_ADC_TEMP_ON
);
else
GPCR
(
CORGI_GPIO_ADC_TEMP_ON
)
=
GPIO_bit
(
CORGI_GPIO_ADC_TEMP_ON
);
}
}
static
void
corgi_charge
(
int
on
)
static
void
corgi_charge
(
int
on
)
{
{
if
(
on
)
{
if
(
on
)
{
if
(
machine_is_corgi
()
&&
(
sharpsl_pm
.
flags
&
SHARPSL_SUSPENDED
))
{
if
(
machine_is_corgi
()
&&
(
sharpsl_pm
.
flags
&
SHARPSL_SUSPENDED
))
{
GPCR
(
CORGI_GPIO_CHRG_ON
)
=
GPIO_bit
(
CORGI_GPIO_CHRG_ON
);
gpio_set_value
(
CORGI_GPIO_CHRG_ON
,
0
);
GPSR
(
CORGI_GPIO_CHRG_UKN
)
=
GPIO_bit
(
CORGI_GPIO_CHRG_UKN
);
gpio_set_value
(
CORGI_GPIO_CHRG_UKN
,
1
);
}
else
{
}
else
{
GPSR
(
CORGI_GPIO_CHRG_ON
)
=
GPIO_bit
(
CORGI_GPIO_CHRG_ON
);
gpio_set_value
(
CORGI_GPIO_CHRG_ON
,
1
);
GPCR
(
CORGI_GPIO_CHRG_UKN
)
=
GPIO_bit
(
CORGI_GPIO_CHRG_UKN
);
gpio_set_value
(
CORGI_GPIO_CHRG_UKN
,
0
);
}
}
}
else
{
}
else
{
GPCR
(
CORGI_GPIO_CHRG_ON
)
=
GPIO_bit
(
CORGI_GPIO_CHRG_ON
);
gpio_set_value
(
CORGI_GPIO_CHRG_ON
,
0
);
GPCR
(
CORGI_GPIO_CHRG_UKN
)
=
GPIO_bit
(
CORGI_GPIO_CHRG_UKN
);
gpio_set_value
(
CORGI_GPIO_CHRG_UKN
,
0
);
}
}
}
}
static
void
corgi_discharge
(
int
on
)
static
void
corgi_discharge
(
int
on
)
{
{
if
(
on
)
gpio_set_value
(
CORGI_GPIO_DISCHARGE_ON
,
on
);
GPSR
(
CORGI_GPIO_DISCHARGE_ON
)
=
GPIO_bit
(
CORGI_GPIO_DISCHARGE_ON
);
else
GPCR
(
CORGI_GPIO_DISCHARGE_ON
)
=
GPIO_bit
(
CORGI_GPIO_DISCHARGE_ON
);
}
}
static
void
corgi_presuspend
(
void
)
static
void
corgi_presuspend
(
void
)
...
...
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