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
ded75664
Commit
ded75664
authored
Apr 01, 2014
by
Jiri Kosina
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-3.15/hid-sensor-hub' into for-linus
parents
ad295b6d
ca2ed12f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
164 additions
and
110 deletions
+164
-110
drivers/hid/hid-sensor-hub.c
drivers/hid/hid-sensor-hub.c
+124
-86
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+25
-14
include/linux/hid-sensor-hub.h
include/linux/hid-sensor-hub.h
+7
-2
include/linux/hid-sensor-ids.h
include/linux/hid-sensor-ids.h
+8
-8
No files found.
drivers/hid/hid-sensor-hub.c
View file @
ded75664
This diff is collapsed.
Click to expand it.
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
View file @
ded75664
...
...
@@ -38,29 +38,40 @@ static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig,
if
(
state
)
{
if
(
sensor_hub_device_open
(
st
->
hsdev
))
return
-
EIO
;
state_val
=
HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM
;
report_val
=
HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM
;
state_val
=
hid_sensor_get_usage_index
(
st
->
hsdev
,
st
->
power_state
.
report_id
,
st
->
power_state
.
index
,
HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM
);
report_val
=
hid_sensor_get_usage_index
(
st
->
hsdev
,
st
->
report_state
.
report_id
,
st
->
report_state
.
index
,
HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM
);
}
else
{
sensor_hub_device_close
(
st
->
hsdev
);
state_val
=
HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM
;
report_val
=
HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM
;
state_val
=
hid_sensor_get_usage_index
(
st
->
hsdev
,
st
->
power_state
.
report_id
,
st
->
power_state
.
index
,
HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM
);
report_val
=
hid_sensor_get_usage_index
(
st
->
hsdev
,
st
->
report_state
.
report_id
,
st
->
report_state
.
index
,
HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM
);
}
st
->
data_ready
=
state
;
state_val
+=
st
->
power_state
.
logical_minimum
;
report_val
+=
st
->
report_state
.
logical_minimum
;
sensor_hub_set_feature
(
st
->
hsdev
,
st
->
power_state
.
report_id
,
if
(
state_val
>=
0
)
{
state_val
+=
st
->
power_state
.
logical_minimum
;
sensor_hub_set_feature
(
st
->
hsdev
,
st
->
power_state
.
report_id
,
st
->
power_state
.
index
,
(
s32
)
state_val
);
}
sensor_hub_set_feature
(
st
->
hsdev
,
st
->
report_state
.
report_id
,
if
(
report_val
>=
0
)
{
report_val
+=
st
->
report_state
.
logical_minimum
;
sensor_hub_set_feature
(
st
->
hsdev
,
st
->
report_state
.
report_id
,
st
->
report_state
.
index
,
(
s32
)
report_val
);
}
return
0
;
}
...
...
include/linux/hid-sensor-hub.h
View file @
ded75664
...
...
@@ -51,13 +51,15 @@ struct hid_sensor_hub_attribute_info {
* @hdev: Stores the hid instance.
* @vendor_id: Vendor id of hub device.
* @product_id: Product id of hub device.
* @ref_cnt: Number of MFD clients have opened this device
* @start_collection_index: Starting index for a phy type collection
* @end_collection_index: Last index for a phy type collection
*/
struct
hid_sensor_hub_device
{
struct
hid_device
*
hdev
;
u32
vendor_id
;
u32
product_id
;
int
ref_cnt
;
int
start_collection_index
;
int
end_collection_index
;
};
/**
...
...
@@ -218,4 +220,7 @@ int hid_sensor_write_samp_freq_value(struct hid_sensor_common *st,
int
hid_sensor_read_samp_freq_value
(
struct
hid_sensor_common
*
st
,
int
*
val1
,
int
*
val2
);
int
hid_sensor_get_usage_index
(
struct
hid_sensor_hub_device
*
hsdev
,
u32
report_id
,
int
field_index
,
u32
usage_id
);
#endif
include/linux/hid-sensor-ids.h
View file @
ded75664
...
...
@@ -130,15 +130,15 @@
#define HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS 0x1000
/* Power state enumerations */
#define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM
0x0
0
#define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM
0x0
1
#define HID_USAGE_SENSOR_PROP_POWER_STATE_D1_LOW_POWER_ENUM
0x0
2
#define HID_USAGE_SENSOR_PROP_POWER_STATE_D2_STANDBY_WITH_WAKE_ENUM
0x0
3
#define HID_USAGE_SENSOR_PROP_POWER_STATE_D3_SLEEP_WITH_WAKE_ENUM
0x0
4
#define HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM
0x0
5
#define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM
0x20085
0
#define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM
0x20085
1
#define HID_USAGE_SENSOR_PROP_POWER_STATE_D1_LOW_POWER_ENUM
0x20085
2
#define HID_USAGE_SENSOR_PROP_POWER_STATE_D2_STANDBY_WITH_WAKE_ENUM
0x20085
3
#define HID_USAGE_SENSOR_PROP_POWER_STATE_D3_SLEEP_WITH_WAKE_ENUM
0x20085
4
#define HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM
0x20085
5
/* Report State enumerations */
#define HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM
0x0
0
#define HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM
0x0
1
#define HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM
0x20084
0
#define HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM
0x20084
1
#endif
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