From patchwork Wed Aug 24 11:05:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 1669737 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=U/kTlJpP; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MCNYP5q1tz1yhJ for ; Wed, 24 Aug 2022 21:05:28 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oQoCA-00030f-ET; Wed, 24 Aug 2022 11:05:14 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oQoC7-0002zX-MP for kernel-team@lists.ubuntu.com; Wed, 24 Aug 2022 11:05:11 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 311DF3F45B for ; Wed, 24 Aug 2022 11:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1661339110; bh=joMFIQfCeCTD0SFX80o6m8hS2I7atvowe8lFQ+QyTNs=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=U/kTlJpP8hu8m1zoKRpIJv+TIZkQsr0kzx2jQbKkylEzV8rXiRo5v14puceWAo9aA HWc8av2/Eqvq0d+HRSUJ37rIUcEahHXRIVezyzU+7PnIjV3CFm6eDqUco9p+lFz3b3 OTaEbaEzIut1rpHtH68lS1HxoNIcAfTJkMJs2+uh4M/vSG1J3RIiA0iOykBj5HVRjj bIzMrtLnfPL35a0EQYPsM06fPJLdOgKHACk1/2PiDySDi7MLV3u5mHMEteVJWg3/mU RYhE8/ylWCgWRlbJ4fLayo/ivJsdjKi2rlw/0l5FhGdS6XNwVd7SJdZZOuHdRdiqrD 5lnwFwgDwScmg== Received: by mail-ej1-f72.google.com with SMTP id hp36-20020a1709073e2400b0073d6bee146aso3056125ejc.20 for ; Wed, 24 Aug 2022 04:05:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=joMFIQfCeCTD0SFX80o6m8hS2I7atvowe8lFQ+QyTNs=; b=vCkmQL6I00gj0p0y3WU8m5zxeo/FrmusoC75htqOUqXzV1eDOXh4lBObNm4+Psyrwg /iYZiZptxT0Fq90XunFPrbjFNe2iFjuaWZR+dMD+ZgXXde3n3kxWWez+hQXoUGqRH5hP ugUd0edt47XK10tZS4SYtyyZ/IPfJTmNt+ewW7A/xIZTfG8af68J52PLfsTjpeMuww+A xkfx4cPVnuBhojuNXjTxky5bzpCY7GltZtmsbfTq2YgnG49x07BnirUYQNT8HCXVCJiR BzIFkLA+6HEAWu9euO4iLMIzhCAeXFQn4/4f06Z7tTb/rs0FAoUttcKaD2Fw/KpVVe5c QyxA== X-Gm-Message-State: ACgBeo2KeZq7TK+sYgPQF94ktPh5AN6eLSKMVJ+C90WcV/q5wsMxLaqI btXNnVoPDK3D5cuL18ZehkWgPeTk3P2LjxhXYyDiEEtCKBeVIKB8D2WcWrFr0Z9PE2jnOGdQEl9 HmzzVfx7v2PCuNerZahyZJ+TvYbXXRDVel5/helUVUA== X-Received: by 2002:a05:6402:3553:b0:446:b76a:bb59 with SMTP id f19-20020a056402355300b00446b76abb59mr7235552edd.375.1661339109703; Wed, 24 Aug 2022 04:05:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR4tnj+3w0ikoCVGdoRY9Jf1QOGrcHlx9drAzOa3/zmXCJ2+H/ll2L//e9pcrcEv3ARMCgtkrA== X-Received: by 2002:a05:6402:3553:b0:446:b76a:bb59 with SMTP id f19-20020a056402355300b00446b76abb59mr7235538edd.375.1661339109495; Wed, 24 Aug 2022 04:05:09 -0700 (PDT) Received: from stitch.. (80.71.140.73.ipv4.parknet.dk. [80.71.140.73]) by smtp.gmail.com with ESMTPSA id q10-20020aa7d44a000000b00447990ba835sm55248edr.25.2022.08.24.04.05.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 04:05:09 -0700 (PDT) From: Emil Renner Berthing To: kernel-team@lists.ubuntu.com Subject: [SRU][K][PATCH 1/3] dt-bindings: leds: pwm-multicolor: Add active-low property Date: Wed, 24 Aug 2022 13:05:05 +0200 Message-Id: <20220824110507.1114445-2-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220824110507.1114445-1-emil.renner.berthing@canonical.com> References: <20220824110507.1114445-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1987513 Add the active-low property to LEDs that are part of a multicolor LED just like the regular PWM LEDs have. Signed-off-by: Emil Renner Berthing Reviewed-by: Geert Uytterhoeven Signed-off-by: Pavel Machek (cherry picked from commit 83543c6e54b9dd18950533fff730e68c19cc053a) Signed-off-by: Emil Renner Berthing --- .../devicetree/bindings/leds/leds-pwm-multicolor.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml b/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml index 6625a528f727..8d614eaf5c5e 100644 --- a/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml +++ b/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml @@ -33,6 +33,10 @@ properties: pwm-names: true + active-low: + description: For PWMs where the LED is wired to supply rather than ground. + type: boolean + color: true required: From patchwork Wed Aug 24 11:05:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 1669736 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=qBySY1J0; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MCNYP6DyQz1yhM for ; Wed, 24 Aug 2022 21:05:28 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oQoCB-00031j-QN; Wed, 24 Aug 2022 11:05:15 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oQoC8-0002zd-01 for kernel-team@lists.ubuntu.com; Wed, 24 Aug 2022 11:05:12 +0000 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 8CF2D3F45E for ; Wed, 24 Aug 2022 11:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1661339111; bh=RLwTPuwSkf5HNNBY+7+YbOjxOHdj8k1cnmqa+4r2W4s=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qBySY1J007cysF1Cu+SHuHQxDPICUntJkFbELFZsiMcjOcKEsuIpg2WC0j744ovp3 NdYjZztS5J+HBrvPbNgTC0ZnhS/wXMAkcXcQkkRJfl54Bo4xCy16BusUOXALV4/N1j 9RfEr4xqPCNonmob/YMKG7X26nzpxC1y3vhc29FbwfUxr1BNYGOSSQr7eZyngBXw8t 0RwlUVi4oHf4Ptr1QoLap6yo2vLdD4sx4doc9eZ1wvWgbg4ml6aFSQyvOZzMORbvYt P8XvbxHvyGWJKA7NwBrEdjPgpgyBO6Sl5uR0RMBYr4/Na3E57lKRPV1GGE/qiVXgFw VpoCUZ3mzSVRg== Received: by mail-ed1-f71.google.com with SMTP id v14-20020a056402348e00b00446946ba703so6623249edc.23 for ; Wed, 24 Aug 2022 04:05:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=RLwTPuwSkf5HNNBY+7+YbOjxOHdj8k1cnmqa+4r2W4s=; b=DO+Ba8b3r0SQov5VnnJHFD4YTwZh2sLa0UE5JK10HyKJiBjRGkCme/WabyVnzc3P0L qgy3uDiU1QgmOynxhWRdqoEKZxoauYCAnpceyqCB2s12YxzyUT5ffe5UTvdR0iHXlSOd zCgFnQcUMyjWV/OCmVtOfB1lZsADgnhkSgYR9x5RzDapiWuJtezhogDKqFX9XZLOJ8N+ 6TPh/9DMdh1xNyh/ib1zlz7xo1bHHV3+D1UtMoYWuCEEOgBscs4uPdaFpVMTWhW5fyX8 pHiGmabZFtfPRHrLkXMXNHSGzqHdgPiF/19HJDj3Lg4Cf+Bb/8bw8bgee5gdJt8GaaZf lGyw== X-Gm-Message-State: ACgBeo2le++OdWhMuiwL3n7tMrfOj0VFN9SE/oMxekLmW5ccsMHWL9yk TR1ULoO/bx2m52KAs6u3N9w30dThwpUhURWdD3WVlTIiMNw3RmBlZzV68A1vDyvBkx6gWceyGuw v/z/KC7ePpQIB+ZnJXt0MO/6N6RhzoibD4t2iQUlqgQ== X-Received: by 2002:aa7:c9c2:0:b0:440:b458:9403 with SMTP id i2-20020aa7c9c2000000b00440b4589403mr7212711edt.132.1661339110580; Wed, 24 Aug 2022 04:05:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR75BfifT4F8O4R2U0S03G+pGiivKE8ady4nsYfrr2nqJ/bmTAKnOPKCI4UEpqp5eIXIv8vBbg== X-Received: by 2002:aa7:c9c2:0:b0:440:b458:9403 with SMTP id i2-20020aa7c9c2000000b00440b4589403mr7212693edt.132.1661339110234; Wed, 24 Aug 2022 04:05:10 -0700 (PDT) Received: from stitch.. (80.71.140.73.ipv4.parknet.dk. [80.71.140.73]) by smtp.gmail.com with ESMTPSA id q10-20020aa7d44a000000b00447990ba835sm55248edr.25.2022.08.24.04.05.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 04:05:09 -0700 (PDT) From: Emil Renner Berthing To: kernel-team@lists.ubuntu.com Subject: [SRU][K][PATCH 2/3] leds: pwm-multicolor: Support active-low LEDs Date: Wed, 24 Aug 2022 13:05:06 +0200 Message-Id: <20220824110507.1114445-3-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220824110507.1114445-1-emil.renner.berthing@canonical.com> References: <20220824110507.1114445-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1987513 Add support for LEDs wired up to light when the PWM output is low, just like the regular PWM LEDs. Signed-off-by: Emil Renner Berthing Reviewed-by: Geert Uytterhoeven Signed-off-by: Pavel Machek (cherry picked from commit 3dd7ed589f2eda3904ab4b9fc49bbbc6d450d7f3) Signed-off-by: Emil Renner Berthing --- drivers/leds/rgb/leds-pwm-multicolor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/leds/rgb/leds-pwm-multicolor.c b/drivers/leds/rgb/leds-pwm-multicolor.c index eb67b89d28e9..da9d2218ae18 100644 --- a/drivers/leds/rgb/leds-pwm-multicolor.c +++ b/drivers/leds/rgb/leds-pwm-multicolor.c @@ -19,6 +19,7 @@ struct pwm_led { struct pwm_device *pwm; struct pwm_state state; + bool active_low; }; struct pwm_mc_led { @@ -45,6 +46,9 @@ static int led_pwm_mc_set(struct led_classdev *cdev, duty *= mc_cdev->subled_info[i].brightness; do_div(duty, cdev->max_brightness); + if (priv->leds[i].active_low) + duty = priv->leds[i].state.period - duty; + priv->leds[i].state.duty_cycle = duty; priv->leds[i].state.enabled = duty > 0; ret = pwm_apply_state(priv->leds[i].pwm, @@ -76,6 +80,7 @@ static int iterate_subleds(struct device *dev, struct pwm_mc_led *priv, goto release_fwnode; } pwm_init_state(pwmled->pwm, &pwmled->state); + pwmled->active_low = fwnode_property_read_bool(fwnode, "active-low"); ret = fwnode_property_read_u32(fwnode, "color", &color); if (ret) { From patchwork Wed Aug 24 11:05:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 1669735 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=WJ8wQS2f; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MCNYP5n0zz1ygT for ; Wed, 24 Aug 2022 21:05:28 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oQoCA-00030y-L9; Wed, 24 Aug 2022 11:05:14 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oQoC8-0002zj-4r for kernel-team@lists.ubuntu.com; Wed, 24 Aug 2022 11:05:12 +0000 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id DC09540AC4 for ; Wed, 24 Aug 2022 11:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1661339111; bh=rxTTG+Vt/hBeqGL1R/TdoWjFycxo0EPjiy5mVI6hGyI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WJ8wQS2fwrxhX7R4H1mylTKHm3E6+VFpt1OyO/Myd/HHprOl8bfUUyCur+9MGVlXZ TVTLmesVqaJGu6U5/OOVG/zEMYn+6We5YH5aIRTWci3NUFxiEsfM762AD1d6ZeueIT efEk6deufgpU+Oo0FptXK5TdiPqve2WjyddYrBomAGzlOs2AnLXwlmLQTodg6bS+rM wOy7o1QTVZyNHGPs10Z6RD0S2+ZHNBraSKp3e0g3/UGbD/DXEUVQFBMw8ARiBwEiSk EM34Dn65OPTgLiTieeL14DB53j/2qmqeG8Yvl0tpTCTLvI0VADfY3nfM4W+232t520 DKgHfUbDD71zA== Received: by mail-ed1-f69.google.com with SMTP id x3-20020a05640226c300b00446ad76aeb5so5905273edd.8 for ; Wed, 24 Aug 2022 04:05:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=rxTTG+Vt/hBeqGL1R/TdoWjFycxo0EPjiy5mVI6hGyI=; b=UUEtXpDaTXKzScVvTplyNzpkoPrUV/3cMQKJKVGw50TxlA4z/CA//7GS2yjH5I8vBT m7KRaYROuvs9qEl3uG/m4Wek4uIPCfkjdV+MngpZZTCbhw5ZEVFa+AzMuVknI2YlOLO0 j5GHf+XcN1gEDZW/7o/h8m+4TyUB82hNmJP1NFy9kWRL6keepRN2wH9sadxjJWHL/Gs5 7X95FtQIz0IJBiEv9Fxb/9XfCRo2txMJSfKcIX/gnnVtZeKBQWUBD9RJdmPN61sYDpX1 cWKBPfyir3rNybOtHEnWGS4kxis6TMxyUKnpKHTvw55W4Ck0wRvMBhpplcHmbfH91K+m /o/A== X-Gm-Message-State: ACgBeo1Rsaq005k27NUOu4epWT+6G3bBEA4hH6YU892bOL14tu/cbjyR JthrD7jCCT66oFuMh80mlxEuuzM4QUjauaZsXcE6y8yRZ4FBIN46aMKQf67be/mqm2IttPD/myz 4zo5vlQJcoaR9dLPDcQZwBiGGDPMWEjzU99qj8F+jgw== X-Received: by 2002:a17:907:3e01:b0:730:a690:a211 with SMTP id hp1-20020a1709073e0100b00730a690a211mr2612692ejc.596.1661339111378; Wed, 24 Aug 2022 04:05:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR7qRHRa5daDAqjIixMdxBaic+H1LUnnGI+ydDnFhQhOpUE4vmmf5WbbfNTxFcMw3uHcPYfp3g== X-Received: by 2002:a17:907:3e01:b0:730:a690:a211 with SMTP id hp1-20020a1709073e0100b00730a690a211mr2612684ejc.596.1661339111165; Wed, 24 Aug 2022 04:05:11 -0700 (PDT) Received: from stitch.. (80.71.140.73.ipv4.parknet.dk. [80.71.140.73]) by smtp.gmail.com with ESMTPSA id q10-20020aa7d44a000000b00447990ba835sm55248edr.25.2022.08.24.04.05.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 04:05:10 -0700 (PDT) From: Emil Renner Berthing To: kernel-team@lists.ubuntu.com Subject: [SRU][K][PATCH 3/3] riscv: dts: sifive unmatched: Add PWM controlled LEDs Date: Wed, 24 Aug 2022 13:05:07 +0200 Message-Id: <20220824110507.1114445-4-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220824110507.1114445-1-emil.renner.berthing@canonical.com> References: <20220824110507.1114445-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1987513 This adds the two PWM controlled LEDs to the HiFive Unmatched device tree. D12 is just a regular green diode, but D2 is an RGB diode with 3 PWM inputs controlling the three different colours. Signed-off-by: Emil Renner Berthing Reviewed-by: Geert Uytterhoeven Acked-by: Pavel Machek Tested-by: Ron Economos Link: https://lore.kernel.org/r/20220705210143.315151-5-emil.renner.berthing@canonical.com Signed-off-by: Palmer Dabbelt (cherry picked from commit 2cfe9bbec56ea579135cdd92409fff371841904f) Signed-off-by: Emil Renner Berthing --- .../boot/dts/sifive/hifive-unmatched-a00.dts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts index c4ed9efdff03..beaefe74755a 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts @@ -4,6 +4,8 @@ #include "fu740-c000.dtsi" #include #include +#include +#include /* Clock frequency (in Hz) of the PCB crystal for rtcclk */ #define RTCCLK_FREQ 1000000 @@ -44,6 +46,46 @@ gpio-poweroff { compatible = "gpio-poweroff"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; }; + + led-controller-1 { + compatible = "pwm-leds"; + + led-d12 { + pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = ; + max-brightness = <255>; + label = "d12"; + }; + }; + + led-controller-2 { + compatible = "pwm-leds-multicolor"; + + multi-led { + color = ; + max-brightness = <255>; + label = "d2"; + + led-red { + pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = ; + }; + + led-green { + pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = ; + }; + + led-blue { + pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = ; + }; + }; + }; }; &uart0 {