Re: [PATCH] added kernel module for FTS sensor chip "Teutates"

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

 



On 06/09/2016 02:13 AM, thilo.cestonaro@xxxxxxxxxxxxxx wrote:
Hey Guenter,

+static int ftsteutates_detect(struct i2c_client *client,
+		struct i2c_board_info *info)
+{
+	int val = ftsteutates_read_byte(client, FTSTEUTATES_DEVICE_ID_REG);
+
+	/* Baseboard Management Controller */
+	if ((val & 0xF0) == 0x10) {
+		switch (val & 0x0F) {
+		case 0x01:
+			strlcpy(info->type, ftsteutates_id[teutates].name,
+			I2C_NAME_SIZE);
+			info->flags = 0;
+			return 0;
+		}
+	}
This is not sufficient for a detect function; it would result in many false
positives. Please drop it unless a much better means to detect the chip
is available.

Would it be sufficient, if I use dmi_name_in_vendors and check for Fujitsu? So the
BMC check will only be used on FJ Boards?

The problem is, that the firmware itself has only this device ID register.
For future revisions I'll ask for more possibilities to identify the chip but for now
I need to use other methods.


You don't need a detect function to start with. Using DMI in an i2c driver
is not appropriate either; an i2c driver is expected to be board agnostic.

If you can determine that the chip is present in the system using DMI, you
would normally have a second (platform)) driver which detects the platform
and instantiate the device, using either i2c_new_device() or
i2c_register_board_info(). See  Documentation/i2c/instantiating-devices
for more details.

Hope this helps,
Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux