[Lcdproc] LCD2USB backlight / contrast patch
Peter Marschall
peter@adpm.de
Sun Oct 21 20:16:02 2007
Hi,
On Monday, 15. October 2007, Markus Dolze wrote:
> I thought it would be nice to change settings for contrast and backlight
> through the server's option menu. And then I found the options are already
> there, but the driver didn't export the necessary functions. So here they
> are. The attached patch does:
>
> * Add get/set functions for contrast and backlight.
> * Modify the config file options handling.
> * Add the OffBrigthness setting.
> * Make the backlight switchable.
> * Try to identify the device's firmware.
> * Added some doxygen comments.
Yeah,I really like that !!!
> Most of the contrast / backlight stuff was copied from the CFontz driver.
> But I am not sure about some implementation details:
>
> 1. I put the variables for contrast, brightness and offbrightness into the
> HD44780 driver's private data structure. Does it belong there or better
> into the LCD2USB driver as (static) variables? Currently no other HD44780
> driver uses them.
I adapted the bwct connection type to make use of p->contrast.
> 2. I named the new functions without HD44780 because they are assigned to
> functions not specific to the HD44780 drivers.
I modified your patch a little to have the get_{contrast,brughtness} functions
and the config parsing in global hd44780.c to avoid duplicating the code.
(and ripped the appropriatep arts from other connection types as well, see
above).
I do not consider the current situation ideal, since I'd like to avoid
setting values in the structure pointed to by drvthis inside connection type
functions.
My goal is to have a setup similar to the handling of the backlight functions,
extended by disabling the hd44780-set_{contrast,brightness} function in
drvthis when there is no connectiontype specific set_{contrast,brightness}
function.
If anybody has an idea, please send patches.
Until then, we keep the (modified) patch by Markus.
> 3. What does the MODULE_EXPORT do (I didn't use it)? Does it has any effect
> at all or is it just there to signal a developer that this is not a private
> function?
The latter, it indicates a function that is part of the LCDproc ABI for
drivers.
Regards
Peter
--
Peter Marschall
peter@adpm.de