lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210803162641.1525980-1-nfraprado@collabora.com>
Date:   Tue,  3 Aug 2021 13:26:36 -0300
From:   Nícolas F. R. A. Prado 
        <nfraprado@...labora.com>
To:     Pavel Machek <pavel@....cz>, Dan Murphy <dmurphy@...com>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Andy Gross <agross@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Jacek Anaszewski <jacek.anaszewski@...il.com>
Cc:     linux-leds@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
        Brian Masney <masneyb@...tation.org>,
        Luca Weiss <luca@...tu.xyz>,
        Russell King <linux@...linux.org.uk>,
        Georgi Djakov <georgi.djakov@...aro.org>,
        linux-kernel@...r.kernel.org, phone-devel@...r.kernel.org,
        ~postmarketos/upstreaming@...ts.sr.ht, ~lkcamp/patches@...ts.sr.ht,
        André Almeida <andrealmeid@...labora.com>,
        kernel@...labora.com
Subject: [PATCH v3 0/5] Add support for QCOM SPMI Flash LEDs

Hi,

this patch series adds support for Qualcomm's SPMI Flash LEDs present in the
PM8941 PMIC. It is used as part of MSM8974 based devices, like the Nexus 5
(hammerhead), as a camera flash or as a lantern when in torch mode.

The driver code is based on the parts of the QPNP LEDs driver from downstream
[1] that handled the flash LED.

This hardware doesn't have any publicly available documentation, so all my
knowledge about its behavior came from reading the downstream driver code and
from inspecting the SPMI registers used for the LED operations. I have collected
my findings at [2].

Bjorn, Jacek and Pavel, big thanks for your review in v2. I didn't answer the
emails but I believe I addressed all of the feedback you gave me. Sorry for the
long delay, I'll try to actually answer the feedback this time, and in a timely
manner too.

The changes in this v3 are too many to list, but the biggest ones were:
- The two LEDs can now be operated independently even when in torch mode
- The flashes can now strobe consecutive times without needing to manually
  disable them between strobes
- Implemented strobe_get()
- Moved dt parsing to a separate function
- Split multiplexed torch/flash on/off and torch/flash regulator on/off
  functions
- Removed configurations from the dt-binding that didn't have any visible
  impact, instead hardcoding them inside the driver
- Moved LED dt nodes configuration to hammerhead dts
- Set current on brightness callback and timeout on timeout callback, instead of
  setting everything every time when strobing/turning torch on

Fault detection and V4L2 flash wrapper support are still missing but, as others
have pointed out before, they can be implemented later if desired.

Thanks,
Nícolas

v2: https://lore.kernel.org/linux-arm-msm/20210126140240.1517044-1-nfraprado@protonmail.com/
v1 RFC: https://lore.kernel.org/linux-arm-msm/20201106165737.1029106-1-nfraprado@protonmail.com/

[1] https://github.com/AICP/kernel_lge_hammerhead/blob/n7.1/drivers/leds/leds-qpnp.c
[2] https://gitlab.collabora.com/nfraprado/linux/-/wikis/PM8941-Flash-LEDs

Nícolas F. R. A. Prado (5):
  dt-bindings: leds: Add binding for qcom-spmi-flash
  leds: Add driver for QCOM SPMI Flash LEDs
  ARM: qcom_defconfig: Enable QCOM SPMI Flash LEDs
  ARM: dts: qcom: pm8941: Add nodes for QCOM SPMI Flash LEDs
  ARM: dts: qcom: msm8974-hammerhead: Enable and configure flash LED
    node

 .../bindings/leds/leds-qcom-spmi-flash.yaml   |   93 ++
 .../qcom-msm8974-lge-nexus5-hammerhead.dts    |   20 +
 arch/arm/boot/dts/qcom-pm8941.dtsi            |   25 +
 arch/arm/configs/qcom_defconfig               |    2 +
 drivers/leds/flash/Kconfig                    |    8 +
 drivers/leds/flash/Makefile                   |    1 +
 drivers/leds/flash/leds-qcom-spmi-flash.c     | 1251 +++++++++++++++++
 7 files changed, 1400 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-qcom-spmi-flash.yaml
 create mode 100644 drivers/leds/flash/leds-qcom-spmi-flash.c

-- 
2.32.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ