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
57f22cd2
Commit
57f22cd2
authored
Feb 19, 2017
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branches 'spi/topic/ti-qspi' and 'spi/topic/topcliff-pch' into spi-next
parents
e2a3b0df
7abfe04c
45e861a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
21 deletions
+25
-21
drivers/spi/spi-ti-qspi.c
drivers/spi/spi-ti-qspi.c
+10
-5
drivers/spi/spi-topcliff-pch.c
drivers/spi/spi-topcliff-pch.c
+15
-16
No files found.
drivers/spi/spi-ti-qspi.c
View file @
57f22cd2
...
@@ -652,7 +652,8 @@ static int ti_qspi_probe(struct platform_device *pdev)
...
@@ -652,7 +652,8 @@ static int ti_qspi_probe(struct platform_device *pdev)
r
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
r
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
if
(
r
==
NULL
)
{
if
(
r
==
NULL
)
{
dev_err
(
&
pdev
->
dev
,
"missing platform data
\n
"
);
dev_err
(
&
pdev
->
dev
,
"missing platform data
\n
"
);
return
-
ENODEV
;
ret
=
-
ENODEV
;
goto
free_master
;
}
}
}
}
...
@@ -669,7 +670,8 @@ static int ti_qspi_probe(struct platform_device *pdev)
...
@@ -669,7 +670,8 @@ static int ti_qspi_probe(struct platform_device *pdev)
irq
=
platform_get_irq
(
pdev
,
0
);
irq
=
platform_get_irq
(
pdev
,
0
);
if
(
irq
<
0
)
{
if
(
irq
<
0
)
{
dev_err
(
&
pdev
->
dev
,
"no irq resource?
\n
"
);
dev_err
(
&
pdev
->
dev
,
"no irq resource?
\n
"
);
return
irq
;
ret
=
irq
;
goto
free_master
;
}
}
mutex_init
(
&
qspi
->
list_lock
);
mutex_init
(
&
qspi
->
list_lock
);
...
@@ -685,15 +687,17 @@ static int ti_qspi_probe(struct platform_device *pdev)
...
@@ -685,15 +687,17 @@ static int ti_qspi_probe(struct platform_device *pdev)
qspi
->
ctrl_base
=
qspi
->
ctrl_base
=
syscon_regmap_lookup_by_phandle
(
np
,
syscon_regmap_lookup_by_phandle
(
np
,
"syscon-chipselects"
);
"syscon-chipselects"
);
if
(
IS_ERR
(
qspi
->
ctrl_base
))
if
(
IS_ERR
(
qspi
->
ctrl_base
))
{
return
PTR_ERR
(
qspi
->
ctrl_base
);
ret
=
PTR_ERR
(
qspi
->
ctrl_base
);
goto
free_master
;
}
ret
=
of_property_read_u32_index
(
np
,
ret
=
of_property_read_u32_index
(
np
,
"syscon-chipselects"
,
"syscon-chipselects"
,
1
,
&
qspi
->
ctrl_reg
);
1
,
&
qspi
->
ctrl_reg
);
if
(
ret
)
{
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
dev_err
(
&
pdev
->
dev
,
"couldn't get ctrl_mod reg index
\n
"
);
"couldn't get ctrl_mod reg index
\n
"
);
return
ret
;
goto
free_master
;
}
}
}
}
...
@@ -743,6 +747,7 @@ static int ti_qspi_probe(struct platform_device *pdev)
...
@@ -743,6 +747,7 @@ static int ti_qspi_probe(struct platform_device *pdev)
if
(
!
ret
)
if
(
!
ret
)
return
0
;
return
0
;
pm_runtime_disable
(
&
pdev
->
dev
);
free_master:
free_master:
spi_master_put
(
master
);
spi_master_put
(
master
);
return
ret
;
return
ret
;
...
...
drivers/spi/spi-topcliff-pch.c
View file @
57f22cd2
...
@@ -591,7 +591,6 @@ static void pch_spi_set_tx(struct pch_spi_data *data, int *bpw)
...
@@ -591,7 +591,6 @@ static void pch_spi_set_tx(struct pch_spi_data *data, int *bpw)
if
(
!
data
->
pkt_rx_buff
)
{
if
(
!
data
->
pkt_rx_buff
)
{
/* flush queue and set status of all transfers to -ENOMEM */
/* flush queue and set status of all transfers to -ENOMEM */
dev_err
(
&
data
->
master
->
dev
,
"%s :kzalloc failed
\n
"
,
__func__
);
list_for_each_entry_safe
(
pmsg
,
tmp
,
data
->
queue
.
next
,
queue
)
{
list_for_each_entry_safe
(
pmsg
,
tmp
,
data
->
queue
.
next
,
queue
)
{
pmsg
->
status
=
-
ENOMEM
;
pmsg
->
status
=
-
ENOMEM
;
...
@@ -622,8 +621,9 @@ static void pch_spi_set_tx(struct pch_spi_data *data, int *bpw)
...
@@ -622,8 +621,9 @@ static void pch_spi_set_tx(struct pch_spi_data *data, int *bpw)
if
(
n_writes
>
PCH_MAX_FIFO_DEPTH
)
if
(
n_writes
>
PCH_MAX_FIFO_DEPTH
)
n_writes
=
PCH_MAX_FIFO_DEPTH
;
n_writes
=
PCH_MAX_FIFO_DEPTH
;
dev_dbg
(
&
data
->
master
->
dev
,
"
\n
%s:Pulling down SSN low - writing "
dev_dbg
(
&
data
->
master
->
dev
,
"0x2 to SSNXCR
\n
"
,
__func__
);
"
\n
%s:Pulling down SSN low - writing 0x2 to SSNXCR
\n
"
,
__func__
);
pch_spi_writereg
(
data
->
master
,
PCH_SSNXCR
,
SSN_LOW
);
pch_spi_writereg
(
data
->
master
,
PCH_SSNXCR
,
SSN_LOW
);
for
(
j
=
0
;
j
<
n_writes
;
j
++
)
for
(
j
=
0
;
j
<
n_writes
;
j
++
)
...
@@ -915,7 +915,6 @@ static void pch_spi_release_dma(struct pch_spi_data *data)
...
@@ -915,7 +915,6 @@ static void pch_spi_release_dma(struct pch_spi_data *data)
dma_release_channel
(
dma
->
chan_rx
);
dma_release_channel
(
dma
->
chan_rx
);
dma
->
chan_rx
=
NULL
;
dma
->
chan_rx
=
NULL
;
}
}
return
;
}
}
static
void
pch_spi_handle_dma
(
struct
pch_spi_data
*
data
,
int
*
bpw
)
static
void
pch_spi_handle_dma
(
struct
pch_spi_data
*
data
,
int
*
bpw
)
...
@@ -1008,7 +1007,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
...
@@ -1008,7 +1007,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
spin_unlock_irqrestore
(
&
data
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
data
->
lock
,
flags
);
/* RX */
/* RX */
dma
->
sg_rx_p
=
k
zalloc
(
sizeof
(
struct
scatterlist
)
*
num
,
GFP_ATOMIC
);
dma
->
sg_rx_p
=
k
calloc
(
num
,
sizeof
(
*
dma
->
sg_rx_p
)
,
GFP_ATOMIC
);
sg_init_table
(
dma
->
sg_rx_p
,
num
);
/* Initialize SG table */
sg_init_table
(
dma
->
sg_rx_p
,
num
);
/* Initialize SG table */
/* offset, length setting */
/* offset, length setting */
sg
=
dma
->
sg_rx_p
;
sg
=
dma
->
sg_rx_p
;
...
@@ -1068,7 +1067,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
...
@@ -1068,7 +1067,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
head
=
0
;
head
=
0
;
}
}
dma
->
sg_tx_p
=
k
zalloc
(
sizeof
(
struct
scatterlist
)
*
num
,
GFP_ATOMIC
);
dma
->
sg_tx_p
=
k
calloc
(
num
,
sizeof
(
*
dma
->
sg_tx_p
)
,
GFP_ATOMIC
);
sg_init_table
(
dma
->
sg_tx_p
,
num
);
/* Initialize SG table */
sg_init_table
(
dma
->
sg_tx_p
,
num
);
/* Initialize SG table */
/* offset, length setting */
/* offset, length setting */
sg
=
dma
->
sg_tx_p
;
sg
=
dma
->
sg_tx_p
;
...
@@ -1181,14 +1180,16 @@ static void pch_spi_process_messages(struct work_struct *pwork)
...
@@ -1181,14 +1180,16 @@ static void pch_spi_process_messages(struct work_struct *pwork)
data
->
cur_trans
=
data
->
cur_trans
=
list_entry
(
data
->
current_msg
->
transfers
.
next
,
list_entry
(
data
->
current_msg
->
transfers
.
next
,
struct
spi_transfer
,
transfer_list
);
struct
spi_transfer
,
transfer_list
);
dev_dbg
(
&
data
->
master
->
dev
,
"%s "
dev_dbg
(
&
data
->
master
->
dev
,
":Getting 1st transfer message
\n
"
,
__func__
);
"%s :Getting 1st transfer message
\n
"
,
__func__
);
}
else
{
}
else
{
data
->
cur_trans
=
data
->
cur_trans
=
list_entry
(
data
->
cur_trans
->
transfer_list
.
next
,
list_entry
(
data
->
cur_trans
->
transfer_list
.
next
,
struct
spi_transfer
,
transfer_list
);
struct
spi_transfer
,
transfer_list
);
dev_dbg
(
&
data
->
master
->
dev
,
"%s "
dev_dbg
(
&
data
->
master
->
dev
,
":Getting next transfer message
\n
"
,
__func__
);
"%s :Getting next transfer message
\n
"
,
__func__
);
}
}
spin_unlock
(
&
data
->
lock
);
spin_unlock
(
&
data
->
lock
);
...
@@ -1233,9 +1234,8 @@ static void pch_spi_process_messages(struct work_struct *pwork)
...
@@ -1233,9 +1234,8 @@ static void pch_spi_process_messages(struct work_struct *pwork)
/* check for delay */
/* check for delay */
if
(
data
->
cur_trans
->
delay_usecs
)
{
if
(
data
->
cur_trans
->
delay_usecs
)
{
dev_dbg
(
&
data
->
master
->
dev
,
"%s:"
dev_dbg
(
&
data
->
master
->
dev
,
"%s:delay in usec=%d
\n
"
,
"delay in usec=%d
\n
"
,
__func__
,
__func__
,
data
->
cur_trans
->
delay_usecs
);
data
->
cur_trans
->
delay_usecs
);
udelay
(
data
->
cur_trans
->
delay_usecs
);
udelay
(
data
->
cur_trans
->
delay_usecs
);
}
}
...
@@ -1292,7 +1292,6 @@ static void pch_free_dma_buf(struct pch_spi_board_data *board_dat,
...
@@ -1292,7 +1292,6 @@ static void pch_free_dma_buf(struct pch_spi_board_data *board_dat,
if
(
dma
->
rx_buf_dma
)
if
(
dma
->
rx_buf_dma
)
dma_free_coherent
(
&
board_dat
->
pdev
->
dev
,
PCH_BUF_SIZE
,
dma_free_coherent
(
&
board_dat
->
pdev
->
dev
,
PCH_BUF_SIZE
,
dma
->
rx_buf_virt
,
dma
->
rx_buf_dma
);
dma
->
rx_buf_virt
,
dma
->
rx_buf_dma
);
return
;
}
}
static
void
pch_alloc_dma_buf
(
struct
pch_spi_board_data
*
board_dat
,
static
void
pch_alloc_dma_buf
(
struct
pch_spi_board_data
*
board_dat
,
...
@@ -1541,11 +1540,11 @@ static int pch_spi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
...
@@ -1541,11 +1540,11 @@ static int pch_spi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
int
i
;
int
i
;
struct
pch_pd_dev_save
*
pd_dev_save
;
struct
pch_pd_dev_save
*
pd_dev_save
;
pd_dev_save
=
kzalloc
(
sizeof
(
struct
pch_
pd_dev_save
),
GFP_KERNEL
);
pd_dev_save
=
kzalloc
(
sizeof
(
*
pd_dev_save
),
GFP_KERNEL
);
if
(
!
pd_dev_save
)
if
(
!
pd_dev_save
)
return
-
ENOMEM
;
return
-
ENOMEM
;
board_dat
=
kzalloc
(
sizeof
(
struct
pch_spi_board_data
),
GFP_KERNEL
);
board_dat
=
kzalloc
(
sizeof
(
*
board_dat
),
GFP_KERNEL
);
if
(
!
board_dat
)
{
if
(
!
board_dat
)
{
retval
=
-
ENOMEM
;
retval
=
-
ENOMEM
;
goto
err_no_mem
;
goto
err_no_mem
;
...
...
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