Skip to contentSkip to conversation

hwmon: (lm75) Aproximate sample times to data-sheet values

PATCH Guenter Roeck 1 participant 1 message Sep 4, 2019 2 messages not in the archive Hardware monitoring

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Guenter Roeck

author maintainer
#2 lore raw
Quoted 6 lines · Iker Perez

From: Iker Perez del Palomar Sustatxa <[email protected]>

Current sample time values are over estimated, this patches applies values closer to the ones defined in the data-sheets.

Merged with my lm75 patch series and applied to hwmon-next.

Thanks,
Guenter

Quoted 145 lines
---
 drivers/hwmon/lm75.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/hwmon/lm75.c +20 -20
index f68ef9d451ab..2bb3e4ea5abd 100644
@@ -123,13 +123,13 @@ static const struct lm75_params device_params[] = {
 	[adt75] = {
 		.clr_mask = 1 << 5,	/* not one-shot mode */
 		.default_resolution = 12,
-		.default_sample_time = MSEC_PER_SEC / 8,
+		.default_sample_time = MSEC_PER_SEC / 10,
 	},
 	[ds1775] = {
 		.clr_mask = 3 << 5,
 		.set_mask = 2 << 5,	/* 11-bit mode */
 		.default_resolution = 11,
-		.default_sample_time = MSEC_PER_SEC,
+		.default_sample_time = MSEC_PER_SEC / 2,
 	},
 	[ds75] = {
 		.clr_mask = 3 << 5,
@@ -145,45 +145,45 @@ static const struct lm75_params device_params[] = {
 	},
 	[stlm75] = {
 		.default_resolution = 9,
-		.default_sample_time = MSEC_PER_SEC / 5,
+		.default_sample_time = MSEC_PER_SEC / 6,
 	},
 	[ds7505] = {
 		.set_mask = 3 << 5,	/* 12-bit mode*/
 		.default_resolution = 12,
-		.default_sample_time = MSEC_PER_SEC / 4,
+		.default_sample_time = MSEC_PER_SEC / 5
 	},
 	[g751] = {
 		.default_resolution = 9,
-		.default_sample_time = MSEC_PER_SEC / 2,
+		.default_sample_time = MSEC_PER_SEC / 10,
 	},
 	[lm75] = {
 		.default_resolution = 9,
-		.default_sample_time = MSEC_PER_SEC / 2,
+		.default_sample_time = MSEC_PER_SEC / 10,
 	},
 	[lm75a] = {
 		.default_resolution = 9,
-		.default_sample_time = MSEC_PER_SEC / 2,
+		.default_sample_time = MSEC_PER_SEC / 10,
 	},
 	[lm75b] = {
 		.default_resolution = 11,
-		.default_sample_time = MSEC_PER_SEC / 4,
+		.default_sample_time = MSEC_PER_SEC / 10,
 	},
 	[max6625] = {
 		.default_resolution = 9,
-		.default_sample_time = MSEC_PER_SEC / 4,
+		.default_sample_time = MSEC_PER_SEC / 7,
 	},
 	[max6626] = {
 		.default_resolution = 12,
-		.default_sample_time = MSEC_PER_SEC / 4,
+		.default_sample_time = MSEC_PER_SEC / 7,
 		.resolution_limits = 9,
 	},
 	[max31725] = {
 		.default_resolution = 16,
-		.default_sample_time = MSEC_PER_SEC / 8,
+		.default_sample_time = MSEC_PER_SEC / 20,
 	},
 	[tcn75] = {
 		.default_resolution = 9,
-		.default_sample_time = MSEC_PER_SEC / 8,
+		.default_sample_time = MSEC_PER_SEC / 18,
 	},
 	[pct2075] = {
 		.default_resolution = 11,
@@ -194,19 +194,19 @@ static const struct lm75_params device_params[] = {
 		.clr_mask = 1 << 7,	/* not one-shot mode */
 		.default_resolution = 12,
 		.resolution_limits = 9,
-		.default_sample_time = MSEC_PER_SEC,
+		.default_sample_time = MSEC_PER_SEC / 4,
 	},
 	[tmp100] = {
 		.set_mask = 3 << 5,	/* 12-bit mode */
 		.clr_mask = 1 << 7,	/* not one-shot mode */
 		.default_resolution = 12,
-		.default_sample_time = MSEC_PER_SEC,
+		.default_sample_time = MSEC_PER_SEC / 3,
 	},
 	[tmp101] = {
 		.set_mask = 3 << 5,	/* 12-bit mode */
 		.clr_mask = 1 << 7,	/* not one-shot mode */
 		.default_resolution = 12,
-		.default_sample_time = MSEC_PER_SEC,
+		.default_sample_time = MSEC_PER_SEC / 3,
 	},
 	[tmp112] = {
 		.set_mask = 3 << 5,	/* 12-bit mode */
@@ -218,25 +218,25 @@ static const struct lm75_params device_params[] = {
 		.set_mask = 3 << 5,	/* 12-bit mode */
 		.clr_mask = 1 << 7,	/* not one-shot mode*/
 		.default_resolution = 12,
-		.default_sample_time = MSEC_PER_SEC / 2,
+		.default_sample_time = MSEC_PER_SEC / 4,
 	},
 	[tmp175] = {
 		.set_mask = 3 << 5,	/* 12-bit mode */
 		.clr_mask = 1 << 7,	/* not one-shot mode*/
 		.default_resolution = 12,
-		.default_sample_time = MSEC_PER_SEC / 2,
+		.default_sample_time = MSEC_PER_SEC / 4,
 	},
 	[tmp275] = {
 		.set_mask = 3 << 5,	/* 12-bit mode */
 		.clr_mask = 1 << 7,	/* not one-shot mode*/
 		.default_resolution = 12,
-		.default_sample_time = MSEC_PER_SEC / 2,
+		.default_sample_time = MSEC_PER_SEC / 4,
 	},
 	[tmp75] = {
 		.set_mask = 3 << 5,	/* 12-bit mode */
 		.clr_mask = 1 << 7,	/* not one-shot mode*/
 		.default_resolution = 12,
-		.default_sample_time = MSEC_PER_SEC / 2,
+		.default_sample_time = MSEC_PER_SEC / 4,
 	},
 	[tmp75b] = { /* not one-shot mode, Conversion rate 37Hz */
 		.clr_mask = 1 << 7 | 3 << 5,
@@ -253,7 +253,7 @@ static const struct lm75_params device_params[] = {
 	[tmp75c] = {
 		.clr_mask = 1 << 5,	/*not one-shot mode*/
 		.default_resolution = 12,
-		.default_sample_time = MSEC_PER_SEC / 4,
+		.default_sample_time = MSEC_PER_SEC / 12,
 	}
 };
 
Signature · 1 line
2.11.0