Re: [RFC PATCH v2 1/2] dt-bindings: leds: Add multicolor PWM LED bindings

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

 



On 1/25/22 21:27, Marek Behún wrote:

what about

	multi-led@0 {
		color = <LED_COLOR_ID_RGB>;
		function = LED_FUNCTION_INDICATOR;
		pwms = <&pwm1 0 1000000>,
		       <&pwm2 0 1000000>,
		       <&pwm3 0 1000000>;
		channels = <LED_COLOR_ID_RED>,
			   <LED_COLOR_ID_GREEN>,
			   <LED_COLOR_ID_BLUE>;
	};

I am not saying that it is necessarily better, just comenting that
maybe it is, since it saves some space. `pwms` is phandle-array, so it
can contain references to multiple pwms, and we have functions which
make getting these pwms in driver code easy...

I have had another look at this. It seems like if you specify more than one PWM instance in the `pwms` property, the device tree must specify `pwm-names` in order for the driver to be able to request the correct instance (see `of_pwm_get`). In this case, the device tree would need to contain some strings in `pwm-names` that allow the driver to match them against the color IDs. Alternatively, I could re-implement the PWM instance request logic. Both options seem not ideal.

For the next version of this patch series, I'll go with my original approach. I'm open for alternatives :)

Best regards,
Sven



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux