sensor_hub_input_get_attribute_info(hsdev,
HID_FEATURE_REPORT, usage_id,
- HID_USAGE_SENSOR_PROY_POWER_STATE,
+ HID_USAGE_SENSOR_PROT_POWER_STATE,
&st->power_state);
sensor_hub_input_get_attribute_info(hsdev,
HID_USAGE_SENSOR_PROP_SENSITIVITY_ABS,
&st->sensitivity);
- hid_dbg(hsdev->hdev, "common attributes: %x:%x, %x:%x, %x:%x %x:%x\n",
+ sensor_hub_input_get_attribute_info(hsdev,
+ HID_FEATURE_REPORT, usage_id,
+ HID_USAGE_SENSOR_PROP_SENSOR_CONNECTION_TYPE,
+ &st->conn_type);
+
+ hid_dbg(hsdev->hdev, "common attributes: %x:%x, %x:%x, %x:%x %x:%x %x:%x\n",
st->poll.index, st->poll.report_id,
st->report_state.index, st->report_state.report_id,
st->power_state.index, st->power_state.report_id,
- st->sensitivity.index, st->sensitivity.report_id);
+ st->sensitivity.index, st->sensitivity.report_id,
+ st->conn_type.index, st->conn_type.report_id);
return 0;
}
#include <linux/iio/sysfs.h>
#include "hid-sensor-trigger.h"
+static int hid_sensor_conn_type = HID_USAGE_SENSOR_PROP_CONNEC_TYPE_PC_INT_ENUM;
+module_param(hid_sensor_conn_type, int, 0644);
+MODULE_PARM_DESC(hid_sensor_conn_type, "HID SENSOR CONNECT TYPE (1 to 3).");
+
int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
{
int state_val;
sensor_hub_get_feature(st->hsdev, st->power_state.report_id,
st->power_state.index,
&state_val);
+
+ sensor_hub_set_feature(st->hsdev, st->conn_type.report_id,
+ st->conn_type.index,
+ hid_sensor_conn_type);
+
return 0;
}
EXPORT_SYMBOL(hid_sensor_power_state);
struct hid_sensor_hub_attribute_info report_state;
struct hid_sensor_hub_attribute_info power_state;
struct hid_sensor_hub_attribute_info sensitivity;
+ struct hid_sensor_hub_attribute_info conn_type;
};
/* Convert from hid unit expo to regular exponent */
#define HID_USAGE_SENSOR_UNITS_DEGREES_PER_SECOND 0x15
/* Common selectors */
+#define HID_USAGE_SENSOR_PROP_SENSOR_CONNECTION_TYPE 0x200309
#define HID_USAGE_SENSOR_PROP_REPORT_INTERVAL 0x20030E
#define HID_USAGE_SENSOR_PROP_SENSITIVITY_ABS 0x20030F
#define HID_USAGE_SENSOR_PROP_SENSITIVITY_RANGE_PCT 0x200310
#define HID_USAGE_SENSOR_PROP_RANGE_MAXIMUM 0x200314
#define HID_USAGE_SENSOR_PROP_RANGE_MINIMUM 0x200315
#define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316
-#define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319
+#define HID_USAGE_SENSOR_PROT_POWER_STATE 0x200319
+
+/* Default connection type */
+#define HID_USAGE_SENSOR_PROP_CONNEC_TYPE_PC_INT_ENUM 0x01
/* Per data field properties */
#define HID_USAGE_SENSOR_DATA_MOD_NONE 0x00