Re: I2c Detect Function for Teutates HWMon

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

 



On 08/10/2016 12:08 AM, thilo.cestonaro@xxxxxxxxxxxxxx wrote:
Hey!

The Firmware developer of the Teutates Chip will implement more "detect"-register so the ftsteutates module can add a i2c detect function.

Would it be sufficient to have 3 register with specific content (0x54,0x54,0x54) plus the Device ID Reg shown below to identify the chip?
Or do you advise another mechanism to identify it?


Registers should have different values. One or two should reflect a Fujitsu manufacturer Id,
one should reflect the device Id. 4 bit for the device is a bit limited; I would prefer device
and version in separate registers. It would also be great if you could use common
manufacturer/device ID registers (such as 0xfd for the device ID and 0xfe/0xff for the
manufacturer ID).

I see that 0x10CF is used as Fujitsu PCI Id. Unless Fujitsu has a well defined I2C
Manufacturer Id, maybe you could use that in two registers (0xfe/0xff).

Thanks,
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;
+             }
+     }
+     return -ENODEV;
+}

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.



Cheers,
Thilo


--
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