|
@@ -1,27 +1,18 @@
|
|
|
+// SPDX-License-Identifier: GPL-2.0
|
|
|
/*
|
|
|
* Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
|
|
- *
|
|
|
- * This program is free software; you can redistribute it and/or modify
|
|
|
- * it under the terms of the GNU General Public License version 2 and
|
|
|
- * only version 2 as published by the Free Software Foundation.
|
|
|
- *
|
|
|
- * This program is distributed in the hope that it will be useful,
|
|
|
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
- * GNU General Public License for more details.
|
|
|
- *
|
|
|
+ * Copyright (c) 2018, Linaro Limited
|
|
|
*/
|
|
|
|
|
|
-#include <linux/platform_device.h>
|
|
|
#include <linux/regmap.h>
|
|
|
#include "tsens.h"
|
|
|
|
|
|
-#define STATUS_OFFSET 0xa0
|
|
|
-#define LAST_TEMP_MASK 0xfff
|
|
|
+#define STATUS_OFFSET 0xa0
|
|
|
+#define LAST_TEMP_MASK 0xfff
|
|
|
#define STATUS_VALID_BIT BIT(21)
|
|
|
#define CODE_SIGN_BIT BIT(11)
|
|
|
|
|
|
-static int get_temp_8996(struct tsens_device *tmdev, int id, int *temp)
|
|
|
+static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp)
|
|
|
{
|
|
|
struct tsens_sensor *s = &tmdev->sensor[id];
|
|
|
u32 code;
|
|
@@ -73,12 +64,12 @@ done:
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static const struct tsens_ops ops_8996 = {
|
|
|
+static const struct tsens_ops ops_generic_v2 = {
|
|
|
.init = init_common,
|
|
|
- .get_temp = get_temp_8996,
|
|
|
+ .get_temp = get_temp_tsens_v2,
|
|
|
};
|
|
|
|
|
|
const struct tsens_data data_8996 = {
|
|
|
.num_sensors = 13,
|
|
|
- .ops = &ops_8996,
|
|
|
+ .ops = &ops_generic_v2,
|
|
|
};
|