return sensor_sts;
}
+const char *get_sensor_name(int idx)
+{
+ switch (idx) {
+ case accel_idx:
+ return "accelerometer";
+ case gyro_idx:
+ return "gyroscope";
+ case mag_idx:
+ return "magnetometer";
+ case als_idx:
+ return "ALS";
+ case HPD_IDX:
+ return "HPD";
+ default:
+ return "unknown sensor type";
+ }
+}
+
int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
{
struct amd_input_data *in_data = &privdata->in_data;
(privdata, cl_data->sensor_idx[i], SENSOR_DISABLED);
if (status != SENSOR_ENABLED)
cl_data->sensor_sts[i] = SENSOR_DISABLED;
- dev_dbg(dev, "sid 0x%x status 0x%x\n",
- cl_data->sensor_idx[i], cl_data->sensor_sts[i]);
+ dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n",
+ cl_data->sensor_idx[i],
+ get_sensor_name(cl_data->sensor_idx[i]),
+ cl_data->sensor_sts[i]);
goto cleanup;
}
}
- dev_dbg(dev, "sid 0x%x status 0x%x\n",
- cl_data->sensor_idx[i], cl_data->sensor_sts[i]);
+ dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n",
+ cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]),
+ cl_data->sensor_sts[i]);
}
if (privdata->mp2_ops->discovery_status &&
privdata->mp2_ops->discovery_status(privdata) == 0) {
(privdata, cl_data->sensor_idx[i], SENSOR_DISABLED);
if (status != SENSOR_ENABLED)
cl_data->sensor_sts[i] = SENSOR_DISABLED;
- dev_dbg(&privdata->pdev->dev, "stopping sid 0x%x status 0x%x\n",
- cl_data->sensor_idx[i], cl_data->sensor_sts[i]);
+ dev_dbg(&privdata->pdev->dev, "stopping sid 0x%x (%s) status 0x%x\n",
+ cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]),
+ cl_data->sensor_sts[i]);
}
}
(mp2, cl_data->sensor_idx[i], SENSOR_ENABLED);
if (status == SENSOR_ENABLED)
cl_data->sensor_sts[i] = SENSOR_ENABLED;
- dev_dbg(dev, "resume sid 0x%x status 0x%x\n",
- cl_data->sensor_idx[i], cl_data->sensor_sts[i]);
+ dev_dbg(dev, "suspend sid 0x%x (%s) status 0x%x\n",
+ cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]),
+ cl_data->sensor_sts[i]);
}
}
(mp2, cl_data->sensor_idx[i], SENSOR_DISABLED);
if (status != SENSOR_ENABLED)
cl_data->sensor_sts[i] = SENSOR_DISABLED;
- dev_dbg(dev, "suspend sid 0x%x status 0x%x\n",
- cl_data->sensor_idx[i], cl_data->sensor_sts[i]);
+ dev_dbg(dev, "suspend sid 0x%x (%s) status 0x%x\n",
+ cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]),
+ cl_data->sensor_sts[i]);
}
}