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
Kirill Smelkov
linux
Commits
b3d6c800
Commit
b3d6c800
authored
Oct 25, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/topic/qspi' into spi-next
parents
982d6287
dabefd56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
34 deletions
+16
-34
drivers/spi/spi-ti-qspi.c
drivers/spi/spi-ti-qspi.c
+16
-34
No files found.
drivers/spi/spi-ti-qspi.c
View file @
b3d6c800
...
...
@@ -41,9 +41,6 @@ struct ti_qspi_regs {
struct
ti_qspi
{
struct
completion
transfer_complete
;
/* IRQ synchronization */
spinlock_t
lock
;
/* list synchronization */
struct
mutex
list_lock
;
...
...
@@ -57,7 +54,6 @@ struct ti_qspi {
u32
spi_max_frequency
;
u32
cmd
;
u32
dc
;
u32
stat
;
};
#define QSPI_PID (0x0)
...
...
@@ -397,13 +393,12 @@ static irqreturn_t ti_qspi_isr(int irq, void *dev_id)
{
struct
ti_qspi
*
qspi
=
dev_id
;
u16
int_stat
;
u32
stat
;
irqreturn_t
ret
=
IRQ_HANDLED
;
spin_lock
(
&
qspi
->
lock
);
int_stat
=
ti_qspi_read
(
qspi
,
QSPI_INTR_STATUS_ENABLED_CLEAR
);
qspi
->
stat
=
ti_qspi_read
(
qspi
,
QSPI_SPI_STATUS_REG
);
stat
=
ti_qspi_read
(
qspi
,
QSPI_SPI_STATUS_REG
);
if
(
!
int_stat
)
{
dev_dbg
(
qspi
->
dev
,
"No IRQ triggered
\n
"
);
...
...
@@ -411,35 +406,14 @@ static irqreturn_t ti_qspi_isr(int irq, void *dev_id)
goto
out
;
}
ret
=
IRQ_WAKE_THREAD
;
ti_qspi_write
(
qspi
,
QSPI_WC_INT_DISABLE
,
QSPI_INTR_ENABLE_CLEAR_REG
);
ti_qspi_write
(
qspi
,
QSPI_WC_INT_DISABLE
,
QSPI_INTR_STATUS_ENABLED_CLEAR
);
if
(
stat
&
WC
)
complete
(
&
qspi
->
transfer_complete
);
out:
spin_unlock
(
&
qspi
->
lock
);
return
ret
;
}
static
irqreturn_t
ti_qspi_threaded_isr
(
int
this_irq
,
void
*
dev_id
)
{
struct
ti_qspi
*
qspi
=
dev_id
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
qspi
->
lock
,
flags
);
if
(
qspi
->
stat
&
WC
)
complete
(
&
qspi
->
transfer_complete
);
spin_unlock_irqrestore
(
&
qspi
->
lock
,
flags
);
ti_qspi_write
(
qspi
,
QSPI_WC_INT_EN
,
QSPI_INTR_ENABLE_SET_REG
);
return
IRQ_HANDLED
;
}
static
int
ti_qspi_runtime_resume
(
struct
device
*
dev
)
{
struct
ti_qspi
*
qspi
;
...
...
@@ -472,7 +446,7 @@ static int ti_qspi_probe(struct platform_device *pdev)
if
(
!
master
)
return
-
ENOMEM
;
master
->
mode_bits
=
SPI_CPOL
|
SPI_CPHA
;
master
->
mode_bits
=
SPI_CPOL
|
SPI_CPHA
|
SPI_RX_DUAL
|
SPI_RX_QUAD
;
master
->
bus_num
=
-
1
;
master
->
flags
=
SPI_MASTER_HALF_DUPLEX
;
...
...
@@ -499,7 +473,6 @@ static int ti_qspi_probe(struct platform_device *pdev)
return
irq
;
}
spin_lock_init
(
&
qspi
->
lock
);
mutex_init
(
&
qspi
->
list_lock
);
qspi
->
base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
r
);
...
...
@@ -508,8 +481,7 @@ static int ti_qspi_probe(struct platform_device *pdev)
goto
free_master
;
}
ret
=
devm_request_threaded_irq
(
&
pdev
->
dev
,
irq
,
ti_qspi_isr
,
ti_qspi_threaded_isr
,
0
,
ret
=
devm_request_irq
(
&
pdev
->
dev
,
irq
,
ti_qspi_isr
,
0
,
dev_name
(
&
pdev
->
dev
),
qspi
);
if
(
ret
<
0
)
{
dev_err
(
&
pdev
->
dev
,
"Failed to register ISR for IRQ %d
\n
"
,
...
...
@@ -543,12 +515,22 @@ static int ti_qspi_probe(struct platform_device *pdev)
return
ret
;
}
static
int
ti_qspi_remove
(
struct
platform_device
*
pdev
)
{
struct
ti_qspi
*
qspi
=
platform_get_drvdata
(
pdev
);
ti_qspi_write
(
qspi
,
QSPI_WC_INT_DISABLE
,
QSPI_INTR_ENABLE_CLEAR_REG
);
return
0
;
}
static
const
struct
dev_pm_ops
ti_qspi_pm_ops
=
{
.
runtime_resume
=
ti_qspi_runtime_resume
,
};
static
struct
platform_driver
ti_qspi_driver
=
{
.
probe
=
ti_qspi_probe
,
.
remove
=
ti_qspi_remove
,
.
driver
=
{
.
name
=
"ti,dra7xxx-qspi"
,
.
owner
=
THIS_MODULE
,
...
...
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