lm_sensors2/kernel/chips w83792d.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jean, Hi Mark,

> That's quite logical. I do the same in my pc87360 driver. When the fan
> clock divider is too low and the register overflows, you have no idea
> what the "ideal" divider would be, so you have to increase it step by
> step until you get a valid reading.

I have one question here:
When the fan divisor adjust itself automatically step by step, Should
the
fan limit keep the original value? For Example, in my present 792
driver,
#sensors
Fan1:     1614 RPM  (min = 2500 RPM, div = 4)
If the divisor increase from 4 to 8, the fan1 limit value will become
1250RPM:
Fan1:     807 RPM  (min = 1250 RPM, div = 8)
Do you think it's quite correct? Should I modify my 792 driver to keep
the original 2500RPM just like this?
Fan1:     807 RPM  (min = 2500 RPM, div = 8)

I check your kernel/chips/pc87360.c, there is:
static void pc87360_autodiv(struct pc87360_data *data, int nr)
{
	u8 old_min = data->fan_min[nr];

	/* Increase clock divider if needed and possible */
	if ((data->fan_status[nr] & 0x04) /* overflow flag */
	 || (data->fan[nr] >= 224)) { /* next to overflow */
		if ((data->fan_status[nr] & 0x60) != 0x60) {
			data->fan_status[nr] += 0x20;
			data->fan_min[nr] >>= 1;
			data->fan[nr] >>= 1;
#ifdef DEBUG
			printk(KERN_DEBUG "pc87360.o: Increasing "
			       "clock divider to %d for fan %d\n",
			       FAN_DIV_FROM_REG(data->fan_status[nr]),
			       nr+1);
#endif
		}
	} else {
		/* Decrease clock divider if possible */
		while (!(data->fan_min[nr] & 0x80) /* fan min "nails"
divider */
		 && data->fan[nr] < 85 /* bad accuracy */
		 && (data->fan_status[nr] & 0x60) != 0x00) {
			data->fan_status[nr] -= 0x20;
			data->fan_min[nr] <<= 1;
			data->fan[nr] <<= 1;
#ifdef DEBUG
			printk(KERN_DEBUG "pc87360.o: Decreasing "
			       "clock divider to %d for fan %d\n",
			       FAN_DIV_FROM_REG(data->fan_status[nr]),
			       nr+1);
#endif
		}
	}

	/* Write new fan min if it changed */
	if (old_min != data->fan_min[nr]) {
		pc87360_write_value(data, LD_FAN, NO_BANK,
				    PC87360_REG_FAN_MIN(nr),
				    data->fan_min[nr]);
	}
}

It seems that in your driver, the fan limit value will also change with
the fan divisor like mine? Could you tell me the exact purpose of
"old_min"?


Thanks
Best Regards
Chunhao


===========================================================================================The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original author of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such person, please kindly reply the sender indicating accordingly and delete all copies of it from your computer and network server immediately. We thank you for your cooperation. It is advisable that any unauthorized use of confidential information of Winbond is strictly prohibited; and any information in this email that does not relate to the official business of Winbond shall be deemed as neither given nor endorsed by Winbond.===========================================================================================If your computer is unable to decode Chinese font, please ignore the following message. They essentially repea!
 t the&nbsp; English statement above.???H???????t?????q?l???]???????K?????T, ?????v???o?H?H???w?????H?H???\????. ?????z???D?Q???w?????H?H???]???????]?b???g???v?????????U???????H??, ???z?i?????o?H?H?????Y?N?H???q?q???P???????A???????H????. ?????z???X?@, ?????????P??. ?S??????, ???????g???v?????????????q?l?????K???T???????O?Q?Y???T????. ?H???P?????q?l???~?L???????e,???o?????????q?l?????????N??.



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux