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
57fb7ee1
Commit
57fb7ee1
authored
Dec 14, 2016
by
Vinod Koul
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/s3c64xx' into for-linus
parents
90644ad7
c41668ad
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
44 deletions
+51
-44
arch/arm/mach-s3c64xx/pl080.c
arch/arm/mach-s3c64xx/pl080.c
+32
-0
arch/arm/plat-samsung/devs.c
arch/arm/plat-samsung/devs.c
+0
-24
drivers/dma/amba-pl08x.c
drivers/dma/amba-pl08x.c
+11
-0
drivers/spi/spi-s3c64xx.c
drivers/spi/spi-s3c64xx.c
+4
-17
include/linux/amba/pl08x.h
include/linux/amba/pl08x.h
+4
-0
include/linux/platform_data/spi-s3c64xx.h
include/linux/platform_data/spi-s3c64xx.h
+0
-3
No files found.
arch/arm/mach-s3c64xx/pl080.c
View file @
57fb7ee1
...
...
@@ -117,6 +117,25 @@ static struct pl08x_channel_data s3c64xx_dma0_info[] = {
}
};
static
const
struct
dma_slave_map
s3c64xx_dma0_slave_map
[]
=
{
{
"s3c6400-uart.0"
,
"tx"
,
&
s3c64xx_dma0_info
[
0
]
},
{
"s3c6400-uart.0"
,
"rx"
,
&
s3c64xx_dma0_info
[
1
]
},
{
"s3c6400-uart.1"
,
"tx"
,
&
s3c64xx_dma0_info
[
2
]
},
{
"s3c6400-uart.1"
,
"rx"
,
&
s3c64xx_dma0_info
[
3
]
},
{
"s3c6400-uart.2"
,
"tx"
,
&
s3c64xx_dma0_info
[
4
]
},
{
"s3c6400-uart.2"
,
"rx"
,
&
s3c64xx_dma0_info
[
5
]
},
{
"s3c6400-uart.3"
,
"tx"
,
&
s3c64xx_dma0_info
[
6
]
},
{
"s3c6400-uart.3"
,
"rx"
,
&
s3c64xx_dma0_info
[
7
]
},
{
"samsung-pcm.0"
,
"tx"
,
&
s3c64xx_dma0_info
[
8
]
},
{
"samsung-pcm.0"
,
"rx"
,
&
s3c64xx_dma0_info
[
9
]
},
{
"samsung-i2s.0"
,
"tx"
,
&
s3c64xx_dma0_info
[
10
]
},
{
"samsung-i2s.0"
,
"rx"
,
&
s3c64xx_dma0_info
[
11
]
},
{
"s3c6410-spi.0"
,
"tx"
,
&
s3c64xx_dma0_info
[
12
]
},
{
"s3c6410-spi.0"
,
"rx"
,
&
s3c64xx_dma0_info
[
13
]
},
{
"samsung-i2s.2"
,
"tx"
,
&
s3c64xx_dma0_info
[
14
]
},
{
"samsung-i2s.2"
,
"rx"
,
&
s3c64xx_dma0_info
[
15
]
},
};
struct
pl08x_platform_data
s3c64xx_dma0_plat_data
=
{
.
memcpy_channel
=
{
.
bus_id
=
"memcpy"
,
...
...
@@ -134,6 +153,8 @@ struct pl08x_platform_data s3c64xx_dma0_plat_data = {
.
put_xfer_signal
=
pl08x_put_xfer_signal
,
.
slave_channels
=
s3c64xx_dma0_info
,
.
num_slave_channels
=
ARRAY_SIZE
(
s3c64xx_dma0_info
),
.
slave_map
=
s3c64xx_dma0_slave_map
,
.
slave_map_len
=
ARRAY_SIZE
(
s3c64xx_dma0_slave_map
),
};
static
AMBA_AHB_DEVICE
(
s3c64xx_dma0
,
"dma-pl080s.0"
,
0
,
...
...
@@ -207,6 +228,15 @@ static struct pl08x_channel_data s3c64xx_dma1_info[] = {
},
};
static
const
struct
dma_slave_map
s3c64xx_dma1_slave_map
[]
=
{
{
"samsung-pcm.1"
,
"tx"
,
&
s3c64xx_dma1_info
[
0
]
},
{
"samsung-pcm.1"
,
"rx"
,
&
s3c64xx_dma1_info
[
1
]
},
{
"samsung-i2s.1"
,
"tx"
,
&
s3c64xx_dma1_info
[
2
]
},
{
"samsung-i2s.1"
,
"rx"
,
&
s3c64xx_dma1_info
[
3
]
},
{
"s3c6410-spi.1"
,
"tx"
,
&
s3c64xx_dma1_info
[
4
]
},
{
"s3c6410-spi.1"
,
"rx"
,
&
s3c64xx_dma1_info
[
5
]
},
};
struct
pl08x_platform_data
s3c64xx_dma1_plat_data
=
{
.
memcpy_channel
=
{
.
bus_id
=
"memcpy"
,
...
...
@@ -224,6 +254,8 @@ struct pl08x_platform_data s3c64xx_dma1_plat_data = {
.
put_xfer_signal
=
pl08x_put_xfer_signal
,
.
slave_channels
=
s3c64xx_dma1_info
,
.
num_slave_channels
=
ARRAY_SIZE
(
s3c64xx_dma1_info
),
.
slave_map
=
s3c64xx_dma1_slave_map
,
.
slave_map_len
=
ARRAY_SIZE
(
s3c64xx_dma1_slave_map
),
};
static
AMBA_AHB_DEVICE
(
s3c64xx_dma1
,
"dma-pl080s.1"
,
0
,
...
...
arch/arm/plat-samsung/devs.c
View file @
57fb7ee1
...
...
@@ -1124,15 +1124,6 @@ void __init s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
pd
.
num_cs
=
num_cs
;
pd
.
src_clk_nr
=
src_clk_nr
;
pd
.
cfg_gpio
=
(
cfg_gpio
)
?
cfg_gpio
:
s3c64xx_spi0_cfg_gpio
;
pd
.
dma_tx
=
(
void
*
)
DMACH_SPI0_TX
;
pd
.
dma_rx
=
(
void
*
)
DMACH_SPI0_RX
;
#if defined(CONFIG_PL330_DMA)
pd
.
filter
=
pl330_filter
;
#elif defined(CONFIG_S3C64XX_PL080)
pd
.
filter
=
pl08x_filter_id
;
#elif defined(CONFIG_S3C24XX_DMAC)
pd
.
filter
=
s3c24xx_dma_filter
;
#endif
s3c_set_platdata
(
&
pd
,
sizeof
(
pd
),
&
s3c64xx_device_spi0
);
}
...
...
@@ -1169,14 +1160,6 @@ void __init s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
pd
.
num_cs
=
num_cs
;
pd
.
src_clk_nr
=
src_clk_nr
;
pd
.
cfg_gpio
=
(
cfg_gpio
)
?
cfg_gpio
:
s3c64xx_spi1_cfg_gpio
;
pd
.
dma_tx
=
(
void
*
)
DMACH_SPI1_TX
;
pd
.
dma_rx
=
(
void
*
)
DMACH_SPI1_RX
;
#if defined(CONFIG_PL330_DMA)
pd
.
filter
=
pl330_filter
;
#elif defined(CONFIG_S3C64XX_PL080)
pd
.
filter
=
pl08x_filter_id
;
#endif
s3c_set_platdata
(
&
pd
,
sizeof
(
pd
),
&
s3c64xx_device_spi1
);
}
...
...
@@ -1213,13 +1196,6 @@ void __init s3c64xx_spi2_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
pd
.
num_cs
=
num_cs
;
pd
.
src_clk_nr
=
src_clk_nr
;
pd
.
cfg_gpio
=
(
cfg_gpio
)
?
cfg_gpio
:
s3c64xx_spi2_cfg_gpio
;
pd
.
dma_tx
=
(
void
*
)
DMACH_SPI2_TX
;
pd
.
dma_rx
=
(
void
*
)
DMACH_SPI2_RX
;
#if defined(CONFIG_PL330_DMA)
pd
.
filter
=
pl330_filter
;
#elif defined(CONFIG_S3C64XX_PL080)
pd
.
filter
=
pl08x_filter_id
;
#endif
s3c_set_platdata
(
&
pd
,
sizeof
(
pd
),
&
s3c64xx_device_spi2
);
}
...
...
drivers/dma/amba-pl08x.c
View file @
57fb7ee1
...
...
@@ -1793,6 +1793,13 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
}
EXPORT_SYMBOL_GPL
(
pl08x_filter_id
);
static
bool
pl08x_filter_fn
(
struct
dma_chan
*
chan
,
void
*
chan_id
)
{
struct
pl08x_dma_chan
*
plchan
=
to_pl08x_chan
(
chan
);
return
plchan
->
cd
==
chan_id
;
}
/*
* Just check that the device is there and active
* TODO: turn this bit on/off depending on the number of physical channels
...
...
@@ -2307,6 +2314,10 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
ret
=
-
EINVAL
;
goto
out_no_platdata
;
}
}
else
{
pl08x
->
slave
.
filter
.
map
=
pl08x
->
pd
->
slave_map
;
pl08x
->
slave
.
filter
.
mapcnt
=
pl08x
->
pd
->
slave_map_len
;
pl08x
->
slave
.
filter
.
fn
=
pl08x_filter_fn
;
}
/* By default, AHB1 only. If dualmaster, from platform */
...
...
drivers/spi/spi-s3c64xx.c
View file @
57fb7ee1
...
...
@@ -341,27 +341,20 @@ static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable)
static
int
s3c64xx_spi_prepare_transfer
(
struct
spi_master
*
spi
)
{
struct
s3c64xx_spi_driver_data
*
sdd
=
spi_master_get_devdata
(
spi
);
dma_filter_fn
filter
=
sdd
->
cntrlr_info
->
filter
;
struct
device
*
dev
=
&
sdd
->
pdev
->
dev
;
dma_cap_mask_t
mask
;
if
(
is_polling
(
sdd
))
return
0
;
dma_cap_zero
(
mask
);
dma_cap_set
(
DMA_SLAVE
,
mask
);
/* Acquire DMA channels */
sdd
->
rx_dma
.
ch
=
dma_request_slave_channel_compat
(
mask
,
filter
,
sdd
->
cntrlr_info
->
dma_rx
,
dev
,
"rx"
);
sdd
->
rx_dma
.
ch
=
dma_request_slave_channel
(
dev
,
"rx"
);
if
(
!
sdd
->
rx_dma
.
ch
)
{
dev_err
(
dev
,
"Failed to get RX DMA channel
\n
"
);
return
-
EBUSY
;
}
spi
->
dma_rx
=
sdd
->
rx_dma
.
ch
;
sdd
->
tx_dma
.
ch
=
dma_request_slave_channel_compat
(
mask
,
filter
,
sdd
->
cntrlr_info
->
dma_tx
,
dev
,
"tx"
);
sdd
->
tx_dma
.
ch
=
dma_request_slave_channel
(
dev
,
"tx"
);
if
(
!
sdd
->
tx_dma
.
ch
)
{
dev_err
(
dev
,
"Failed to get TX DMA channel
\n
"
);
dma_release_channel
(
sdd
->
rx_dma
.
ch
);
...
...
@@ -1091,11 +1084,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
sdd
->
cur_bpw
=
8
;
if
(
!
sdd
->
pdev
->
dev
.
of_node
&&
(
!
sci
->
dma_tx
||
!
sci
->
dma_rx
))
{
dev_warn
(
&
pdev
->
dev
,
"Unable to get SPI tx/rx DMA data. Switching to poll mode
\n
"
);
sdd
->
port_conf
->
quirks
=
S3C64XX_SPI_QUIRK_POLL
;
}
sdd
->
tx_dma
.
direction
=
DMA_MEM_TO_DEV
;
sdd
->
rx_dma
.
direction
=
DMA_DEV_TO_MEM
;
...
...
@@ -1205,9 +1193,8 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
dev_dbg
(
&
pdev
->
dev
,
"Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached
\n
"
,
sdd
->
port_id
,
master
->
num_chipselect
);
dev_dbg
(
&
pdev
->
dev
,
"
\t
IOmem=[%pR]
\t
FIFO %dbytes
\t
DMA=[Rx-%p, Tx-%p]
\n
"
,
mem_res
,
(
FIFO_LVL_MASK
(
sdd
)
>>
1
)
+
1
,
sci
->
dma_rx
,
sci
->
dma_tx
);
dev_dbg
(
&
pdev
->
dev
,
"
\t
IOmem=[%pR]
\t
FIFO %dbytes
\n
"
,
mem_res
,
(
FIFO_LVL_MASK
(
sdd
)
>>
1
)
+
1
);
pm_runtime_mark_last_busy
(
&
pdev
->
dev
);
pm_runtime_put_autosuspend
(
&
pdev
->
dev
);
...
...
include/linux/amba/pl08x.h
View file @
57fb7ee1
...
...
@@ -84,6 +84,8 @@ struct pl08x_channel_data {
* running any DMA transfer and multiplexing can be recycled
* @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2
* @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2
* @slave_map: DMA slave matching table
* @slave_map_len: number of elements in @slave_map
*/
struct
pl08x_platform_data
{
struct
pl08x_channel_data
*
slave_channels
;
...
...
@@ -93,6 +95,8 @@ struct pl08x_platform_data {
void
(
*
put_xfer_signal
)(
const
struct
pl08x_channel_data
*
,
int
);
u8
lli_buses
;
u8
mem_buses
;
const
struct
dma_slave_map
*
slave_map
;
int
slave_map_len
;
};
#ifdef CONFIG_AMBA_PL08X
...
...
include/linux/platform_data/spi-s3c64xx.h
View file @
57fb7ee1
...
...
@@ -40,9 +40,6 @@ struct s3c64xx_spi_info {
int
num_cs
;
bool
no_cs
;
int
(
*
cfg_gpio
)(
void
);
dma_filter_fn
filter
;
void
*
dma_tx
;
void
*
dma_rx
;
};
/**
...
...
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