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
7e016d14
Commit
7e016d14
authored
Jun 26, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spi/topic/pxa' into spi-next
parents
37553b92
4b30f2a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
38 deletions
+10
-38
drivers/spi/spi-pxa2xx-dma.c
drivers/spi/spi-pxa2xx-dma.c
+6
-5
drivers/spi/spi-pxa2xx.c
drivers/spi/spi-pxa2xx.c
+4
-33
No files found.
drivers/spi/spi-pxa2xx-dma.c
View file @
7e016d14
...
...
@@ -327,22 +327,23 @@ void pxa2xx_spi_dma_start(struct driver_data *drv_data)
int
pxa2xx_spi_dma_setup
(
struct
driver_data
*
drv_data
)
{
struct
pxa2xx_spi_master
*
pdata
=
drv_data
->
master_info
;
struct
device
*
dev
=
&
drv_data
->
pdev
->
dev
;
dma_cap_mask_t
mask
;
dma_cap_zero
(
mask
);
dma_cap_set
(
DMA_SLAVE
,
mask
);
drv_data
->
dummy
=
devm_kzalloc
(
&
drv_data
->
pdev
->
dev
,
SZ_2K
,
GFP_KERNEL
);
drv_data
->
dummy
=
devm_kzalloc
(
dev
,
SZ_2K
,
GFP_KERNEL
);
if
(
!
drv_data
->
dummy
)
return
-
ENOMEM
;
drv_data
->
tx_chan
=
dma_request_
channel
(
mask
,
pxa2xx_spi_dma_filter
,
pdata
);
drv_data
->
tx_chan
=
dma_request_
slave_channel_compat
(
mask
,
pxa2xx_spi_dma_filter
,
pdata
,
dev
,
"tx"
);
if
(
!
drv_data
->
tx_chan
)
return
-
ENODEV
;
drv_data
->
rx_chan
=
dma_request_
channel
(
mask
,
pxa2xx_spi_dma_filter
,
pdata
);
drv_data
->
rx_chan
=
dma_request_
slave_channel_compat
(
mask
,
pxa2xx_spi_dma_filter
,
pdata
,
dev
,
"rx"
);
if
(
!
drv_data
->
rx_chan
)
{
dma_release_channel
(
drv_data
->
tx_chan
);
drv_data
->
tx_chan
=
NULL
;
...
...
drivers/spi/spi-pxa2xx.c
View file @
7e016d14
...
...
@@ -1022,32 +1022,10 @@ static void cleanup(struct spi_device *spi)
}
#ifdef CONFIG_ACPI
static
int
pxa2xx_spi_acpi_add_dma
(
struct
acpi_resource
*
res
,
void
*
data
)
{
struct
pxa2xx_spi_master
*
pdata
=
data
;
if
(
res
->
type
==
ACPI_RESOURCE_TYPE_FIXED_DMA
)
{
const
struct
acpi_resource_fixed_dma
*
dma
;
dma
=
&
res
->
data
.
fixed_dma
;
if
(
pdata
->
tx_slave_id
<
0
)
{
pdata
->
tx_slave_id
=
dma
->
request_lines
;
pdata
->
tx_chan_id
=
dma
->
channels
;
}
else
if
(
pdata
->
rx_slave_id
<
0
)
{
pdata
->
rx_slave_id
=
dma
->
request_lines
;
pdata
->
rx_chan_id
=
dma
->
channels
;
}
}
/* Tell the ACPI core to skip this resource */
return
1
;
}
static
struct
pxa2xx_spi_master
*
pxa2xx_spi_acpi_get_pdata
(
struct
platform_device
*
pdev
)
{
struct
pxa2xx_spi_master
*
pdata
;
struct
list_head
resource_list
;
struct
acpi_device
*
adev
;
struct
ssp_device
*
ssp
;
struct
resource
*
res
;
...
...
@@ -1073,7 +1051,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
ssp
->
phys_base
=
res
->
start
;
ssp
->
mmio_base
=
devm_ioremap_resource
(
&
pdev
->
dev
,
res
);
if
(
IS_ERR
(
ssp
->
mmio_base
))
return
PTR_ERR
(
ssp
->
mmio_base
)
;
return
NULL
;
ssp
->
clk
=
devm_clk_get
(
&
pdev
->
dev
,
NULL
);
ssp
->
irq
=
platform_get_irq
(
pdev
,
0
);
...
...
@@ -1085,15 +1063,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
ssp
->
port_id
=
devid
;
pdata
->
num_chipselect
=
1
;
pdata
->
rx_slave_id
=
-
1
;
pdata
->
tx_slave_id
=
-
1
;
INIT_LIST_HEAD
(
&
resource_list
);
acpi_dev_get_resources
(
adev
,
&
resource_list
,
pxa2xx_spi_acpi_add_dma
,
pdata
);
acpi_dev_free_resource_list
(
&
resource_list
);
pdata
->
enable_dma
=
pdata
->
rx_slave_id
>=
0
&&
pdata
->
tx_slave_id
>=
0
;
pdata
->
enable_dma
=
true
;
return
pdata
;
}
...
...
@@ -1101,6 +1071,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
static
struct
acpi_device_id
pxa2xx_spi_acpi_match
[]
=
{
{
"INT33C0"
,
0
},
{
"INT33C1"
,
0
},
{
"80860F0E"
,
0
},
{
},
};
MODULE_DEVICE_TABLE
(
acpi
,
pxa2xx_spi_acpi_match
);
...
...
@@ -1198,7 +1169,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
if
(
platform_info
->
enable_dma
)
{
status
=
pxa2xx_spi_dma_setup
(
drv_data
);
if
(
status
)
{
dev_
warn
(
dev
,
"failed to setup DMA
, using PIO
\n
"
);
dev_
dbg
(
dev
,
"no DMA channels available
, using PIO
\n
"
);
platform_info
->
enable_dma
=
false
;
}
}
...
...
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