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
ac609d26
Commit
ac609d26
authored
Feb 04, 2010
by
Eric Miao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] locomo: allow cascaded IRQ base to be specified by platforms
Signed-off-by:
Eric Miao
<
eric.y.miao@gmail.com
>
parent
00dd8027
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
39 deletions
+48
-39
arch/arm/common/locomo.c
arch/arm/common/locomo.c
+30
-23
arch/arm/include/asm/hardware/locomo.h
arch/arm/include/asm/hardware/locomo.h
+4
-0
arch/arm/mach-pxa/include/mach/irqs.h
arch/arm/mach-pxa/include/mach/irqs.h
+0
-6
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/poodle.c
+7
-0
arch/arm/mach-sa1100/collie.c
arch/arm/mach-sa1100/collie.c
+4
-0
arch/arm/mach-sa1100/include/mach/irqs.h
arch/arm/mach-sa1100/include/mach/irqs.h
+3
-10
No files found.
arch/arm/common/locomo.c
View file @
ac609d26
...
@@ -32,6 +32,12 @@
...
@@ -32,6 +32,12 @@
#include <asm/hardware/locomo.h>
#include <asm/hardware/locomo.h>
/* LoCoMo Interrupts */
#define IRQ_LOCOMO_KEY (0)
#define IRQ_LOCOMO_GPIO (1)
#define IRQ_LOCOMO_LT (2)
#define IRQ_LOCOMO_SPI (3)
/* M62332 output channel selection */
/* M62332 output channel selection */
#define M62332_EVR_CH 1
/* M62332 volume channel number */
#define M62332_EVR_CH 1
/* M62332 volume channel number */
/* 0 : CH.1 , 1 : CH. 2 */
/* 0 : CH.1 , 1 : CH. 2 */
...
@@ -58,6 +64,7 @@ struct locomo {
...
@@ -58,6 +64,7 @@ struct locomo {
struct
device
*
dev
;
struct
device
*
dev
;
unsigned
long
phys
;
unsigned
long
phys
;
unsigned
int
irq
;
unsigned
int
irq
;
int
irq_base
;
spinlock_t
lock
;
spinlock_t
lock
;
void
__iomem
*
base
;
void
__iomem
*
base
;
#ifdef CONFIG_PM
#ifdef CONFIG_PM
...
@@ -81,9 +88,7 @@ struct locomo_dev_info {
...
@@ -81,9 +88,7 @@ struct locomo_dev_info {
static
struct
locomo_dev_info
locomo_devices
[]
=
{
static
struct
locomo_dev_info
locomo_devices
[]
=
{
{
{
.
devid
=
LOCOMO_DEVID_KEYBOARD
,
.
devid
=
LOCOMO_DEVID_KEYBOARD
,
.
irq
=
{
.
irq
=
{
IRQ_LOCOMO_KEY
},
IRQ_LOCOMO_KEY
,
},
.
name
=
"locomo-keyboard"
,
.
name
=
"locomo-keyboard"
,
.
offset
=
LOCOMO_KEYBOARD
,
.
offset
=
LOCOMO_KEYBOARD
,
.
length
=
16
,
.
length
=
16
,
...
@@ -135,18 +140,18 @@ static struct locomo_dev_info locomo_devices[] = {
...
@@ -135,18 +140,18 @@ static struct locomo_dev_info locomo_devices[] = {
static
void
locomo_handler
(
unsigned
int
irq
,
struct
irq_desc
*
desc
)
static
void
locomo_handler
(
unsigned
int
irq
,
struct
irq_desc
*
desc
)
{
{
struct
locomo
*
lchip
=
get_irq_chip_data
(
irq
);
int
req
,
i
;
int
req
,
i
;
void
__iomem
*
mapbase
=
get_irq_chip_data
(
irq
);
/* Acknowledge the parent IRQ */
/* Acknowledge the parent IRQ */
desc
->
chip
->
ack
(
irq
);
desc
->
chip
->
ack
(
irq
);
/* check why this interrupt was generated */
/* check why this interrupt was generated */
req
=
locomo_readl
(
map
base
+
LOCOMO_ICR
)
&
0x0f00
;
req
=
locomo_readl
(
lchip
->
base
+
LOCOMO_ICR
)
&
0x0f00
;
if
(
req
)
{
if
(
req
)
{
/* generate the next interrupt(s) */
/* generate the next interrupt(s) */
irq
=
IRQ_LOCOMO_KEY
;
irq
=
lchip
->
irq_base
;
for
(
i
=
0
;
i
<=
3
;
i
++
,
irq
++
)
{
for
(
i
=
0
;
i
<=
3
;
i
++
,
irq
++
)
{
if
(
req
&
(
0x0100
<<
i
))
{
if
(
req
&
(
0x0100
<<
i
))
{
generic_handle_irq
(
irq
);
generic_handle_irq
(
irq
);
...
@@ -162,20 +167,20 @@ static void locomo_ack_irq(unsigned int irq)
...
@@ -162,20 +167,20 @@ static void locomo_ack_irq(unsigned int irq)
static
void
locomo_mask_irq
(
unsigned
int
irq
)
static
void
locomo_mask_irq
(
unsigned
int
irq
)
{
{
void
__iomem
*
mapbase
=
get_irq_chip_data
(
irq
);
struct
locomo
*
lchip
=
get_irq_chip_data
(
irq
);
unsigned
int
r
;
unsigned
int
r
;
r
=
locomo_readl
(
map
base
+
LOCOMO_ICR
);
r
=
locomo_readl
(
lchip
->
base
+
LOCOMO_ICR
);
r
&=
~
(
0x0010
<<
(
irq
-
IRQ_LOCOMO_KEY
));
r
&=
~
(
0x0010
<<
(
irq
-
lchip
->
irq_base
));
locomo_writel
(
r
,
map
base
+
LOCOMO_ICR
);
locomo_writel
(
r
,
lchip
->
base
+
LOCOMO_ICR
);
}
}
static
void
locomo_unmask_irq
(
unsigned
int
irq
)
static
void
locomo_unmask_irq
(
unsigned
int
irq
)
{
{
void
__iomem
*
mapbase
=
get_irq_chip_data
(
irq
);
struct
locomo
*
lchip
=
get_irq_chip_data
(
irq
);
unsigned
int
r
;
unsigned
int
r
;
r
=
locomo_readl
(
map
base
+
LOCOMO_ICR
);
r
=
locomo_readl
(
lchip
->
base
+
LOCOMO_ICR
);
r
|=
(
0x0010
<<
(
irq
-
IRQ_LOCOMO_KEY
));
r
|=
(
0x0010
<<
(
irq
-
lchip
->
irq_base
));
locomo_writel
(
r
,
map
base
+
LOCOMO_ICR
);
locomo_writel
(
r
,
lchip
->
base
+
LOCOMO_ICR
);
}
}
static
struct
irq_chip
locomo_chip
=
{
static
struct
irq_chip
locomo_chip
=
{
...
@@ -187,21 +192,20 @@ static struct irq_chip locomo_chip = {
...
@@ -187,21 +192,20 @@ static struct irq_chip locomo_chip = {
static
void
locomo_setup_irq
(
struct
locomo
*
lchip
)
static
void
locomo_setup_irq
(
struct
locomo
*
lchip
)
{
{
int
irq
;
int
irq
=
lchip
->
irq_base
;
void
__iomem
*
irqbase
=
lchip
->
base
;
/*
/*
* Install handler for IRQ_LOCOMO_HW.
* Install handler for IRQ_LOCOMO_HW.
*/
*/
set_irq_type
(
lchip
->
irq
,
IRQ_TYPE_EDGE_FALLING
);
set_irq_type
(
lchip
->
irq
,
IRQ_TYPE_EDGE_FALLING
);
set_irq_chip_data
(
lchip
->
irq
,
irqbase
);
set_irq_chip_data
(
lchip
->
irq
,
lchip
);
set_irq_chained_handler
(
lchip
->
irq
,
locomo_handler
);
set_irq_chained_handler
(
lchip
->
irq
,
locomo_handler
);
/*
i
nstall handlers for IRQ_LOCOMO_* */
/*
I
nstall handlers for IRQ_LOCOMO_* */
for
(
irq
=
IRQ_LOCOMO_KEY
;
irq
<
IRQ_LOCOMO_KEY
+
4
;
irq
++
)
{
for
(
;
irq
<=
lchip
->
irq_base
+
3
;
irq
++
)
{
set_irq_chip
(
irq
,
&
locomo_chip
);
set_irq_chip
(
irq
,
&
locomo_chip
);
set_irq_chip_data
(
irq
,
irqbase
);
set_irq_chip_data
(
irq
,
lchip
);
set_irq_handler
(
irq
,
handle_
edge
_irq
);
set_irq_handler
(
irq
,
handle_
level
_irq
);
set_irq_flags
(
irq
,
IRQF_VALID
|
IRQF_PROBE
);
set_irq_flags
(
irq
,
IRQF_VALID
|
IRQF_PROBE
);
}
}
}
}
...
@@ -248,7 +252,8 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
...
@@ -248,7 +252,8 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
dev
->
mapbase
=
0
;
dev
->
mapbase
=
0
;
dev
->
length
=
info
->
length
;
dev
->
length
=
info
->
length
;
memmove
(
dev
->
irq
,
info
->
irq
,
sizeof
(
dev
->
irq
));
dev
->
irq
[
0
]
=
(
lchip
->
irq_base
==
NO_IRQ
)
?
NO_IRQ
:
lchip
->
irq_base
+
info
->
irq
[
0
];
ret
=
device_register
(
&
dev
->
dev
);
ret
=
device_register
(
&
dev
->
dev
);
if
(
ret
)
{
if
(
ret
)
{
...
@@ -365,6 +370,7 @@ static int locomo_resume(struct platform_device *dev)
...
@@ -365,6 +370,7 @@ static int locomo_resume(struct platform_device *dev)
static
int
static
int
__locomo_probe
(
struct
device
*
me
,
struct
resource
*
mem
,
int
irq
)
__locomo_probe
(
struct
device
*
me
,
struct
resource
*
mem
,
int
irq
)
{
{
struct
locomo_platform_data
*
pdata
=
me
->
platform_data
;
struct
locomo
*
lchip
;
struct
locomo
*
lchip
;
unsigned
long
r
;
unsigned
long
r
;
int
i
,
ret
=
-
ENODEV
;
int
i
,
ret
=
-
ENODEV
;
...
@@ -380,6 +386,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
...
@@ -380,6 +386,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
lchip
->
phys
=
mem
->
start
;
lchip
->
phys
=
mem
->
start
;
lchip
->
irq
=
irq
;
lchip
->
irq
=
irq
;
lchip
->
irq_base
=
(
pdata
)
?
pdata
->
irq_base
:
NO_IRQ
;
/*
/*
* Map the whole region. This also maps the
* Map the whole region. This also maps the
...
@@ -446,7 +453,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
...
@@ -446,7 +453,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
* The interrupt controller must be initialised before any
* The interrupt controller must be initialised before any
* other device to ensure that the interrupts are available.
* other device to ensure that the interrupts are available.
*/
*/
if
(
lchip
->
irq
!=
NO_IRQ
)
if
(
lchip
->
irq
!=
NO_IRQ
&&
lchip
->
irq_base
!=
NO_IRQ
)
locomo_setup_irq
(
lchip
);
locomo_setup_irq
(
lchip
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
locomo_devices
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
locomo_devices
);
i
++
)
...
...
arch/arm/include/asm/hardware/locomo.h
View file @
ac609d26
...
@@ -214,4 +214,8 @@ void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int
...
@@ -214,4 +214,8 @@ void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int
/* Frontlight control */
/* Frontlight control */
void
locomo_frontlight_set
(
struct
locomo_dev
*
dev
,
int
duty
,
int
vr
,
int
bpwf
);
void
locomo_frontlight_set
(
struct
locomo_dev
*
dev
,
int
duty
,
int
vr
,
int
bpwf
);
struct
locomo_platform_data
{
int
irq_base
;
/* IRQ base for cascaded on-chip IRQs */
};
#endif
#endif
arch/arm/mach-pxa/include/mach/irqs.h
View file @
ac609d26
...
@@ -247,12 +247,6 @@
...
@@ -247,12 +247,6 @@
#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
#define IRQ_LOCOMO_KEY (IRQ_BOARD_START + 0)
#define IRQ_LOCOMO_GPIO (IRQ_BOARD_START + 1)
#define IRQ_LOCOMO_LT (IRQ_BOARD_START + 2)
#define IRQ_LOCOMO_SPI (IRQ_BOARD_START + 3)
/* phyCORE-PXA270 (PCM027) Interrupts */
/* phyCORE-PXA270 (PCM027) Interrupts */
#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
#define PCM027_BTDET_IRQ PCM027_IRQ(0)
#define PCM027_BTDET_IRQ PCM027_IRQ(0)
...
...
arch/arm/mach-pxa/poodle.c
View file @
ac609d26
...
@@ -174,11 +174,18 @@ static struct resource locomo_resources[] = {
...
@@ -174,11 +174,18 @@ static struct resource locomo_resources[] = {
},
},
};
};
static
struct
locomo_platform_data
locomo_info
=
{
.
irq_base
=
IRQ_BOARD_START
,
};
struct
platform_device
poodle_locomo_device
=
{
struct
platform_device
poodle_locomo_device
=
{
.
name
=
"locomo"
,
.
name
=
"locomo"
,
.
id
=
0
,
.
id
=
0
,
.
num_resources
=
ARRAY_SIZE
(
locomo_resources
),
.
num_resources
=
ARRAY_SIZE
(
locomo_resources
),
.
resource
=
locomo_resources
,
.
resource
=
locomo_resources
,
.
dev
=
{
.
platform_data
=
&
locomo_info
,
},
};
};
EXPORT_SYMBOL
(
poodle_locomo_device
);
EXPORT_SYMBOL
(
poodle_locomo_device
);
...
...
arch/arm/mach-sa1100/collie.c
View file @
ac609d26
...
@@ -234,6 +234,10 @@ static struct resource locomo_resources[] = {
...
@@ -234,6 +234,10 @@ static struct resource locomo_resources[] = {
},
},
};
};
static
struct
locomo_platform_data
locomo_info
=
{
.
irq_base
=
IRQ_BOARD_START
,
};
struct
platform_device
collie_locomo_device
=
{
struct
platform_device
collie_locomo_device
=
{
.
name
=
"locomo"
,
.
name
=
"locomo"
,
.
id
=
0
,
.
id
=
0
,
...
...
arch/arm/mach-sa1100/include/mach/irqs.h
View file @
ac609d26
...
@@ -124,13 +124,13 @@
...
@@ -124,13 +124,13 @@
* Figure out the MAX IRQ number.
* Figure out the MAX IRQ number.
*
*
* If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1.
* If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1.
* If we have an LoCoMo, the max IRQ is IRQ_
LOCOMO_SPI_TEND+1
* If we have an LoCoMo, the max IRQ is IRQ_
BOARD_START + 4
* Otherwise, we have the standard IRQs only.
* Otherwise, we have the standard IRQs only.
*/
*/
#ifdef CONFIG_SA1111
#ifdef CONFIG_SA1111
#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
#elif defined(CONFIG_SHARP_LOCOMO)
#elif defined(CONFIG_SHARP
SL
_LOCOMO)
#define NR_IRQS (IRQ_
LOCOMO_SPI + 1
)
#define NR_IRQS (IRQ_
BOARD_START + 4
)
#else
#else
#define NR_IRQS (IRQ_BOARD_START)
#define NR_IRQS (IRQ_BOARD_START)
#endif
#endif
...
@@ -142,10 +142,3 @@
...
@@ -142,10 +142,3 @@
#define IRQ_NEPONSET_SMC9196 (IRQ_BOARD_START + 0)
#define IRQ_NEPONSET_SMC9196 (IRQ_BOARD_START + 0)
#define IRQ_NEPONSET_USAR (IRQ_BOARD_START + 1)
#define IRQ_NEPONSET_USAR (IRQ_BOARD_START + 1)
#define IRQ_NEPONSET_SA1111 (IRQ_BOARD_START + 2)
#define IRQ_NEPONSET_SA1111 (IRQ_BOARD_START + 2)
/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
#define IRQ_LOCOMO_KEY (IRQ_BOARD_START + 0)
#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
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