Thread (41 messages) flat view 41 messages, 6 authors, 21h ago

Re: [Letux-kernel] [PATCH 15/16] backlight: remove pandora_bl

From: H. Nikolaus Schaller <hidden>
Date: 2026-08-10 20:58:04
Also in: dri-devel, linux-arm-kernel, linux-devicetree, linux-omap, linux-sound, lkml

Am 10.08.2026 um 22:34 schrieb Andreas Kemnade [off-list ref]:

On Mon, 10 Aug 2026 20:30:13 +0200
"H. Nikolaus Schaller" [off-list ref] wrote:
quoted
quoted
Yes that is what I mean. It needs to be ported somewhere. If it can be ported to
some compatible = "pwm_bl_for_tps61161" or what fits best it will be fine. Or it
could be in some compatible = "pandora_bl" driver.

Has to be worked out when the development machines are not blocked by 3 or 4 other
projects already running in parallel :)  
Nevertheless I did a quick look into the pandora_bl driver structure.

Here are my findings:
- the code fragment is part of pandora_backlight_update_status()
- priv->old_state remembers if brighness was set to 0 or not
- so this code triggers on any change from bright = 0 to bright > 0
- the pandora_bl driver is the only one to use TWL_MODULE_PWM besides twl-pwm

So the most natural way of transplanting this appears to me:
- add this logic to the twl-pwm driver
That chip could be connected to any pwm driver, so
it does not make sense to have that in a pwm driver.
Well, the chip does not need a driver, at all - at least in PWM case.
The missing piece is just about doing proper startup into PWM mode.
So it belongs into a backlight driver.
Interesting how contrary requirements can be judged :) Especially
for such simple things that apparently even work without any driver.
And since it shared so much
code with the pwm_bl, it could be extended.
But how do you give the chip driver access to twl4030 registers?
Or make it universal so that it works on any PWM generator? Any ideas?
The compatible should have pwm in the name to be able to also add
a w1 driver later.
Ok, that is an argument to be considered.

But: for multi-protocol chips (think of SPI and I2C) there are
usually two drivers (or glue code for a core driver) for each
protocol. So we can have one driver when connected to PWM and
another being an EasyScale (which is not the standard one-wire
protocol) driver.

BTW: I am still not convinced that the chip needs an EasyScale
client driver at all. The protocol is similar to an UART with
fixed bit format. So this rather needs a generic host driver. Not a
client driver. Something like baclkight levels -> easy-scale.
Then you can connect any compatible chip.

But even in this case the hardware connection requires you to
patch or piggy-back that into the twl4030 pwm driver because that
is the connection given by the Pandora hardware.

So why not generating the simple startup sequence in the PWM driver?
KISS...

BR,
Nikolaus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help