Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC ADC 100M 14b 4cha - Software
Commits
110bf60e
Commit
110bf60e
authored
Aug 27, 2012
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fa-zio-drv.c: add temperature attribute to zio device
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
067dc0de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
fa-zio-drv.c
fa-zio-drv.c
+13
-1
fmc-adc.h
fmc-adc.h
+1
-0
No files found.
fa-zio-drv.c
View file @
110bf60e
...
...
@@ -201,6 +201,11 @@ static struct zio_attribute zfad_chan_ext_zattr[] = {
ZATTR_EXT_REG
(
"in-range"
,
S_IRUGO
|
S_IWUGO
,
ZFA_CHx_CTL_RANGE
,
0x11
),
PARAM_EXT_REG
(
"current-value"
,
S_IRUGO
,
ZFA_CHx_STA
,
0
),
};
static
struct
zio_attribute
zfad_dev_ext_zattr
[]
=
{
/* Get Mezzanine temperature from onewire */
PARAM_EXT_REG
(
"temperature"
,
S_IRUGO
,
ZFA_SW_R_NOADDRES_TEMP
,
0
),
};
/* Calculate correct index for channel from CHx indexes */
static
inline
int
zfad_get_chx_index
(
unsigned
long
addr
,
struct
zio_channel
*
chan
)
...
...
@@ -295,6 +300,10 @@ static int zfad_info_get(struct device *dev, struct zio_attribute *zattr,
int
i
;
switch
(
zattr
->
priv
.
addr
)
{
case
ZFA_SW_R_NOADDRES_TEMP
:
/* Read temperature from onewire */
*
usr_val
=
fa_read_temp
(
fa
,
0
);
return
0
;
case
ZFA_CHx_CTL_RANGE
:
case
ZFA_CHx_STA
:
case
ZFA_CHx_GAIN
:
...
...
@@ -433,7 +442,10 @@ static struct zio_device zfad_tmpl = {
.
flags
=
0
,
.
cset
=
zfad_cset
,
.
n_cset
=
ARRAY_SIZE
(
zfad_cset
),
.
zattr_set
=
{
.
ext_zattr
=
zfad_dev_ext_zattr
,
.
n_ext_attr
=
ARRAY_SIZE
(
zfad_dev_ext_zattr
),
},
/* This driver work only with the fmc-adc-trg */
.
preferred_trigger
=
"fmc-adc-trg"
,
.
preferred_buffer
=
"kmalloc"
,
...
...
fmc-adc.h
View file @
110bf60e
...
...
@@ -308,6 +308,7 @@ extern void fa_spec_exit(void);
/* Functions exported by onewire.c */
extern
int
fa_onewire_init
(
struct
fa_dev
*
fa
);
extern
void
fa_onewire_exit
(
struct
fa_dev
*
fa
);
extern
int
fa_read_temp
(
struct
fa_dev
*
fa
,
int
verbose
);
#endif
/* __KERNEL__ */
#endif
/* _fa_dev_H_ */
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