static ssize_t gyro_get_temp(struct device *dev,
                             struct device_attribute *attr, char *buf)
{
    short temperature = 0;
    struct ssp_data *data = dev_get_drvdata(dev);

    if (k330_rev > 0) {
        if (is_jf_eur == true) {
            if (data->ap_rev == 13)
                temperature = mpu6500_gyro_get_temp(data);
            else if (data->ap_rev >= k330_rev)
                temperature = (short)k330_gyro_get_temp(data);
            else
                temperature = mpu6500_gyro_get_temp(data);
        } else {
            if (data->ap_rev >= k330_rev)
                temperature = (short)k330_gyro_get_temp(data);
            else
                temperature = mpu6500_gyro_get_temp(data);
        }
    } else
        temperature = mpu6500_gyro_get_temp(data);

    return sprintf(buf, "%d\n", temperature);
}
Example #2
0
static ssize_t gyro_get_temp(struct device *dev,
	struct device_attribute *attr, char *buf)
{
	short temperature = 0;
	struct ssp_data *data = dev_get_drvdata(dev);
#ifdef K330_REV
	if (data->ap_rev >= K330_REV)
		temperature = (short)k330_gyro_get_temp(data);
	else
		temperature = mpu6500_gyro_get_temp(data);
#else
	temperature = mpu6500_gyro_get_temp(data);
#endif
	return sprintf(buf, "%d\n", temperature);
}