From patchwork Thu Feb 4 14:37:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Schuchmann X-Patchwork-Id: 377285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01DEDC433DB for ; Thu, 4 Feb 2021 14:40:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C042164DDD for ; Thu, 4 Feb 2021 14:40:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236836AbhBDOkM (ORCPT ); Thu, 4 Feb 2021 09:40:12 -0500 Received: from mail-eopbgr50110.outbound.protection.outlook.com ([40.107.5.110]:42563 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236851AbhBDOiT (ORCPT ); Thu, 4 Feb 2021 09:38:19 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QSjgosloYwHgrsHQRoyRo7oSBKWjzF2LyJ0Fvv7TfOBJL+DSgtJHZIfL107E+bjYsDb66NVPfVKsuY5JchS6a7l/lQMCjOKWvNShtNCtmo+7VwqiraMs/FuCuifd6DirMieF36coK4TZmYGSzJcpJ8tjXJxfXThO0AQ6aXoSNvpejXi6bugKQPC0WvVw9fmHJ9g2uTtmfu6HTiTRjOKvkeSxmVq6URrkVoJFglyEeuMHJfUQ30QxSwHpvoR0jk9O7y473eFPk8GWJpSgnzGa4HPKcgIdFMAWb30BsLk0GJ0f+YzdzfsCUXUiGyFQ4dN5vqjLVNEUbGeJFFSLbGyqpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7y2dgRYVshTRN1Kzw/WSNFjbXsyrnW+GuDbIdQobtuM=; b=lWkvY4CGkD2NBIhGuCF5kiugLxJUQ0zd4sZh68+NvVnlHwfVsk3csv+TmzWd8Mo2iCaLTg4LWplbpwl6GTNgy+fZk1IxdU38p20vH4rKJo/qug4ql2pTXGeQCOS1ieoqdZOFstqH4epYsAjYG/uACuoLLc194oNWutDB3mgsnYJZYc/CRW5rd7o2Tp0v5lcoYhSqza1Rw2S2auKpb/FlF6RbXG+SuTXtyDx8U3aNQxwNdJqiAQReU/Qw1W/AkgJHsX7iFabtZubDHCRrU0rUeDF+pgBWrtLbzrfuphGdNsbSGeFgT4CZFAVHtdVV/XXIRLh0Qi93IJ1FVIjOgwNNlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 62.153.209.162) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=schleissheimer.de; dmarc=none action=none header.from=schleissheimer.de; dkim=fail (no key for signature) header.d=schleissheimer.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schleissheimer.onmicrosoft.com; s=selector1-schleissheimer-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7y2dgRYVshTRN1Kzw/WSNFjbXsyrnW+GuDbIdQobtuM=; b=F2M32kAkWZ+Fs27/EAyu0j+e8xVhJZYkV+ZRLW7TsBbhQatFA6frRpH0BZ8wsN0Loi9KUQEjZYoedp5hPORnE5QTUHlkoMrx1lbT56mv2p5DagX2m0fZKrNCDFmwPu1xJnFtlSJ5l+gdbqMNfbH8mcDr2KkMuc7ThOXEJjgvD6E= Received: from AM5PR1001CA0022.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::35) by PR3P190MB0826.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:92::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.20; Thu, 4 Feb 2021 14:37:31 +0000 Received: from VI1EUR04FT049.eop-eur04.prod.protection.outlook.com (2603:10a6:206:2:cafe::a1) by AM5PR1001CA0022.outlook.office365.com (2603:10a6:206:2::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.19 via Frontend Transport; Thu, 4 Feb 2021 14:37:31 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 62.153.209.162) smtp.mailfrom=schleissheimer.de; vger.kernel.org; dkim=fail (no key for signature) header.d=schleissheimer.de; vger.kernel.org; dmarc=none action=none header.from=schleissheimer.de; Received-SPF: Fail (protection.outlook.com: domain of schleissheimer.de does not designate 62.153.209.162 as permitted sender) receiver=protection.outlook.com; client-ip=62.153.209.162; helo=mail.schleissheimer.de; Received: from mail.schleissheimer.de (62.153.209.162) by VI1EUR04FT049.mail.protection.outlook.com (10.152.28.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Thu, 4 Feb 2021 14:37:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=schleissheimer.de; s=dkim1; h=Message-Id:Date:Subject:Cc:To:From; bh=7y2dgRYVshTRN1Kzw/WSNFjbXsyrnW+GuDbIdQobtuM=; b=NuSiNFtH97zcwyZW7lAVx4Oq4UBw/ugQQbaawLWijlvR7qoiSdM5SQn/XDy9kMgWP2vqXS8gRQDD0Xml9DJcpuqXufRkc+WGwreg/s0oyISm7YYlNsBXwimwZgkdQKsd9zX+Aib6OZ7gIb5QVYu/6YkOM5GTxvMJazSKaiQckec=; Received: from [192.168.10.165] (port=41970 helo=contiredmine.schleissheimer.de) by mail.schleissheimer.de with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1l7fl9-0003vV-30; Thu, 04 Feb 2021 15:37:28 +0100 X-CTCH-RefID: str=0001.0A782F24.601C06A8.0001, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 From: Sven Schuchmann Cc: Sven Schuchmann , Pavel Machek , Dan Murphy , Rob Herring , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] leds: lp50xx: add setting of default intensity from DT Date: Thu, 4 Feb 2021 14:37:26 +0000 Message-Id: <20210204143726.27977-1-schuchmann@schleissheimer.de> X-Mailer: git-send-email 2.17.1 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: e881dd8a-2ff4-4ae2-0be7-08d8c91a6739 X-MS-TrafficTypeDiagnostic: PR3P190MB0826: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZpksaKArr//u+0OrlD0nQqmCQQ7xQUg5SnRh1s20fbKvnVGXQOlnfsPQ5Pi7WiOvVgDtatxGwsCxTyyvV76fjPUtd/LZ2ytnwvzLc39yD+/8vIetPgMrIG50S9tabsHTx01U+Cmbp2gpQr5FF4Evr4Tsedjjo/m9ZrMOno3nVDfFjX1tn2GzDau776ByXqvbBM72nYDZTRKVyBpBeetkdXCsxzhLy5/YYtGDGwIp9aOERK7VuaI0WV8aookNXjkfJPkH6ggF82r19P9idrcBZzZkOM64Sbz+3Nd33CMwXMEYWJF+WqHuPbLE7O+DIOU83zJCl53KKFBvXjQCPQCiea2LIc33FUfMTPBCi+wfKiMB5Nt394hZ1VqbQR1QPb0VxMz4ipQfUL4c2nENbEC8pv30kOmBXYxVlD0dtbpAhi0omj6JkhkPD3K4LTQeqNjhCqTcitzCKyHcCzYv5mDd8lFkLuSxvUXyOr+EHv0uwuDtSzxsYoQwce3wdpHP2ufx4uD2es6N3l2rlX30ypuuxIMZiHv5MTlwNZhEhBfwSDbcRojiI5r9kvyl2a+IjntvJpg7owc/Yiv4gSqQBAeKL0gLEpZIQNof5g9oFCJrSrlzmsOb409aWuMr5BNOdrq0XhZSsIaE77IJg5Ej/pveLN71/1fNBiS6J33LwhafVYk= X-Forefront-Antispam-Report: CIP:62.153.209.162; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.schleissheimer.de; PTR:www.schleissheimer.de; CAT:NONE; SFS:(39840400004)(376002)(396003)(136003)(346002)(46966006)(36840700001)(8936002)(5660300002)(47076005)(26005)(2906002)(336012)(70586007)(7696005)(186003)(4326008)(356005)(1076003)(8676002)(478600001)(109986005)(82310400003)(83380400001)(316002)(36860700001)(2616005)(7636003)(36756003)(426003)(9786002)(54906003)(70206006)(266003); DIR:OUT; SFP:1102; X-OriginatorOrg: schleissheimer.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2021 14:37:31.0300 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e881dd8a-2ff4-4ae2-0be7-08d8c91a6739 X-MS-Exchange-CrossTenant-Id: ba05321a-a007-44df-8805-c7e62d5887b5 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=ba05321a-a007-44df-8805-c7e62d5887b5; Ip=[62.153.209.162]; Helo=[mail.schleissheimer.de] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR04FT049.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P190MB0826 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org In order to use a multicolor-led together with a trigger the led needs to have an intensity set to see something. The trigger changes the brightness of the led but if there is no intensity we actually see nothing. This patch adds the ability to set the default intensity of each multi-led node so that it is turned on from DT. If no intensity is given the led will be initialized with full intensity. Part 1 updates the documentation. Part 2 removes an unused variable. Part 3 sets the initial intensity to full. Part 4 reads the default intensity from DT changes in v1 - fix dt_binding_check errors changes in v2 - sets default intensity to full - adds the property to the multi-led node Signed-off-by: Sven Schuchmann --- Documentation/devicetree/bindings/leds/leds-lp50xx.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml index c192b5feadc7..2bc25b2fc94d 100644 --- a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml +++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml @@ -65,6 +65,11 @@ patternProperties: This property denotes the LED module number(s) that is used on the for the child node. The LED modules can either be used stand alone or grouped into a module bank. + default-intensity: + minItems: 1 + maxItems: 3 + description: + The default intensity the multi-led gets initialised with. patternProperties: "(^led-[0-9a-f]$|led)": @@ -99,6 +104,7 @@ examples: reg = <0x1>; color = ; function = LED_FUNCTION_CHARGING; + default-intensity = <100 0 0>; led-0 { color = ; From patchwork Thu Feb 4 14:37:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Schuchmann X-Patchwork-Id: 377283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B046C433E0 for ; Thu, 4 Feb 2021 14:49:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10E6564F58 for ; Thu, 4 Feb 2021 14:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236766AbhBDOte (ORCPT ); Thu, 4 Feb 2021 09:49:34 -0500 Received: from mail-am6eur05on2132.outbound.protection.outlook.com ([40.107.22.132]:4288 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236858AbhBDOip (ORCPT ); Thu, 4 Feb 2021 09:38:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NMepqI2S0GOoLRAqfX6AlSkRY4O6v79FLpHGOZf7fAXmNW/R+tJ8cMSoiqZuU5ZT1HMKOcT3zCuLXqigM2AKT3p8R4vJpm+Au0Et4GcKhr6R7ArevniJGTsnfIHKn7e43D1M6NbTtHjTZOsK6LN9IoX8x2mPiTDUwWuWlVUIGzwXHUCt1MXy7uU5tKlO4lj68atSVXsfPLmAPoUxArQMbL+ywhPQMD14r0q1gWbi6lxAhC8jffT6NJciCL5bBlARFe7Ty1tv96k6e3xFn8E7Ex8nnbvb/bdpJEMOeVXoW7vsECENEGQ/cbM6y4AT3fS8yAAdg2vqjpMWCTmny/5zfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U8hwsuotRJyFZlNoGcVUj+0hWqgZSxHdgSkrE5F3vSI=; b=Zp7v5oqtCnN6pQXFJ0qLCe4m6sL6Z5p03w5u8xqG9im3hdqEEChItiZRPUvv3GGmlOyKECuNxS0XI/kazY7o1ic2w12s10oiAlzV84gsHl1bvXKFXoMV/sDiLHiBq5+BoIrPRlUQtI8PU9je6I0+lsLc2BJ5WiVcCoHnghQXITHByE0aXEAd3zLXtun2bFPp8MXcJ9kstcUVMRIkXIHEOGj/E8t0LS/aTSskS3i5XB6II7YIrhFWjAQYxcHtgAshOjZ+gUX2FXBmV4zLHy/ttJwjngvMbZRd0lWO3ulzTSFpsqEC3af97JMfYOcEpJy1JMvkgEkjuy4ePG4maY2i9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 62.153.209.162) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=schleissheimer.de; dmarc=none action=none header.from=schleissheimer.de; dkim=fail (no key for signature) header.d=schleissheimer.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schleissheimer.onmicrosoft.com; s=selector1-schleissheimer-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U8hwsuotRJyFZlNoGcVUj+0hWqgZSxHdgSkrE5F3vSI=; b=XHx35wpjaF6ncmCPrAcpH64RfW717kLpYZHQByx3q0BNRwVSHovKPhqToGXjlgZA8uQBgoSpMiH5bdPUDqIB2G6JjeTQsDnbc1w1S756f5jPsDvPj3SdU2pGhDPwfrfC5Cg5jAJy/GfosEjwKq7ImWRj+L691E/ik5VSB3Gi/8Q= Received: from AS8PR04CA0148.eurprd04.prod.outlook.com (2603:10a6:20b:127::33) by VI1P190MB0525.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:30::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.16; Thu, 4 Feb 2021 14:37:43 +0000 Received: from HE1EUR04FT020.eop-eur04.prod.protection.outlook.com (2603:10a6:20b:127:cafe::ad) by AS8PR04CA0148.outlook.office365.com (2603:10a6:20b:127::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.19 via Frontend Transport; Thu, 4 Feb 2021 14:37:43 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 62.153.209.162) smtp.mailfrom=schleissheimer.de; vger.kernel.org; dkim=fail (no key for signature) header.d=schleissheimer.de; vger.kernel.org; dmarc=none action=none header.from=schleissheimer.de; Received-SPF: Fail (protection.outlook.com: domain of schleissheimer.de does not designate 62.153.209.162 as permitted sender) receiver=protection.outlook.com; client-ip=62.153.209.162; helo=mail.schleissheimer.de; Received: from mail.schleissheimer.de (62.153.209.162) by HE1EUR04FT020.mail.protection.outlook.com (10.152.26.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Thu, 4 Feb 2021 14:37:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=schleissheimer.de; s=dkim1; h=Message-Id:Date:Subject:Cc:To:From; bh=U8hwsuotRJyFZlNoGcVUj+0hWqgZSxHdgSkrE5F3vSI=; b=XIa+P2RRW7UyamNm4sr8MiWKyRyPniw+zSDXBZYeKiIPPuMWTTnmHbtaVmgMerK8zXRSaZ7b7BzlNr/0pz70lAJrz86Pf80v8SEANUfzQVtsDmLxMudfm6gCMmKL3dZiaZPihDbBUTOjUZ2FaEM0gSt0YAM0/KaAt+p32ApTivU=; Received: from [192.168.10.165] (port=41972 helo=contiredmine.schleissheimer.de) by mail.schleissheimer.de with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1l7flL-00040F-1q; Thu, 04 Feb 2021 15:37:39 +0100 X-CTCH-RefID: str=0001.0A782F17.601C06B3.0090, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 From: Sven Schuchmann Cc: Sven Schuchmann , Pavel Machek , Dan Murphy , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] leds: lp50xx: add setting of default intensity from DT Date: Thu, 4 Feb 2021 14:37:38 +0000 Message-Id: <20210204143738.28036-1-schuchmann@schleissheimer.de> X-Mailer: git-send-email 2.17.1 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8bfbdf91-97cf-4070-a5a7-08d8c91a6e76 X-MS-TrafficTypeDiagnostic: VI1P190MB0525: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OpZ+bFTklA31lXOeuxm1+vz3AJ/wMBS/sVm+BweSvC/MEdg0RQw8jXNUQLxvAudrgXkJLIie9dtxKpxYlk7eEvKsUqWTvRFHRj7hvj2VyNk2OUqTBg6xovL7+p8DFnXp7hi9ZQZfgaT/lb8JRlNc89a7E1+at+lJlDpLJeuSb9kjr/fA73lBpA5MWIiwS1gv3uJWr0rIHdYeTyprzLyOsXlhEmQ7q4C+83SMYsSWBMP9ixdNhmBSGWHZoQZ99mBMWlhAHpzuyO6n9AzoDbBtwkb+zapd/a7JToKgrGz7+DuG+VhgaPDRdkqpWzWkkwYrG4MT0F+Sb5nkr3NjaVLlhQ1O3u1juA5gOUnLWOVS2O444whlWEifEU4aDF91oyz23cSbkFm+VJN0BPit1E/VRZsPhUp0TAgpLj+mgYaTX4mhxVGzUQ7XBQoklWrc3pwGu+NReDsddv+kObjcUtZwGKuCVL9m1cgtDuvITWBprwAp7Ju6IaQW7wyA5i/8bNuLm80HpgHP4BMetfoUnw+L2zMZAcTF/UahbfGXKaL6KOyr6t28lmJaGk1JkiDCWV/yPOOzXTnyGAsYegN216JiK6j6aX5lBNx/LDwmpvx85ayHq9dUYNCNjmpZ165NJQOerxipWX7BibGkzDTIulRzA1rKVo4AyBGvzES/JUbXyzE= X-Forefront-Antispam-Report: CIP:62.153.209.162; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.schleissheimer.de; PTR:mail.schleissheimer.de; CAT:NONE; SFS:(396003)(376002)(39840400004)(346002)(136003)(36840700001)(46966006)(2906002)(109986005)(9786002)(7596003)(186003)(36860700001)(478600001)(8936002)(356005)(26005)(336012)(47076005)(70206006)(36756003)(82310400003)(1076003)(7636003)(70586007)(8676002)(426003)(316002)(2616005)(7696005)(54906003)(4326008)(5660300002)(83380400001)(266003); DIR:OUT; SFP:1102; X-OriginatorOrg: schleissheimer.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2021 14:37:43.1547 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8bfbdf91-97cf-4070-a5a7-08d8c91a6e76 X-MS-Exchange-CrossTenant-Id: ba05321a-a007-44df-8805-c7e62d5887b5 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=ba05321a-a007-44df-8805-c7e62d5887b5; Ip=[62.153.209.162]; Helo=[mail.schleissheimer.de] X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT020.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1P190MB0525 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org In order to use a multicolor-led together with a trigger the led needs to have an intensity set to see something. The trigger changes the brightness of the led but if there is no intensity we actually see nothing. This patch adds the ability to set the default intensity of each multi-led node so that it is turned on from DT. If no intensity is given the led will be initialized with full intensity. Part 1 updates the documentation. Part 2 removes an unused variable. Part 3 sets the initial intensity to full. Part 4 reads the default intensity from DT changes in v1 - fix dt_binding_check errors changes in v2 - sets default intensity to full - adds the property to the multi-led node Signed-off-by: Sven Schuchmann --- drivers/leds/leds-lp50xx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index f13117eed976..4b40bf66483c 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -267,7 +267,6 @@ struct lp50xx_led { struct led_classdev_mc mc_cdev; struct lp50xx *priv; unsigned long bank_modules; - int led_intensity[LP50XX_LEDS_PER_MODULE]; u8 ctrl_bank_enabled; int led_number; }; From patchwork Thu Feb 4 14:37:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Schuchmann X-Patchwork-Id: 376588 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDBC9C433DB for ; Thu, 4 Feb 2021 14:41:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A954264F4D for ; Thu, 4 Feb 2021 14:41:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236866AbhBDOk7 (ORCPT ); Thu, 4 Feb 2021 09:40:59 -0500 Received: from mail-eopbgr130123.outbound.protection.outlook.com ([40.107.13.123]:56965 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236782AbhBDOit (ORCPT ); Thu, 4 Feb 2021 09:38:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KIMTX1dry8vQrnTSSazGWEaxj3gtnD/Rxs8fkdaMnW3F1v3H1sLC7Kz9nlx1HwFVfJs+Z4moMbAA8YKtzTTdv/l1e9MM7oBNV1UkruY/t0rlsEPGRQOxN/yzSjF2XK1PsC1LP4Rm3eUw65Dzd4hIhaitXJ1jfYr/pU0AFyDHIhV9gWg6crATWVv+4PMYqBkIBBMjwtzbw4j//nPB1e76iEItW/I4AOZUkLf5mLqYoA+2WbOMbifogClfmP6cGR8agMpyg+K5mCiLQiDO1NU7NHBRAD4V1Ep3WVRTeQP7mPP/X+C6d9wsKTNPH/Gp06oLidtCYUnzEWCE25gL3eXFng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dFrn7Vt1je7kdjp8cC5anRNu7TqR8GzlT3IrLRF893c=; b=Q0kdwi92jnEYO1eaqwXK3EeT7qB2pQmvaxJYJTHGeNUH2qLxEh9be6FkIPTWZRxQQfkcxNPiy+gwqEjUt6TJMSj9zvxWNh88+Dmr37aiEq2TaA5NhqIw0HYy7cf6IiTtNU/fH9dJUP3Pu7FB1FetQzjCLwRw1KXL2lWO6CakGFhi2/DhyuDgMH6/sP7dVpY1+0sEFBN1Qv9ufK4XI1SRWQAmgd8nf2t1SuSgoGW8MM4rbBXY1VU8qMfg9TnQr7yam063rNgdZ6lcKglX6xRfGuS9bAzrKSA3St1gWbbxyTC5m6UEbtuDTlRwb6BimIXvFgBcUhlSua4BnXlXd8piwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 62.153.209.162) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=schleissheimer.de; dmarc=none action=none header.from=schleissheimer.de; dkim=fail (no key for signature) header.d=schleissheimer.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schleissheimer.onmicrosoft.com; s=selector1-schleissheimer-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dFrn7Vt1je7kdjp8cC5anRNu7TqR8GzlT3IrLRF893c=; b=P5fkwEvpPauRFsKqswLqQn+vep8BseCU//n43ra1GOhJ1Ed/WK9b+1mnzNZgszt37sP/mxySpzOh5Re8bgTdcr0ll48u6X5zmxjXye3EtBmHeBQF4yOhF4yUK5fmS/kZatrMMCgHB/w2nG8fry+kS28qyVPYLLIA3iGkMKBIBu4= Received: from DB8PR04CA0013.eurprd04.prod.outlook.com (2603:10a6:10:110::23) by VI1P190MB0221.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:9b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.20; Thu, 4 Feb 2021 14:38:01 +0000 Received: from DB3EUR04FT057.eop-eur04.prod.protection.outlook.com (2603:10a6:10:110:cafe::3c) by DB8PR04CA0013.outlook.office365.com (2603:10a6:10:110::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.17 via Frontend Transport; Thu, 4 Feb 2021 14:38:01 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 62.153.209.162) smtp.mailfrom=schleissheimer.de; vger.kernel.org; dkim=fail (no key for signature) header.d=schleissheimer.de; vger.kernel.org; dmarc=none action=none header.from=schleissheimer.de; Received-SPF: Fail (protection.outlook.com: domain of schleissheimer.de does not designate 62.153.209.162 as permitted sender) receiver=protection.outlook.com; client-ip=62.153.209.162; helo=mail.schleissheimer.de; Received: from mail.schleissheimer.de (62.153.209.162) by DB3EUR04FT057.mail.protection.outlook.com (10.152.24.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Thu, 4 Feb 2021 14:38:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=schleissheimer.de; s=dkim1; h=Message-Id:Date:Subject:Cc:To:From; bh=dFrn7Vt1je7kdjp8cC5anRNu7TqR8GzlT3IrLRF893c=; b=PwBeeBShfeX9QSZk4jqnhs/IGysUq8cuLP05N4Nb1Fnn4WGWQFap5HzzeRQ+FAe2DDbm20BCap8guNOZ47F3XP0j69swlg9v/Ha63BKEUkKTarGT2ekqjS2+svtH70P5PY4FSwry/EuLyU5wsR2e2C+QXVruvGzJGvktPkQni5E=; Received: from [192.168.10.165] (port=41974 helo=contiredmine.schleissheimer.de) by mail.schleissheimer.de with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1l7fld-000419-0I; Thu, 04 Feb 2021 15:37:57 +0100 X-CTCH-RefID: str=0001.0A782F1F.601C06C5.0018, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 From: Sven Schuchmann Cc: Sven Schuchmann , Pavel Machek , Dan Murphy , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] leds: lp50xx: add setting of default intensity from DT Date: Thu, 4 Feb 2021 14:37:56 +0000 Message-Id: <20210204143756.28088-1-schuchmann@schleissheimer.de> X-Mailer: git-send-email 2.17.1 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: eeea7ab8-6e88-42e8-ff48-08d8c91a78f5 X-MS-TrafficTypeDiagnostic: VI1P190MB0221: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t7FyVm09h9AZYuLZFzSNV3x9QNx/L8eCl6jYgGzwqz23y8iFh2Tq4ZjXJhZ3oj2t0HnFWq7NmePrsIQB0S8sUrv3vs5X2STydPownXErpwdx27lrFZNP7TAQuiuZTD9LTU++wU+QqdoXdGrjw2724/JlP1MTT4hxvkxwVhrFcDvasGjTPaFTm5+PW9NEAQR9raUliLh67Q0+hdDarC3dYpQVuUEyMAJBihnOte4IBJQDGM3uLyfOQnzzIU2LCxCo7rnDwwRyZlWp5dHtueOdDmTo74pBUOlAIf+Ckv7CKVeMH0+hx7wpQ9eiHcNzk5u58Tzr/uvCfyazuZX5hipWFYkmSn3I2pvcnGXBILRFxae+Bi9Vz1HG/ghFHJYgpy/Vs1nRDaigQjYOjCgyzxWu3wt6cG+5tbB21z2Z3dP9ELuu9Xru3lJdyt3/fDRxdI46I8Fu0oi4tXZkOHGxzGWnqiIANsd85A7kdBP+eLW5UDwD/l7+hSt2Ry7tyvWNlcBwH6fZBrkyxftF3sZeGPr/dUMmI6dVv1eCgP5GYzCDjaNwPWx/P+9vPUIiDqaUrralM5JfgiB25gmVjHMzaxTSN+QDj5+44aSztW1ohxgE+b0RkACcnBJt2M/zrghXtEZlnK50d2clHgNfpC0Y5cpJrr5/HwNL8I6AzWTewG85za0= X-Forefront-Antispam-Report: CIP:62.153.209.162; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.schleissheimer.de; PTR:www.schleissheimer.de; CAT:NONE; SFS:(39840400004)(136003)(396003)(346002)(376002)(36840700001)(46966006)(478600001)(8936002)(426003)(9786002)(36756003)(5660300002)(4326008)(8676002)(2616005)(7636003)(1076003)(26005)(70586007)(336012)(356005)(54906003)(7696005)(47076005)(70206006)(82310400003)(36860700001)(109986005)(83380400001)(186003)(2906002)(316002)(266003); DIR:OUT; SFP:1102; X-OriginatorOrg: schleissheimer.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2021 14:38:00.7715 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eeea7ab8-6e88-42e8-ff48-08d8c91a78f5 X-MS-Exchange-CrossTenant-Id: ba05321a-a007-44df-8805-c7e62d5887b5 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=ba05321a-a007-44df-8805-c7e62d5887b5; Ip=[62.153.209.162]; Helo=[mail.schleissheimer.de] X-MS-Exchange-CrossTenant-AuthSource: DB3EUR04FT057.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1P190MB0221 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org In order to use a multicolor-led together with a trigger the led needs to have an intensity set to see something. The trigger changes the brightness of the led but if there is no intensity we actually see nothing. This patch adds the ability to set the default intensity of each multi-led node so that it is turned on from DT. If no intensity is given the led will be initialized with full intensity. Part 1 updates the documentation. Part 2 removes an unused variable. Part 3 sets the initial intensity to full. Part 4 reads the default intensity from DT changes in v1 - fix dt_binding_check errors changes in v2 - sets default intensity to full - adds the property to the multi-led node Signed-off-by: Sven Schuchmann --- drivers/leds/leds-lp50xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index 4b40bf66483c..79bc071c31fb 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -500,6 +500,7 @@ static int lp50xx_probe_dt(struct lp50xx *priv) } mc_led_info[num_colors].color_index = color_id; + mc_led_info[num_colors].intensity = LED_FULL; num_colors++; } From patchwork Thu Feb 4 14:38:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Schuchmann X-Patchwork-Id: 377284 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64CEBC433DB for ; Thu, 4 Feb 2021 14:41:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27ED764E42 for ; Thu, 4 Feb 2021 14:41:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236771AbhBDOlN (ORCPT ); Thu, 4 Feb 2021 09:41:13 -0500 Received: from mail-am6eur05on2106.outbound.protection.outlook.com ([40.107.22.106]:49732 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236797AbhBDOi5 (ORCPT ); Thu, 4 Feb 2021 09:38:57 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E8/9urRPFlf3/OP3j+6DMVeg2qgrwgukNwtKhZk0ggRMZJmt67Es9p026VqSqBmj5Cj97uRyDpaHko3PlwacVzrKO9/LoobnQvv8r7E6d6Nnm5GGgTrIGcI13Hp4/F4IPKzPqdSIYhYuB6/rHvjOi7vRFj/kWUP7clhG1svTectDmQbAsAEJNro7d79bxDCfs7JmDmX4WDP5DkBgYWh1cgRkbPOiQUwQhQZesFvMu/t/WF2cre5VoKtPbYjD3+tvQZrXzdF/YXgojJ0eMJ/UPQ5JC0bnJ7GpMqpsCV7ia8bp0WhK016vVdtVduSQgNH21avBiEqsS33AX/OpqLSxiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jDyisx5GKNuYiaZx3bcN5ZL8eCRJewgkWWNpmsbdMM4=; b=TVSH5c3PNnEq5zgNAtS1S+tvsL/FSmdV5+7C8Jl0uGfLeTHIN0f1dP937F0JW4xkA9oJ0u/msnG951bCsibSLe/Uz4u9ivWPZJu2Oi6MxLdp/HpvzKoD7hb3BHyD9lH8OTzE8Hz2S3c9Cn2Zdk+9kXFnEt5i9Q/GiSKeMutkudpcgdiFJBIDT+EAYNvxzBF/kigvoYkWtpHEvQ/vXDdyEPBtcseftrAW0mXSigyf0K7yza45DoJ6clw4KJ2PuFQqWarmGflWl4BOEZvNN1aAkPUki7cVjnRey2rJ+QfaY9t49veKE+9VOBzJs6awe1tINADYQhuUGM6l8XUXKHtncw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 62.153.209.162) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=schleissheimer.de; dmarc=none action=none header.from=schleissheimer.de; dkim=fail (no key for signature) header.d=schleissheimer.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schleissheimer.onmicrosoft.com; s=selector1-schleissheimer-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jDyisx5GKNuYiaZx3bcN5ZL8eCRJewgkWWNpmsbdMM4=; b=Yl+/k7FNvXKwdwtydeiU4qF82t9R90DS5PdXevfBiU3mxb4Kp3RZNjYgrfdnYvLhAA0SPRkv5I625TuSn8OGswWN1/Eo/OcQhcOdg2UdLQlnCXcJmE2SzVi/mmy4lpwypsgu63S5H0GxeSsP1fNpFKV5Tto7TXTzWuG99sjQ56M= Received: from DU2PR04CA0073.eurprd04.prod.outlook.com (2603:10a6:10:232::18) by AS8P190MB1368.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:2e8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Thu, 4 Feb 2021 14:38:08 +0000 Received: from DB3EUR04FT064.eop-eur04.prod.protection.outlook.com (2603:10a6:10:232:cafe::75) by DU2PR04CA0073.outlook.office365.com (2603:10a6:10:232::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.19 via Frontend Transport; Thu, 4 Feb 2021 14:38:08 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 62.153.209.162) smtp.mailfrom=schleissheimer.de; vger.kernel.org; dkim=fail (no key for signature) header.d=schleissheimer.de; vger.kernel.org; dmarc=none action=none header.from=schleissheimer.de; Received-SPF: Fail (protection.outlook.com: domain of schleissheimer.de does not designate 62.153.209.162 as permitted sender) receiver=protection.outlook.com; client-ip=62.153.209.162; helo=mail.schleissheimer.de; Received: from mail.schleissheimer.de (62.153.209.162) by DB3EUR04FT064.mail.protection.outlook.com (10.152.24.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Thu, 4 Feb 2021 14:38:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=schleissheimer.de; s=dkim1; h=Message-Id:Date:Subject:Cc:To:From; bh=jDyisx5GKNuYiaZx3bcN5ZL8eCRJewgkWWNpmsbdMM4=; b=VvuzQrUvsBAd0pg1VEx3us8RxCwTtHGVVKyKtFUjYoBKE0C9+B3W00WeYaVFggz4sL80KoKKkiu1oE73iG82HzhluZ3t2MwjDbdfc4bYGaJbxgdQ9t6u235AfVn1uI2tqzofRrBMDoHTLNTkRjkf8RzVr56D2IaQDOwBHg5IKyw=; Received: from [192.168.10.165] (port=41976 helo=contiredmine.schleissheimer.de) by mail.schleissheimer.de with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1l7flk-00042E-2E; Thu, 04 Feb 2021 15:38:04 +0100 X-CTCH-RefID: str=0001.0A782F20.601C06CC.00BB, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 From: Sven Schuchmann Cc: Sven Schuchmann , Pavel Machek , Dan Murphy , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] leds: lp50xx: add setting of default intensity from DT Date: Thu, 4 Feb 2021 14:38:03 +0000 Message-Id: <20210204143803.28140-1-schuchmann@schleissheimer.de> X-Mailer: git-send-email 2.17.1 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 0e3166d4-be03-4de4-687c-08d8c91a7d49 X-MS-TrafficTypeDiagnostic: AS8P190MB1368: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5/Xs4HfhBluQPkukgaikwPPu+HXvJLZwQZ3va5m1/T4GtXcaGpYhG6xlyyjIi8NtLIopg4unKT771fK38VpV6CfTCIM4Kbqiggz0e6UitqQnfmouaFU+maeeP2cdPIAire6P9b2Fq4OkW+PSWny6ouSq+O5+LC1YOiOaX3p4V3fd6E/YCIeSe0Iz+ZeuO8rvVMUG9GlvdcmZYOFdwlt2K1Y5DDSeZ/948UjbI1EK3WyFZUiAO8/0WagOhpFmEyE4+9fgveBwiSYXboV9JT01paeWOGVZ8eNMf8Q9/sMsMY4/BdEtXpWEaV5yag/0A9gjWp4d8pT0XB72x3a9ZBGmTFh//3P2d0vmTR3Q+JoBSlUVLnfLLYkoGn3qQSkJIg3Py0oTomIbFXhPxWZDUi2y5X4Dknwy++hMMo0wsqklGHAHlY2SIFZ96kfrmPOTwaEKyrF6ak7UYNE0W+X3fRPuMCMz77DZ9la2kps58jbJO1TCfijbUHunGjsQnxxBeSv0qh4wuCV3qQw5m8cYUZY4ftlWTzw8fDoV4C8aSvPV5uWutcddZg9TLvh4zpep/OU01+AelTYiFr0R/ERUwjzFSsib5ypxhUZOjlqtJ1AogMJyo9AVucHojVepV179wz5zzV1gXzMy9/b5SCPel8q2CFm3rHp8ZBNmgInSh2DTuOE= X-Forefront-Antispam-Report: CIP:62.153.209.162; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.schleissheimer.de; PTR:mail.schleissheimer.de; CAT:NONE; SFS:(39840400004)(376002)(136003)(396003)(346002)(36840700001)(46966006)(47076005)(70206006)(70586007)(82310400003)(7596003)(356005)(7636003)(2906002)(5660300002)(26005)(8676002)(83380400001)(1076003)(109986005)(8936002)(36860700001)(9786002)(186003)(2616005)(36756003)(478600001)(426003)(54906003)(336012)(7696005)(316002)(4326008)(266003); DIR:OUT; SFP:1102; X-OriginatorOrg: schleissheimer.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2021 14:38:08.0341 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e3166d4-be03-4de4-687c-08d8c91a7d49 X-MS-Exchange-CrossTenant-Id: ba05321a-a007-44df-8805-c7e62d5887b5 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=ba05321a-a007-44df-8805-c7e62d5887b5; Ip=[62.153.209.162]; Helo=[mail.schleissheimer.de] X-MS-Exchange-CrossTenant-AuthSource: DB3EUR04FT064.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P190MB1368 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org In order to use a multicolor-led together with a trigger the led needs to have an intensity set to see something. The trigger changes the brightness of the led but if there is no intensity we actually see nothing. This patch adds the ability to set the default intensity of each multi-led node so that it is turned on from DT. If no intensity is given the led will be initialized with full intensity. Part 1 updates the documentation. Part 2 removes an unused variable. Part 3 sets the initial intensity to full. Part 4 reads the default intensity from DT changes in v1 - fix dt_binding_check errors changes in v2 - sets default intensity to full - adds the property to the multi-led node Signed-off-by: Sven Schuchmann --- drivers/leds/leds-lp50xx.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index 79bc071c31fb..e8aa36c7e963 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -504,6 +504,24 @@ static int lp50xx_probe_dt(struct lp50xx *priv) num_colors++; } + if (fwnode_property_count_u32(child, "default-intensity") + == num_colors) { + + int j, def_int[LP50XX_LEDS_PER_MODULE]; + + ret = fwnode_property_read_u32_array(child, + "default-intensity", def_int, num_colors); + if (ret) { + dev_err(&priv->client->dev, + "Cannot read default-intensity: %d\n", + ret); + goto child_out; + } + + for (j = 0; j < num_colors; j++) + mc_led_info[j].intensity = def_int[j]; + } + led->priv = priv; led->mc_cdev.num_colors = num_colors; led->mc_cdev.subled_info = mc_led_info;