Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
27f25ce6
Commit
27f25ce6
authored
Sep 02, 2015
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed vsc330x.c
parent
1436d5e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
.cproject
.cproject
+1
-1
vsc330x.c
src/drivers/misc/vsc330x.c
+6
-2
No files found.
.cproject
View file @
27f25ce6
...
@@ -5,12 +5,12 @@
...
@@ -5,12 +5,12 @@
<storageModule
buildSystemId=
"org.eclipse.cdt.managedbuilder.core.configurationDataProvider"
id=
"cdt.managedbuild.toolchain.gnu.base.1636449201"
moduleId=
"org.eclipse.cdt.core.settings"
name=
"Default"
>
<storageModule
buildSystemId=
"org.eclipse.cdt.managedbuilder.core.configurationDataProvider"
id=
"cdt.managedbuild.toolchain.gnu.base.1636449201"
moduleId=
"org.eclipse.cdt.core.settings"
name=
"Default"
>
<externalSettings/>
<externalSettings/>
<extensions>
<extensions>
<extension
id=
"org.eclipse.cdt.core.ELF"
point=
"org.eclipse.cdt.core.BinaryParser"
/>
<extension
id=
"org.eclipse.cdt.core.GmakeErrorParser"
point=
"org.eclipse.cdt.core.ErrorParser"
/>
<extension
id=
"org.eclipse.cdt.core.GmakeErrorParser"
point=
"org.eclipse.cdt.core.ErrorParser"
/>
<extension
id=
"org.eclipse.cdt.core.CWDLocator"
point=
"org.eclipse.cdt.core.ErrorParser"
/>
<extension
id=
"org.eclipse.cdt.core.CWDLocator"
point=
"org.eclipse.cdt.core.ErrorParser"
/>
<extension
id=
"org.eclipse.cdt.core.GCCErrorParser"
point=
"org.eclipse.cdt.core.ErrorParser"
/>
<extension
id=
"org.eclipse.cdt.core.GCCErrorParser"
point=
"org.eclipse.cdt.core.ErrorParser"
/>
<extension
id=
"org.eclipse.cdt.core.GASErrorParser"
point=
"org.eclipse.cdt.core.ErrorParser"
/>
<extension
id=
"org.eclipse.cdt.core.GASErrorParser"
point=
"org.eclipse.cdt.core.ErrorParser"
/>
<extension
id=
"org.eclipse.cdt.core.GLDErrorParser"
point=
"org.eclipse.cdt.core.ErrorParser"
/>
<extension
id=
"org.eclipse.cdt.core.GLDErrorParser"
point=
"org.eclipse.cdt.core.ErrorParser"
/>
<extension
id=
"org.eclipse.cdt.core.ELF"
point=
"org.eclipse.cdt.core.BinaryParser"
/>
</extensions>
</extensions>
</storageModule>
</storageModule>
<storageModule
moduleId=
"cdtBuildSystem"
version=
"4.0.0"
>
<storageModule
moduleId=
"cdtBuildSystem"
version=
"4.0.0"
>
...
...
src/drivers/misc/vsc330x.c
View file @
27f25ce6
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <linux/of.h>
#include <linux/of.h>
#define DRV_VERSION "1.0"
#define DRV_VERSION "1.0"
/* TODO: Descriptions from vsc3312 - check differences */
/* TODO: Descriptions from vsc3312 - check differences */
#define I2C_PAGE_CONNECTION 0x00
/* When written to I2C_CURRENT_PAGE, makes registers 0..0xf control corresponding output (0..0xf) source
#define I2C_PAGE_CONNECTION 0x00
/* When written to I2C_CURRENT_PAGE, makes registers 0..0xf control corresponding output (0..0xf) source
(input number) bit 4 (+0x10) - turn output off, bits 3:0 - source */
(input number) bit 4 (+0x10) - turn output off, bits 3:0 - source */
...
@@ -99,7 +100,7 @@
...
@@ -99,7 +100,7 @@
#define I2C_INTERFACE_MODE 0x79
#define I2C_INTERFACE_MODE 0x79
#define I2C_INTERFACE_MODE_DATA 0x02
/* i2c (1 - 4-wire) */
#define I2C_INTERFACE_MODE_DATA 0x02
/* i2c (1 - 4-wire) */
#define I2C_SOFTWARE_RESET 0x7a
#define I2C_SOFTWARE_RESET 0x7a
#define I2C_SOFTWARE_RESET_DATA 0x10
/* to reset, 0 - normal */
//#define I2C_SOFTWARE_RESET_DATA 0x10 /* to reset, 0 - normal */ not used - but number 4 is used instead
#define I2C_CURRENT_PAGE 0x7f
#define I2C_CURRENT_PAGE 0x7f
#define PORT_PEFIX "port_"
#define PORT_PEFIX "port_"
#define ALL_PORTS "all"
#define ALL_PORTS "all"
...
@@ -650,7 +651,10 @@ static int _init_device(struct i2c_client *client, int address_mode_data)
...
@@ -650,7 +651,10 @@ static int _init_device(struct i2c_client *client, int address_mode_data)
int
rc
;
int
rc
;
if
(((
rc
=
write_reg
(
client
,
I2C_INTERFACE_MODE
,
I2C_INTERFACE_MODE_DATA
)))
<
0
)
return
rc
;
if
(((
rc
=
write_reg
(
client
,
I2C_INTERFACE_MODE
,
I2C_INTERFACE_MODE_DATA
)))
<
0
)
return
rc
;
if
(
address_mode_data
>=
0
){
/* only write if needed, 3304 needs, 3312 - does not, 3308 - ? */
if
(
address_mode_data
>=
0
){
/* only write if needed, 3304 needs, 3312 - does not, 3308 - ? */
if
(((
rc
=
write_reg
(
client
,
I2C_SOFTWARE_RESET_DATA
,
address_mode_data
)))
<
0
)
return
rc
;
// if (((rc=write_reg(client, I2C_SOFTWARE_RESET_DATA, address_mode_data)))<0) return rc;
// this bug caused me to assemble a new board, urgently find vsc3304 chip,spend several days trying to troubleshoot...
// Just five extra characters!
if
(((
rc
=
write_reg
(
client
,
I2C_SOFTWARE_RESET
,
address_mode_data
)))
<
0
)
return
rc
;
}
}
if
(((
rc
=
write_reg
(
client
,
I2C_CURRENT_PAGE
,
0
)))
<
0
)
return
rc
;
if
(((
rc
=
write_reg
(
client
,
I2C_CURRENT_PAGE
,
0
)))
<
0
)
return
rc
;
return
0
;
return
0
;
...
...
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