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
c1f1a9d4
Commit
c1f1a9d4
authored
Jun 30, 2012
by
Jonathan Cameron
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixes-togreg' into togreg
parents
2da049bd
06d5199d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
11 deletions
+28
-11
drivers/staging/iio/Documentation/iio_utils.h
drivers/staging/iio/Documentation/iio_utils.h
+19
-5
drivers/staging/iio/accel/adis16204_core.c
drivers/staging/iio/accel/adis16204_core.c
+1
-1
drivers/staging/iio/accel/adis16240_core.c
drivers/staging/iio/accel/adis16240_core.c
+6
-3
drivers/staging/iio/adc/ad7793.c
drivers/staging/iio/adc/ad7793.c
+2
-2
No files found.
drivers/staging/iio/Documentation/iio_utils.h
View file @
c1f1a9d4
...
@@ -158,7 +158,8 @@ inline int iioutils_get_type(unsigned *is_signed,
...
@@ -158,7 +158,8 @@ inline int iioutils_get_type(unsigned *is_signed,
&
padint
,
shift
);
&
padint
,
shift
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
printf
(
"failed to pass scan type description
\n
"
);
printf
(
"failed to pass scan type description
\n
"
);
return
ret
;
ret
=
-
errno
;
goto
error_close_sysfsfp
;
}
}
*
be
=
(
endianchar
==
'b'
);
*
be
=
(
endianchar
==
'b'
);
*
bytes
=
padint
/
8
;
*
bytes
=
padint
/
8
;
...
@@ -174,7 +175,11 @@ inline int iioutils_get_type(unsigned *is_signed,
...
@@ -174,7 +175,11 @@ inline int iioutils_get_type(unsigned *is_signed,
free
(
filename
);
free
(
filename
);
filename
=
0
;
filename
=
0
;
sysfsfp
=
0
;
}
}
error_close_sysfsfp:
if
(
sysfsfp
)
fclose
(
sysfsfp
);
error_free_filename:
error_free_filename:
if
(
filename
)
if
(
filename
)
free
(
filename
);
free
(
filename
);
...
@@ -468,23 +473,30 @@ inline int find_type_by_name(const char *name, const char *type)
...
@@ -468,23 +473,30 @@ inline int find_type_by_name(const char *name, const char *type)
+
strlen
(
type
)
+
strlen
(
type
)
+
numstrlen
+
numstrlen
+
6
);
+
6
);
if
(
filename
==
NULL
)
if
(
filename
==
NULL
)
{
closedir
(
dp
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
sprintf
(
filename
,
"%s%s%d/name"
,
sprintf
(
filename
,
"%s%s%d/name"
,
iio_dir
,
iio_dir
,
type
,
type
,
number
);
number
);
nameFile
=
fopen
(
filename
,
"r"
);
nameFile
=
fopen
(
filename
,
"r"
);
if
(
!
nameFile
)
if
(
!
nameFile
)
{
free
(
filename
);
continue
;
continue
;
}
free
(
filename
);
free
(
filename
);
fscanf
(
nameFile
,
"%s"
,
thisname
);
fscanf
(
nameFile
,
"%s"
,
thisname
);
if
(
strcmp
(
name
,
thisname
)
==
0
)
return
number
;
fclose
(
nameFile
);
fclose
(
nameFile
);
if
(
strcmp
(
name
,
thisname
)
==
0
)
{
closedir
(
dp
);
return
number
;
}
}
}
}
}
}
}
closedir
(
dp
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
@@ -513,6 +525,7 @@ inline int _write_sysfs_int(char *filename, char *basedir, int val, int verify)
...
@@ -513,6 +525,7 @@ inline int _write_sysfs_int(char *filename, char *basedir, int val, int verify)
goto
error_free
;
goto
error_free
;
}
}
fscanf
(
sysfsfp
,
"%d"
,
&
test
);
fscanf
(
sysfsfp
,
"%d"
,
&
test
);
fclose
(
sysfsfp
);
if
(
test
!=
val
)
{
if
(
test
!=
val
)
{
printf
(
"Possible failure in int write %d to %s%s
\n
"
,
printf
(
"Possible failure in int write %d to %s%s
\n
"
,
val
,
val
,
...
@@ -562,6 +575,7 @@ int _write_sysfs_string(char *filename, char *basedir, char *val, int verify)
...
@@ -562,6 +575,7 @@ int _write_sysfs_string(char *filename, char *basedir, char *val, int verify)
goto
error_free
;
goto
error_free
;
}
}
fscanf
(
sysfsfp
,
"%s"
,
temp
);
fscanf
(
sysfsfp
,
"%s"
,
temp
);
fclose
(
sysfsfp
);
if
(
strcmp
(
temp
,
val
)
!=
0
)
{
if
(
strcmp
(
temp
,
val
)
!=
0
)
{
printf
(
"Possible failure in string write of %s "
printf
(
"Possible failure in string write of %s "
"Should be %s "
"Should be %s "
...
...
drivers/staging/iio/accel/adis16204_core.c
View file @
c1f1a9d4
...
@@ -381,7 +381,7 @@ static int adis16204_read_raw(struct iio_dev *indio_dev,
...
@@ -381,7 +381,7 @@ static int adis16204_read_raw(struct iio_dev *indio_dev,
return
IIO_VAL_INT_PLUS_MICRO
;
return
IIO_VAL_INT_PLUS_MICRO
;
case
IIO_ACCEL
:
case
IIO_ACCEL
:
*
val
=
0
;
*
val
=
0
;
if
(
chan
->
channel
==
'x'
)
if
(
chan
->
channel
2
==
IIO_MOD_X
)
*
val2
=
17125
;
*
val2
=
17125
;
else
else
*
val2
=
8407
;
*
val2
=
8407
;
...
...
drivers/staging/iio/accel/adis16240_core.c
View file @
c1f1a9d4
...
@@ -500,7 +500,8 @@ static struct iio_chan_spec adis16240_channels[] = {
...
@@ -500,7 +500,8 @@ static struct iio_chan_spec adis16240_channels[] = {
.
channel2
=
IIO_MOD_X
,
.
channel2
=
IIO_MOD_X
,
.
info_mask
=
IIO_CHAN_INFO_RAW_SEPARATE_BIT
|
.
info_mask
=
IIO_CHAN_INFO_RAW_SEPARATE_BIT
|
IIO_CHAN_INFO_SCALE_SHARED_BIT
|
IIO_CHAN_INFO_SCALE_SHARED_BIT
|
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT
,
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT
|
IIO_CHAN_INFO_PEAK_SEPARATE_BIT
,
.
address
=
accel_x
,
.
address
=
accel_x
,
.
scan_index
=
ADIS16240_SCAN_ACC_X
,
.
scan_index
=
ADIS16240_SCAN_ACC_X
,
.
scan_type
=
{
.
scan_type
=
{
...
@@ -514,7 +515,8 @@ static struct iio_chan_spec adis16240_channels[] = {
...
@@ -514,7 +515,8 @@ static struct iio_chan_spec adis16240_channels[] = {
.
channel2
=
IIO_MOD_Y
,
.
channel2
=
IIO_MOD_Y
,
.
info_mask
=
IIO_CHAN_INFO_RAW_SEPARATE_BIT
|
.
info_mask
=
IIO_CHAN_INFO_RAW_SEPARATE_BIT
|
IIO_CHAN_INFO_SCALE_SHARED_BIT
|
IIO_CHAN_INFO_SCALE_SHARED_BIT
|
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT
,
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT
|
IIO_CHAN_INFO_PEAK_SEPARATE_BIT
,
.
address
=
accel_y
,
.
address
=
accel_y
,
.
scan_index
=
ADIS16240_SCAN_ACC_Y
,
.
scan_index
=
ADIS16240_SCAN_ACC_Y
,
.
scan_type
=
{
.
scan_type
=
{
...
@@ -528,7 +530,8 @@ static struct iio_chan_spec adis16240_channels[] = {
...
@@ -528,7 +530,8 @@ static struct iio_chan_spec adis16240_channels[] = {
.
channel2
=
IIO_MOD_Z
,
.
channel2
=
IIO_MOD_Z
,
.
info_mask
=
IIO_CHAN_INFO_RAW_SEPARATE_BIT
|
.
info_mask
=
IIO_CHAN_INFO_RAW_SEPARATE_BIT
|
IIO_CHAN_INFO_SCALE_SHARED_BIT
|
IIO_CHAN_INFO_SCALE_SHARED_BIT
|
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT
,
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT
|
IIO_CHAN_INFO_PEAK_SEPARATE_BIT
,
.
address
=
accel_z
,
.
address
=
accel_z
,
.
scan_index
=
ADIS16240_SCAN_ACC_Z
,
.
scan_index
=
ADIS16240_SCAN_ACC_Z
,
.
scan_type
=
{
.
scan_type
=
{
...
...
drivers/staging/iio/adc/ad7793.c
View file @
c1f1a9d4
...
@@ -758,7 +758,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
...
@@ -758,7 +758,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.
address
=
AD7793_CH_AIN1M_AIN1M
,
.
address
=
AD7793_CH_AIN1M_AIN1M
,
.
info_mask
=
IIO_CHAN_INFO_RAW_SEPARATE_BIT
|
.
info_mask
=
IIO_CHAN_INFO_RAW_SEPARATE_BIT
|
IIO_CHAN_INFO_SCALE_SHARED_BIT
,
IIO_CHAN_INFO_SCALE_SHARED_BIT
,
.
scan_index
=
2
,
.
scan_index
=
3
,
.
scan_type
=
IIO_ST
(
's'
,
24
,
32
,
0
)
.
scan_type
=
IIO_ST
(
's'
,
24
,
32
,
0
)
},
},
.
channel
[
4
]
=
{
.
channel
[
4
]
=
{
...
@@ -831,7 +831,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
...
@@ -831,7 +831,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.
address
=
AD7793_CH_AIN1M_AIN1M
,
.
address
=
AD7793_CH_AIN1M_AIN1M
,
.
info_mask
=
IIO_CHAN_INFO_RAW_SEPARATE_BIT
|
.
info_mask
=
IIO_CHAN_INFO_RAW_SEPARATE_BIT
|
IIO_CHAN_INFO_SCALE_SHARED_BIT
,
IIO_CHAN_INFO_SCALE_SHARED_BIT
,
.
scan_index
=
2
,
.
scan_index
=
3
,
.
scan_type
=
IIO_ST
(
's'
,
16
,
32
,
0
)
.
scan_type
=
IIO_ST
(
's'
,
16
,
32
,
0
)
},
},
.
channel
[
4
]
=
{
.
channel
[
4
]
=
{
...
...
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