Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73f4f4ec authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss
Browse files

hwmon: qpnp-adc: Update temperature to voltage table



Update the temperature units in the translation table
used to map voltage to temperature and vice versa.
Thermal zone prefers units to be in units of millidegC.
Therefore update the temperature units in the table
to provide the output of the voltage to temperature
translation in units of millidegC.

Change-Id: Ida2e2ec49f2e482d506d082ead2cd989bae4a802
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent 5495704f
Loading
Loading
Loading
Loading
+99 −99
Original line number Original line Diff line number Diff line
@@ -392,78 +392,78 @@ static const struct qpnp_vadc_map_pt adcmap_qrd_skut1_btm_threshold[] = {


/* Voltage to temperature */
/* Voltage to temperature */
static const struct qpnp_vadc_map_pt adcmap_100k_104ef_104fb[] = {
static const struct qpnp_vadc_map_pt adcmap_100k_104ef_104fb[] = {
	{1758,	-40},
	{1758,	-40000},
	{1742,	-35},
	{1742,	-35000},
	{1719,	-30},
	{1719,	-30000},
	{1691,	-25},
	{1691,	-25000},
	{1654,	-20},
	{1654,	-20000},
	{1608,	-15},
	{1608,	-15000},
	{1551,	-10},
	{1551,	-10000},
	{1483,	-5},
	{1483,	-5000},
	{1404,	0},
	{1404,	0},
	{1315,	5},
	{1315,	5000},
	{1218,	10},
	{1218,	10000},
	{1114,	15},
	{1114,	15000},
	{1007,	20},
	{1007,	20000},
	{900,	25},
	{900,	25000},
	{795,	30},
	{795,	30000},
	{696,	35},
	{696,	35000},
	{605,	40},
	{605,	40000},
	{522,	45},
	{522,	45000},
	{448,	50},
	{448,	50000},
	{383,	55},
	{383,	55000},
	{327,	60},
	{327,	60000},
	{278,	65},
	{278,	65000},
	{237,	70},
	{237,	70000},
	{202,	75},
	{202,	75000},
	{172,	80},
	{172,	80000},
	{146,	85},
	{146,	85000},
	{125,	90},
	{125,	90000},
	{107,	95},
	{107,	95000},
	{92,	100},
	{92,	100000},
	{79,	105},
	{79,	105000},
	{68,	110},
	{68,	110000},
	{59,	115},
	{59,	115000},
	{51,	120},
	{51,	120000},
	{44,	125}
	{44,	125000}
};
};


/* Voltage to temperature */
/* Voltage to temperature */
static const struct qpnp_vadc_map_pt adcmap_150k_104ef_104fb[] = {
static const struct qpnp_vadc_map_pt adcmap_150k_104ef_104fb[] = {
	{1738,	-40},
	{1738,	-40000},
	{1714,	-35},
	{1714,	-35000},
	{1682,	-30},
	{1682,	-30000},
	{1641,	-25},
	{1641,	-25000},
	{1589,	-20},
	{1589,	-20000},
	{1526,	-15},
	{1526,	-15000},
	{1451,	-10},
	{1451,	-10000},
	{1363,	-5},
	{1363,	-5000},
	{1266,	0},
	{1266,	0},
	{1159,	5},
	{1159,	5000},
	{1048,	10},
	{1048,	10000},
	{936,	15},
	{936,	15000},
	{825,	20},
	{825,	20000},
	{720,	25},
	{720,	25000},
	{622,	30},
	{622,	30000},
	{533,	35},
	{533,	35000},
	{454,	40},
	{454,	40000},
	{385,	45},
	{385,	45000},
	{326,	50},
	{326,	50000},
	{275,	55},
	{275,	55000},
	{232,	60},
	{232,	60000},
	{195,	65},
	{195,	65000},
	{165,	70},
	{165,	70000},
	{139,	75},
	{139,	75000},
	{118,	80},
	{118,	80000},
	{100,	85},
	{100,	85000},
	{85,	90},
	{85,	90000},
	{73,	95},
	{73,	95000},
	{62,	100},
	{62,	100000},
	{53,	105},
	{53,	105000},
	{46,	110},
	{46,	110000},
	{40,	115},
	{40,	115000},
	{34,	120},
	{34,	120000},
	{30,	125}
	{30,	125000}
};
};


static const struct qpnp_vadc_map_pt adcmap_smb_batt_therm[] = {
static const struct qpnp_vadc_map_pt adcmap_smb_batt_therm[] = {
@@ -595,40 +595,40 @@ static const struct qpnp_vadc_map_pt adcmap_ncp03wf683[] = {
 * 1.875V reference.
 * 1.875V reference.
 */
 */
static const struct qpnp_vadc_map_pt adcmap_100k_104ef_104fb_1875_vref[] = {
static const struct qpnp_vadc_map_pt adcmap_100k_104ef_104fb_1875_vref[] = {
	{ 1831,	-40 },
	{ 1831,	-40000 },
	{ 1814,	-35 },
	{ 1814,	-35000 },
	{ 1791,	-30 },
	{ 1791,	-30000 },
	{ 1761,	-25 },
	{ 1761,	-25000 },
	{ 1723,	-20 },
	{ 1723,	-20000 },
	{ 1675,	-15 },
	{ 1675,	-15000 },
	{ 1616,	-10 },
	{ 1616,	-10000 },
	{ 1545,	-5 },
	{ 1545,	-5000 },
	{ 1463,	0 },
	{ 1463,	0 },
	{ 1370,	5 },
	{ 1370,	5000 },
	{ 1268,	10 },
	{ 1268,	10000 },
	{ 1160,	15 },
	{ 1160,	15000 },
	{ 1049,	20 },
	{ 1049,	20000 },
	{ 937,	25 },
	{ 937,	25000 },
	{ 828,	30 },
	{ 828,	30000 },
	{ 726,	35 },
	{ 726,	35000 },
	{ 630,	40 },
	{ 630,	40000 },
	{ 544,	45 },
	{ 544,	45000 },
	{ 467,	50 },
	{ 467,	50000 },
	{ 399,	55 },
	{ 399,	55000 },
	{ 340,	60 },
	{ 340,	60000 },
	{ 290,	65 },
	{ 290,	65000 },
	{ 247,	70 },
	{ 247,	70000 },
	{ 209,	75 },
	{ 209,	75000 },
	{ 179,	80 },
	{ 179,	80000 },
	{ 153,	85 },
	{ 153,	85000 },
	{ 130,	90 },
	{ 130,	90000 },
	{ 112,	95 },
	{ 112,	95000 },
	{ 96,	100 },
	{ 96,	100000 },
	{ 82,	105 },
	{ 82,	105000 },
	{ 71,	110 },
	{ 71,	110000 },
	{ 62,	115 },
	{ 62,	115000 },
	{ 53,	120 },
	{ 53,	120000 },
	{ 46,	125 },
	{ 46,	125000 },
};
};


static int32_t qpnp_adc_map_voltage_temp(const struct qpnp_vadc_map_pt *pts,
static int32_t qpnp_adc_map_voltage_temp(const struct qpnp_vadc_map_pt *pts,