From patchwork Fri Nov 6 16:58:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 321351 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=-8.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED 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 127E4C5517A for ; Fri, 6 Nov 2020 16:58:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F37B217A0 for ; Fri, 6 Nov 2020 16:58:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="V4ecOcfM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727334AbgKFQ6R (ORCPT ); Fri, 6 Nov 2020 11:58:17 -0500 Received: from mail-03.mail-europe.com ([91.134.188.129]:39206 "EHLO mail-03.mail-europe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726176AbgKFQ6Q (ORCPT ); Fri, 6 Nov 2020 11:58:16 -0500 Date: Fri, 06 Nov 2020 16:58:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1604681891; bh=Cxw7DayELvc3qFiSUFsEDeHz2abSz8ZKKvShcAZzGs4=; h=Date:To:From:Cc:Reply-To:Subject:From; b=V4ecOcfMwrzQwVVAadDcFFrVquVfAX0sNE4d9AXx0HTmHp07Oqs6LkIksFi/PCg+b 3N3YwWdZenhBVBvceDB/vW3a1sQcnZK3rH7dAcd8SUOgzvVievVXdIBC8v+lr4ecxR GA64X6Cue7yH99ws87Hh7lMGTV3LQH9z7GN2NRLk= To: Pavel Machek , Dan Murphy , Bjorn Andersson , Andy Gross , Rob Herring From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Cc: linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Brian Masney , Luca Weiss , Russell King , Georgi Djakov , linux-kernel@vger.kernel.org, lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com Reply-To: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Subject: [RFC PATCH 0/3] Add support for the flash LED on Nexus 5 Message-ID: <20201106165737.1029106-1-nfraprado@protonmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi, this patch series adds support for the flash LED on Nexus 5. The first patch adds the driver for the QPNP flash LED. The code for the driver was ported from [1], which was for the 3.4 kernel. That driver originally supported multiple LED types: WLED, Flash/Torch, RGB, MPP and KPDBL as described in [2], but this port only contains support for Flash/Torch, and the code for the others was removed just because it was easier to test. Also, it was originally an SPMI driver, but here I made it into a platform driver that matches an SPMI device and uses regmap to read and write on the addresses. The second patch adds the driver as a module in qcom's defconfig, which is the one used by the Nexus 5. The third patch adds the relevant nodes to Nexus 5's device tree. These nodes were copied from [3] and [4], only changing the flash-boost-supply and torch-boost-supply properties to point to the regulator nodes already defined upstream at qcom-pm8941.dtsi. Again, I'm not sure if the nodes should be kept on separate .dtsi as they were downstream, I just did what was easier for testing. The flash LED can be tested on a Nexus 5 with the following: To turn the LED on: echo 1 > /sys/class/leds/led\:flash_torch/brightness To turn the LED on only for a couple seconds: echo 1 > /sys/class/leds/led\:flash_0/brightness