Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
1da78078
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
1da78078
编写于
5月 17, 2008
作者:
R
Russell King
提交者:
Russell King
5月 17, 2008
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'sa1100'
上级
53491e04
2a52efb2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
60 addition
and
27 deletion
+60
-27
arch/arm/common/locomo.c
arch/arm/common/locomo.c
+48
-18
include/asm-arm/arch-sa1100/irqs.h
include/asm-arm/arch-sa1100/irqs.h
+1
-1
include/asm-arm/hardware/locomo.h
include/asm-arm/hardware/locomo.h
+11
-8
未找到文件。
arch/arm/common/locomo.c
浏览文件 @
1da78078
...
...
@@ -321,11 +321,42 @@ static void locomo_gpio_unmask_irq(unsigned int irq)
locomo_writel
(
r
,
mapbase
+
LOCOMO_GIE
);
}
static
int
GPIO_IRQ_rising_edge
;
static
int
GPIO_IRQ_falling_edge
;
static
int
locomo_gpio_type
(
unsigned
int
irq
,
unsigned
int
type
)
{
unsigned
int
mask
;
void
__iomem
*
mapbase
=
get_irq_chip_data
(
irq
);
mask
=
1
<<
(
irq
-
LOCOMO_IRQ_GPIO_START
);
if
(
type
==
IRQT_PROBE
)
{
if
((
GPIO_IRQ_rising_edge
|
GPIO_IRQ_falling_edge
)
&
mask
)
return
0
;
type
=
__IRQT_RISEDGE
|
__IRQT_FALEDGE
;
}
if
(
type
&
__IRQT_RISEDGE
)
GPIO_IRQ_rising_edge
|=
mask
;
else
GPIO_IRQ_rising_edge
&=
~
mask
;
if
(
type
&
__IRQT_FALEDGE
)
GPIO_IRQ_falling_edge
|=
mask
;
else
GPIO_IRQ_falling_edge
&=
~
mask
;
locomo_writel
(
GPIO_IRQ_rising_edge
,
mapbase
+
LOCOMO_GRIE
);
locomo_writel
(
GPIO_IRQ_falling_edge
,
mapbase
+
LOCOMO_GFIE
);
return
0
;
}
static
struct
irq_chip
locomo_gpio_chip
=
{
.
name
=
"LOCOMO-gpio"
,
.
ack
=
locomo_gpio_ack_irq
,
.
mask
=
locomo_gpio_mask_irq
,
.
unmask
=
locomo_gpio_unmask_irq
,
.
name
=
"LOCOMO-gpio"
,
.
ack
=
locomo_gpio_ack_irq
,
.
mask
=
locomo_gpio_mask_irq
,
.
unmask
=
locomo_gpio_unmask_irq
,
.
set_type
=
locomo_gpio_type
,
};
static
void
locomo_lt_handler
(
unsigned
int
irq
,
struct
irq_desc
*
desc
)
...
...
@@ -450,22 +481,18 @@ static void locomo_setup_irq(struct locomo *lchip)
set_irq_chip
(
IRQ_LOCOMO_KEY_BASE
,
&
locomo_chip
);
set_irq_chip_data
(
IRQ_LOCOMO_KEY_BASE
,
irqbase
);
set_irq_chained_handler
(
IRQ_LOCOMO_KEY_BASE
,
locomo_key_handler
);
set_irq_flags
(
IRQ_LOCOMO_KEY_BASE
,
IRQF_VALID
|
IRQF_PROBE
);
set_irq_chip
(
IRQ_LOCOMO_GPIO_BASE
,
&
locomo_chip
);
set_irq_chip_data
(
IRQ_LOCOMO_GPIO_BASE
,
irqbase
);
set_irq_chained_handler
(
IRQ_LOCOMO_GPIO_BASE
,
locomo_gpio_handler
);
set_irq_flags
(
IRQ_LOCOMO_GPIO_BASE
,
IRQF_VALID
|
IRQF_PROBE
);
set_irq_chip
(
IRQ_LOCOMO_LT_BASE
,
&
locomo_chip
);
set_irq_chip_data
(
IRQ_LOCOMO_LT_BASE
,
irqbase
);
set_irq_chained_handler
(
IRQ_LOCOMO_LT_BASE
,
locomo_lt_handler
);
set_irq_flags
(
IRQ_LOCOMO_LT_BASE
,
IRQF_VALID
|
IRQF_PROBE
);
set_irq_chip
(
IRQ_LOCOMO_SPI_BASE
,
&
locomo_chip
);
set_irq_chip_data
(
IRQ_LOCOMO_SPI_BASE
,
irqbase
);
set_irq_chained_handler
(
IRQ_LOCOMO_SPI_BASE
,
locomo_spi_handler
);
set_irq_flags
(
IRQ_LOCOMO_SPI_BASE
,
IRQF_VALID
|
IRQF_PROBE
);
/* install handlers for IRQ_LOCOMO_KEY_BASE generated interrupts */
set_irq_chip
(
LOCOMO_IRQ_KEY_START
,
&
locomo_key_chip
);
...
...
@@ -488,7 +515,7 @@ static void locomo_setup_irq(struct locomo *lchip)
set_irq_flags
(
LOCOMO_IRQ_LT_START
,
IRQF_VALID
|
IRQF_PROBE
);
/* install handlers for IRQ_LOCOMO_SPI_BASE generated interrupts */
for
(
irq
=
LOCOMO_IRQ_SPI_START
;
irq
<
LOCOMO_IRQ_SPI_START
+
3
;
irq
++
)
{
for
(
irq
=
LOCOMO_IRQ_SPI_START
;
irq
<
LOCOMO_IRQ_SPI_START
+
4
;
irq
++
)
{
set_irq_chip
(
irq
,
&
locomo_spi_chip
);
set_irq_chip_data
(
irq
,
irqbase
);
set_irq_handler
(
irq
,
handle_edge_irq
);
...
...
@@ -574,20 +601,20 @@ static int locomo_suspend(struct platform_device *dev, pm_message_t state)
save
->
LCM_GPO
=
locomo_readl
(
lchip
->
base
+
LOCOMO_GPO
);
/* GPIO */
locomo_writel
(
0x00
,
lchip
->
base
+
LOCOMO_GPO
);
save
->
LCM_SPICT
=
locomo_readl
(
lchip
->
base
+
LOCOMO_SPICT
);
/* SPI */
save
->
LCM_SPICT
=
locomo_readl
(
lchip
->
base
+
LOCOMO_SPI
+
LOCOMO_SPI
CT
);
/* SPI */
locomo_writel
(
0x40
,
lchip
->
base
+
LOCOMO_SPICT
);
save
->
LCM_GPE
=
locomo_readl
(
lchip
->
base
+
LOCOMO_GPE
);
/* GPIO */
locomo_writel
(
0x00
,
lchip
->
base
+
LOCOMO_GPE
);
save
->
LCM_ASD
=
locomo_readl
(
lchip
->
base
+
LOCOMO_ASD
);
/* ADSTART */
locomo_writel
(
0x00
,
lchip
->
base
+
LOCOMO_ASD
);
save
->
LCM_SPIMD
=
locomo_readl
(
lchip
->
base
+
LOCOMO_SPIMD
);
/* SPI */
locomo_writel
(
0x3C14
,
lchip
->
base
+
LOCOMO_SPIMD
);
save
->
LCM_SPIMD
=
locomo_readl
(
lchip
->
base
+
LOCOMO_SPI
+
LOCOMO_SPI
MD
);
/* SPI */
locomo_writel
(
0x3C14
,
lchip
->
base
+
LOCOMO_SPI
+
LOCOMO_SPI
MD
);
locomo_writel
(
0x00
,
lchip
->
base
+
LOCOMO_PAIF
);
locomo_writel
(
0x00
,
lchip
->
base
+
LOCOMO_DAC
);
locomo_writel
(
0x00
,
lchip
->
base
+
LOCOMO_BACKLIGHT
+
LOCOMO_TC
);
if
(
(
locomo_readl
(
lchip
->
base
+
LOCOMO_LED
+
LOCOMO_LPT0
)
&
0x88
)
&&
(
locomo_readl
(
lchip
->
base
+
LOCOMO_LED
+
LOCOMO_LPT1
)
&
0x88
)
)
if
(
(
locomo_readl
(
lchip
->
base
+
LOCOMO_LED
+
LOCOMO_LPT0
)
&
0x88
)
&&
(
locomo_readl
(
lchip
->
base
+
LOCOMO_LED
+
LOCOMO_LPT1
)
&
0x88
)
)
locomo_writel
(
0x00
,
lchip
->
base
+
LOCOMO_C32K
);
/* CLK32 off */
else
/* 18MHz already enabled, so no wait */
...
...
@@ -616,10 +643,10 @@ static int locomo_resume(struct platform_device *dev)
spin_lock_irqsave
(
&
lchip
->
lock
,
flags
);
locomo_writel
(
save
->
LCM_GPO
,
lchip
->
base
+
LOCOMO_GPO
);
locomo_writel
(
save
->
LCM_SPICT
,
lchip
->
base
+
LOCOMO_SPICT
);
locomo_writel
(
save
->
LCM_SPICT
,
lchip
->
base
+
LOCOMO_SPI
+
LOCOMO_SPI
CT
);
locomo_writel
(
save
->
LCM_GPE
,
lchip
->
base
+
LOCOMO_GPE
);
locomo_writel
(
save
->
LCM_ASD
,
lchip
->
base
+
LOCOMO_ASD
);
locomo_writel
(
save
->
LCM_SPIMD
,
lchip
->
base
+
LOCOMO_SPIMD
);
locomo_writel
(
save
->
LCM_SPIMD
,
lchip
->
base
+
LOCOMO_SPI
+
LOCOMO_SPI
MD
);
locomo_writel
(
0x00
,
lchip
->
base
+
LOCOMO_C32K
);
locomo_writel
(
0x90
,
lchip
->
base
+
LOCOMO_TADC
);
...
...
@@ -688,9 +715,9 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
/* GPIO */
locomo_writel
(
0
,
lchip
->
base
+
LOCOMO_GPO
);
locomo_writel
(
(
LOCOMO_GPIO
(
2
)
|
LOCOMO_GPIO
(
3
)
|
LOCOMO_GPIO
(
13
)
|
LOCOMO_GPIO
(
14
))
locomo_writel
(
(
LOCOMO_GPIO
(
1
)
|
LOCOMO_GPIO
(
2
)
|
LOCOMO_GPIO
(
13
)
|
LOCOMO_GPIO
(
14
))
,
lchip
->
base
+
LOCOMO_GPE
);
locomo_writel
(
(
LOCOMO_GPIO
(
2
)
|
LOCOMO_GPIO
(
3
)
|
LOCOMO_GPIO
(
13
)
|
LOCOMO_GPIO
(
14
))
locomo_writel
(
(
LOCOMO_GPIO
(
1
)
|
LOCOMO_GPIO
(
2
)
|
LOCOMO_GPIO
(
13
)
|
LOCOMO_GPIO
(
14
))
,
lchip
->
base
+
LOCOMO_GPD
);
locomo_writel
(
0
,
lchip
->
base
+
LOCOMO_GIE
);
...
...
@@ -833,7 +860,10 @@ void locomo_gpio_set_dir(struct device *dev, unsigned int bits, unsigned int dir
spin_lock_irqsave
(
&
lchip
->
lock
,
flags
);
r
=
locomo_readl
(
lchip
->
base
+
LOCOMO_GPD
);
r
&=
~
bits
;
if
(
dir
)
r
|=
bits
;
else
r
&=
~
bits
;
locomo_writel
(
r
,
lchip
->
base
+
LOCOMO_GPD
);
r
=
locomo_readl
(
lchip
->
base
+
LOCOMO_GPE
);
...
...
include/asm-arm/arch-sa1100/irqs.h
浏览文件 @
1da78078
...
...
@@ -141,7 +141,7 @@
#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
#define IRQ_LOCOMO_SPI_
OVRN
(IRQ_BOARD_END + 20)
#define IRQ_LOCOMO_SPI_
REND
(IRQ_BOARD_END + 20)
#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
/*
...
...
include/asm-arm/hardware/locomo.h
浏览文件 @
1da78078
...
...
@@ -58,6 +58,11 @@
#define LOCOMO_SPIMD 0x00
/* SPI mode setting */
#define LOCOMO_SPICT 0x04
/* SPI mode control */
#define LOCOMO_SPIST 0x08
/* SPI status */
#define LOCOMO_SPI_TEND (1 << 3)
/* Transfer end bit */
#define LOCOMO_SPI_REND (1 << 2)
/* Receive end bit */
#define LOCOMO_SPI_RFW (1 << 1)
/* write buffer bit */
#define LOCOMO_SPI_RFR (1)
/* read buffer bit */
#define LOCOMO_SPIIS 0x10
/* SPI interrupt status */
#define LOCOMO_SPIWE 0x14
/* SPI interrupt status write enable */
#define LOCOMO_SPIIE 0x18
/* SPI interrupt enable */
...
...
@@ -66,16 +71,12 @@
#define LOCOMO_SPIRD 0x24
/* SPI receive data read */
#define LOCOMO_SPITS 0x28
/* SPI transfer data shift */
#define LOCOMO_SPIRS 0x2C
/* SPI receive data shift */
#define LOCOMO_SPI_TEND (1 << 3)
/* Transfer end bit */
#define LOCOMO_SPI_OVRN (1 << 2)
/* Over Run bit */
#define LOCOMO_SPI_RFW (1 << 1)
/* write buffer bit */
#define LOCOMO_SPI_RFR (1)
/* read buffer bit */
/* GPIO */
#define LOCOMO_GPD 0x90
/* GPIO direction */
#define LOCOMO_GPE 0x94
/* GPIO input enable */
#define LOCOMO_GPL 0x98
/* GPIO level */
#define LOCOMO_GPO 0x9c
/* GPIO out data sett
e
ing */
#define LOCOMO_GPO 0x9c
/* GPIO out data setting */
#define LOCOMO_GRIE 0xa0
/* GPIO rise detection */
#define LOCOMO_GFIE 0xa4
/* GPIO fall detection */
#define LOCOMO_GIS 0xa8
/* GPIO edge detection status */
...
...
@@ -96,6 +97,9 @@
#define LOCOMO_GPIO_DAC_SDATA LOCOMO_GPIO(10)
#define LOCOMO_GPIO_DAC_SCK LOCOMO_GPIO(11)
#define LOCOMO_GPIO_DAC_SLOAD LOCOMO_GPIO(12)
#define LOCOMO_GPIO_CARD_DETECT LOCOMO_GPIO(13)
#define LOCOMO_GPIO_WRITE_PROT LOCOMO_GPIO(14)
#define LOCOMO_GPIO_CARD_POWER LOCOMO_GPIO(15)
/* Start the definitions of the devices. Each device has an initial
* base address and a series of offsets from that base address. */
...
...
@@ -122,7 +126,7 @@
/* Audio controller */
#define LOCOMO_AUDIO 0x54
#define LOCOMO_ACC 0x00
/* Audio clock */
#define LOCOMO_PAIF 0x
7C
/* PCM audio interface */
#define LOCOMO_PAIF 0x
D0
/* PCM audio interface */
/* Audio clock */
#define LOCOMO_ACC_XON 0x80
#define LOCOMO_ACC_XEN 0x40
...
...
@@ -162,7 +166,7 @@ extern struct bus_type locomo_bus_type;
#define LOCOMO_DEVID_AUDIO 3
#define LOCOMO_DEVID_LED 4
#define LOCOMO_DEVID_UART 5
#define LOCOMO_DEVID_SPI
6
#define LOCOMO_DEVID_SPI 6
struct
locomo_dev
{
struct
device
dev
;
...
...
@@ -204,7 +208,6 @@ int locomo_gpio_read_level(struct device *dev, unsigned int bits);
int
locomo_gpio_read_output
(
struct
device
*
dev
,
unsigned
int
bits
);
void
locomo_gpio_write
(
struct
device
*
dev
,
unsigned
int
bits
,
unsigned
int
set
);
/* M62332 control function */
void
locomo_m62332_senddata
(
struct
locomo_dev
*
ldev
,
unsigned
int
dac_data
,
int
channel
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录