BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
c6878f74
Commit
c6878f74
authored
Sep 29, 2017
by
David Clark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates to use the current cp2130 driver changes
parent
220ee96b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
21 deletions
+28
-21
io.c
linux_kernel_modules/mt7697q/io.c
+3
-4
queue.c
linux_kernel_modules/mt7697q/queue.c
+7
-7
queue.h
linux_kernel_modules/mt7697q/queue.h
+1
-1
spi.c
linux_kernel_modules/mt7697q/spi.c
+16
-7
spi.h
linux_kernel_modules/mt7697q/spi.h
+1
-2
No files found.
linux_kernel_modules/mt7697q/io.c
View file @
c6878f74
...
...
@@ -83,16 +83,15 @@ static int mt7697io_read16(struct mt7697q_info *qinfo, u8 reg, u16 *value)
qinfo
->
txBuffer
[
0
]
=
MT7697_IO_CMD_READ
;
qinfo
->
txBuffer
[
1
]
=
reg
;
ret
=
qinfo
->
hw_ops
->
write_then_read
(
qinfo
->
hw_priv
,
qinfo
->
txBuffer
,
sizeof
(
u16
),
qinfo
->
rxBuffer
,
sizeof
(
qinfo
->
rxBuffer
));
ret
=
qinfo
->
hw_ops
->
write_then_read
(
qinfo
->
hw_priv
,
qinfo
->
txBuffer
,
qinfo
->
rxBuffer
,
sizeof
(
u16
)
+
sizeof
(
u16
));
if
(
ret
<
0
)
{
dev_err
(
qinfo
->
dev
,
"%s(): write_then_read() failed(%d)
\n
"
,
__func__
,
ret
);
goto
cleanup
;
}
*
value
=
((
qinfo
->
rxBuffer
[
0
]
<<
8
)
|
qinfo
->
rxBuffer
[
1
]);
*
value
=
((
qinfo
->
rxBuffer
[
2
]
<<
8
)
|
qinfo
->
rxBuffer
[
3
]);
cleanup:
return
ret
;
...
...
linux_kernel_modules/mt7697q/queue.c
View file @
c6878f74
...
...
@@ -426,14 +426,14 @@ int mt7697q_proc_data(struct mt7697q_spec *qsS2M)
dev_dbg
(
qsS2M
->
qinfo
->
dev
,
"%s(): avail(%u) len(%u) req(%u)
\n
"
,
__func__
,
avail
,
qsS2M
->
qinfo
->
rsp
.
cmd
.
len
,
req
);
}
}
ret
=
mt7697q_push_rd_ptr
(
qsS2M
);
if
(
ret
<
0
)
{
dev_err
(
qsS2M
->
qinfo
->
dev
,
"%s(): mt7697q_push_rd_ptr() failed(%d)
\n
"
,
__func__
,
ret
);
goto
cleanup
;
ret
=
mt7697q_push_rd_ptr
(
qsS2M
);
if
(
ret
<
0
)
{
dev_err
(
qsS2M
->
qinfo
->
dev
,
"%s(): mt7697q_push_rd_ptr() failed(%d)
\n
"
,
__func__
,
ret
);
goto
cleanup
;
}
}
cleanup:
...
...
linux_kernel_modules/mt7697q/queue.h
View file @
c6878f74
...
...
@@ -55,7 +55,7 @@ struct mt7697q_info {
struct
mt7697q_spec
queues
[
MT7697_NUM_QUEUES
];
struct
mt7697q_rsp_hdr
rsp
;
u8
txBuffer
[
sizeof
(
u32
)];
u8
rxBuffer
[
sizeof
(
u
16
)];
u8
rxBuffer
[
sizeof
(
u
32
)];
struct
device
*
dev
;
void
*
hw_priv
;
...
...
linux_kernel_modules/mt7697q/spi.c
View file @
c6878f74
...
...
@@ -30,6 +30,18 @@
#include "queue.h"
#include "spi.h"
static
int
mt7697spi_write_then_read
(
struct
spi_device
*
spi
,
const
void
*
txbuf
,
void
*
rxbuf
,
unsigned
len
)
{
struct
spi_transfer
transfer
=
{
.
tx_buf
=
txbuf
,
.
rx_buf
=
rxbuf
,
.
len
=
len
,
};
return
spi_sync_transfer
(
spi
,
&
transfer
,
1
);
}
static
void
mt7697spi_reset
(
struct
spi_device
*
spi
)
{
...
...
@@ -53,7 +65,7 @@ static const struct mt7697spi_hw_ops hw_ops =
{
.
write
=
spi_write
,
.
read
=
spi_read
,
.
write_then_read
=
spi_write_then_read
,
.
write_then_read
=
mt7697
spi_write_then_read
,
.
reset
=
mt7697spi_reset
,
.
enable_irq
=
mt7697spi_enable_irq
,
.
disable_irq
=
mt7697spi_disable_irq
,
...
...
@@ -72,8 +84,6 @@ static int __init mt7697spi_init(void)
pr_info
(
DRVNAME
" %s(): '%s' initialize
\n
"
,
__func__
,
DRVNAME
);
while
(
!
master
&&
(
bus_num
>=
0
))
{
// pr_info(DRVNAME" %s(): get SPI master bus(%u)\n",
// __func__, bus_num);
master
=
spi_busnum_to_master
(
bus_num
);
if
(
!
master
)
bus_num
--
;
...
...
@@ -136,9 +146,10 @@ static int __init mt7697spi_init(void)
INIT_DELAYED_WORK
(
&
qinfo
->
irq_delayed_work
,
mt7697_irq_delayed_work
);
INIT_WORK
(
&
qinfo
->
irq_work
,
mt7697_irq_work
);
qinfo
->
irq_workq
=
create_workqueue
(
DRVNAME
"wq"
);
qinfo
->
irq_workq
=
alloc_workqueue
(
DRVNAME
"wq"
,
WQ_HIGHPRI
|
WQ_MEM_RECLAIM
|
WQ_UNBOUND
,
1
);
if
(
!
qinfo
->
irq_workq
)
{
dev_err
(
qinfo
->
dev
,
"%s():
create
_workqueue() failed
\n
"
,
dev_err
(
qinfo
->
dev
,
"%s():
alloc
_workqueue() failed
\n
"
,
__func__
);
ret
=
-
ENOMEM
;
goto
cleanup
;
...
...
@@ -189,8 +200,6 @@ static void __exit mt7697spi_exit(void)
int
bus_num
=
MT7697_SPI_BUS_NUM
;
while
(
!
master
&&
(
bus_num
>=
0
))
{
// pr_info(DRVNAME" %s(): get SPI master bus(%u)\n",
// __func__, bus_num);
master
=
spi_busnum_to_master
(
bus_num
);
if
(
!
master
)
bus_num
--
;
...
...
linux_kernel_modules/mt7697q/spi.h
View file @
c6878f74
...
...
@@ -36,8 +36,7 @@
struct
mt7697spi_hw_ops
{
int
(
*
write
)(
struct
spi_device
*
,
const
void
*
,
size_t
);
int
(
*
read
)(
struct
spi_device
*
,
void
*
,
size_t
);
int
(
*
write_then_read
)(
struct
spi_device
*
,
const
void
*
,
unsigned
,
void
*
,
unsigned
);
int
(
*
write_then_read
)(
struct
spi_device
*
,
const
void
*
,
void
*
,
unsigned
);
void
(
*
reset
)(
struct
spi_device
*
);
void
(
*
enable_irq
)(
struct
spi_device
*
);
void
(
*
disable_irq
)(
struct
spi_device
*
);
...
...
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