Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: intel-m10-bmc-hwmon: add n5010 sensors

Add the list of sensors supported by the Silicom n5010 PAC, and enable
the drivers as a subtype of the intel-m10-bmc multi-function driver.

Signed-off-by: Martin Hundebøll <mhu@silicom.dk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
Reviewed-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20210716135441.3235863-4-martin@geanix.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Martin Hundebøll and committed by
Guenter Roeck
1ccdc184 228f2aed

+116
+116
drivers/hwmon/intel-m10-bmc-hwmon.c
··· 228 228 .hinfo = d5005bmc_hinfo, 229 229 }; 230 230 231 + static const struct m10bmc_sdata n5010bmc_temp_tbl[] = { 232 + { 0x100, 0x0, 0x104, 0x0, 0x0, 1000, "Board Local Temperature" }, 233 + { 0x108, 0x0, 0x10c, 0x0, 0x0, 1000, "FPGA 1 Temperature" }, 234 + { 0x110, 0x0, 0x114, 0x0, 0x0, 1000, "FPGA 2 Temperature" }, 235 + { 0x118, 0x0, 0x0, 0x0, 0x0, 1000, "Card Top Temperature" }, 236 + { 0x11c, 0x0, 0x0, 0x0, 0x0, 1000, "Card Bottom Temperature" }, 237 + { 0x128, 0x0, 0x0, 0x0, 0x0, 1000, "FPGA 1.2V Temperature" }, 238 + { 0x134, 0x0, 0x0, 0x0, 0x0, 1000, "FPGA 5V Temperature" }, 239 + { 0x140, 0x0, 0x0, 0x0, 0x0, 1000, "FPGA 0.9V Temperature" }, 240 + { 0x14c, 0x0, 0x0, 0x0, 0x0, 1000, "FPGA 0.85V Temperature" }, 241 + { 0x158, 0x0, 0x0, 0x0, 0x0, 1000, "AUX 12V Temperature" }, 242 + { 0x164, 0x0, 0x0, 0x0, 0x0, 1000, "Backplane 12V Temperature" }, 243 + { 0x1a8, 0x0, 0x0, 0x0, 0x0, 1000, "QSFP28-1 Temperature" }, 244 + { 0x1ac, 0x0, 0x0, 0x0, 0x0, 1000, "QSFP28-2 Temperature" }, 245 + { 0x1b0, 0x0, 0x0, 0x0, 0x0, 1000, "QSFP28-3 Temperature" }, 246 + { 0x1b4, 0x0, 0x0, 0x0, 0x0, 1000, "QSFP28-4 Temperature" }, 247 + { 0x1b8, 0x0, 0x0, 0x0, 0x0, 1000, "CVL1 Internal Temperature" }, 248 + { 0x1bc, 0x0, 0x0, 0x0, 0x0, 1000, "CVL2 Internal Temperature" }, 249 + }; 250 + 251 + static const struct m10bmc_sdata n5010bmc_in_tbl[] = { 252 + { 0x120, 0x0, 0x0, 0x0, 0x0, 1, "FPGA 1.2V Voltage" }, 253 + { 0x12c, 0x0, 0x0, 0x0, 0x0, 1, "FPGA 5V Voltage" }, 254 + { 0x138, 0x0, 0x0, 0x0, 0x0, 1, "FPGA 0.9V Voltage" }, 255 + { 0x144, 0x0, 0x0, 0x0, 0x0, 1, "FPGA 0.85V Voltage" }, 256 + { 0x150, 0x0, 0x0, 0x0, 0x0, 1, "AUX 12V Voltage" }, 257 + { 0x15c, 0x0, 0x0, 0x0, 0x0, 1, "Backplane 12V Voltage" }, 258 + { 0x16c, 0x0, 0x0, 0x0, 0x0, 1, "DDR4 1.2V Voltage" }, 259 + { 0x17c, 0x0, 0x0, 0x0, 0x0, 1, "FPGA 1.8V Voltage" }, 260 + { 0x184, 0x0, 0x0, 0x0, 0x0, 1, "QDR 1.3V Voltage" }, 261 + { 0x18c, 0x0, 0x0, 0x0, 0x0, 1, "CVL1 0.8V Voltage" }, 262 + { 0x194, 0x0, 0x0, 0x0, 0x0, 1, "CVL1 1.05V Voltage" }, 263 + { 0x19c, 0x0, 0x0, 0x0, 0x0, 1, "CVL2 1.05V Voltage" }, 264 + { 0x1a4, 0x0, 0x0, 0x0, 0x0, 1, "CVL2 0.8V Voltage" }, 265 + }; 266 + 267 + static const struct m10bmc_sdata n5010bmc_curr_tbl[] = { 268 + { 0x124, 0x0, 0x0, 0x0, 0x0, 1, "FPGA 1.2V Current" }, 269 + { 0x130, 0x0, 0x0, 0x0, 0x0, 1, "FPGA 5V Current" }, 270 + { 0x13c, 0x0, 0x0, 0x0, 0x0, 1, "FPGA 0.9V Current" }, 271 + { 0x148, 0x0, 0x0, 0x0, 0x0, 1, "FPGA 0.85V Current" }, 272 + { 0x154, 0x0, 0x0, 0x0, 0x0, 1, "AUX 12V Current" }, 273 + { 0x160, 0x0, 0x0, 0x0, 0x0, 1, "Backplane 12V Current" }, 274 + { 0x168, 0x0, 0x0, 0x0, 0x0, 1, "DDR4 1.2V Current" }, 275 + { 0x178, 0x0, 0x0, 0x0, 0x0, 1, "FPGA 1.8V Current" }, 276 + { 0x180, 0x0, 0x0, 0x0, 0x0, 1, "QDR 1.3V Current" }, 277 + { 0x188, 0x0, 0x0, 0x0, 0x0, 1, "CVL1 0.8V Current" }, 278 + { 0x190, 0x0, 0x0, 0x0, 0x0, 1, "CVL1 1.05V Current" }, 279 + { 0x198, 0x0, 0x0, 0x0, 0x0, 1, "CVL2 1.05V Current" }, 280 + { 0x1a0, 0x0, 0x0, 0x0, 0x0, 1, "CVL2 0.8V Current" }, 281 + }; 282 + 283 + static const struct hwmon_channel_info *n5010bmc_hinfo[] = { 284 + HWMON_CHANNEL_INFO(temp, 285 + HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_LABEL, 286 + HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_LABEL, 287 + HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_LABEL, 288 + HWMON_T_INPUT | HWMON_T_LABEL, 289 + HWMON_T_INPUT | HWMON_T_LABEL, 290 + HWMON_T_INPUT | HWMON_T_LABEL, 291 + HWMON_T_INPUT | HWMON_T_LABEL, 292 + HWMON_T_INPUT | HWMON_T_LABEL, 293 + HWMON_T_INPUT | HWMON_T_LABEL, 294 + HWMON_T_INPUT | HWMON_T_LABEL, 295 + HWMON_T_INPUT | HWMON_T_LABEL, 296 + HWMON_T_INPUT | HWMON_T_LABEL, 297 + HWMON_T_INPUT | HWMON_T_LABEL, 298 + HWMON_T_INPUT | HWMON_T_LABEL, 299 + HWMON_T_INPUT | HWMON_T_LABEL, 300 + HWMON_T_INPUT | HWMON_T_LABEL, 301 + HWMON_T_INPUT | HWMON_T_LABEL), 302 + HWMON_CHANNEL_INFO(in, 303 + HWMON_I_INPUT | HWMON_I_LABEL, 304 + HWMON_I_INPUT | HWMON_I_LABEL, 305 + HWMON_I_INPUT | HWMON_I_LABEL, 306 + HWMON_I_INPUT | HWMON_I_LABEL, 307 + HWMON_I_INPUT | HWMON_I_LABEL, 308 + HWMON_I_INPUT | HWMON_I_LABEL, 309 + HWMON_I_INPUT | HWMON_I_LABEL, 310 + HWMON_I_INPUT | HWMON_I_LABEL, 311 + HWMON_I_INPUT | HWMON_I_LABEL, 312 + HWMON_I_INPUT | HWMON_I_LABEL, 313 + HWMON_I_INPUT | HWMON_I_LABEL, 314 + HWMON_I_INPUT | HWMON_I_LABEL, 315 + HWMON_I_INPUT | HWMON_I_LABEL), 316 + HWMON_CHANNEL_INFO(curr, 317 + HWMON_C_INPUT | HWMON_C_LABEL, 318 + HWMON_C_INPUT | HWMON_C_LABEL, 319 + HWMON_C_INPUT | HWMON_C_LABEL, 320 + HWMON_C_INPUT | HWMON_C_LABEL, 321 + HWMON_C_INPUT | HWMON_C_LABEL, 322 + HWMON_C_INPUT | HWMON_C_LABEL, 323 + HWMON_C_INPUT | HWMON_C_LABEL, 324 + HWMON_C_INPUT | HWMON_C_LABEL, 325 + HWMON_C_INPUT | HWMON_C_LABEL, 326 + HWMON_C_INPUT | HWMON_C_LABEL, 327 + HWMON_C_INPUT | HWMON_C_LABEL, 328 + HWMON_C_INPUT | HWMON_C_LABEL, 329 + HWMON_C_INPUT | HWMON_C_LABEL), 330 + NULL 331 + }; 332 + 333 + static const struct m10bmc_hwmon_board_data n5010bmc_hwmon_bdata = { 334 + .tables = { 335 + [hwmon_temp] = n5010bmc_temp_tbl, 336 + [hwmon_in] = n5010bmc_in_tbl, 337 + [hwmon_curr] = n5010bmc_curr_tbl, 338 + }, 339 + 340 + .hinfo = n5010bmc_hinfo, 341 + }; 342 + 231 343 static umode_t 232 344 m10bmc_hwmon_is_visible(const void *data, enum hwmon_sensor_types type, 233 345 u32 attr, int channel) ··· 549 437 { 550 438 .name = "d5005bmc-hwmon", 551 439 .driver_data = (unsigned long)&d5005bmc_hwmon_bdata, 440 + }, 441 + { 442 + .name = "n5010bmc-hwmon", 443 + .driver_data = (unsigned long)&n5010bmc_hwmon_bdata, 552 444 }, 553 445 { } 554 446 };