devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Georgi Vlaev <g-vlaev@ti.com>
To: Tony Lindgren <tony@atomide.com>, Nishanth Menon <nm@ti.com>,
	Vignesh Raghavendra <vigneshr@ti.com>
Cc: <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Keerthy <j-keerthy@ti.com>
Subject: Re: [PATCH 2/2] arm64: dts: ti: k3-am625-sk: Use pwm-led instead of gpio-led
Date: Fri, 28 Oct 2022 23:19:32 +0300	[thread overview]
Message-ID: <fbd9755c-6a06-9fc0-5e11-50a0bb8aa33f@ti.com> (raw)
In-Reply-To: <20220914074224.44786-2-tony@atomide.com>

Hi,

On 9/14/22 10:42, Tony Lindgren wrote:
> On am625, pad c17 can be used either in gpio mode or pwm mode to control
> the connected led. Let's change to use pwm-led for additional brighness
> control.
> 
> The pwm controller is dmtimer7 for pad C17. We configure it for 128 Hz
> rate (1000000000 / 7812500) similar to what has been done elsewhere for
> pwm-leds.
> 
> Cc: Keerthy <j-keerthy@ti.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Vignesh Raghavendra <vigneshr@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm64/boot/dts/ti/k3-am625-sk.dts | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> --- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
> @@ -131,18 +131,25 @@ vdd_sd_dv: regulator-4 {
>  	};
>  
>  	leds {
> -		compatible = "gpio-leds";
> -		pinctrl-names = "default";
> -		pinctrl-0 = <&usr_led_pins_default>;
> +		compatible = "pwm-leds";
>  
>  		led-0 {
>  			label = "am62-sk:green:heartbeat";
> -			gpios = <&main_gpio1 49 GPIO_ACTIVE_HIGH>;
> +			pwms = <&main_pwm7 0 7812500 0>;
> +			max-brightness = <255>;
>  			linux,default-trigger = "heartbeat";
>  			function = LED_FUNCTION_HEARTBEAT;
>  			default-state = "off";
>  		};
>  	};
> +
> +	main_pwm7: dmtimer-main-pwm-7 {
> +		pinctrl-0 = <&usr_led_pins_default>;
> +		pinctrl-names = "default";
> +		compatible = "ti,omap-dmtimer-pwm";
> +		#pwm-cells = <3>;
> +		ti,timers = <&main_timer7>;
> +	};
>  };
>  
>  &main_pmx0 {
> @@ -203,7 +210,7 @@ AM62X_IOPAD(0x240, PIN_INPUT, 0) /* (D17) MMC1_SDCD */
>  
>  	usr_led_pins_default: usr-led-pins-default {
>  		pinctrl-single,pins = <
> -			AM62X_IOPAD(0x244, PIN_OUTPUT, 7) /* (C17) MMC1_SDWP.GPIO1_49 */
> +			AM62X_IOPAD(0x244, PIN_OUTPUT, 2) /* (C17) MMC1_SDWP.TIMER_IO7 */
>  		>;
>  	};
>  

Looking good on SK-AM625 E3. 

Just for a reference, I also checked the PWM output for TIMER_IO2 (C15) and TIMER_IO3 (E15).

Tested-by: Georgi Vlaev <g-vlaev@ti.com>

-- 
Regards,
Georgi

  reply	other threads:[~2022-10-28 20:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14  7:42 [PATCH 1/2] arm64: dts: ti: k3-am62: Add general purpose timers for am62 Tony Lindgren
2022-09-14  7:42 ` [PATCH 2/2] arm64: dts: ti: k3-am625-sk: Use pwm-led instead of gpio-led Tony Lindgren
2022-10-28 20:19   ` Georgi Vlaev [this message]
2022-09-17  7:02 ` [PATCH 1/2] arm64: dts: ti: k3-am62: Add general purpose timers for am62 Vignesh Raghavendra
2022-09-19 11:28   ` Tony Lindgren
2022-10-28 20:12 ` Georgi Vlaev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fbd9755c-6a06-9fc0-5e11-50a0bb8aa33f@ti.com \
    --to=g-vlaev@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=j-keerthy@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=nm@ti.com \
    --cc=tony@atomide.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).