lights: boot: use DSI panel regulator driver

* Old rpi_backlight driver is no longer used on recent kernel versions.
  Regulator driver is used for backlight instead.
* Change the backlight path and implement scaling to support the official
  Raspberry Pi 7" DSI Touch Display & Touch Display 2.
* The original Touch Display has max brightness of 255 while the new Touch
  Display 2 has 31.
This commit is contained in:
Konsta
2025-01-30 22:41:25 +02:00
parent 1b7cb2e460
commit 2da7253013
5 changed files with 34 additions and 17 deletions

View File

@@ -23,11 +23,14 @@ namespace aidl::android::hardware::light {
class Lights : public BnLights {
public:
Lights();
ndk::ScopedAStatus setLightState(int id, const HwLightState& state) override;
ndk::ScopedAStatus getLights(std::vector<HwLight>* types) override;
private:
uint32_t rgbToBrightness(const HwLightState& state);
uint32_t maxBrightness;
uint32_t rgbToScaledBrightness(const HwLightState& state, uint32_t maxBrightness);
};
} // aidl::android::hardware::light