Merge tag 'sound-5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[linux-2.6-microblaze.git] / drivers / iio / light / hid-sensor-prox.c
index e9e00ce..17d167c 100644 (file)
@@ -28,6 +28,11 @@ struct prox_state {
        int scale_precision;
 };
 
+static const u32 prox_sensitivity_addresses[] = {
+       HID_USAGE_SENSOR_HUMAN_PRESENCE,
+       HID_USAGE_SENSOR_DATA_PRESENCE,
+};
+
 /* Channel definitions */
 static const struct iio_chan_spec prox_channels[] = {
        {
@@ -220,29 +225,6 @@ static int prox_parse_report(struct platform_device *pdev,
        dev_dbg(&pdev->dev, "prox %x:%x\n", st->prox_attr.index,
                        st->prox_attr.report_id);
 
-       /* Set Sensitivity field ids, when there is no individual modifier */
-       if (st->common_attributes.sensitivity.index < 0) {
-               sensor_hub_input_get_attribute_info(hsdev,
-                       HID_FEATURE_REPORT, usage_id,
-                       HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS |
-                       HID_USAGE_SENSOR_DATA_PRESENCE,
-                       &st->common_attributes.sensitivity);
-               dev_dbg(&pdev->dev, "Sensitivity index:report %d:%d\n",
-                       st->common_attributes.sensitivity.index,
-                       st->common_attributes.sensitivity.report_id);
-       }
-       if (st->common_attributes.sensitivity.index < 0)
-               sensor_hub_input_get_attribute_info(hsdev,
-                       HID_FEATURE_REPORT, usage_id,
-                       HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS |
-                       HID_USAGE_SENSOR_HUMAN_PRESENCE,
-                       &st->common_attributes.sensitivity);
-
-       st->scale_precision = hid_sensor_format_scale(
-                               hsdev->usage,
-                               &st->prox_attr,
-                               &st->scale_pre_decml, &st->scale_post_decml);
-
        return ret;
 }
 
@@ -266,7 +248,9 @@ static int hid_prox_probe(struct platform_device *pdev)
        prox_state->common_attributes.pdev = pdev;
 
        ret = hid_sensor_parse_common_attributes(hsdev, HID_USAGE_SENSOR_PROX,
-                                       &prox_state->common_attributes);
+                                       &prox_state->common_attributes,
+                                       prox_sensitivity_addresses,
+                                       ARRAY_SIZE(prox_sensitivity_addresses));
        if (ret) {
                dev_err(&pdev->dev, "failed to setup common attributes\n");
                return ret;