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
a0a53a43
Commit
a0a53a43
authored
Sep 18, 2014
by
Vinod Koul
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit 'tags/spi-pxa2xx-clk' into for-linus
parents
29897087
afa93c90
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
drivers/spi/Kconfig
drivers/spi/Kconfig
+1
-1
drivers/spi/spi-pxa2xx-pci.c
drivers/spi/spi-pxa2xx-pci.c
+20
-1
No files found.
drivers/spi/Kconfig
View file @
a0a53a43
...
...
@@ -380,7 +380,7 @@ config SPI_PXA2XX
additional documentation can be found a Documentation/spi/pxa2xx.
config SPI_PXA2XX_PCI
def_tristate SPI_PXA2XX && PCI
def_tristate SPI_PXA2XX && PCI
&& COMMON_CLK
config SPI_ROCKCHIP
tristate "Rockchip SPI controller driver"
...
...
drivers/spi/spi-pxa2xx-pci.c
View file @
a0a53a43
...
...
@@ -7,6 +7,8 @@
#include <linux/of_device.h>
#include <linux/module.h>
#include <linux/spi/pxa2xx_spi.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
enum
{
PORT_CE4100
,
...
...
@@ -21,6 +23,7 @@ struct pxa_spi_info {
int
tx_chan_id
;
int
rx_slave_id
;
int
rx_chan_id
;
unsigned
long
max_clk_rate
;
};
static
struct
pxa_spi_info
spi_info_configs
[]
=
{
...
...
@@ -32,6 +35,7 @@ static struct pxa_spi_info spi_info_configs[] = {
.
tx_chan_id
=
-
1
,
.
rx_slave_id
=
-
1
,
.
rx_chan_id
=
-
1
,
.
max_clk_rate
=
3686400
,
},
[
PORT_BYT
]
=
{
.
type
=
LPSS_SSP
,
...
...
@@ -41,6 +45,7 @@ static struct pxa_spi_info spi_info_configs[] = {
.
tx_chan_id
=
0
,
.
rx_slave_id
=
1
,
.
rx_chan_id
=
1
,
.
max_clk_rate
=
50000000
,
},
};
...
...
@@ -53,6 +58,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
struct
pxa2xx_spi_master
spi_pdata
;
struct
ssp_device
*
ssp
;
struct
pxa_spi_info
*
c
;
char
buf
[
40
];
ret
=
pcim_enable_device
(
dev
);
if
(
ret
)
...
...
@@ -84,6 +90,12 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
ssp
->
port_id
=
(
c
->
port_id
>=
0
)
?
c
->
port_id
:
dev
->
devfn
;
ssp
->
type
=
c
->
type
;
snprintf
(
buf
,
sizeof
(
buf
),
"pxa2xx-spi.%d"
,
ssp
->
port_id
);
ssp
->
clk
=
clk_register_fixed_rate
(
&
dev
->
dev
,
buf
,
NULL
,
CLK_IS_ROOT
,
c
->
max_clk_rate
);
if
(
IS_ERR
(
ssp
->
clk
))
return
PTR_ERR
(
ssp
->
clk
);
memset
(
&
pi
,
0
,
sizeof
(
pi
));
pi
.
parent
=
&
dev
->
dev
;
pi
.
name
=
"pxa2xx-spi"
;
...
...
@@ -92,8 +104,10 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
pi
.
size_data
=
sizeof
(
spi_pdata
);
pdev
=
platform_device_register_full
(
&
pi
);
if
(
IS_ERR
(
pdev
))
if
(
IS_ERR
(
pdev
))
{
clk_unregister
(
ssp
->
clk
);
return
PTR_ERR
(
pdev
);
}
pci_set_drvdata
(
dev
,
pdev
);
...
...
@@ -103,8 +117,13 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
static
void
pxa2xx_spi_pci_remove
(
struct
pci_dev
*
dev
)
{
struct
platform_device
*
pdev
=
pci_get_drvdata
(
dev
);
struct
pxa2xx_spi_master
*
spi_pdata
;
spi_pdata
=
dev_get_platdata
(
&
pdev
->
dev
);
platform_device_unregister
(
pdev
);
clk_unregister
(
spi_pdata
->
ssp
.
clk
);
pci_set_drvdata
(
dev
,
NULL
);
}
static
const
struct
pci_device_id
pxa2xx_spi_pci_devices
[]
=
{
...
...
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