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
60d9edd5
Commit
60d9edd5
authored
Apr 11, 2013
by
Samuel Ortiz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFC: pn533: Turn radio on and off when bringing the device up and down
Signed-off-by:
Samuel Ortiz
<
sameo@linux.intel.com
>
parent
7757dc8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
4 deletions
+35
-4
drivers/nfc/pn533.c
drivers/nfc/pn533.c
+35
-4
No files found.
drivers/nfc/pn533.c
View file @
60d9edd5
...
@@ -163,9 +163,13 @@ struct pn533_fw_version {
...
@@ -163,9 +163,13 @@ struct pn533_fw_version {
};
};
/* PN533_CMD_RF_CONFIGURATION */
/* PN533_CMD_RF_CONFIGURATION */
#define PN533_CFGITEM_TIMING 0x02
#define PN533_CFGITEM_RF_FIELD 0x01
#define PN533_CFGITEM_TIMING 0x02
#define PN533_CFGITEM_MAX_RETRIES 0x05
#define PN533_CFGITEM_MAX_RETRIES 0x05
#define PN533_CFGITEM_PASORI 0x82
#define PN533_CFGITEM_PASORI 0x82
#define PN533_CFGITEM_RF_FIELD_ON 0x1
#define PN533_CFGITEM_RF_FIELD_OFF 0x0
#define PN533_CONFIG_TIMING_102 0xb
#define PN533_CONFIG_TIMING_102 0xb
#define PN533_CONFIG_TIMING_204 0xc
#define PN533_CONFIG_TIMING_204 0xc
...
@@ -2540,9 +2544,36 @@ static int pn533_acr122_poweron_rdr(struct pn533 *dev)
...
@@ -2540,9 +2544,36 @@ static int pn533_acr122_poweron_rdr(struct pn533 *dev)
return
arg
.
rc
;
return
arg
.
rc
;
}
}
static
int
pn533_rf_field
(
struct
nfc_dev
*
nfc_dev
,
u8
rf
)
{
struct
pn533
*
dev
=
nfc_get_drvdata
(
nfc_dev
);
u8
rf_field
=
!!
rf
;
int
rc
;
rc
=
pn533_set_configuration
(
dev
,
PN533_CFGITEM_RF_FIELD
,
(
u8
*
)
&
rf_field
,
1
);
if
(
rc
)
{
nfc_dev_err
(
&
dev
->
interface
->
dev
,
"Error on setting RF field"
);
return
rc
;
}
return
rc
;
}
int
pn533_dev_up
(
struct
nfc_dev
*
nfc_dev
)
{
return
pn533_rf_field
(
nfc_dev
,
1
);
}
int
pn533_dev_down
(
struct
nfc_dev
*
nfc_dev
)
{
return
pn533_rf_field
(
nfc_dev
,
0
);
}
static
struct
nfc_ops
pn533_nfc_ops
=
{
static
struct
nfc_ops
pn533_nfc_ops
=
{
.
dev_up
=
NULL
,
.
dev_up
=
pn533_dev_up
,
.
dev_down
=
NULL
,
.
dev_down
=
pn533_dev_down
,
.
dep_link_up
=
pn533_dep_link_up
,
.
dep_link_up
=
pn533_dep_link_up
,
.
dep_link_down
=
pn533_dep_link_down
,
.
dep_link_down
=
pn533_dep_link_down
,
.
start_poll
=
pn533_start_poll
,
.
start_poll
=
pn533_start_poll
,
...
...
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