<div dir="ltr">Well, to do that you would have to read the specifications of the particular hardware. In which case the driver becomes specialized to it-not useful for anything but your own monitor. But if your monitor provides that support, then I guess when the ioctl receives a requested change in brightness you could use that facility of the monitor to retain the setting.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 26, 2015 at 2:16 PM, Umair Khan <span dir="ltr"><<a href="mailto:omerjerk@gmail.com" target="_blank">omerjerk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class=""><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 26, 2015 at 11:21 PM, Kenneth Adam Miller <span dir="ltr"><<a href="mailto:kennethadammiller@gmail.com" target="_blank">kennethadammiller@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Well, it's probably worth doing for the sake of your learning. However, if you are going to get into the source, I think it's highly likely that you are going to see that the driver provides such a feature to userspace code through means of an ioctl, and in that case, you will probably be able to set the brightness programmatically without ever having to interfere with the driver code itself. So for that matter, the objective doesn't really fit with the complexity you're taking on. If what I'm saying is right, you could easily implement this entirely in userland code by writing a binary and then putting a script in the startup execution so that it calls your binary.<div><br></div><div>If you really want to hack the driver, another way to do it is to just put the brightness setting in the driver's init function, so that when the module is loaded it turns up the brightness. In that case, you *should* get what you want because the driver will be loaded at system boot.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Wed, Aug 26, 2015 at 1:45 PM, Umair Khan <span dir="ltr"><<a href="mailto:omerjerk@gmail.com" target="_blank">omerjerk@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hello everyone,<div><br></div><div>I've been thinking of writing a patch a lot lately. But with my level of knowledge I cannot do something groundbreaking.</div><div>One thing which came to my mind is to write a patch related to the driver which controls the brightness of the display.</div><div>What happens now is I lower down the brightness, and when I restart the laptop, it's back to the highest amount.</div><div>I'm using Ubuntu 14.04 LTS on top of Linux Kernel 4.2 rc3+.</div><div>I was thinking of writing the current brightness to sysfs and read that value when the driver is started during the boot.</div><div><br></div><div>So, my question is that is it already implemented in the driver and just that Ubuntu resets it on every reboot from userspace ?</div><div>And if it is not implemented, is it worth implementing ?</div><div><br></div><div>Thanks</div><div>Umair</div><div>Delhi, India</div></div>
</div></div><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></span><div class="gmail_extra">I do get this that, most probably this feature would have been provided via ioctl. And it is better handled inside the userspace. </div><div class="gmail_extra">But it'd be just like the hardware is intelligent enough to keep the value persistent across reboot. Like the monitor of my PC keeps the brightness, and all the different values for that matter, persistent across reboot.</div><div class="gmail_extra">Userspace can always override this behavior anyways.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thoughts ?</div></div>
</blockquote></div><br></div>