Re: [PATCH v14] platform/x86: Add Silicom Platform Driver

From: Barnabás Pőcze
Date: Wed Nov 22 2023 - 18:48:30 EST


Hi

2023. november 22., szerda 22:20 keltezéssel, Henry Shi írta:

> [...]
> +What: /sys/devices/platform/silicom-platform/hwmon/hwmon1/temp1_input
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This file is read only. It returns the temperature
> + of device in the scale of 1000 * Degree Celsius.
> +
> +What: /sys/devices/platform/silicom-platform/hwmon/hwmon1/temp1_label
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This file is read only. It returns "Silicom_platform:
> + Thermostat Sensor".
> +
> +What: /sys/devices/platform/silicom-platform/hwmon/hwmon1/fan1_input
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This file is read only. It returns current fan
> + speed (RPM).
> +
> +What: /sys/devices/platform/silicom-platform/hwmon/hwmon1/fan1_label
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This file is read only. It returns "Silicom_platform:
> + Fan Speed".
> +

These are standard hwmon attributes already documented in
Documentation/ABI/testing/sysfs-class-hwmon, is it really needed to document
them here as well?



> +What: /sys/class/leds/multicolor:sys/brightness
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + status of system LED brightness:
> +
> + 0 - to turn off the LED
> + 1 - to turn on the LED
> +
> +What: /sys/class/leds/multicolor:sys/multi_index
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read only file. It returns:
> +
> + white amber red
> +
> +What: /sys/class/leds/multicolor:sys/multi_intensity
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + multi-color intensity of system LED: First value for
> + color white, second value for color amber and third value
> + for color red:
> +
> + 0 - The color is turned off.
> + 1 - the color is turned on.
> +
> +What: /sys/class/leds/multicolor:wan/brightness
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + status of WAN LED brightness:
> +
> + 0 - to turn off the LED
> + 1 - to turn on the LED
> +
> +What: /sys/class/leds/multicolor:wan/multi_index
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read only file. It returns:
> +
> + white yellow red
> +
> +What: /sys/class/leds/multicolor:wan/multi_intensity
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + multi-color intensity of WAN LED: First value for
> + color white, second value for color yellow and third value
> + for color red:
> +
> + 0 - The color is turned off.
> + 1 - the color is turned on.
> +
> +What: /sys/class/leds/multicolor:stat%d/brightness
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + status of device status LED (number %d) brightness:
> +
> + 0 - to turn off the LED
> + 1 - to turn on the LED
> +
> +What: /sys/class/leds/multicolor:stat%d/multi_index
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read only file. It returns:
> +
> + red green blue yellow
> +
> +What: /sys/class/leds/multicolor:stat%d/multi_intensity
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + multi-color intensity of device status LED (number %d):
> + First value for color red, second value for color green,
> + third value for color blue and fourth value for color
> + yellow.
> +
> + 0 - The color is turned off.
> + 1 - the color is turned on.
> +
> +What: /sys/class/leds/multicolor:fp_left/brightness
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + status of left LED brightness:
> +
> + 0 - to turn off the LED
> + 1 - to turn on the LED
> +
> +What: /sys/class/leds/multicolor:fp_left/multi_index
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read only file. It returns:
> +
> + red green blue amber
> +
> +What: /sys/class/leds/multicolor:fp_left/multi_intensity
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + multi-color intensity of left LED: First value for
> + color red; Second value for color green; Third value for
> + color blue and fourth value for color amber.
> + for color red:
> +
> + 0 - The color is turned off.
> + 1 - the color is turned on.
> +
> +What: /sys/class/leds/multicolor:fp_center/brightness
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + status of left LED brightness:
> +
> + 0 - to turn off the LED
> + 1 - to turn on the LED
> +
> +What: /sys/class/leds/multicolor:fp_center/multi_index
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read only file. It returns:
> +
> + red green blue amber
> +
> +What: /sys/class/leds/multicolor:fp_center/multi_intensity
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + multi-color intensity of left LED: First value for
> + color red; Second value for color green; Third value for
> + color blue and fourth value for color amber.
> + for color red:
> +
> + 0 - The color is turned off.
> + 1 - the color is turned on.
> +
> +What: /sys/class/leds/multicolor:fp_right/brightness
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + status of left LED brightness:
> +
> + 0 - to turn off the LED
> + 1 - to turn on the LED
> +
> +What: /sys/class/leds/multicolor:fp_right/multi_index
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read only file. It returns:
> +
> + red green blue amber
> +
> +What: /sys/class/leds/multicolor:fp_right/multi_intensity
> +Date: November 2023
> +KernelVersion: 6.7
> +Contact: Henry Shi <henrys@xxxxxxxxxxxxxxx>
> +Description:
> + This is a read/write file. It is used to read/set current
> + multi-color intensity of left LED: First value for
> + color red; Second value for color green; Third value for
> + color blue and fourth value for color amber.
> + for color red:
> +
> + 0 - The color is turned off.
> + 1 - the color is turned on.
> +

These are standard LED attributes already documented in
Documentation/ABI/testing/sysfs-class-{led,led-multicolor},
is it really needed to document them here as well?


> [...]
> +static struct led_classdev_mc plat_0222_mc_led_info[] __initdata = {
> + {
> + .led_cdev = {
> + .name = "multicolor:wan",
> + .brightness = 0,
> + .max_brightness = 1,
> + .brightness_set = silicom_mec_led_mc_brightness_set,
> + .brightness_get = silicom_mec_led_mc_brightness_get,
> + },
> + .num_colors = ARRAY_SIZE(plat_0222_wan_mc_subled_info),
> + .subled_info = plat_0222_wan_mc_subled_info,
> + },
> + {
> + .led_cdev = {
> + .name = "multicolor:sys",
> + .brightness = 0,
> + .max_brightness = 1,
> + .brightness_set = silicom_mec_led_mc_brightness_set,
> + .brightness_get = silicom_mec_led_mc_brightness_get,
> + },
> + .num_colors = ARRAY_SIZE(plat_0222_sys_mc_subled_info),
> + .subled_info = plat_0222_sys_mc_subled_info,
> + },
> + {
> + .led_cdev = {
> + .name = "multicolor:stat1",
> + .brightness = 0,
> + .max_brightness = 1,
> + .brightness_set = silicom_mec_led_mc_brightness_set,
> + .brightness_get = silicom_mec_led_mc_brightness_get,
> + },
> + .num_colors = ARRAY_SIZE(plat_0222_stat1_mc_subled_info),
> + .subled_info = plat_0222_stat1_mc_subled_info,
> + },
> + {
> + .led_cdev = {
> + .name = "multicolor:stat2",
> + .brightness = 0,
> + .max_brightness = 1,
> + .brightness_set = silicom_mec_led_mc_brightness_set,
> + .brightness_get = silicom_mec_led_mc_brightness_get,
> + },
> + .num_colors = ARRAY_SIZE(plat_0222_stat2_mc_subled_info),
> + .subled_info = plat_0222_stat2_mc_subled_info,
> + },
> + {
> + .led_cdev = {
> + .name = "multicolor:stat3",
> + .brightness = 0,
> + .max_brightness = 1,
> + .brightness_set = silicom_mec_led_mc_brightness_set,
> + .brightness_get = silicom_mec_led_mc_brightness_get,
> + },
> + .num_colors = ARRAY_SIZE(plat_0222_stat3_mc_subled_info),
> + .subled_info = plat_0222_stat3_mc_subled_info,
> + },
> + { },
> +};
> [...]
> +static struct led_classdev_mc cordoba_mc_led_info[] __initdata = {
> + {
> + .led_cdev = {
> + .name = "multicolor:fp_left",
> + .brightness = 0,
> + .max_brightness = 1,
> + .brightness_set = silicom_mec_led_mc_brightness_set,
> + .brightness_get = silicom_mec_led_mc_brightness_get,
> + },
> + .num_colors = ARRAY_SIZE(cordoba_fp_left_mc_subled_info),
> + .subled_info = cordoba_fp_left_mc_subled_info,
> + },
> + {
> + .led_cdev = {
> + .name = "multicolor:fp_center",
> + .brightness = 0,
> + .max_brightness = 1,
> + .brightness_set = silicom_mec_led_mc_brightness_set,
> + .brightness_get = silicom_mec_led_mc_brightness_get,
> + },
> + .num_colors = ARRAY_SIZE(cordoba_fp_center_mc_subled_info),
> + .subled_info = cordoba_fp_center_mc_subled_info,
> + },
> + {
> + .led_cdev = {
> + .name = "multicolor:fp_right",
> + .brightness = 0,
> + .max_brightness = 1,
> + .brightness_set = silicom_mec_led_mc_brightness_set,
> + .brightness_get = silicom_mec_led_mc_brightness_get,
> + },
> + .num_colors = ARRAY_SIZE(cordoba_fp_right_mc_subled_info),
> + .subled_info = cordoba_fp_right_mc_subled_info,
> + },
> + { },
> +};
> [...]

These LED names do not have the syntax described in Documentation/leds/leds-class.rst,
which is "devicename:color:function".


Regards,
Barnabás Pőcze