Commit 374630e3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'hwmon-for-v5.17-rc2' of...

Merge tag 'hwmon-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

 - Fix crash in nct6775 driver

 - Prevent divide by zero in adt7470 driver

 - Fix conditional compile warning in pmbus/ir38064 driver

 - Various minor fixes in lm90 driver

* tag 'hwmon-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (nct6775) Fix crash in clear_caseopen
  hwmon: (adt7470) Prevent divide by zero in adt7470_fan_write()
  hwmon: (pmbus/ir38064) Mark ir38064_of_match as __maybe_unused
  hwmon: (lm90) Fix sysfs and udev notifications
  hwmon: (lm90) Mark alert as broken for MAX6646/6647/6649
  hwmon: (lm90) Mark alert as broken for MAX6680
  hwmon: (lm90) Mark alert as broken for MAX6654
  hwmon: (lm90) Re-enable interrupts after alert clears
  hwmon: (lm90) Reduce maximum conversion rate for G781
parents 82b550fa 79da533d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -662,6 +662,9 @@ static int adt7470_fan_write(struct device *dev, u32 attr, int channel, long val
	struct adt7470_data *data = dev_get_drvdata(dev);
	int err;

	if (val <= 0)
		return -EINVAL;

	val = FAN_RPM_TO_PERIOD(val);
	val = clamp_val(val, 1, 65534);

+11 −10
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ static const struct lm90_params lm90_params[] = {
		.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
		  | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT,
		.alert_alarms = 0x7c,
		.max_convrate = 8,
		.max_convrate = 7,
	},
	[lm86] = {
		.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
@@ -394,12 +394,13 @@ static const struct lm90_params lm90_params[] = {
		.max_convrate = 9,
	},
	[max6646] = {
		.flags = LM90_HAVE_CRIT,
		.flags = LM90_HAVE_CRIT | LM90_HAVE_BROKEN_ALERT,
		.alert_alarms = 0x7c,
		.max_convrate = 6,
		.reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
	},
	[max6654] = {
		.flags = LM90_HAVE_BROKEN_ALERT,
		.alert_alarms = 0x7c,
		.max_convrate = 7,
		.reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
@@ -418,7 +419,7 @@ static const struct lm90_params lm90_params[] = {
	},
	[max6680] = {
		.flags = LM90_HAVE_OFFSET | LM90_HAVE_CRIT
		  | LM90_HAVE_CRIT_ALRM_SWP,
		  | LM90_HAVE_CRIT_ALRM_SWP | LM90_HAVE_BROKEN_ALERT,
		.alert_alarms = 0x7c,
		.max_convrate = 7,
	},
@@ -848,7 +849,7 @@ static int lm90_update_device(struct device *dev)
		 * Re-enable ALERT# output if it was originally enabled and
		 * relevant alarms are all clear
		 */
		if (!(data->config_orig & 0x80) &&
		if ((client->irq || !(data->config_orig & 0x80)) &&
		    !(data->alarms & data->alert_alarms)) {
			if (data->config & 0x80) {
				dev_dbg(&client->dev, "Re-enabling ALERT#\n");
@@ -1807,22 +1808,22 @@ static bool lm90_is_tripped(struct i2c_client *client, u16 *status)

	if (st & LM90_STATUS_LLOW)
		hwmon_notify_event(data->hwmon_dev, hwmon_temp,
				   hwmon_temp_min, 0);
				   hwmon_temp_min_alarm, 0);
	if (st & LM90_STATUS_RLOW)
		hwmon_notify_event(data->hwmon_dev, hwmon_temp,
				   hwmon_temp_min, 1);
				   hwmon_temp_min_alarm, 1);
	if (st2 & MAX6696_STATUS2_R2LOW)
		hwmon_notify_event(data->hwmon_dev, hwmon_temp,
				   hwmon_temp_min, 2);
				   hwmon_temp_min_alarm, 2);
	if (st & LM90_STATUS_LHIGH)
		hwmon_notify_event(data->hwmon_dev, hwmon_temp,
				   hwmon_temp_max, 0);
				   hwmon_temp_max_alarm, 0);
	if (st & LM90_STATUS_RHIGH)
		hwmon_notify_event(data->hwmon_dev, hwmon_temp,
				   hwmon_temp_max, 1);
				   hwmon_temp_max_alarm, 1);
	if (st2 & MAX6696_STATUS2_R2HIGH)
		hwmon_notify_event(data->hwmon_dev, hwmon_temp,
				   hwmon_temp_max, 2);
				   hwmon_temp_max_alarm, 2);

	return true;
}
+3 −3
Original line number Diff line number Diff line
@@ -1175,7 +1175,7 @@ static inline u8 in_to_reg(u32 val, u8 nr)

struct nct6775_data {
	int addr;	/* IO base of hw monitor block */
	int sioreg;	/* SIO register address */
	struct nct6775_sio_data *sio_data;
	enum kinds kind;
	const char *name;

@@ -3559,7 +3559,7 @@ clear_caseopen(struct device *dev, struct device_attribute *attr,
	       const char *buf, size_t count)
{
	struct nct6775_data *data = dev_get_drvdata(dev);
	struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
	struct nct6775_sio_data *sio_data = data->sio_data;
	int nr = to_sensor_dev_attr(attr)->index - INTRUSION_ALARM_BASE;
	unsigned long val;
	u8 reg;
@@ -3967,7 +3967,7 @@ static int nct6775_probe(struct platform_device *pdev)
		return -ENOMEM;

	data->kind = sio_data->kind;
	data->sioreg = sio_data->sioreg;
	data->sio_data = sio_data;

	if (sio_data->access == access_direct) {
		data->addr = res->start;
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ static const struct i2c_device_id ir38064_id[] = {

MODULE_DEVICE_TABLE(i2c, ir38064_id);

static const struct of_device_id ir38064_of_match[] = {
static const struct of_device_id __maybe_unused ir38064_of_match[] = {
	{ .compatible = "infineon,ir38060" },
	{ .compatible = "infineon,ir38064" },
	{ .compatible = "infineon,ir38164" },